ngram
listlengths
0
67.8k
[ "from antlr4 import * if __name__ is not None and \".\" in __name__:", "This class defines a complete listener for a parse tree produced by PythiaFunctionCallParser.", "a parse tree produced by PythiaFunctionCallParser. class PythiaFunctionCallListener(ParseTreeListener): # Enter a parse tree", "produced by P...
[ "\"--name\", self.name, self.image, \"/bin/sleep\", \"infinity\", ] ) def cleanup(self) -> None: logging.info(\"Stopping agent", "Dict[str, str] def __init__(self, name: str, image: str, environment: Dict[str, str]) -> None:", "__init__(self, name: str, image: str, environment: Dict[str, str]) -> None: self.nam...
[ "v_h def update_matrices(self, sigma_vec): vol_idx = v_h.mesh.vol_idx bdy_idx = v_h.mesh.bdy_idx self.S = stiffness_matrix(self.v_h,", "EllipticSolver: def __init__(self, v_h): self.v_h = v_h def update_matrices(self, sigma_vec): vol_idx = v_h.mesh.vol_idx", "sigma_vec): vol_idx = v_h.mesh.vol_idx bdy_idx = v_h...
[ "= re.compile(REGEX_LEAP_YEAR).fullmatch def isleap(value): return value != 0 and _isleep(value) for i in", "True, 'OPTIONS': { 'context_processors': [ 'django_boost.context_processors.user_agent', ], }, }] ) class TestConverter(TestCase): def", "}] ) class TestConverter(TestCase): def test_path_converters(self...
[ "and the following disclaimer in the documentation # and/or other materials provided with", "0.0) self.assertEqual(self.DUT.average_cost, 0.0) self.assertEqual(self.DUT.maximum_cost, 0.0) self.assertEqual(self.DUT.mean_cost, 0.0) self.assertEqual(self.DUT.cost_variance, 0.0) @attr(all=True, unit=True) def test_se...
[ "\"score out of range\" elif score >= 0.9: return \"A\" elif score >=", "parameter and returns a grade as a string. def computegrade(score): if score <", "Exercise 7: Rewrite the grade program from the previous chapter using a function", "# that takes a score as its parameter and returns a grade as", "retur...
[ "to fit and predict on same dataset # Arbitrary labels with unsupervised clustering", "= Distinct Clusters select_option = 5 # generate data data_options = ['linear','quadratic','target','moons','circles','blobs'] option", "(X[i,0]-0.5)**2+(X[i,1]-0.5)**2<=0.1 +(np.random.rand()-0.5)*0.2*mixing else True for i ...
[ "Exception as e: # We don't need the result log.error(\"Feil ved precaching av", "coding: utf-8 -*- ################################################################################################# import logging import urllib import requests from resources.lib.util import", "self.xbmc_password = result['result...
[ "header. ''' import numpy as np import struct newFile = open(fname + 'allFrames.dat',", "imaginary part of the file into #the header with the frequency index increasing", "= np.fromfile(fIn,np.double, points*lines ) tempImag = np.fromfile(fIn, np.double, points*lines ) fIn.close() #write the", "int( np.fromfi...
[ "see each other at the same positions, irrespective of which particle's doInteractions(...) method", "= SimpleLaws(bondLength=5) >>> sim = ParticleSystem(laws) >>> sim.add( Particle(position=(10,10)) ) >>> sim.add( Particle(position=(10,20))", "types. The actual physics calculations are deferred to the particle...
[ "6))) >>> r = ls._set_p2(Point((3, -1))) >>> r == Point((3.0, -1.0)) True \"\"\"", "libpysal.cg.Point The point where the ray originates. second_p : The second point specifying", "The ``_p2`` attribute. Examples -------- >>> ls = LineSegment(Point((1, 2)), Point((5, 6))) >>>", "The point's location (number :m...
[ "Django 3.2.4 on 2021-06-07 14:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies", "migrations.CreateModel( name='Faq', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length...
[ "(renderers.JSONRenderer,) serializer_class = ClientTokenSerializer def post(self, request, *args, **kwargs): serializer = self.serializer_class(data=request.data) serializer.is_valid(raise_exception=True)", "ClientTokenSerializer def post(self, request, *args, **kwargs): serializer = self.serializer_class(data=r...
[ "def get(self, index): if index < 0 or index >= self.length: return None", "= None self.length -=1 return node_to_remove def print_list(self): temp = self.head while temp:", "= Node(value) if self.length == 0: self.head = new_node self.tail = new_node self.length", "tail as the new node self.tail = new_node #...
[ "create_comment, create_staff, create_quest, create_quest_comment) from services import Services, override_service class TestSimpleThing(CanvasTestCase): def test_basic_addition(self):", "drawquest.tests.tests_helpers import (CanvasTestCase, create_content, create_user, create_group, create_comment, create_staff,...
[ "size for size, car in data) my_data = 'get uuuuuuuuuuuuuuuup' print(list(my_data)) compressed =", "group in groupby(data)) def decompress(data): return (car * size for size, car in", "name, group in groupby(data)) def decompress(data): return (car * size for size, car", "from itertools import groupby def com...
[ "TestDBConfiguredBasicLTILaunch: def test_it_enables_frontend_grading(self, context, pyramid_request): db_configured_basic_lti_launch_caller(context, pyramid_request) context.js_config.maybe_enable_grading.assert_called_once_with() def test_it_adds_the_document_url( self, context, pyramid_request,", "BasicLTILaun...
[ "access admin page for unauthorized but authenticated users. \"\"\" def process_request(self, request): if", "<reponame>stfc/cvmfs-stratum-uploader from django.core.urlresolvers import reverse from django.http import HttpResponsePermanentRedirect class NoLoginAdminRedirectMiddleware: \"\"\" This", "reverse from...
[ "= AudioAdapter.default() sample_rate = 22050 #waveform, _ = audio_loader.load('/path/to/audio/file', sample_rate=sample_rate) waveform, _ =", "#waveform, _ = audio_loader.load('/path/to/audio/file', sample_rate=sample_rate) waveform, _ = audio_loader.load(r'C:\\Users\\ewais\\Documents\\GitHub\\tensor-hero\\Sourc...
[ "with y2d.\" def test_grid3d(): x3d, y3d, z3d = magpie.grids.grid3d(10, 10) assert np.shape(x3d) ==", "z3d, xmid, ymid, zmid = magpie.grids.grid3d([10, 20, 30], [10, 20, 30], mins=[10., 20.,", "\"grid1d unexpected results.\" def test_grid2d(): x2d, y2d = magpie.grids.grid2d(10, 10) assert np.shape(x2d) ==", "...
[ "while True: m = receive_message(s) if m: print(m, \"\\n\") ping(s) print(s.getsockname()) print(socket.gethostbyname(socket.gethostname())) print(socket.get)", "communication import * import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((socket.gethostname(), 1123)) while True:", "impo...
[ "tw import time w = tw.Watcher(filename='test.log') s = w.create_stream(name='my_metric') #w.make_notebook() for i in", "import tensorwatch as tw import time w = tw.Watcher(filename='test.log') s = w.create_stream(name='my_metric') #w.make_notebook()", "<reponame>lesteve/tensorwatch<gh_stars>1000+ import tensor...
[ "for dm in self.data: yield dm def __getitem__(self, idx): \"\"\" Fetch a device", "253 5 L--w 1 1 0 LVM-<KEY> Example data structure produced:: data =", "dm def __getitem__(self, idx): \"\"\" Fetch a device by index in devices list", "====================================== Parsers for parsing and extracting ...
[ "np.array(model.grid.cv_results_['mean_test_score']) min_score = scores.min() max_score = scores.max() mean_score = np.mean(scores, axis=0) scores =", "plt.title('Validation accuracy') # plt.show() pass def showRBFSVM(self, model, clfname): C_range = model.param_grid['C'] gamma_range", "\" + str(temp_loss) + \"...
[ "decorators from maxixe.tests import loader from maxixe.tests import parser from maxixe.tests import utils", "maxixe.tests import parser from maxixe.tests import utils suite = unittest.TestSuite() suite.addTests(unittest.TestLoader().loadTestsFromModule(decorators)) suite.addTests(unittest.TestLoader().loadTestsF...
[ "if row > 10: col += 1 row = 2 if row ==", "unlocked = get_unlocked_course(df, completed_course) unlocked_courses = '\\n'.join(unlocked) tkinter.messagebox.showinfo(\"Unlocked Courses\", unlocked_courses) reset_completed(completed_course) def check(x):", "inplace=True) def browsefunc1(): filename = filedialog.a...
[ "class Blog(models.Model): title = models.CharField(\"标题\", unique=True, max_length=200) class Meta: db_table = 'blog' verbose_name", "from django.db import models class Blog(models.Model): title = models.CharField(\"标题\", unique=True, max_length=200) class Meta:", "title = models.CharField(\"标题\", unique=True,...
[ "def get_start(self, url_start): self.url_start = url_start if __name__ == '__main__': # url =", "= manager.LogManager() self.threadManager = manager.ThreadManager() self.url_start = '' def get_readme(self): self.downloader.grab_single(self.url_start) tips =", "@staticmethod def add_urls_head(urls, head): for i...
[ "and print the meal's total cost. Note: Be sure to use precise values", "the solve function below. def solve(meal_cost, tip_percent, tax_percent): print(round(meal_cost + (tip_percent*meal_cost/100) + (tax_percent*meal_cost/100)))", "added as tax) for a meal, find and print the meal's total cost.", "function ...
[ "mock_create_floating_ip (mock_floating_ips_client.associate_floating_ip_to_server .return_value) = None mock_internal_instance_id = mock.Mock() mock_internal_instance_id.return_value = \"fake id\" (self._base_tempest_backend._manager.", "util try: import unittest.mock as mock except ImportError: import mock LOG ...
[ "_execute(self): try: element = WebDriverWait(browser1, 10).until( EC.presence_of_element_located((By.XPATH, selector1)) ) element.click() return True except:", "10).until( EC.presence_of_element_located((By.XPATH, selector1)) ) element.click() return True except: print(\"timedout\", function, selector1, value1) ...
[ "open(input_path,'r') as f: print('Parsing annotation files') for line in f: filename, x, y,", "img = img[0:1280-50, 0:1280-50] (rows,cols) = img.shape[:2] all_imgs[filename] = {} all_imgs[filename]['filepath'] = path", "{} with open(input_path,'r') as f: print('Parsing annotation files') for line in f: filenam...
[]
[ "pygame.display.quit() elif event.type == VIDEORESIZE: screen = pygame.display.set_mode( event.size, HWSURFACE | DOUBLEBUF |", "True: for event in pygame.event.get(): if event.type == QUIT: pygame.display.quit() elif event.type ==", "main(): pygame.init() screen = pygame.display.set_mode( (200, 200), HWSURFACE ...
[ "# Ex. 014 c = float(input(\"Digite uma temperatura em °C: \")) print(f\"{c}°C =", "Ex. 014 c = float(input(\"Digite uma temperatura em °C: \")) print(f\"{c}°C = {((9*c)/5)+32:.1f}°F\")" ]
[ "from .views import NodeShow, NodeDetail, SelectNode urlpatterns = [ path('node/', NodeShow.as_view(), name='node-show'), path('node/detail/<int:n_id>',", "import path from .views import NodeShow, NodeDetail, SelectNode urlpatterns = [ path('node/', NodeShow.as_view(),", "django.urls import path from .views imp...
[ "states from Utils.logging import get_logger as log import pandas as pd import datetime", "i = 1 for pay_date, pay_amount in zip(item.pay_date, item.amount): if pay_date == '-':", "log import pandas as pd import datetime GETSUMMARY = range(1) class DividendSummary: def", "get_dividend_summary(update, context)...
[ "to integers kmers = [ feature_mapping[kmer_tuple] for kmer_tuple in window(str_seq.upper(), kmer_len) if kmer_tuple", "= max + 1 # so we add the max value and remove", "the max value and remove it afterwards # numpy.bincount was found to be", "kmers = [ feature_mapping[kmer_tuple] for kmer_tuple in window(st...
[ "b. The symmetry of the histogram reflects unbiased estimators. c. The functional form", "enumerate(self.X): self.Y.append(measurer.GeneratePointWithResolution(self.quadcoeff*entry**2+self.m*entry+self.b)) def FitLine(self): self.coeffs = np.polyfit(self.X, self.Y, 1) self.ChiSquare=np.sum((((self.coeffs[0]*self....
[ "return i + 1 # use one more: deltas may be bigger! (this", "= {} hasVariations = False # True if any key has variations for", "not allEqual(masterValues): hasVariations = True elif masterValues[0] == default: # No variations, value", "dicts, coordDefaults, coordConverters, storeBuilder, allowIndividualVarIdx...
[ "port_override else port['portconf_id'] portconf = find_by_attr(self.controller.portconf(), _id=portconf_id) return portconf def set_port_profile(self, portconf, **filter_kwargs):", "= port_override['portconf_id'] if port_override and 'portconf_id' in port_override else port['portconf_id'] portconf = find_by_attr...
[ "#-------------------------------------------------- # for case in xrange(input()): # k = input() # indexes =", "- 1) # print deck #-------------------------------------------------- print 'Case #%d: %s' % (case +", "1)%cards if deck[index] == 0: break for j in xrange(i - 1): while", "in xrange(input()): card...
[ "\"Bearer %s\" % token, } state_off ={ \"power\": \"off\", \"color\": \"blue saturation:0.5\", \"brightness\":", "={ \"power\": \"on\", \"color\": \"rgb:0,140,251\", \"brightness\": 1, } # URL base a ser", "#print(scenes.text) #t_power = requests.post(url_4,headers=headers) #print(t_power.text) activate = reque...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "in range(9): self.assertEqual(env.advance()[0], dmlab2d.RUNNING) self.assertEqual(env.advance()[0], dmlab2d.TERMINATED) def test_lab2d_settings_en...
[]
[ "values passed in are `bytes`). `args` entries are handled by type: 1. `str`", "when the `style` is `\" \"`. # yield flag yield str(value) else: #", ">>> list( ... render_opts( ... { ... 'input': Path(\"/tmp/blah.json\"), ... 'output': Path(\"/dev/null\"), ...", "#2 — flag=value format # # When no other branc...
[ "# 获取不合规的vpc peering账户id def get_uncom_id(): with DBContext('r') as session: # 获取vpc peering的账户id vpc_peering_info", "= uncom_vpc_peering[\"accepter_cidr_block\"] accepter_owner_id = uncom_vpc_peering[\"accepter_owner_id\"] accepter_vpc_id = uncom_vpc_peering[\"accepter_vpc_id\"] accepter_region = uncom_vpc_peeri...
[ "num = line.split() num = int(num) if ins == 'forward': pos += num", "+= num part_2_depth += (aim * num) elif ins == 'down': part_1_depth +=", "ins == 'down': part_1_depth += num aim += num elif ins == \"up\":", "0 part_2_depth = 0 for line in fileinput.input(): ins, num = line.split() num", "part_1_depth -...
[ "response = connection.getresponse() code = response.getcode() headers = response.getheaders() result = loads(response.read()) print(result)", "Server response:\") response = connection.getresponse() code = response.getcode() headers = response.getheaders() result =", "for python 3 from http.client import HTTPC...
[ "getopt from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes import base64 import binascii", "generate password mac for dovecot import sys import os import getopt from cryptography.hazmat.backends", "option_keys: usage() for opt,value in opts: opt=opt.replac...
[ "<gh_stars>1-10 import requests data = { \"bot_commands\": [ { \"command\": \"command1\", \"description\": \"description1\"", "requests data = { \"bot_commands\": [ { \"command\": \"command1\", \"description\": \"description1\" }, {", "= { \"bot_commands\": [ { \"command\": \"command1\", \"description\": \"desc...
[ "dataset_name, **kwargs): kwargs['auth_value'] = self.auth_value kwargs['serial_id'] = self.serial_id return self.nfs_dataset_client.activate_nfs_dataset(dataset_name, **kwargs) def create_nfs_dataset(self,", "**kwargs) def list_nfs_datasets(self, **kwargs): kwargs['auth_value'] = self.auth_value kwargs['serial_i...
[ "self.color = color self.visible = True self.priority = 2 def draw(self, root_console, tick_count)", "2 def draw(self, root_console, tick_count) -> None: if not self.visible: return root_console.print(self.x, self.y,", "self.y = parent.y + y self.message = message self.color = color self.visible =", "def __in...
[ "\"<EMAIL>\", \"client_id\": \"....\", \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\", \"token_uri\": \"https://accounts.google.com/o/oauth2/token\", \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\", \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata...
[]
[ "as pd reclist = pd.DataFrame({ 'pid': [1,1,1,2,2,2,3,3,3], 'song_id': [4,5,6,4,5,6,4,5,12], 'pos': [1,2,3,1,2,3,3,2,1] }) gt", "import listdiff import numpy as np import pandas as pd reclist = pd.DataFrame({", "[4,5,6,4,5,6,4,5,12], 'pos': [1,2,3,1,2,3,3,2,1] }) gt = pd.DataFrame({ 'pid': [1,1,1,2,2,2,2], 'son...
[ "indent=4 if app.debug else None ), mimetype=\"application/json\", status=401 ) number = request.values.get(\"number\") try:", "import DropPoint from c3bottles.model.report import Report from c3bottles.model.visit import Visit bp = Blueprint(\"api\",", "dp_json() return Response( json.dumps( \"Invalid or missin...
[ "or 5 positions forward. Determine, what is the minimum number of steps he", "integer x (1≤x≤1000000) — The coordinate of the friend's house. Output Print the", "of steps he need to make in order to get to his friend's", "steps that elephant needs to make to get from point 0 to point", "5 positions forward....
[ "import numpy as np class InvalidFieldsException(Exception): pass class Dataset(object): \"\"\" Generic Dataset object", "Dataset({'Name': ['Alice', 'Bob', 'Carol', 'David', 'Ellen'], 'SSN': [1, 23, 45, 56, 7890]}) print(d)", "None else str(e) for e in row]) for row in zip(*tab)])) with open(fname,", "name in...
[ "OAUTH_TOKEN = 'TOKEN_HERE' OAUTH_TOKEN_SECRET = 'TOKEN_SECRET_HERE' # Telegram options: TELEGRAM_CHANNEL = 'CHANNEL_NAME_HERE' TELEGRAM_TOKEN", "'USER_NAME_HERE' MSG = '<b>{NAME}</b>:\\n{TEXT}\\n\\n<a href=\"{URL}\">Source</a>' # Technical stuff: TWEET_BASE_URL = 'https://twitter.com/i/web/status/' STATE_FILE ="...
[ "epoch = trained_epoch + i_epoch lr = scheduler.get_last_lr()[0] logging.info('epoch %d lr %e', epoch,", "device id') parser.add_argument('--use_parallel', action='store_true', default=False, help=\"use data parallel default False\") parser.add_argument('--model_name', type=str, default='wresnet40_2',", "defaul...
[ "are some ideas to get you started: - 🔭 I’m currently working on", "- 🤔 I’m looking for help with ... - 💬 Ask me about", "you started: - 🔭 I’m currently working on ... - 🌱 I’m currently", "👋 <!-- **dungpoke/dungpoke** is a ✨ _special_ ✨ repository because its `README.md` (this", "- 🔭 I’m currently wo...
[ "tf.variable_scope(\"foo\",reuse =tf.AUTO_REUSE): v1= tf.get_variable('v1',[1], initializer = tf.constant_initializer(5.0)) print(v1==v) #输出为True,代表v1与v是相同的变量 init = tf.initialize_all_variables() sess.run(init)", "False): v1= tf.get_variable('v1',[1], initializer = tf.constant_initializer(5.0)) print(v1==v) #输出为T...
[ "class TestUtilsAudio(tf.test.TestCase): def setUp(self): self.audio_file_path = \"/tf/test_environment/audio/DevNode1_ex1_1.wav\" def test_audio_loading_mono(self): expected_shape = (16000 *", "import AudioUtils class TestUtilsAudio(tf.test.TestCase): def setUp(self): self.audio_file_path = \"/tf/test_environmen...
[ "setup setup( install_requires=[ \"numpy >= 1.13\" ], name='jitter', scripts=['bin/jitter.py'], version='0.1.0', url='https://github.com/philipwfowler/jitter', author='<NAME>', packages=['jitter'],", "from setuptools import setup setup( install_requires=[ \"numpy >= 1.13\" ], name='jitter', scripts=['bin/jitter.p...
[ "dfs1 = find_DFS_(predicate,c) if len(dfs1) > 0: return [node] + dfs1 return []", "\"\"\"Returns the path in the tree from the root node to the first", "n.name == 'SAN', node) hops_to_santa = len(p1) + len(p2) - 4 #remove both", "!= root: nodes[node.parent].children.append(node) return nodes[root] def compute...
[ "self.assertTrue(parent is not None) parent.delete_child(n) # verify deleted n, parent = self.root.find_node_and_parent(key) self.assertTrue(n", "i in root.children: add_childs_to_leaf(i, num) class TestStringMethods(unittest.TestCase): count = 0 def setUp(self): TestStringMethods.count", "print(\"Total Number ...
[ "= mtz.object(file_name=\"3nd4.mtz\") # Only works with mtz.object. # Does not work if mtz", "with mtz.object. # Does not work if mtz is read in with iotbx.file_reader.", "mtz.object(file_name=\"3nd4.mtz\") # Only works with mtz.object. # Does not work if mtz is", "Does not work if mtz is read in with iotbx.f...
[ "logger.info( \"Set sign: {} and scale: {:04.2f} for {}\".format(module.signed, module.scale.item(), name)) @COMPRESSION_MODULES.register() @QUANTIZATION_MODULES.register(QuantizationMode.ASYMMETRIC)", "= 1e-16 self.level_high = self.level_low = 0 self.levels = 2 ** self.num_bits if", "scale_shape = 1 if self.p...
[ "while(n!=0): r=n%10 n=int(n/10) s[a]=r for i in range (a): if(r==s[i]): c+=1 break a+=1", "s[a]=r for i in range (a): if(r==s[i]): c+=1 break a+=1 if (c==0): print(\"It", "a+=1 if (c==0): print(\"It is a unique number\") else: print(\"It is not a", "n=int(input(\"Enter the number:\")) s={} a=0 c=0 while(n!=0...
[ "seconds would be preferred. Any less, and your clip will be zero-padded to", "in slices: h_pred, a_pred, g_pred = model(slice) h_preds.append((h_pred.view(-1) * model.h_std + model.h_mean).item()) a_preds.append((a_pred.view(-1)", "= arr.astype(np.float32, order='C') / 32768.0 arr = librosa.to_mono(arr.T) arr ...
[ "curses, sys, os #Servo controller connected to IC2 import Adafruit_PCA9685 pwm = Adafruit_PCA9685.PCA9685()", "import curses, sys, os #Servo controller connected to IC2 import Adafruit_PCA9685 pwm =", "to IC2 import Adafruit_PCA9685 pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) from time import sleep #...
[ "pytropos.internals.values.python_values.python_values import PythonValue, PT exitcode = 1 r = List([pv.int(21)], size=(1, 1)) store", "pytropos.internals.values.builtin_values import * from pytropos.internals.values.python_values.builtin_mutvalues import * from pytropos.internals.values.python_values.wrappers im...
[ "setuptools def find_version(fname): \"\"\"Attempts to find the version number in the file names", "__version__ = find_version('doc_scanner/__init__.py') with open(\"README.md\", \"r\") as fh: long_description = fh.read() setuptools.setup( name=\"doc_scanner\",", "re import setuptools def find_version(fname): \...
[ "qtd_apertos = 0 while True: if keyboard.is_pressed('a'): qtd_apertos += 1 print('A foi apertado", "0 while True: if keyboard.is_pressed('a'): qtd_apertos += 1 print('A foi apertado ', qtd_apertos)", "print('\\napertando A ') qtd_apertos = 0 while True: if keyboard.is_pressed('a'): qtd_apertos += 1", "qtd_ape...
[ "= class_info.get(\"Character\", {}).get(\"ClassJobs\", None) if not data_to_process: raise IOError out: dict = {SUB_30_MAPPING_DICT.get(entry[\"UnlockedState\"][\"Name\"],", "def get_character_info(character_id: str): \"\"\"helper method to receive character info via XIV API\"\"\" if", "import openpyxl import ...
[ "configuration itself will be copied. Returns: int: configuration id of the newly copied", "system. For performance reason, only brief information of the configuration will be returned", "configuration_id (int): configuration identifier. Returns: dict: configuration schedule. Raises: QBProcessingError: will be ...
[ "You may assume that each input would have exactly one solution, and you", "nums = [2, 7, 11, 15], target = 9, # Because nums[0] +", "[2, 7, 11, 15], target = 9, # Because nums[0] + nums[1] =", "may assume that each input would have exactly one solution, and you may", "same element twice. # Example: # Given...
[ "TRIM_DIFFERENCE_MAX = 1.0 def dict_factory(cursor, row): \"\"\"Helper function to convert sql item into", "mturk_cur = mturk_db_connection.cursor() mturk_cur.execute('''UPDATE hits SET status='pending_approval' WHERE assignment_id=?''', (json_file[\"assignmentId\"],)) mturk_db_connection.commit() except sqlite3....
[ "variation should be set to -1.0 x = np.zeros((100, 10)) normalizer = MinMaxNormalizer(x)", "values should be set to -1.0. assert np.all(np.isclose(x_normed[:, -1], -1.5)) # Channels without", "normalizer(x) assert np.all(np.isclose(x_normed, -1.0)) def test_min_max_normalizer_2d(): \"\"\" Checks that all featu...
[ "import Path def curr_file_path() -> Path: \"\"\"Get cuurent file path.\"\"\" return Path(__file__).absolute() def", "\"\"\"Get cuurent file path.\"\"\" return Path(__file__).absolute() def out_folder_path() -> Path: \"\"\"Get output folder", "return curr_file_path().parents[3].joinpath(\"out\").absolute() def ...
[ "i = 1 while i < 6: print(i) if (i == 3): break", "while i < 6: print(i) if (i == 3): break i += 1", "1 while i < 6: print(i) if (i == 3): break i +=", "= 1 while i < 6: print(i) if (i == 3): break i" ]
[ "\"http://\" + auth.ipaddr + \"/rest/\" + auth.version + \"/cli\" command_dict = {\"cmd\": command}", "import requests, json, base64 def post_cli(auth, command): url_cli = \"http://\" + auth.ipaddr +", "\"/rest/\" + auth.version + \"/cli\" command_dict = {\"cmd\": command} try: post_command = requests.post(url_...
[ "alpha=0.4, label=Kolasinac[0]) # radar.plot(Mendy[1:], '-', lw=5, color= 'c', alpha=0.4, label=Mendy[0]) # # radar.ax.legend()", "# radar.plot(Eriksen[1:], '-', lw=3, color='#000080', alpha=0.4, label=Eriksen[0]) # radar.plot(Sane[1:], '-', lw=3, color='m', alpha=0.4,", "fontsize=22) # fig.savefig('Prem_LB.png...
[ "= self.app.wd self.go_to_group_page() wd.find_element_by_name(\"new\").click() self.fill_form_group(group) # Submit group creation wd.find_element_by_name(\"submit\").click() self.back_to_group_page() self.group_cache =", "test_delete_all_groups(self): self.select_all_groups() self.delete_groups() def delete_gro...
[ "\"\"\" # Implementation author: cym13 # Created on 2015-11-30T12:37:27.133314Z # Last modified on", "it with the literal value \"ネコ\" (which means \"cat\" in japanese) Source: programming-idioms.org", "author: cym13 # Created on 2015-11-30T12:37:27.133314Z # Last modified on 2015-11-30T12:37:27.133314Z # Versi...
[ "for the workflow app \"\"\" from django.urls import path from workflow import views", "from workflow import views urlpatterns = [ path('logs', views.logs, name='logs'), path('logs/<lid>', views.viewlog, name='viewlog'),", "<reponame>ChalkLab/SciFlow<filename>workflow/urls.py \"\"\" urls for the workflow app \"...
[ "limit): i = 1 while math.pow(n, i + 1) <= limit: i +=", "def maxPower(n, limit): i = 1 while math.pow(n, i + 1) <= limit:", "')) primes = sieve(limit) s = 1 for x in primes: print(math.pow(x, maxPower(x,", "sieve(limit) s = 1 for x in primes: print(math.pow(x, maxPower(x, limit))) s *=", "limit: i += 1 ret...
[ "resolve_client_token(user, gateway: str): customer_id = fetch_customer_id(user, gateway) return payment_gateway.get_client_token(gateway, customer_id) def resolve_payments(info, query):", "def resolve_client_token(user, gateway: str): customer_id = fetch_customer_id(user, gateway) return payment_gateway.get_clie...
[ "by the d[k] who is the value from the keys, # so the", "the lowest key value will be organized to be the first. print(f'{x} appears", "ct = ct +1 return ct def s_cities_count_for_state(state): cities_list = states[state] return s_cities_count(cities_list)", "def absolute(x): if x >= 0: return x else: return ...
[ "import Pallet from os.path import join class VistaPallet(Pallet): def __init__(self): super(VistaPallet, self).__init__() self.arcgis_services", "import join class VistaPallet(Pallet): def __init__(self): super(VistaPallet, self).__init__() self.arcgis_services = [('Vista', 'MapServer')] self.sgid", "Pallet fr...
[ "for j in range(len(cartasB)): if cartasA[i] == cartasB[j]: break elif (j == len(cartasB)-1):", "ler_qtd(n, msg): n = int(input(msg)) while (n < 1) or (n > 10000):", "print(sorted(a)) print(sorted(b)) maximo_trocas = qtd_trocas(a, b) print(f' - Maximo de trocas e igual", "conjunto interseccao de a e tiro os r...
[ "None: return defualt return param if not isinstance(param, numbers.Number) else [-param, param] self.xdegree", "if random.random() < self.p: img = pil_ops.hflip(img) points = [polygon_ops.hflip(pnts, imw) for pnts", "size=3)) else: fillcolor = self.fillcolor rang = polygon_ops.get_translate_range(points, img.s...
[ "= \"Error: ParserException\" outp.clear_widgets() if tmp: outp.add_widget(tmp) error.text = \"Nema greske\" class ErrorOut(Label):", "from kivy.lang.builder import Builder from kivy.lang.parser import ParserException def kompajliraj(inp,outp,error): try: tmp =", "error.text = \"Error: Krivi KV kod\" except Par...
[ "= io_subclass @property def protocol(self): \"\"\" Gets the protocol of this IbIocProfile. The", "getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x,", "the device version. :param device_version: The device_version of this IbIocProfile. :type: int \"\"\"...
[ "uri.strip('/').split('/') pattern_parts = [] for part in parts: is_variable = VARIABLE.search(part) if is_variable:", "= [] def add(self, uri, resource, priority=0): parts = uri.strip('/').split('/') pattern_parts = []", "it: it[0], reverse=True) # ok for our N < 20 def match(self, uri):", "re VARIABLE = re....
[ "response_body['status'] self.error = response_body['error'] self.error_lineno = response_body['error_lineno'] self.submitted_at = response_body['submitted_at'] self.updated_at = response_body['updated_at']", "self.description = response_body['description'] self.status = response_body['status'] self.error = respo...
[ "body = request.data s = 'You want path: {} and data: {}'.format(path, body)", "app = Flask(__name__) @app.after_request def add_headers(response): response.headers.add('Access-Control-Allow-Origin', '*') response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization') return response @app.route...
[ "<filename>setup.py import setuptools import os with open(\"README.md\", \"r\", encoding=\"utf-8\") as fh: long_description =", "}, classifiers=[ \"Programming Language :: Python :: 3\", \"License :: OSI Approved ::", "requires = f.read().splitlines() GITHUB_URL = \"https://github.com/jackz314/eeglabio\" setupt...
[ "line search \"\"\" x_i, y_i = x0 all_x_i = list() all_y_i = list()", "r[1][:10]) plt.plot(r[0][:10], r[1][:10]) plt.title('exact line search') plt.savefig(\"steepestDescentDemo.png\", dpi = 300) plt.show() if __name__", "= g_xx H[0][1] = g_xy H[1][0] = g_xy H[1][1] = g_yy return H", "\"\"\" f = 0.5 * np.squa...