ngram
listlengths
0
67.8k
[ "dr_size self.dwr_qty = dwr_qty self.dwr_size = dwr_size self.index = index self.height = height", "/ 2.0, PAGE_HEIGHT - 34, \"DOOR ORDER FORM\") c.setFont(\"Helvetica\", 12) c.setFillColorRGB(0, 0, 0)", "c.setFont(\"Helvetica-Bold\", 14) c.setFillColorRGB(BACKGROUND_COLOR[0], BACKGROUND_COLOR[1], BACKGROUND_CO...
[ "<reponame>s2t2/tweet-analyzer-py from app.bq_service import BigQueryService if __name__ == \"__main__\": bq_service = BigQueryService() bq_service.migrate_daily_bot_probabilities_table()", "from app.bq_service import BigQueryService if __name__ == \"__main__\": bq_service = BigQueryService() bq_service.migrate_d...
[ "2 - 1) self.optimal_distribution = beta(size ** 2 - 1, 1) else: self.optimal_distribution", "4 if action == MiniGridDoorKeyAction.TurnLeft: newnode_prms[\"Dir\"] = (node.Dir - 1) % 4 if", "node.IsDoorOpened and next_coord == self.door_position ): newnode_prms[\"X\"], newnode_prms[\"Y\"] = next_coord if action ...
[ "ALL connections --> should NOT be used for reproducing ticket issue: # #con_admin.execute_immediate('delete", "Confirmed bug on 3.0.6.33271. # Checked on 3.0.6.33272 (SS/CS) - works fine. #", "# Confirmed bug on 3.0.6.33271. # Checked on 3.0.6.33272 (SS/CS) - works fine.", "import fdb # # ATT_CNT=5 # ATT_DEL...
[ "from bs4 import BeautifulSoup import logging import pandas as pd import csv import", "bs4 import BeautifulSoup import logging import pandas as pd import csv import re", "self.base_url = \"https://www25.senado.leg.br/\" self.search_url = self.base_url + \"web/senadores/em-exercicio/-/e/por-nome\" self.senate = ...
[ "TagFactory from ...users.factories import UserFactory class AdministrativeUnitAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename =", "factory_class = InstitutionFactory def validate_item(self, item): self.assertEqual(item[\"id\"], self.obj.id) self.assertEqual(item[\"name\"...
[ "-> LennyBotState: return self._state def source_version(self, application: str) -> str: for action in", "for action in self._actions: if action.application != application: continue return action.source_version return None", "@property def actions(self) -> List[IAction]: return self._actions @property def state...
[ "api_uri = f\"/api/v2/ContainerRegistries/{type}\" else: api_uri = \"/api/v2/ContainerRegistries\" response = self._session.get(api_uri, org=org) return response.json()", "logging logger = logging.getLogger(__name__) class ContainerRegistriesAPI(object): \"\"\" Lacework Container Registries API. \"\"\" def", "\...
[ "# Cell class NewDecoder(nn.Module): def __init__(self, hidden_size, embedding_size, output_size, n_layers=1, dropout_p=0.1): super(NewDecoder, self).__init__()", "= nn.Dropout(p) self.embedding = nn.Embedding(input_size, embedding_size) self.rnn = nn.LSTM(embedding_size, hidden_size, num_layers, dropout=p,batch_...
[ "http_resp.status_code == 200 verify_url_re = re.compile(r\"{}/verify/\\w+\".format(api_url)) with responses.RequestsMock() as rsps: # fake no", "with responses.RequestsMock() as rsps: # fake consent rsps.add(responses.GET, verify_url_re, json.dumps({\"foo\": \"bar\"}), status=200) #", "Response from satosa.pro...
[ "Unless required by applicable law or agreed to in writing, software # distributed", "dim=-1) else: ws, bs = [], [] for i in range(len(self.cutoffs)): if self.div_val", "labels is not None: if (hasattr(self, \"keep_order\") and self.keep_order) or keep_order: y.index_copy_(0, indices_i,", "mask.dim() == 3: a ...
[ "+ 5]] for j in range(5)] warped_face = warp_and_crop_face( np.array(img), facial5points, reference, crop_size=(crop_size,", "try: # Handle exception bbs, landmarks = detect_faces(img) except Exception: print(\"{} is discarded", "\"/\".join(image_name.split('/')[-5:]) img_warped.save(image_name) li_meta.append(...
[ "from srtvoiceext import extract if __name__ == '__main__': ext = extract('video.mkv', 'subtitles.srt', 'outdir')" ]
[ "def __delitem__(self, key): raise TypeError('Cannot modify ReadOnlyDict') def __iter__(self): return iter(self.store) def __len__(self):", "__iter__(self): return iter(self.store) def __len__(self): return len(self.store) def __str__(self): return 'ReadOnlyDict(%s)' % self.store", "value): raise TypeError('Can...
[ "and summon\"} line = [] for c in self.choices: btn = attr_button(c, self.select_class)", "def update_header(self): widgets = [] for p in self.header_list: widgets.append(urwid.AttrMap(urwid.AttrMap(urwid.Text(p.status, wrap=\"clip\"), {self.player.id:\"player\"}), {p.id:\"other\"", "in visible_map] self.map_bo...
[ "\"Any\", \"XXX TODO XXX\": \"item type\"}, \"XXX TODO XXX\": \"array_like or sparse matrix,", "= Op(**self._hyperparams) def fit(self, X, y=None): if y is not None: self._wrapped_model.fit(X, y)", "\"array_like or sparse matrix, shape (n_samples, n_features)\", }, { \"type\": \"array\", \"items\": {\"type\":",...
[ "= ELU(name='elu_Dx51_{}'.format(dd))(x51) x52 = Conv2D(filt_num*dd, (3, 3), padding='same', name='DeConv52_{}'.format(dd))(x51) if use_bn: x52 =", "x3 = ELU(name='elu_Dx3_{}'.format(dd))(x3) x51 = Conv2D(filt_num*dd, (3, 3), padding='same', name='DeConv51_{}'.format(dd))(x) if use_bn: x51", "= BatchNormalizati...
[ "with schema.\"\"\" from sqlalchemy_utils.functions import database_exists, create_database, drop_database from flunkybot.db import engine, base", "new database with schema.\"\"\" from sqlalchemy_utils.functions import database_exists, create_database, drop_database from flunkybot.db import", "database with sch...
[ "setup( name='webspider', version=__version__, license='MIT', author='heguozhu', author_email='<EMAIL>', description='lagou.com spider', url='<EMAIL>:GuozhuHe/webspider.git', packages=find_packages(exclude=['tests']), package_data={'webspider': ['README.md']}, zip_safe=False,", "os.path.abspath(os.path.dirname(__...
[ "data file. refcount_file = 'data/refcounts.dat' # Translation # ----------- gettext_compact = False locale_dirs", "the index html_split_index = True # Options for LaTeX output # ------------------------ #", "r''' \\authoraddress{ \\strong{Python Software Foundation}\\\\ Email: \\email{<EMAIL>} } \\let\\Verbati...
[ "+= 1 l += 1 else: l += 1 dist = k /", "here. No other modules should be used. # Import plotting library import matplotlib.pyplot", "graph(my_list): plt.hist(my_list,density=True, facecolor='b') sigma = sd(my_list) #stores standard deviation mu = mean(my_list) #stores", "1 l += 1 else: l += 1 dist = k / l", ...
[ "* len(new_label) pattern = '^(' + re.escape(old_label) + ')\\n([' + re.escape(valid_section_characters) + ']+)$'", "a forthcoming section in their changelog file: %s' % ', '.join(sorted(missing_forthcoming)), file=sys.stderr) if", "version number to bump? (default: %(default)s)') args = parser.parse_args(sysar...
[ "function, backend='tcp'): os.environ['MASTER_ADDR'] = '127.0.0.1' os.environ['MASTER_PORT'] = '29500' dist.init_process_group(backend, rank=rank, world_size=world_size) function(rank, world_size)", "model(torch.ones(10).float()) loss.backward() optimizer.step() processes = [] world_size = 4 for rank in range(wor...
[ "\"\"\" Squeak model. W_Object W_SmallInteger W_MutableSmallInteger W_AbstractObjectWithIdentityHash W_AbstractFloat W_Float W_MutableFloat W_Character W_PointersObject W_AbstractObjectWithClassReference", "rsqueakvm.model.display import * from rsqueakvm.model.numeric import * from rsqueakvm.model.pointers import...
[ "self).__init__() self.size_average = size_average if normalize: self.normalize = Normalize() else: self.normalize = None", "# Weighting of the loss, default is HED-style if self.pos_weight is None: num_labels_pos", "mask), torch.masked_select(label, mask), reduction='sum') if self.size_average: if ignore_label...
[ "DELTA_T, PASSOS+1) z = [] for k in range(PASSOS+1): z_k = np.copy(z_temp) z.append(z_k)", "y = np.linspace(0.0, DELTA_T, PASSOS+1) z = [] for k in range(PASSOS+1): z_k", "DELTA_X z_temp = contorno.p_3 TAMANHO_BARRA = 2 x = np.linspace(0.0, TAMANHO_BARRA, INTERVALOS+1) y", "z = [] for k in range(PASSOS+1): z_...
[ "0: step = 1 elif index == numRows - 1: step = -1", "= numRows-1, if we reach bottom (i.e. row = numRows-1) # then we", "int) -> str: if numRows == 1 or numRows >= len(s): return s", "move up. Similarly if we reach top, we change direction and move down", "Similarly if we reach top, we change direction and ...
[ "embedding_vector_features = 40 model = Sequential() model.add(Embedding(voc_size,embedding_vector_features,input_length=sent_len)) model.add(LSTM(100)) model.add(Dense(1,activation='sigmoid')) model.compile(loss='binary_crossentropy',optimizer = 'adam',metrics =", "np X_final = np.array(embedded_doc) y_final = n...
[ "pred = clf.predict(features_test) #### store your predictions in a list named pred from", "the training features/labels, and to #### make a set of predictions on the", "on the test data clf.fit(features_train,labels_train) pred = clf.predict(features_test) #### store your predictions in", "##################...
[ "Version 2.0 (the \"License\" # you may not use this file except in", "writing, software # distributed under the License is distributed on an \"AS IS\"", "import numpy as np import unittest import paddle class Net(BaseNet): \"\"\" simple Net", "KIND, either express or implied. # See the License for the specif...
[ "arguments) :setter: Sets the task function/method result \"\"\" return self._result @result.setter def result(self,", "return self._func @property def args(self): \"\"\" Task function/method arguments property - getter only.", "@property def func(self): \"\"\" Task function/method property - getter only. :gett...
[ "( parsed.categorized_comments[\"nested\"].get(module, {}).pop(from_import, None) ) if comment: from_imports.remove(from_import) if from_imports: use_comments = []", "if pending_lines_before or not no_lines_before: output += [\"\"] * config.lines_between_sections output += section_output", "while from_imports: ...
[ "type='string' ) def _cleanup_query(q, tag_types): type_map = dict(float=FLOAT.from_bytes, int=INT.from_bytes) for term in q.leaves():", "not appear to have a header.\" if 'path' not in header: msg =", "in reader: total += 1 path = record[path_idx] rpath = relpath(path, self.path) index", "_check_date_range(x...
[ "be stabilized. class _RefTranslator: \"\"\" Resolve JSON pointers/references in a spec by translation.", "return ref_url.path.split('/')[-1] + '_' + '_'.join(item_path[1:]) def _local_ref(path): url = '#/' + '/'.join(path)", "url: self.url = _url.absurl(url) url_key = (_url.urlresource(self.url), self.__strict...
[ "self.assertEqual(ch, '1') ch = cs.next().ok() self.assertEqual(ch, '1') ch = cs.next().ok() self.assertEqual(ch, '2') r", "'1') ch = cs.peek().ok() self.assertEqual(ch, '1') ch = cs.next().ok() self.assertEqual(ch, '1') ch =", "'1') ch = cs.next().ok() self.assertEqual(ch, '2') r = cs.next() self.assertFalse(r...
[ "rs2 = ql.CReg(2) k.classical(rs1, ql.Operation(3)) k.classical(rs1, ql.Operation(4)) k.classical(rd, ql.Operation(rs1, '+', rs2)) p.add_kernel(k) NCOMPILES=50", "k.classical(rs1, ql.Operation(3)) k.classical(rs1, ql.Operation(4)) k.classical(rd, ql.Operation(rs1, '+', rs2)) p.add_kernel(k) NCOMPILES=50 QISA_fn =...
[ "sensor = minimalmodbus.Instrument('/dev/ttyUSB5', slaveaddress=i) addressRead = sensor.read_register(0, functioncode=3) if(i == addressRead): print('FOUND!') return", "import minimalmodbus import serial from time import sleep parser = argparse.ArgumentParser() parser.add_argument('address', metavar='ADDR',", "...
[ "shutil import tempfile import unittest import ray from ray import tune from ray.rllib", "# Restore the checkpoint config={\"env\": \"CartPole-v0\", \"log_level\": \"DEBUG\"}, ).trials self.assertIsNone(trial.error_file) def testDottedRelativePath(self): local_dir", "checkpoint_dir): with open(os.path.join(chec...
[ "20, \"button\": {\"x\": (8, 8), \"y\": (100, 105)}}, \"colours\": { \"primary\": (112, 112,", "\"Orange\", \"crystal\": [\"Ilum crystal\", \"Ultima Pearl\"], \"type\": \"Sith\", }, \"b9\": { \"colour\": \"Black\",", "\"tertiary\": (180, 97, 19), # b46113 }, \"length\": 22, \"materials\": \"Alloy metal/Salvaged...
[ "assert out.shape == (2, 3) assert out.dtype == dt f = theano.function( [],", ") assert self.op == GpuReshape class TestGPUComparison(TestComparison): def setup_method(self): utt.seed_rng() self.mode = mode_with_gpu", "dtype=\"float32\") f = theano.function( [a, b], tt.join(0, tt.zeros_like(a), tt.ones_like(b))...
[ ") assert b\"Available animations include\" in got assert b\"* dice\" in got assert", "[]}, ) async it \"can get information\", server, m: # start got =", "final_future) as server: yield server, m @pytest.fixture() def server(make_server): return make_server[0] @pytest.fixture() def", "assert got[\"started\"]...
[ "YouTube def download_video(watch_url): yt = YouTube(watch_url) (yt.streams .filter(progressive=True, file_extension='mp4') .order_by('resolution') .desc() .first() .download())", "pytube import YouTube def download_video(watch_url): yt = YouTube(watch_url) (yt.streams .filter(progressive=True, file_extension='mp...
[ "Transform the data_files structure into a dictionary. :param data_files: either a list of", "function \"\"\" prefix = get_command_prefix( '%s__setup' % build_type, context.build_space, context.build_dependencies) ament_tools_path = os.path.dirname(os.path.dirname(__file__))", "KIND, either express or implied. ...
[ "tree. import torch from neuralcompression.functional import soft_round, soft_round_inverse def test_soft_round_inverse(): x = torch.linspace(-2.0,", "soft_round, soft_round_inverse def test_soft_round_inverse(): x = torch.linspace(-2.0, 2.0, 50) torch.testing.assert_close( x, soft_round_inverse(x, alpha=1e-13),"...
[ "clip_ratio=0.2, adv_norm=True, value_norm=True, ), collect=dict( n_sample=2048, unroll_len=1, discount_factor=0.99, gae_lambda=0.97, ), eval=dict(evaluator=dict(eval_freq=5000, )), other=dict(replay_buffer=dict(", "collector_env_num=8, evaluator_env_num=10, use_act_scale=True, n_evaluator_episode=10, stop_value=...
[ "cls(name,entries,appFamily,id,references,**kwargs) def to_json(self): return { \"name\":self.name, \"description\":\"Desc Not Required\", \"type\":\"app\", \"entries\":[ {\"appFamily\" if", "\"name\":self.name, \"description\":\"Desc Not Required\", \"type\":\"app\", \"entries\":[ {\"appFamily\" if self.app_fami...
[ "self._meta = docker_container.attrs _LOGGER.info( \"Starting DNS %s with version %s - %s\", self.image,", "from ..const import ENV_TIME from ..coresys import CoreSysAttributes from .interface import DockerInterface _LOGGER:", "\"\"\"Docker Supervisor wrapper for Supervisor DNS.\"\"\" @property def image(self) ...
[ "and # integrates with CPython, but also works on its own. # #", "\"Pow\" : \"PyNumber_Power\", # \"IPow\" : \"PyNumber_InPlacePower\", # The others are generic code", "KIND, either express or implied. # See the License for the specific language", "\"ILShift\": \"PyNumber_InPlaceLshift\", \"IRShift\": \"PyNum...
[ "): return graphene_info.context.get_external_execution_plan( external_pipeline=external_pipeline, run_config=run_config, mode=mode, step_keys_to_execute=step_keys_to_execute, known_state=known_state, ) @capture_error def fetch_repositories(graphene_info): from", "selector.solid_selection: if not full_pipeline.ha...
[ "parent_dir=d) assert '__init__' in w.modules assert w.has_module_name('__init__') assert w.pkg_path == os.path.join(d, 'foo') w.write()", "w.get_file_as_string() lns = s.split('\\n') assert 'a' in lns[0] assert 'b' in lns[1] assert", "import TemporaryDirectory from quickbase_client.utils.pywriting_utils import...
[ "is True. train_bn : boolean, optional Whether one should normalize the layer input", ": string The ResNet architecture in {'resnet50', 'resnet101'}. stage5 : boolean, optional Whether", "3 x = conv_block(x, [128,128,512], stage=3, block='a', train_bn=train_bn) x = identity_block(x, [128,128,512], stage=3,", ...
[ "= 'UTC' return { '@timestamp': self.compose_timestamp(line[0], timezone), 'log_level': log_level, 'process_id': int(pid), 'message': '", "= line[2].lstrip(\"[\").rstrip(\"]\") timezone = 'UTC' return { '@timestamp': self.compose_timestamp(line[0], timezone), 'log_level': log_level, 'process_id':", "in line to ...
[ "in the corpus. Parameters ---------- corpus_context : CorpusContext Context manager for a corpus", "sequence_type, specifier, max_distance): return phono_edit_distance(getattr(w, sequence_type), getattr(query, sequence_type), sequence_type, specifier) <= max_distance def", "= corpus_context.sequence_type query...
[ "import settings from django.db import migrations class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('brokenChains',", "2018-11-06 17:19 from django.conf import settings from django.db import migrations class Migration(migrations.Migration): depende...
[ "[[0.2, 0.5], [0.5, 0.2], [0.8, 0.5], [0.5, 0.8]] cmap = plt.cm.RdYlGn norm =", "'normal')) plt.xticks([]) plt.yticks([]) def choose_abs_greedy_action(state, Q, epsilon): action = None if np.random.uniform(0, 1)", "epsilon: action = np.random.randint(env.action_space.n) else: action = np.argmax(Q[state,:]) retu...
[ "Generated by Django 3.0.4 on 2020-07-14 11:00 from django.db import migrations, models import", "on 2020-07-14 11:00 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies", "( \"use_case\", models.ForeignKey( on_delete=django.db.models.del...
[ "for the connection. :type port: string :param connection_username: The new username for the", "embed_password_flag=None): super().__init__(ts_connection) self._server_address = server_address self._port = port self._connection_username = connection_username self._connection_password =", "new password for the c...
[ "name=\"type\" content=\"blog_post\">\"\"\" in html) self.assertTrue(\"\"\"<meta property=\"og:title\" content=\"My Blog\">\"\"\" in html) def tearDown(self): frappe.db.rollback()", "meta tags for this route doc = frappe.new_doc(\"Website Route Meta\") doc.append(\"meta_tags\", {\"key\": \"type\",", "test_depen...
[ "z.InitSnow_0, z.Prec, z.NRur, z.CN, z.AntMoist_0, z.NUrb, z.Grow_0, z.Landuse, z.Area), AgRunoff.AgRunoff(z.NYrs, z.DaysMonth, z.Temp, z.InitSnow_0,", "z.Grow_0, z.Landuse, z.Area), AgRunoff.AgRunoff(z.NYrs, z.DaysMonth, z.Temp, z.InitSnow_0, z.Prec, z.NRur, z.CN, z.AntMoist_0, z.NUrb, z.Grow_0,", "from .Varia...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "p, input_shape, expected_shape): batch_size, num_points, _ = input_shape g = tf.Graph() with g.as_default():", "KIND, either express or implied. #...
[]
[ "= str(sniff_path).lower() # Variable in which information will be stored dir_store = {}", "# Important: it's cross-platform relevant! modified_date = os.path.getmtime(f_path) dir_store[subdir]['file_details'][file] = (modified_date,) # Name", "modification date # Important: it's cross-platform relevant! modifi...
[ "and # integrates with CPython, but also works on its own. # #", "ExpressionBuiltinGlobals(ExpressionBase): kind = \"EXPRESSION_BUILTIN_GLOBALS\" def __init__(self, source_ref): ExpressionBase.__init__(self, source_ref=source_ref) def finalize(self): del self.parent", "KIND, either express or implied. # See the...
[ "0x10000), (0x10000, chainerx.int64, 0x10000), (0x10000, chainerx.uint8, 0), (0x100000000, chainerx.bool_, True), (0x100000000, chainerx.int8, 0),", "# (float('inf'), float('inf')), ]) def test_equality(value1, value2): scalar1 = chainerx.Scalar(value1) scalar2 = chainerx.Scalar(value2)", "-1.5), (True, True), ...
[ "for button in self.active_buttons: button.update() def intro_draw(self): for button in self.active_buttons: button.draw() def", "50, 300, WIDTH - 100, 50, PLAY_BUTTON_COLOUR, hover_colour=(49, 218, 46), function=self.intro_to_play, text=\"PLAY\") self.intro_buttons.append(intro_play_button)", "self.gameover_ev...
[ "= {'abstracts': (BillAbstract, 'bill_id', {}), 'other_titles': (BillTitle, 'bill_id', {}), 'other_identifiers': (BillIdentifier, 'bill_id', {}),", "BillVersion, BillDocumentLink, BillVersionLink) from .base import BaseImporter from ..exceptions import PupaInternalError class BillImporter(BaseImporter):", "in R...
[ "i in range(len(test_data_1)): final_labels[i]=np.mean(preds[:,i]) if i%10000==0: print(i ,' out of ',len(test_data_1)) print('making the", "in range(len(test_data_1)): final_labels[i]=round(np.mean(preds[:,i])) if i%100==0: print(i ,' out of ',len(test_data_1)) print(\"test data accuracy:", "n_h_features=nlp_f...
[ "s=20, c=palette[y.astype(np.int)]) ax.axis(\"off\") # Add the labels for each cluster. for i in", "The vertical line for average silhouette score of all the values ax1.axvline(x=silhouette_avg, color=\"red\",", "[PathEffects.Stroke(linewidth=5, foreground=\"w\"), PathEffects.Normal()] ) # plt.legend() figure_f...
[]
[ "<reponame>jack139/cnnc #!/usr/bin/env python # -*- coding: utf-8 -*- # import web import time", "= helper.create_render() user_data = web.input(news_id='') if user_data.news_id == '': return render.info('参数错误!') db.index_news.delete_one({'_id':ObjectId(user_data.news_id)}) return", "url = ('/plat/index_news_re...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "copyvars=None): BaseWindow.__init__(self, **get_args(locals())) # Set the online model for subclasses if type(self).__name__ !=", "disables it. ...
[ "this case the email list is needed :return: 3 arrays of outputs \"\"\"", "Description of breach from API response :return: Description string that altered HTML urls", "+ ')' breach_description = re.sub(html_link_pattern, link_from_desc, breach_description, count=1) return breach_description def data_to_markdow...
[ "[self.visit(n.left)], [], lineno=n.lineno, col_offset=n.col_offset ) return self.generic_visit(n) class Pipeline(Extension): identifier = \"pipeline\" def", "ast.Call( self.visit(n.right), [self.visit(n.left)], [], lineno=n.lineno, col_offset=n.col_offset ) return self.generic_visit(n) class Pipeline(Extension):...
[ "= struct.pack(flag, patch_value) mm.write(patch_bytes) def get_protected_function_info(r2, function): # find addresses and sizes of", "names if function in name: mangledName = name match += 1 if match", "size, expected hash\", required=True) results = parser.parse_args() print(\"python protect program\", resul...
[ "Django 2.2.15 on 2021-01-29 20:20 from django.db import migrations, models import django.db.models.deletion class", "migrations.CreateModel( name='auditionRounds', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('roundno', models.IntegerField(default=1...
[ "is_old_facts = self.module._name == 'azure_rm_availabilityset_facts' if is_old_facts: self.module.deprecate(\"The 'azure_rm_availabilityset_facts' module has been renamed", "to search for the desired availability set. tags: description: - List of tags", ") self.name = None self.resource_group = None self.tags ...
[ "nodes = client.list_node(clusterId=cluster.id).data if len(nodes) > 0: if nodes[0].nodeTemplateId is None: return \"Custom\"", "while not check_function(resource): if time.time() - start > timeout: exceptionMsg = 'Timeout waiting", "\" http://\" + host_ip + \":\" + \\ str(source_port) + \"/name.html\" validate...
[ "= {')':'(',']':'[','}':'{'} stack = [] for ch in s: if ch in dict.values():", "0 or (stack.pop() != dict[ch]): return False return len(stack) == 0 def main():", "true class Solution(object): def isValid(self, s): \"\"\" :type s: str :rtype: bool \"\"\"", "empty string is also considered valid. # Example 1: #...
[ "True except ImportError: IS_CONNECTED = False def get_health(token_info=None, user=None): \"\"\"Get a health report", "response = ({\"status\": \"Error\", \"message\": \"Incomplete database configuration\"}, 500) else: Result.query.first() response =", "\"Fetching service status\"}, 200) # Try to connect to th...
[ "N.uint8, ['CONTIGUOUS', 'ALIGNED']) self._lib.pymodule_bh_tsne( self.embedding, # result self.points, # points self.points.ctypes.shape, # dims", "Point dumpoing self.dump_file = str(dump_file) self.dump_points = bool(dump_points) self.dump_interval = int(dump_interval) # Viz", "-- Input array, shape: (n_point...
[ "any CRUD not related to strictly editing users info and courses info from", "# contains any CRUD not related to strictly editing users info and courses", "related to strictly editing users info and courses info from .views import admin", "CRUD not related to strictly editing users info and courses info from ...
[ "PATHS_FROM_ECLIPSE_TO_PYTHON). @note: all the paths with breakpoints must be translated (otherwise they won't", "x in PATHS_FROM_ECLIPSE_TO_PYTHON] # example: # PATHS_FROM_ECLIPSE_TO_PYTHON = [ # (r'd:\\temp\\temp_workspace_2\\test_python\\src\\yyy\\yyy', # r'd:\\temp\\temp_workspace_2\\test_python\\src\\hhh\\xx...
[ "= self.gen_id() if num != file.read(): file.close() os.remove(Constants.Files.ID) file = self.open_id_file() file.write(num) file.close()", "== NetworkPackets.NetLogicIncomes.PAIRED.value: Constants.Network.IS_PAIRING = True self.client.send(NetworkPackets.assemble(arr=Actions.COMPUTER.get_specs_as_str_arr())) e...
[ "EDIT! # source: resource_requirements.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))", "file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ],", "ResourceR...
[ "\"\" if method != \"post\": abs_url = \"%s?%s\" % (abs_url, data) data =", "True def test_should_retry_on_error(self, mocker): client = stripe.http_client.new_default_http_client() client._max_network_retries = lambda: 1 api_connection_error =", "assert telemetry[\"last_request_metrics\"][\"request_id\"] == \"...
[ "def download(self, url: str): \"\"\" Store a python dictionary generated from json data", "data.items(): self._iterate(key) self._open_list() self._iterate(value) self._close_list() elif isinstance(data, list): self._open_list() for item in data:", "\"\"\" Store a python dictionary generated from json data at ...
[ "FMDBTab.NAME) vbox.addWidget(tabWidget) wid = QWidget(self) self.setCentralWidget(wid) wid.setLayout(vbox) if __name__ == \"__main__\": app =", "QEvent, QPoint, Qt from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import (QApplication, QDialog, QGroupBox,", "= 100 width = 70*4 height = 130*4 def __init__(self...
[ "similar-sized chunks from l.\"\"\" chunk_size = 1 + len(l) // n for i", "LOCATION_FIELDS]) elif sheet.name == \"Teacher\": (teachers, ) = process_sheet(sheet, TEACHER_TITLES, [TEACHER_FIELDS]) elif sheet.name", "\"SCHOOL_ID\"] STUDENT_TITLES = [\"SCHOOL_NAME\", \"SCHOOL_ID\", \"STUDENT_ID\", \"STUDENT_SRN\", \...
[ "= [] streamdict = {} if chandict[\"callsign\"] in list(self.cached_m3u): streamurl = self.cached_m3u[chandict[\"callsign\"]] else:", "format_callsign(self, url): callsign = (url .split('/')[-2] .replace('-live', '') .replace('-channel', '') .replace('-free', '') .replace('-streaming',", "driver.find_element_by...
[]
[ "def __init__(self, images:list, centre:tuple, key:str) -> None: ''' Class variables. key: 'sm', 'lg',", "size self.rect.center = self.centre # set centre for all frames self.frame = 0", "= 0.8 seconds self.active = True def update(self, dt): self.time_passed += dt if", "= self.image.get_rect() # new rectangl...
[ "= args self.callback = callback self._wake_up_time = time.time() + 1 self._kill_event = threading.Event()", "the appropriate executors for processing. This is based on the following logic: ..", "bit more\") def make_callback(self, kind=None): \"\"\"Makes the callback and resets the timer. \"\"\"", "is starte...
[ "[attribution_gcc], ['Guided_Grad_Cam']) # Computing Guided BackProp gbp = GuidedBackprop(model) attribution_gbp = compute_attributions(gbp, X_tensor,", "= True X_tensor = torch.cat([preprocess(Image.fromarray(x)) for x in X], dim=0).requires_grad_(True) y_tensor = torch.LongTensor(y)", "guided backprop results...
[ "reduce_concat') PRIMITIVES = [ 'none', 'max_pool_3x3', 'avg_pool_3x3', 'skip_connect', 'sep_conv_3x3', 'sep_conv_5x5', 'dil_conv_3x3', 'dil_conv_5x5' ]", "0), ('max_pool_3x3', 1), ('skip_connect', 2), ('max_pool_3x3', 1), ('max_pool_3x3', 0), ('skip_connect', 2), ('skip_connect', 2),", "NASNet = Genotype( norm...
[ "use SQLite.') return bar = TabBar(predicates + ['(Log)']) logs_idx = len(predicates) executions =", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "IPython.display import display import os im...
[ "import Basic as sp_Basic class Basic(sp_Basic): \"\"\"Basic class for Pyccel AST.\"\"\" _fst =", "as sp_Basic class Basic(sp_Basic): \"\"\"Basic class for Pyccel AST.\"\"\" _fst = None def", "sp_Basic class Basic(sp_Basic): \"\"\"Basic class for Pyccel AST.\"\"\" _fst = None def set_fst(self,", "from sympy.c...
[ "for _ in range(n_features)] categorical_features = [[], [1, 3]] percentiles = [list(np.arange(25, 100,", "indirect=True) def test_discretizer(cats_and_percentiles): cat, perc = cats_and_percentiles disc = Discretizer(x, cat, feature_names, perc)", "n_tests = len(tests) @pytest.fixture def cats_and_percentiles(...
[ "= 1 self.assertEqual(ps.get_common_id([dim1, dim2]), \"0.2_1\") dim1.value = 0.1 dim2.value = 2 self.assertEqual(ps.get_common_id([dim1, dim2]),", "[-0.3,-0.2, -0.1, 0] ps = ParameterSpace(\"ps\") ps.register_parameters([p1, p2]) ps.enable_cache(\"ps_test\") def func(param1, param2): return", "1 self.assertEqu...
[ "from interpretable_ddts.agents.ddt_agent import DDTAgent from interpretable_ddts.agents.mlp_agent import MLPAgent from interpretable_ddts.opt_helpers.replay_buffer import discount_reward import", "bot_name = AGENT_TYPE + ENV_TYPE if USE_GPU: bot_name += 'GPU' if AGENT_TYPE ==", "reward agent.save_reward(reward...
[ "my_list: if letter.isalpha(): if letter not in count: letter[count] = [] count.update(letter) return", "question_2 = ['able', 'ability', 'apple', 'tryst', 'trial', 'tremendous', 'tree'] my_list = [] for", "my_list = [] #count = 0 for key in word: prefix = key[:prefix_length]", "key[:prefix_length] my_list.ap...