What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-09 12:40:08
query mriqc api with Python
In [2]: def get_iqms(modality, versions=None, software='mriqc'): """ Grab all iqms for the given modality and the list of versions """ url_root = 'https://mriqc.nimh.nih.gov/api/v1/{modality}?{que... Add solution -
Javascript 2022-03-08 12:30:11
javascript date custom string format
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0, 200)); // request a weekday along with a long date var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; console.log(new Intl.DateTimeFormat('de-DE', options).format(date));... Add solution -
Other 2022-03-06 20:30:03
python brute-force network training
from sklearn.metrics import accuracy_score from sklearn.datasets import load_digits from sklearn.model_selection import train_test_split digits = load_digits() X_scale = StandardScaler() X = X_scale.fit_transform(digits.data) y = digits.target # setup th... Add solution -
Python 2022-03-03 15:25:06
python traceback single line logging module
import logging class OneLineExceptionFormatter(logging.Formatter): def formatException(self, exc_info): """ Format an exception so that it prints on a single line. """ result = super().for... Add solution -
Python 2022-03-03 10:05:06
python print to terminal with color
def colored(r, g, b, text): return "\033[38;2;{};{};{}m{} \033[38;2;255;255;255m".format(r, g, b, text) text = 'Hello, World' colored_text = colored(255, 0, 0, text) print(colored_text) #or print(colored(255, 0, 0, 'Hello, World')) Add solution -
Other 2022-03-03 04:20:03
flutter&dart recommended settings for vs code
{ // Causes the debug view to automatically appear when a breakpoint is hit. This // setting is global and not configurable per-language. "debug.openDebug": "openOnDebugBreak", "[dart]": { // Automatically format code ... Add solution -
Other 2022-03-02 14:35:03
Usando ImageSequenceClip para criar clip de imagens
def create_video_from_images(video_output_name, image_input_dir, frame_rate=30.0, image_file_extension='png'): ''' Creates an MP4 video from the images in a given directory. Arguments: video_output_name (string): The full path and nam... Add solution -
Python 2022-02-28 22:40:20
python definition
def myFunction(say): #you can add variables to the function print(say) myFunction("Hello") age = input("How old are you?") myFunction("You are {} years old!".format(age)) #this is what you get: Hello How old are you? &... Add solution