ngram
listlengths
0
67.8k
[ "when calling the function, can be removed in the future \"\"\" def test_sample_attack():", "from privacy_evaluator.attacks.sample_attack import Sample_Attack \"\"\" This test only test if no error is", "removed in the future \"\"\" def test_sample_attack(): test = Sample_Attack(0, 0, 0) test.perform_attack()",...
[ "writing, software # distributed under the License is distributed on an \"AS IS\"", "\"\"\"), license='Apache 2.0', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience ::", "the Presto distributed SQL Engine', long_description=textwrap.dedent(\"\"\" Client for Presto (https://prestodb.io), a dist...
[ "\"Discrete Mathematics\", \"Adv Engineering Mathematics\", \"Linear Algebra\", \"Cryptography\"] weightage = [250,900,850,1200,290,345] seperator =", "as graph subject = [\"Probability\", \"Calculas\", \"Discrete Mathematics\", \"Adv Engineering Mathematics\", \"Linear Algebra\",", "Mathematics\", \"Linear Alg...
[ "parameter values to evaluate for each of the algorithms \"\"\" # Question 6", "for lam in ran: rg = learner(lam) train_score, validation_score = cross_validate(rg, train_X.to_numpy(), train_y.to_numpy(),", "train_err = [] validation_err = [] for lam in ran: rg = learner(lam)", "as gg def select_polynomial_de...
[ "version of the source content :type content_version: string :return: a list of formats", "the catalog :param media: the media object :type media: dict :param content_version: the", "isinstance(target, int): return target else: raise Exception('Invalid replacement target \"{}\". Expected string but", "a book ...
[ "return utils.get_log(self) def workflow_is_finished(self): state = self.get_state() if not state.transitions.all(): return True else:", "utils.import_from_string(transition.condition) # todo:目前这里是轮询到条件正确的一个, 就跳出轮询设置状态了 if not cond().run(self, transition): continue if transition.task: # todo:task是顺序还是异步执行,", "g...
[ "name=None, duration_field=None, **kwargs): self.duration_field = duration_field super(VideoField, self).__init__(verbose_name, name, **kwargs) def check(self, **kwargs):", "def __init__(self, verbose_name=None, name=None, duration_field=None, **kwargs): self.duration_field = duration_field super(VideoField, self...
[ "@staticmethod def array2BST(array): ''' array:sorted array ''' n = len(array) if n ==", "array:sorted array ''' n = len(array) if n == 0: return None m", "n = len(array) if n == 0: return None m = n//2 left,root,right", "= len(array) if n == 0: return None m = n//2 left,root,right =", "@staticmethod def BS...
[ "@pytest.mark.parametrize('spec_file,spec_name', [ ('experimental/reinforce.json', 'reinforce_mlp_cartpole'), ('experimental/reinforce.json', 'reinforce_rnn_cartpole'), # ('experimental/reinforce.json', 'reinforce_conv_breakout'), ]) def test_reinforce(spec_file, spec_name):", "test_hydra_dqn(spec_file, spec_name...
[ "group\")) new_groups = app.group.get_group_list() assert len(old_groups) == len(new_groups) def test_modify_group_header(app): if app.group.count() ==", "Group def test_modify_group_name(app): if app.group.count() == 0: app.group.create(Group(name=\"test\")) old_groups = app.group.get_group_list() app.group.modi...
[ "= ResponseInfoWrapper( response_headers, response_status, res_ctype, res_clength, data.decode(\"utf-8\"), ) # Send off data to", "yourself under normal circumstances. \"\"\" response_headers = {} response_status = 0 iterable =", "the current WSGI application, which will be wrapped config (MetricsApiConfig): In...
[ "= max(epsilon, 0) return take_action # Ignore sklearn warnings def warn(*args, **kwargs): pass", "sorted_list = [(y,x) for x,y in action_list.items()] sorted_list.sort(reverse=True) take_action = sorted_list[0][1] else: #", "= NearestNeighbors(n_neighbors=min(k,max_iters)).fit(states[:max_iters]) distances, in...
[ "self.es.indices.delete(index=self.blocks_index_name) self.es.indices.create(index=self.blocks_index_name, body=self.block_mapping) except elasticsearch.ElasticsearchException as es1: print(\"Elastic exception on create Indicies:\", es1)", "\"mappings\": { \"balance\": { \"properties\": { \"@dtime\": { \"type\": ...
[ "def testCleanPhoneNumber(self): phone_number = \" 324 23-23421241\" cleaned = clean_phone_number(phone_number) self.assertEquals(cleaned, \"+3242323421241\") def", "pass def testCleanPhoneNumber(self): phone_number = \" 324 23-23421241\" cleaned = clean_phone_number(phone_number) self.assertEquals(cleaned, \"+32...
[ "= complex_energy - (frag1_energy + frag2_energy) return tf.expand_dims(binding_energy, axis=1) class AtomicConvModel(KerasModel): \"\"\"Implements an", "enumerate( dataset.iterbatches( batch_size, deterministic=True, pad_batches=pad_batches)): N = self.complex_num_atoms N_1 = self.frag1_num_atoms N_2 =", "rang...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "copyright notice and this permission notice shall be included in all copies or", "= YamlConfigurationFile() self.assertIsNotNone(yaml) yaml.load_from_text(\"\"\" brain: oobs: default: \"\"\", ConsoleConfiguration(), \".\") bra...
[ "that create specific orb types (whether board change, orb change, orb spawn, etc)", "for active skills that create specific orb types (whether board change, orb change,", "active skills that create specific orb types (whether board change, orb change, orb", "Interface for active skills that create specific o...
[ "fixed_package_name.startswith('backports_'): fixed_package_name.replace('_', '.', 1) return fixed_package_name def _write_init_py(package_name: str) -> None: \"\"\" Dynamically", ":return: tuple of the README.md text and the long_description type. :rtype: typing.Tuple[str, str]", "Python :: 3.7', 'Programming ...
[ "np.linalg.norm(pi_dag.sum(axis = 1) - mu, 1)) print('error_nu = %.5e' % np.linalg.norm(pi_dag.sum(axis = 0)", "print('error_nu = %.5e' % np.linalg.norm(pi_dag.sum(axis = 0) - nu, 1)) print('fvall = %.5e'", "- r.sum() / (m + n + 1)) / (n + 1)).reshape((m, 1))", "mu, 1)) print('error_nu = %.5e' % np.linalg.nor...
[ "argparse.ArgumentParser(description='Clean up the data for a given parameter') parser.add_argument('--infile', help=\"Path to the VCF", "VCF file\", default='test.vcf') parser.add_argument('--outfile', help=\"Path to the new VCF file\", default='test.out.vcf') parser.add_argument('--param', help=\"Parameter", ...
[ "= 0 for trans in self.corpus.iter_transcripts(): self.trans_num += 1 self.da2num = switchboard_da_mapping() #", "prev_speaker = speaker i += 1 segment_indices[j] = i return segment_indices def swda_half_perturb(self,", "permutations, only the uniquely possible ones are returned \"\"\" assert len(sents) == len(...
[ "test_clean_accounting_column(): test_str = \"(1,000)\" assert _clean_accounting_column(test_str) == float(-1000) @pytest.mark.utils def test_clean_accounting_column_zeroes(): test_str =", "def test_clean_accounting_column(): test_str = \"(1,000)\" assert _clean_accounting_column(test_str) == float(-1000) @pytest...
[ "import requests import requests_cache import re import time from bs4 import BeautifulSoup from", "link if SEARCH_RESULT['WIKI']['link'] != NO_RESULT and SEARCH_RESULT['YOUTUBE']['link'] != NO_RESULT: break SEARCH_RESULT['FIRST']['title'] = results[0].get('title')", "\"link\": link } results.append(item) #print...
[ "after_course.appendChild(course_name) with open(file_path, 'wb+') as f: f.write(doc.toprettyxml(indent='\\t', encoding='utf-8')) def load_data_xml(file_path): info_list = []", "self.pre_node_titles = pre_node_titles def save_data_xml(course_list, file_path): doc = Document() courses = doc.createElement('course_l...
[ "from theheck.types import Command @pytest.fixture def output(target): return ('error: the following file has", "rm foo bar', 'git rm']) def test_not_match(script): assert not match(Command(script, '')) @pytest.mark.parametrize('script, target,", "rm']) def test_not_match(script): assert not match(Command(scrip...
[ "async def redoc_html(): return get_redoc_html( openapi_url=data_service_app.openapi_url, title=data_service_app.title + \" - ReDoc\", redoc_js_url=\"/static/redoc.standalone.js\", )", "from fastapi.staticfiles import StaticFiles from starlette.responses import PlainTextResponse, Response from data_service.api.da...
[ "str(walk_iteration + 1) + \"/\" + str(num_walks) ) self.random_state.shuffle(nodes) for node in nodes:", "= new_id_map self.is_directed = self.graph.is_directed() self.p = return_hyperparameter self.q = inout_hyperparameter self.random_state =", "reference implementation of node2vec comes from Aditya Grover fr...
[ "= re.sub(r'[^A-z0-9]', '', messages[2]) if messages[3][0] == self.symbol: messages = [\"\"] + messages", "command = getattr(commands, \"command_{}\".format(cmd), __name__)(args, room.strip().lower(), user.lower(), self) self.ws.send(\"{}|{}\".format(room, command)) except (IndexError, TypeError):", "\"name\": ...
[ "X = model.points if spatial_key is None else model[spatial_key] if rd_method == \"ElPiGraph\":", "import Optional, Tuple, Union import numpy as np import pandas as pd import", "np.ndarray, NumNodes: int = 50, **kwargs, ) -> Tuple[np.ndarray, np.ndarray]: \"\"\" Generate a", "tree model, which contains the fo...
[ "model.group import Group import pytest import allure_pytest def test_add_group(app, db, check_ui, json_groups): group0", "db, check_ui, json_groups): group0 = json_groups #with pytest.allure.step(\"Given a group list\"): old_groups =", "the list\" % group0): app.group.create(group0) #assert app.group.count() =...
[ "cls.frames[frame_id] = frame print(frame_id, frame) @classmethod def find_frames(cls, position: CursorPosition) -> list[Frame]: \"\"\"", "def find_frames(cls, position: CursorPosition) -> list[Frame]: \"\"\" Right now it's a fake implementation,", "callee frames of the same caller frame. Nodes are also indexed...
[ "API to use: '1.0', '1.1', or '2.0'. (Default: '2.0') .. attribute:: use_ssl *BooleanField*:", "use_ssl = models.BooleanField( default=False, verbose_name=\"Use SSL\", help_text=\"Use HTTPS API URLs by default?\" )", "api_key *CharField*: Your base64-encoded API key, used to sign requests. This is optional", ...
[ "\"inventory_blue_item\": return HsvFilter(79, 169, 0, 109, 246, 188, 0, 0, 0, 0) if", "1260, 210] if object_name == \"player_map_loc\": if kwargs.get(\"big_map\"): return HsvFilter(31, 94, 86, 73,", "20), [415, 533, 888, 700] if object_name == \"loot_chest_normal\": # This is a", "0, 0, 0, 0) if object_name ...
[ "state.comp = data.id['x'] assert state.n_bin == 12 state.n_bin = 11 state.comp = data.id['y']", "self.helper.upper == +100 def test_change_percentile(self): # Changing scale mode updates the limits self.helper.percentile", "8 self.state.comp = self.data.id['y'] assert self.state.x_min == 1.5 assert self.state....
[ "import Iterable, Optional class ProductsNotFound(Exception): def __init__(self, product_ids: Optional[Iterable[int]] = None): self.product_ids =", "self.product_ids = product_ids or [] self.message = \"One or more products are invalid.\"", "ProductsNotFound(Exception): def __init__(self, product_ids: Optional[...
[ "999) def test_record_items(self): r = Record([\"name\", \"age\", \"married\"], [\"Alice\", 33, True]) self.assertEqual(r.items(), [(\"name\",", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", ...
[ "db = ExplainerDashboard(explainer, title=\"testing\", responsive=False) dash_duo.start_server(db.app) dash_duo.wait_for_text_to_equal(\"h1\", \"testing\", timeout=30) assert dash_duo.get_logs() == [],", "= ClassifierExplainer(model, X_test, y_test, cats=['Sex', 'Deck'], labels=['Queenstown', 'Southampton', 'Cher...
[ "in input dir {1}\".format(len(files),inputDataDir)) print(\"First is {0}\".format(files[0])) ds = tfDsParquet.create_parquet_dataset([files[0]]) for element in", "{0}\".format(sampleId)) #print(sampleIds.shape) #print(pixels.shape) # a += 1 # if a > 10: #", "sampleId.decode(\"utf-8\") fileName = os.path.join(o...
[ "= val2[:index] + '&&' + val2[index+2:] else: val = val2 xrcgen.DefaultXrcObject.write_property(self, name, val,", "def cn(self, name): # don't process already formatted items again if name.startswith('wx.'): return", "to be supported fully: if compat.IS_PHOENIX: import_modules = ['import wx.adv\\n'] if compat....
[ "config import config, gen_config, update_config_from_args, s_args config = update_config_from_args(config, s_args) def main(): #", "train_metric, epoch, config, logger=logger, ctx=ctx) validNet(net, valid_data_iter, loss, eval_metric, epoch, config, logger=logger, ctx=ctx)", "config and mkdir output logger, fi...
[ "default=128, help=\"feat dimension\") parser.add_argument(\"--feature_layer\", type=str, default='lowdim', help=\"feature layer\") parser.add_argument('--use-lmdb', action='store_true') args = parser.parse_args()", "get_dino_network(args.backbone, pretrained_path, feature_layer=args.feature_layer) elif args.task...
[ "def test_find_data_corrupt_pom(self): content = \"\"\" </project> </project> <dependencyManagement> <dependencies> <dependency> <groupId>grp1.id</groupId> <artifactId>art1.id</artifactId> </dependency>", "[d.group_id for d in deps] assert not {'grp1.id', 'grp2.id', 'grp3.id'}.difference(set(group_ids)) scopes = ...
[ "import os import sys import unittest from tests.tests_bin_class.test_performance import * if __name__ ==", "import sys import unittest from tests.tests_bin_class.test_performance import * if __name__ == \"__main__\": unittest.main()", "os import sys import unittest from tests.tests_bin_class.test_performance i...
[ "to do consistency/sanity checks on Allocations. ''' def runtask(self): ''' ''' self.log.info(\"Running task", "checks on Allocations. ''' def runtask(self): ''' ''' self.log.info(\"Running task %s\" % self.section)", "#!/usr/bin/env python from vc3master.task import VC3Task class CheckAllocations(VC3Task): '''...
[ "{ 'TIMEOUT': 5, 'USE_SSL': False, } @property def url(self): scheme = 'http' if", "request=None): _, _, trace = sys.exc_info() notice_em = etree.Element('notice', version='2.0') tb = traceback.extract_tb(trace)", "= traceback.extract_tb(trace) api_key = etree.SubElement(notice_em, 'api-key').text = self.settin...
[ "['SnapshotConnector'] _LOGGER = logging.getLogger(__name__) class SnapshotConnector(AzureConnector): def __init__(self, **kwargs): super().__init__(**kwargs) self.set_connect(kwargs.get('secret_data')) def list_snapshots(self):", "SnapshotConnector(AzureConnector): def __init__(self, **kwargs): super().__init__(...
[ "punctuation: str @dataclass class Greeter: punctuation: str greeting: str = 'Hello' def __call__(self,", "FrenchCustomer, pass into the \"greet_customer\" interaction, # then test the result. french_customer =", "using its class for the \"key\" registry.register_factory(default_greeter_factory, Greeter) # Now ...
[ "and runs the repair method :param time: the simulation time object :param gas_field:", "and repair costs associated with all detection and repair methods in the program.", "and repair methods must be defined by the dispatch_objects specified for each method.", "+ ' ' + tech.dispatch_object.name] = tech.dispa...
[ "self.G_A2B = modelGenerator(conv_kernel_c7Ak=7, use_resize_convolution=self.use_resize_convolution, input=self.image_shapeA, output=self.image_shapeB, name='G_A2B_model') self.G_B2A = modelGenerator(conv_kernel_c7Ak=7, use_resize_convolution=self.use_resize_convolution, input=self.image_shapeB, output=self.image_s...
[ "templates = Jinja2Templates(directory=\"templates\") #views @app.get(\"/\", tags=[\"/view\"]) async def index(request: Request): return templates.TemplateResponse(\"index.html\", {\"request\":", "configure static and templates file on jinja 2 app = FastAPI( title=f\"Technical Case\",", "para subir planilhas pa...
[ "def f(x): return client.scripts.put_sql_archive(script_id, True) fut.add_done_callback(f) fut.result() outputs = client.scripts.get_sql_runs(script_id, run_id)[\"output\"] if not", "existing_table_rows is \"upsert\", delayed executions move data from staging table to final table", "ID of the database credentia...
[ "def test_badge_str(self): strategy = BADGE(2) expected_str = 'BADGE(num_classes=2)' self.assertEqual(expected_str, str(strategy)) @pytest.mark.pytorch class ExpectedGradientLengthTest(unittest.TestCase):", "batch_size=100, device='cpu') self.assertEqual(4, strategy.num_classes) self.assertEqual(100, strategy.bat...
[ "] def parse_tango_color(c): r = int(c[:4][:2], 16) g = int(c[4:8][:2], 16) b =", "parse_tango_color(c): r = int(c[:4][:2], 16) g = int(c[4:8][:2], 16) b = int(c[8:][:2], 16)", "color_table): cfg.default_foreground_color = parse_tango_color('eeeeeeeeecec') cfg.default_background_color = parse_tango_color('32323...
[ "auth_code_data is None: return None auth_code = DbAuthorizationCode.validate_document(auth_code_data) if auth_code.is_expired(): return None return", "class OpenIDCode(UserInfoMixin, ExistsNonceMixin, JwtConfigMixin, _OpenIDCode): jwt_token_expiration = config.oauth2.token_expiration.authorization_code class Ope...
[ "None self.backlog = backlog self.listener = None self.protocols = {} async def start(self)", "self.backlog = backlog self.listener = None self.protocols = {} async def start(self) ->", "-> None: \"\"\" Send a message. :param msg: A bytes object representing the", "Start the server \"\"\" try: self.listener =...
[ "specify a key, so this finding shouldn't be accessed by key. Randomise it", "triggers for example stop_processing: bool = False _scheduler: Optional[PlaybooksScheduler] = None def set_scheduler(self,", "from enum import Enum from typing import List, Optional, Dict, Any from dataclasses", "MANUAL_TRIGGER = 3 ...
[ "= ObjectIdField() name = StringField() brand = StringField() year = StringField() size =", "mongoengine import Document from mongoengine.fields import ( FloatField, StringField, ListField, URLField, ObjectIdField, )", "{\"collection\": \"bike\"} ID = ObjectIdField() name = StringField() brand = StringField() y...
[]
[ "self: This instance with matching fixedClassifier resources retrieved from the server available through", "error condition \"\"\" return self._select(self._map_locals(self._SDM_ATT_MAP, locals())) def read(self, href): \"\"\"Retrieves a single instance", "TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A P...
[ "= np.int16(self._coefD >> 16) secondHalf = np.int16(self._coefD & 0xffff) # Set the minimum", "libc # libc = m.SacherLasaTeknique() # print(libc.vcs()) # eposlib = ctypes.windll.eposcmd eposlib =", "* 1)() ObjectData = ctypes.cast(ObjectDataArray, ctypes.POINTER(ctypes.c_int32)) StoredPositionNbBytesRead = cty...
[ "[ 'image/{}', 'image/{}_crop' ] label_dirs = [ 'label/{}/annotations', 'label/{}/annotations_crop', ] def generate(root): assert", "] label_dirs = [ 'label/{}/annotations', 'label/{}/annotations_crop', ] def generate(root): assert len(image_dirs) == len(label_dirs)", "label_path)): image = label.replace('.png'...
[ "same arguments and perform the same operation torch_module = torch.nn.Unfold( kernel_size, dilation=dilation, padding=padding,", "1 padding = 1 stride = 2 # both modules accept the same", "comparison with ``torch.nn.Unfold``.\"\"\" # imports, make this example deterministic import torch import unfoldNd", "di...
[ "'\\\\u0026', } _json_escapes_attr = { ord('>'): '\\\\u003E', ord('<'): '\\\\u003C', ord('&'): '\\\\u0026', ord('\"'): '&#34;',", "ord('\"'): '&#34;', ord(\"'\"): '&#39;', ord(\"=\"): '&#61;', } @keep_lazy(str, SafeText) def escapejson(value): \"\"\"Hex encodes", "script.\"\"\" return mark_safe(force_str(value)...
[ "} class PlotlyAPI(Chart): \"\"\" Base class for Plotly.js API This class is used", "options = { \"chartid\": chart_id, \"url\": url, \"params\": init_params } super(PlotlyAPI, self).__init__(\"PlotlyAPI\", options,", "have a default method of transmitting data. Instead the user must supply a", "\"showLink\":...
[ "Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): qbtn = QtGui.QPushButton('Quit', self) qbtn.clicked.connect(QtCore.QCoreApplication.instance().quit)", "super(Example, self).__init__() self.initUI() def initUI(self): qbtn = QtGui.QPushButton('Quit', self...
[ "from gpytorch.means import ZeroMean class TestZeroMean(unittest.TestCase): def setUp(self): self.mean = ZeroMean() def test_forward(self):", "__future__ import division from __future__ import print_function from __future__ import unicode_literals import torch", "self.assertTrue(res.eq(0).all()) def test_forwar...
[ "birthday=\"\", anniversary=\"\", secondary_address=\"\", secondary_tel=\"\", notes=\"\")] + [ Contact(first_name=random_string('first_name', 10), middle_name=random_string('middle_name', 10), last_name=random_string('last_name', 10),", "anniversary=\"\", secondary_address=\"\", secondary_tel=\"\", notes=\"\")] +...
[ "Added cousin package:\", cousin_dir nephew_fname = os.path.join(cousin_dir, \"nephew\"+os.extsep+\"py\") nephew_file = open(nephew_fname, \"w\") nephew_file.close()", "= run_module(mod_name, run_name=run_name) # Read from bytecode self.failUnless(\"__package__\" in d2) self.failUnless(d2[\"__package__\"] == pkg_...
[ "is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='dtype', full_name='ImageData.dtype', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False,", "\\x01(\\x05\\x12\\r\\n\\x05\\x64type\\x18\\x04 \\x01(\\t\\\"!\\n\\x0fPredictionC...
[ "(completed.c.discount_code_id == discounts.c.discount_code_id) & (completed.c.marketer_id == discounts.c.marketer_id)) \\ .outerjoin(placed, (placed.c.event_id == discounts.c.event_id) &", "sales (dictionary with total sales and ticket count) for placed, completed and pending", "methods = ['GET'] decorators = ...
[ "import Language class SerbianDefaults(Language.Defaults): tokenizer_exceptions = TOKENIZER_EXCEPTIONS lex_attr_getters = LEX_ATTRS stop_words = STOP_WORDS", ".tokenizer_exceptions import TOKENIZER_EXCEPTIONS from .lex_attrs import LEX_ATTRS from ...language import Language class SerbianDefaults(Language.Defaults...
[ ".functions.deform_pool import deform_roi_pooling from .modules.deform_conv import (DeformConv, ModulatedDeformConv, DeformConvPack, ModulatedDeformConvPack) from .modules.deform_pool import", "import deform_roi_pooling from .modules.deform_conv import (DeformConv, ModulatedDeformConv, DeformConvPack, ModulatedDe...
[ "def get_skill_value_list(obj): return SkillValue.get_value_list(obj.skill_value_id) class Costar(object): def __init__(self, name, count): self.name = name", "from data.models import Skill, SkillValue class ListSerializer(serializers.ModelSerializer): skill_value_list = serializers.SerializerMethodField(read_onl...
[ "by 'image_GreyScale.shape + tuple([3])' we add one more element '3' to the tuple", "three channels image_GreyScale_with_3_channels[:, :, 0] = x[:, :, 0] image_GreyScale_with_3_channels[:, :, 1] =", "# Checking that image was written with three channels and they are identical", "Adjusting third subplot ax2.im...
[ "def render(nodes, edges, output_name): color_map = roles_to_color_map(edges=edges) formatted_nodes, formatted_edges = format_graph(nodes, edges, color_map)", "node.name, 'type': node.node_type, 'icon': { 'face': 'Font Awesome 5 Free', 'code': node.get_font_code(), 'size':", "description = get_description(node)...
[ "INRIA # Copyright (c) 2018, University of Lille # All rights reserved. #", "and the following disclaimer in the documentation # and/or other materials provided with", "# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #", "'model', help='specify data type that will be storen in the...
[ "on None\" assert self.is_compatible_with(phase), \"`%r` is not compatible with phase `%r`\" % (self,", "found in the LICENSE file. from mvc.models.properties import StringProperty from pyxrd.generic.io.custom_io import storables,", "InSituBehaviour(DataModel, RefinementGroup, Storable): \"\"\" Interface class ...
[ "\", xPos, \" Y = \", yPos) # returns -1, 0, 1 with", "xPos = 40 yPos = 40 # the action for i in range(100):", "return random.randint(-1, 1) SimpleBug() \"\"\" you can eliminate the randomMove() function substituting xPos", "function substituting xPos += randomMove() yPos += randomMove() with xPos += random.r...
[ "coin: if d[m-coin]+1 < min_coin: min_coin = d[m-coin]+1 d[m] = min_coin #print d", "if m >= coin: if d[m-coin]+1 < min_coin: min_coin = d[m-coin]+1 d[m] =", "coin_list = [24,13,12,7,5,3,1] #coin_list = map(int, open('dataset_71_8.txt').read().split(',')) d = {0:0} for m in", ">= coin: if d[m-coin]+1 < min_co...
[ "from txbibtex import bibentry_str BIB_FILE = 'references.bib' bibfile = metamodel_for_language('bibtex').model_from_file(BIB_FILE) # Drop line", "Remove comments from bib file. \"\"\" from textx import metamodel_for_language from txbibtex import", "file. \"\"\" from textx import metamodel_for_language from txb...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "to build args based on different API version.\"\"\" messages = apis.GetMessagesModule('compute', api_version) flags.MakeResourcePolicyArg().AddArgum...
[ ".papers import Papers from .researchers import Researchers def ResearchersFile(filename): \"\"\"Parse a file containing", "containing researchers.\"\"\" try: with open(filename, \"r\") as file: data = json.load(file) except FileNotFoundError:", "file containing papers.\"\"\" try: with open(filename, \"r\") as ...
[ "addresses.cidr_db.first_address() assert address <= addresses.cidr_db.last_address() addresses.cidr_db.reload() assert addresses.cidr_db.get_address_for_host('test_test_foo') == address assert addresses.cidr_db.has('test_test_foo') addresses.cidr_db.forget('test_test_foo')", "Copyright (c) 2017 SiteWare Corp. Al...
[ "'bert-base-uncased' } # See https://texar.readthedocs.io/en/latest/code/modules.html#texar.tf.modules.BERTEncoder.default_hparams bert_encoder = {} # From https://github.com/asyml/texar/blob/413e07f859acbbee979f274b52942edd57b335c1/examples/transformer/config_model.py#L27-L45 # with", "rate, specified by 'static...
[ "09:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wishes', '0004_auto_20201029_0857'),", "2020-10-29 09:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wishes',", "import migrations, models class Migrat...
[ "bands and Temperature in Kelvin for Thermal bands Save: Boolean value that indicates", "Lbands \"\"\" OutList=[] #These lists will be used to parse the meta data", "=2*math.pi*float(jday)/DIY dSun2 = (1.00011 + 0.034221*math.cos(theta) + 0.001280*math.sin(theta) + 0.000719*math.cos(2*theta)+ 0.000077*math.sin(...
[ "Firefox/34.0'} try: r=requests.get(urly,headers=headers) except Exception,e: print e self.results = r.content self.totalresults += self.results", "= myparser.parser(self.totalresults, self.word) return rawres.people_twitter() def process(self): while (self.counter < self.limit): self.do_search() self.counter", ...
[ "import json access_token = \"<KEY>\" api_url = \"https://api.instagram.com/v1\" nn_lat = 56.296504 nn_lng =", "def request(endpoint, req_params = \"\"): req = api_url + endpoint + \"?access_token=\" +", "+ access_token + \"&\" + req_params print(req) raw_response = urllib.request.urlopen(req).read() return jso...
[ "valid, invalid) def test_password_rules_lower(subtests): validator = password_rules(length=6, upper=None, lower=3, numeric=None, special=None) valid =", "def __init__(self, data=None, errors=(), raw_data=None): self.data = data self.errors = list(errors) self.raw_data =", "field.\"\"\" def __init__(self, data=...
[ "without raising a warning in case of NaNs in the dataset \"\"\" with", "return True def nanmeanw(arr, axis=None): \"\"\" Computes nanmean without raising a warning in", "in the same positions. \"\"\" if len(arrays) == 0: return True for arr", "Computes nanmean without raising a warning in case of NaNs in the...
[ "<gh_stars>1-10 \"\"\"Unit tests of authorization searches.\"\"\" import pytest from ..utilities.general import is_never_authz, is_no_authz,", "# From test_templates/resource.py::ResourceSearch::init_template request.cls.search = request.cls.catalog.get_vault_search() @pytest.mark.usefixtures(\"vault_search_class...
[ "import autofile def read_flux(ts_save_path, vrc_locs=(0,)): \"\"\" Read the geometry from the filesys \"\"\"", "Read the geometry from the filesys \"\"\" vrc_fs = autofile.fs.vrctst(ts_save_path) if vrc_fs[-1].file.flux.exists(vrc_locs): flux_str", "vrc_fs = autofile.fs.vrctst(ts_save_path) if vrc_fs[-1].file....
[ "self.trees[i].fit(X_sub, y_sub) def predict(self, X): all_preds = np.empty((X.shape[0], self.n_estimators)) for i, tree in", "== 'entropy': self.is_classification_forest = True elif self.criterion == 'mse' or self.criterion == 'mae':", "[] for i in range(self.n_estimators): self.trees.append(DecisionTree(max_d...
[ "except AttributeError: print(\"SKIP\") raise SystemExit print(next(g)) print(next(g)) g.pend_throw(ValueError()) v = None try: v", "gen(): i = 0 while 1: yield i i += 1 g =", "# as it's legal to .throw() into it. g = gen() g.pend_throw(ValueError()) try:", "g.pend_throw except AttributeError: print(\"SKIP\")...
[ "the space occupied by unit Position: location of unit Orientation: as the name", "= self.Orientation Duplicate.Attack = self.Attack Duplicate.RemainingLifetime = self.RemainingLifetime return Duplicate def __deepcopy__(self, memo):", "memo): Default = None Exists = memo.get(self, Default) if Exists is not Defa...
[ "from car import * def compare(car1,car2): print(car1) print(car2) car1 = Car(\"Nissan\",\"Tiida\",450000) car2 =", "* def compare(car1,car2): print(car1) print(car2) car1 = Car(\"Nissan\",\"Tiida\",450000) car2 = Car(\"Toyota\",\"Vios\",400000) car3 =", "compare(car1,car2): print(car1) print(car2) car1 = Car(\...
[ "def __iter__(self): yield self.__val def __repr__(self): return \"Just({})\".format(self.__val) @singleton class Nothing(Maybe): def __rshift__(self,", "self.__val def __repr__(self): return \"Just({})\".format(self.__val) @singleton class Nothing(Maybe): def __rshift__(self, f): return self", "val): self.__va...
[ "CvBridge() self.image_sub = rospy.Subscriber(\"/bebop/image_raw\",Image,self.callback) def callback(self,data): try: cv_image = self.bridge.imgmsg_to_cv2(data, \"bgr8\") except CvBridgeError", "cv2.imshow(\"hola\", cv_image) cv2.waitKey(3) def main(args): while True: ic = image_converter() rospy.init_node('image...
[ "Food-X Technologies # # This file is part of foodx_devops_tools. # # You", "Copyright (c) 2021 Food-X Technologies # # This file is part of foodx_devops_tools.", "a copy of the MIT License along with # foodx_devops_tools. If not, see", "file is part of foodx_devops_tools. # # You should have received a copy"...
[ "IMPORTS }.................... #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # WARNING: To avoid polluting the public module namespace, external", "this is probably actually useless. # #Nonetheless, the idea itself is trivial. We", "#* Each __class_getitem__() dunder method of ...