ngram
listlengths
0
82k
[ "-*- __author__ = \"\"\"<NAME>\"\"\" __email__ = '<EMAIL>' __version__ = '0.1.0'", "utf-8 -*- __author__ = \"\"\"<NAME>\"\"\" __email__ = '<EMAIL>' __version__ =", "-*- coding: utf-8 -*- __author__ = \"\"\"<NAME>\"\"\" __email__ = '<EMAIL>'", "coding: utf-8 -*- __author__ = \"\"\"<NAME>\"\"\" __email__ = '<EM...
[ "path) def save_to_s3(self, bucket, access_key, secret_key, **kwargs): \"\"\"Save the backup", "\"\"\"A new directory which is subsequently added to the backup\"\"\"", "file %s\" % self._path) def include_directory(self, path, preserve_paths=False, name=None): \"\"\"Add", "filename = filename.replace(director...
[ "'邀请面试'), ('WJ', '婉拒')], default='DD', max_length=2, verbose_name='投递状态')), ], options={ 'verbose_name': '面试',", "13:03 from django.db import migrations, models class Migration(migrations.Migration): initial =", "'待定'), ('YQ', '邀请面试'), ('WJ', '婉拒')], default='DD', max_length=2, verbose_name='投递状态')), ], options...
[ "hour, minute = int(time[11:13]), int(time[14:16]) return f\"{int(time[0:2])} {months[int(time[3:5])-1]} {time[6:10]} year", "minute!=1 else ''}\" if __name__ == '__main__': print(date_time(\"01.01.2018 00:00\")) assert", "15 minutes\" assert date_time(\"17.12.1990 07:42\") == \"17 December 1990 year", "8 hou...
[ "port as an integer.\"\"\" return self._port('ssl_port') @cachedproperty def tcp_port(self): \"\"\"Returns", "in-place.\"\"\" try: tmp = Peer(self.host, features) except Exception: pass else:", "pruning > 0: return pruning return None def _protocol_version_string(self, key):", "A PARTICULAR PURPOSE AND # NONI...
[ "[], }, \"events\": {}, \"alarm_systems\": {}, \"groups\": {}, \"lights\": {},", "\"home_assistant\": {\"get_system_info\": \"fake data\"}, \"config_entry\": dict(config_entry.data), \"deconz_config\": DECONZ_CONFIG, \"websocket_state\": STATE_RUNNING,", "unittest.mock import patch from pydeconz.websocket impor...
[ "function `cell_list_fn(R, **kwargs)` that partitions positions, `R`, and side data", "maximum number of neighbors (along with additional space specified by", "axis=-2) cell_idx = cell_idx[..., jnp.newaxis, :, :] cell_idx = jnp.broadcast_to(cell_idx,", "2.0 (the \"License\"); # you may not use this file", "...
[ "rhucrl_experiments.evaluate.utilities import ENVIRONMENTS RARL_DIR = \"../../runs/RARLAgent\" ZERO_SUM_DIR = \"../../runs/ZeroSumAgent\" SCRIPT", "\"RHUCRL\", \"base-dir\": ZERO_SUM_DIR}, \"lazy\": {\"algorithm\": \"HUCRL\", \"base-dir\": RARL_DIR}, }.get(socket.gethostname(), {\"algorithm\":", "RARL_DIR}, }.g...
[ "TagKeyStatus class ProjectTagsEndpoint(ProjectEndpoint): def get(self, request, project): tag_keys = TagKey.objects.filter(", ") data = [] for tag_key in tag_keys: data.append({ 'id':", "status=TagKeyStatus.VISIBLE, ) data = [] for tag_key in tag_keys: data.append({", "six from rest_framework.response import...
[ "try: async_eel.init('web') await async_eel.start('callbacks.html', size=(400, 300)) # Call Javascript function,", "function, and pass explicit callback function await async_eel.js_random()(print_num) # Do", "asyncio loop = asyncio.get_event_loop() @async_eel.expose async def py_random(): return random.random()...
[ "is available. :param application_name: A short, alphanumeric name to identify", "logging from datacube.config import LocalConfig from datacube.drivers import index_driver_by_name, index_drivers", "%r. %s available: %s\" % ( driver_name, len(index_drivers()), ', '.join(index_drivers())", "for indexing dataset...
[ "specified\") optparser.print_usage() sys.exit(1) if opt.directory and opt.mbox: print(\"Can't specify both", "{ 'list': opt.list }) r = curs.fetchall() if len(r) !=", "reads it into the database. # import os import sys", "lib.exception import IgnorableException from lib.log import log, opstatus from lib.varn...
[ "models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('shop', '0008_auto_20200310_1134'),", "from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies", "-*- coding: utf-8 -*- # Generated by Django 1....
[ "sample_class = np.random.choice(np.arange(self.num_classes), p=self.progress_p) sample_indexes = self.class_dict[sample_class] index = random.choice(sample_indexes)", "super(iNaturalist, self).__init__(mode, cfg, transform) random.seed(0) self.class_dict = self._get_class_dict() def __getitem__(self,", "class ...
[ "parsed_second) def create_fake_conference_nodes(n, conference): nodes = [] for i in", "else '', conference.endpoint, ) res = self.app.post( api_url_for('meeting_hook'), { 'X-Mailgun-Sscore':", "# Create conference nodes n_conference_nodes = 3 create_fake_conference_nodes( n_conference_nodes, conference,", "n...
[ "class SendHandler(Handler): filemode = \"w\" class Server(object): def __init__(self, handlers):", "SendHandler(Handler): filemode = \"w\" class Server(object): def __init__(self, handlers): self.handlers", "key in to_destroy: server = self.servers.pop(key) server.stop() def connection_key(self, connection):",...
[ "binary char\") if currName == \"\": break name.append(currName) mmax.append( data[OnOffstart", "#print(\"increment params\") numParameters = numParameters + 1 except: pass #print(\"Found", "+ 1 except: pass #print(\"Found {} parameters.\".format(numParameters)) tD['Parameters'] = []", "!= -1: fxName=\"\" OnO...
[ "in range(ord('a'), ord('z') + 1)] upper_char = [chr(x) for x", "x in range(ord('A'), ord('Z') + 1)] number_char = [chr(x) for", "source += \"\".join(lower_char) source += \"\".join(upper_char) source += \"\".join(number_char) source", "= [chr(x) for x in range(ord('0'), ord('9') + 1)] source", "random sour...
[ "from django.test import TestCase from rest_framework.test import APIRequestFactory from .models", "TestCase from rest_framework.test import APIRequestFactory from .models import GBIC, GBICType", "gbic_test = GBIC.objects.create( serial='showdomilhao', patrimony_number='777', gbic_type=gbic_type_test ) gbic_tes...
[ "branch: \"FruitBranch\" = None): \"\"\"Adds a new branch to the", "\"\\n\\t \".join(lines[1:]) return summary def copy(self) -> \"FruitBranch\": \"\"\"Returns a", "# transform the dataset X_train_transformed = fruit.transform(X_train) X_test_tranformed = fruit.transform(X_test)", "self.fork() self._branches[...
[ "not os.path.isdir(path): os.mkdir(path) class ParseDict(argparse.Action): def __call__(self, parser, namespace, values,", "= output[output.find('LATEST'):].split('\\\\n')[0].split(' ')[-1] return latest_version else: return False def _setup_rpi(vendor_id:", "and systemd service file\\n\" f\"to your system to e...
[ "['\"T\"', '\"5\"']} def trim_adapters(fastq_files, dirs, config): QUALITY_CUTOFF = 5 to_trim", "trim_sequences += [str(Seq(sequence).reverse_complement()) for sequence in v] return trim_sequences def", "reverse complement of the adapters for _, v in builtin_adapters.items():", "\"standard\").lower() if quali...
[ "= request.query_params.get('category') list_id = int(request.query_params.get('id')) parentConfig = AnalysisConfig.objects.get(project=project) jsonHelper =", "get_object_or_404(projects, id=kwargs['project_id']) if (SolverProgress.objects.filter(project=project).exists()): progress = json.loads(get_object_or_40...
[ "unicode_literals from .base import Opener from .errors import OpenerError from", "'sitedata': appfs.SiteDataFS, 'siteconf': appfs.SiteConfigFS, 'usercache': appfs.UserCacheFS, 'userlog': appfs.UserLogFS } def", "len(tokens) == 2: appname, author = tokens version = None", "<appname>:<author> ' 'or <appname>:<...
[ "'svm', 'auc': area, 'f_beta': fb, 'projection': 'PCA'}, ignore_index=True) # Fit", "{}'.format(autoencoder.evaluate(x_test, x_test, batch_size=8, verbose=False))) print('Mean loss on attacks: {}'.format(autoencoder.evaluate(x_attacks, x_attacks,", "tpr = supervised_evaluation(classifier, x_test, y_test) xg_boo...
[ "msg=\"foo test\") self.assertEqual(2201, res[\"response_code\"]) def test_message_banned(self): res = send_message(self.banned, self.banned_token,", "test\") self.assertEqual(403, res[\"response_code\"]) def test_message_provider(self): res = send_message(self.provider, self.provider_token, to=self.user,", "cl...
[ "for xyP in XY: Win.append(0) for xyE in zip(x,y): Dis", "= CU.Polygon() P.Load(Wkt) # Unwrapping coordinates if Unwrap: x =", "Unwrap=Unwrap) else: XY = P.CartGrid(Dx=Delta, Dy=Delta, Bounds=Box) Win = []", "Dis = CU.WgsDistance(xyP[1], xyP[0], xyE[1], xyE[0]) Win[-1] += Window(Dis, Par)", ".Exploration as...
[ "each of them for start_offset, length in terms_offsets: result =", "the Automaton offsets and create Recognizer result for each of", "lexicon :param text: text for recognition :param entities: supported entities", "means prepositions are not allowed) is the default \"\"\" super().__init__(name=name,", "sta...
[ "Local::in_line { 'req': ( 'goto.cc', 24, 26 ), 'res': (", "default;' ), 'range': has_entries( { 'start': has_entries( { 'line_num': 54,", "def FixIt_Check_RawStringReplace_Resolved( results ): assert_that( results, has_entries( { 'fixits': contains(", "( 'goto.cc', 36, 25 ), 'res': ( 'goto.cc', 32, 54", "2...
[ "#Elasticsearch settings self.elasticsearch_host = \"\" self.elasticsearch_verify_certs = False self.elasticsearch_index_name =", "of the JSON file. \"\"\" with open(filepath, \"r\") as file:", "\"\"\"Loads the config from a JSON file. Args: filepath: path", "JSON file. Args: filepath: path of the JSON file. ...
[ "Invert Images data_set = ds.ImageFolderDataset(dataset_dir=DATA_DIR, shuffle=False) transform_invert = [C.Decode(), C.Resize(size=[224,", "range(num_samples): mse[i] = diff_mse(images_p_invert[i], images_c_invert[i]) logger.info(\"MSE= {}\".format(str(np.mean(mse)))) if plot: visualize_list(images_c_invert,", ...
[ "[(1, 0), (0, 1)]], [(4, 4), [(3, 4), (4, 3)]]]:", "0), [(1, 0), (0, 1)]], [(4, 4), [(3, 4), (4,", "1)]], [(4, 4), [(3, 4), (4, 3)]]]: self.assertListEqual( collector.get_next_positions(pos), expected", "m, t, candies) for pos, expected in [[(1, 1), [(0,", "1, 1, 1, 1], [2, 2, 1, 1, 1], [1,", "(1, 0), (1,...
[ "os.uname()[0].startswith(\"Darw\"): import pygame pygame.mixer.init() # Plays a song def playSong(filename):", "\"play song\" if not os.uname()[0].startswith(\"Darw\"): pygame.mixer.music.fadeout(1000) #fadeout current music over", "music over 1 sec. pygame.mixer.music.load(\"music/\" + filename) pygame.mixer....
[ "this is a failure self.assertTrue(False, err_msg) except Exception as e:", "of `get_item`.\"\"\" self.handler.table.get_item.return_value = { \"TheWrongKey\": dict(field1=\"1\", field2=\"2\") } self.assertIsNone(self.handler.get_item(\"key\"))", "mock.MagicMock() def setUp(self): self.handler.table.reset_mock(...
[ "\"Amount\": [4, 1, 2, 2, 4, 5], \"City\": [\"SF\", \"SF\",", "as pd app = Dash(__name__) server = app.server # assume", "2, 4, 5], \"City\": [\"SF\", \"SF\", \"SF\", \"Montreal\", \"Montreal\", \"Montreal\"]", "# see https://plotly.com/python/px-arguments/ for more options df = pd.DataFrame({ \"Fruit\":", ...
[ "= self.formStash # ------------------- # do a quick parse... requirements_either_or", "None le_pkey_jsons = None le_reg_jsons = None private_key_cycle_id = None", "we use `jsonS` to indicate a string self.le_meta_jsons = getcreate_args[", "tracked acme_account_provider_id = None account_key_pem = None le_met...
[ "(NStreams == 1): #Creates list of filenames for Phi in", "'Dirac'): vr = 0 vi = 0 if(k%151 == 1):", "table to associate data to streams NSamplesIn128bits = int(128/NBitsData )", "2.0 (the \"License\"); # you may not use this file", "and SequenceType != 'Random' and SequenceType != 'Dirac'): print ('Unknown...
[ "5 item1_price_total = item1_price * item1_quantity print(type(item1)) # str print(type(item1_price))", "item1='phone' item1_price = 100 item1_quantity = 5 item1_price_total = item1_price", "print(type(item1_price)) # int print(type(item1_quantity)) # int print(type(item1_price_total)) # int #", "output: # <c...
[ "<gh_stars>10-100 _base_ = \"./FlowNet512_1.5AugCosyAAEGray_NoiseRandom_AggressiveR_ClipGrad_fxfy1_Dtw01_LogDz_PM10_Flat_Pbr_01_02MasterChefCan.py\" OUTPUT_DIR = \"output/deepim/ycbvPbrSO/FlowNet512_1.5AugCosyAAEGray_NoiseRandom_AggressiveR_ClipGrad_fxfy1_Dtw01_LogDz_PM10_Flat_ycbvPbr_SO/16_36WoodBlock\" DATASETS =...
[ "import get_page, select_page, process_args from .results import serialize_bookmark, unserialize_bookmark, Page,", "import serialize_bookmark, unserialize_bookmark, Page, Paging __all__ = [ 'OC', 'get_page',", ".paging import get_page, select_page, process_args from .results import serialize_bookmark, unseriali...
[ "if pass_is_training else layer(net) endpoints['layer%d' % i] = net tf.add_to_collection(tf.GraphKeys.UPDATE_OPS,", "padding=padding, activation=None, use_bias=True, # not self.config.batch_norm, name=os.path.join(self.variable_scope, 'layer%d' %i, layer_type),", "= layers.LowRankLocallyConnected2D( filters=cho...
[ "Adafruit Industries # SPDX-License-Identifier: MIT import time import board import", "time.sleep(2) for i in range(cycles): print(icm.gyro) icm.gyro_data_rate_divisor = 255 #", "# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT", "busio.I2C(board.SCL, board.SDA) ic...
[ "* (a-x-2) + '*' print(out.center(2*a-1)) print('*' * (2 * a", "* a - 1)) for x in range(a-1): out =", "* (2 * a - 1)) for x in range(a-1):", "in range(a-1): out = '*' + ' ' * x", "' ' * x + '*' + ' ' *", "'*' + ' ' * x + '*' print(out.center(2*a-1)) a", "1)) for x in range(a-1): out = '*' + '", "prin...
[ "raise ValueError( f\"expected to find 1 high_res_video_path from PathDetails; instead", "Optional[int] timestamp: datetime.datetime camera_name: str is_image: bool is_lowres: bool class", "low_res_video_paths[0] # in Go: # eventId := uuid.NewSHA1( # uuid.NameSpaceDNS,", "= relate_path_details(some_path_detai...
[ "2019-09-27 14:23 from django.db import migrations, models class Migration(migrations.Migration): dependencies", "model_name='student_assessment', name='assessment_score', field=models.IntegerField(blank=True, null=True), ), migrations.AlterField( model_name='student_assessment', name='understanding_level', field...
[ "self def __next__(self): if self._idx >= len(self._data): raise StopIteration else:", "self._data is None: raise Exception('Dataset is not loaded') def __iter__(self):", "None _label_col = 'label' def __init__(self): self._idx = 0 if", "else: return item[self._first_text_col], int(item[self._label_col]) def ...
[ "True/False \"\"\" try: # pass the hashed password req =", "req.reset_identity() # make a request now morphed_identity = req.get('http://ipecho.net/plain') #", "the tor service Parameters ---------- arg1 [OPTIONAL]| text: bool A", "import literal_eval from fp.fp import FreeProxy from torrequest import TorRequ...
[ "c.endswith(' m') or c.endswith(' re'), 'path must start with a", "height): \"\"\"adds an ellipse to the path\"\"\" self._curves(pdfgeom.bezierArc(x, y, x", "not long, so we pack onto one line the code", "\"\"\" def __init__(self,code=None): self._code = (code,[])[code is None] self._code_append =", "an eff...
[ "wikipedia import re import TCPclient as client WORDS = [\"WIKIPEDIA\",\"SEARCH\",\"INFORMATION\"]", "as client WORDS = [\"WIKIPEDIA\",\"SEARCH\",\"INFORMATION\"] def handle(text,mic,profile): # SEARCH ON", "to search about\") #text = mic.activeListen() print \"entering wiki term\"", "= client.grab_input() wh...
[ "all of the saturated \" , random.choice(plural) , \" be", "in range(4): n = input(\"Enter noun : \") noun.append(n) plural", "school cafeteria.\") print(\"The lunch special, prepared by our \" ,", "be eliminated.\") print(\"He rated the cafeteria a \" + letter", "of either a \" , random.choice(noun) , \" s...
[ "numpy g = open('/home/srallaba/mgc/transposed/arctic_a0404.mgc','w') x = numpy.loadtxt('/home/srallaba/mgc_spaces/arctic_a0404.mgc') numpy.savetxt(g, numpy.transpose(x)) g.close()", "import numpy g = open('/home/srallaba/mgc/transposed/arctic_a0404.mgc','w') x = numpy.loadtxt('/home/srallaba/mgc_spaces/arctic_a0...
[ "from zone_api.core.devices.motion_sensor import MotionSensor from zone_api.core.actions.turn_on_switch import TurnOnSwitch from zone_api_test.core.device_test", "8 INVALID_ITEM_NAME = 'invalid item name' class ZoneManagerTest(DeviceTest): \"\"\" Unit", "Zone from zone_api.core.zone_event import ZoneEvent from ...
[ "conn = get_redis_connection('cart') # 获取hash数据sku_id ,count sku_id_count = conn.hgetall('cart_%s' %user.id)", "= self.kwargs['sku_id'] # 获取商品信息 orders = OrderGoods.objects.filter(sku_id=sku_id, is_commented = True)", "decimal import Decimal from rest_framework.generics import CreateAPIView,ListAPIView from res...
[ "other file output options.\") if args.output: if args.output == \"-\":", "+ \"[{name}][{levelname}] {message}\", datefmt=\"%H:%M:%S\" + (\".%f\" if level == \"trace\"", "= platform.platform() log.debug(f\"OS: {os_version}\") log.debug(f\"Python: {platform.python_version()}\") log.debug(f\"Streamlink: {streamli...
[ "\"Fortune Summit\": { \"id\": \"B2\", \"division\": { \"TMSC\": { \"id\":", "} } } } } } } } #Create and", "+\"-\" +str(end_date.month)+\"-\" + str(end_date.year) if(autoThrashed): end_date = scan_date if( not", "\"tmc-1\":{ \"id\":\"DEP1\", \"floor\":{\"0\":\"0\", \"1\":\"1\", \"2\":\"2\", \"3\":\"3\", \"4\...
[ "[t.task_id for t in test_dag.tasks] self.assertListEqual(actual_task_ids, expected_task_ids) if __name__ ==", "mock.Mock() self.build_impersonated_client_mock.start() self.mock_variable = mock.patch.object( variable, 'Variable', autospec=True).start() # `side_effect`", "# # http://www.apache.org/licenses/LICEN...
[ "Regional code setting is done automatically by DOS Webservices, so", "\"differential_rate\", \"BIDPOSTS:BT_REST_RELAXATION_POINT_TEXT\": strip_extra_spaces(\"rest_relaxation_point\"), \"BIDPOSTS:BT_DANGER_PAY_NUM\": \"danger_pay\", \"BIDPOSTS:BT_CONSUMABLE_ALLOWANCE_FLG\": parse_boolean(\"has_consumable_allowanc...
[ "str(uuid.uuid4()) + '.test') with recfile.open(filename, \"w\") as g: g.write(teststring) self.assertEqual(recfile.open(filename,", "teststring = 'test%s' % k filename = os.path.join('tests', str(uuid.uuid4()), str(uuid.uuid4())", "% k filename = os.path.join('tests', str(uuid.uuid4()), str(uuid.uuid4()) + '.t...
[ "dotenv import load_dotenv from subprocess import check_output, Popen, PIPE load_dotenv()", "BUCKET_NAME = os.environ.get('BUCKET_NAME') def get_lambda_functions(): function_dict = {} res =", "lambda_functions: function_name = lambda_function['FunctionName'] subprocess.run([ \"aws\", \"lambda\", \"update-functi...
[ "0 ) ) gbSizer1.Add( self.m_button20, wx.GBPosition( 2, 0 ), wx.GBSpan(", "self, event ): event.Skip() def onButton41Click( self, event ): event.Skip()", "1 ), wx.ALL, 5 ) self.m_button01 = wx.Button( self, wx.ID_ANY,", "wx.Size( 50,50 ), 0 ) self.m_button11.SetBackgroundColour( wx.Colour( 255, 0, 0", "gbSi...
[ "task. :copyright: (c) 2016-2020 by dry-python team. :license: BSD, see", "LICENSE for more details. \"\"\" from _dependencies.contrib.celery import shared_task from", "\"\"\" from _dependencies.contrib.celery import shared_task from _dependencies.contrib.celery import task __all__", "\"\"\" dependencies.cont...
[ "f, g: lambda *a, **kw: g(f(*a, **kw)), funcs) else: raise", "(w,h), (128,128,128)) new_image.paste(image, (dx, dy)) image = new_image # flip", "*= val x[x>1] = 1 x[x<0] = 0 image_data =", "val) if rand()<.5 else 1/rand(1, val) x = rgb_to_hsv(np.array(image)/255.) x[...,", "max(0, int(max_bbox[1] - random.u...
[ "pathlib logging.basicConfig(level=logging.INFO) # Dirs ROOT_DIR = pathlib.Path(__file__).parent.absolute() DUMP_DIR = ROOT_DIR", "logging.basicConfig(level=logging.INFO) # Dirs ROOT_DIR = pathlib.Path(__file__).parent.absolute() DUMP_DIR = ROOT_DIR /", "import pathlib logging.basicConfig(level=logging.INFO) # ...
[ "week. The results expose the current and previous rankings as", "abbreviation, 'name': name, 'rank': int(rank), 'week': int(week), 'date': date, 'previous':", "weekly_rankings @property def current_extended(self): \"\"\" Returns a ``list`` of ``dictionaries``", "Each dictionary has the following structure:: ...
[ "wrapper(*args, **kwargs): if ding.enable_hpc_rl: shape = shape_fn(args, kwargs) if is_cls_method:", "... }, ... } ``` Besides, `per_fn_limit` means the max", "'vtrace_error': ['hpc_rll.rl_utils.vtrace', 'VTrace'], } fn_str = fn_name_mapping[fn_name] cls = getattr(importlib.import_module(fn_str[0]),", "is_cls...
[ "the count of int(s) in passed array. def number_of_occurrences(s, xs):", "#Return the count of int(s) in passed array. def number_of_occurrences(s,", "count of int(s) in passed array. def number_of_occurrences(s, xs): return", "of int(s) in passed array. def number_of_occurrences(s, xs): return xs.count(s)" ...
[ "# https://github.com/telegramdesktop/tdesktop/blob/4bf66cb6e93f3965b40084771b595e93d0b11bcd/Telegram/SourceFiles/codegen/scheme/codegen_scheme.py#L57-L62 WHITELISTED_MISMATCHING_IDS = { # 0 represents any layer", "fullname if '.' in fullname: self.namespace, self.name = fullname.split('.', maxsplit=1)", "' ' +...
[ "out == None: fail(\"either name or out must be set\")", "name that is used to load the resource. The default", "adds an action that compiles a single .resx file into", "generate. src: The .resx source file that is transformed into", "name of the output file (if name should not be", "<reponame>purkhusid/r...
[ "and intialized to a list. class Net(torch.nn.Linear): x: torch.jit.Final[int] def", "that has __constants__ set to something that is not a", "# Make the helper files in test/ importable pytorch_test_dir =", "= os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(pytorch_test_dir) if _...
[ "import time import pybullet as p import pybullet_data import cv2", "pybullet_data import cv2 if __name__ == \"__main__\": env = gym.make(\"pix_sample_arena-v0\")", "as p import pybullet_data import cv2 if __name__ == \"__main__\":", "__name__ == \"__main__\": env = gym.make(\"pix_sample_arena-v0\") x = 0 whi...
[ "parse_time @pytest.mark.parametrize( \"time_input, expected\", [ (\"12:13\", time(hour=12, minute=13)), (\"12:13:14\", time(hour=12,", ") def test_manually_time_parsing(time_input: str, expected: time): assert __parse_time_manually(time_input) == expected,", "\"manual time parsing has gone wrong\" @pytest.mark...
[ "coefficients.coeff]) @generator def construct(mod): \"\"\"Implement this module for input 'x'.\"\"\"", "for input 'x'.\"\"\" x = mod.x taps = list() for", "-> (%y: i32) # CHECK: hw.constant 1 # CHECK: hw.constant", "{coeff = [62, 42, 6]}, module_name = \"PolyComputeForCoeff_62_42_6\", unused_parameter =", ...
[ "/usr/bin/env python import arc import sys import os def retrieve(uc,", "for service in retriever]))) # Get all the ExecutionTargets on", "we want to query the LDAP GLUE2 tree arc.Endpoint(\"piff.hep.lu.se\", arc.Endpoint.COMPUTINGINFO,", "finish before we destroy the objects they may use import", "discover...
[ "tried to change private viewability of exploration %s ' 'but", "if activity_rights is None: return False elif activity_rights.is_published(): return bool(", "unpublish the activity. \"\"\" committer_id = committer.user_id activity_rights = _get_activity_rights(activity_type,", "logging from constants import ...
[ "# executed at runtime def cast(type_, value): # noqa return", "be imported at runtime and used in that fashion -", "used to remove the need for the types to be", "to remove the need for the types to be accessible", "TYPE_CHECKING = False # pragma: no cover # typing's cast", "the False-y guard in a nicely...
[ "== 0 or send_ui): can_sends.append(create_ui_command(self.packer, steer_alert, pcm_cancel_cmd, left_line, right_line, left_lane_depart,", "if frame % 100 == 0 and CS.CP.enableDsu: can_sends.append(create_fcw_command(self.packer, fcw_alert))", "actuators.steeringAngleDeg, apply_steer_req, frame // 2)) # we can ...
[]
[ "\"White\"), ('yellow', \"Yellow\"), ('lime', \"Green\"), (\"#ffa500\", \"Orange\")]) code_correction = SelectField('Error", "SelectField('Colour', choices=[('white', 'Colour'), (\"white\", \"White\"), ('yellow', \"Yellow\"), ('lime', \"Green\"), (\"#ffa500\",", "code_correction = SelectField('Error Correction'...
[ "for a stock. l : float The 'lambda' parameter of", "'lambda' parameter of the exponential moving average model. Making this", "pd.read_csv(filename, parse_dates=[ 'date'], index_col='date', squeeze=True) print(\"Most recent volatility estimate: {:.6f}\".format(estimate_volatility(prices,", "adjusted closing ...
[ "map(int, sys.stdin.readline().split()) s = '$' + sys.stdin.readline().rstrip() lr = zip(*[map(int,", "1); res[0] = 0 prev = '$' for i in", "and s[i] == 'C') & 1 prev = s[i] for", "lr = zip(*[map(int, sys.stdin.read().split())] * 2) def main(): res =", "'$' + sys.stdin.readline().rstrip() lr = zip(*[map(int...
[ "trg.shape[1] pos = torch.arange(0, trg_len).unsqueeze(0).repeat(batch_size, 1).to(self.device) #pos = [batch size,", "= [batch size, trg len, embed dim] for layer in", "embed_dim): pos_enc = torch.zeros(max_seq_len, embed_dim) position = torch.arange(0, max_seq_len).unsqueeze(1) div_term", "[batch size, src ...
[ "salt.utils.nxos import salt.utils.platform from salt.exceptions import NxosClientError log = logging.getLogger(__name__)", "Cisco NX-OS minions .. versionadded:: 2016.11.0 For documentation on setting", "minions .. versionadded:: 2016.11.0 For documentation on setting up the", "except NxosClientError as err:...
[ "str = \"\") -> Optional[Tuple[List[object], int]]: devices = super().get_list(start=start, limit=limit,", "None, mac: str = None, remote_custom_field: str = None, comment:", "-> object: device = TmsDevice( unique_id=device_dict[\"unique_id\"], device_id=device_dict[\"id\"], ipaddr=device_dict[\"ipaddr\"], mac=...
[ "== 1: walled_field_numerics.grad_i_1d(field, inds, grad_i, dx, walls) elif field.ndim ==", "def _grad_i(field, inds, dx): assert dx > 0.0 assert inds.ndim", "from __future__ import print_function, division import numpy as np from", "Scalar.__init__(self, L, dim, dx, a_0=a_0) self.D = D self.dt =", "self.di...
[ "os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"example_django.settings\") application = get_asgi_application() os.system(\"/usr/bin/python3 /opt/code/manage.py migrate\") os.system(\"/usr/bin/python3 /opt/code/manage.py", "= get_asgi_application() os.system(\"/usr/bin/python3 /opt/code/manage.py migrate\") ...
[ "src.library.compute_moments import calc_restricted_wage_distribution from src.library.compute_moments import calc_unrestricted_choice_probabilities from src.library.compute_moments import", "calc_restricted_wage_distribution from src.library.compute_moments import calc_unrestricted_choice_probabilities from src....
[ "space_game.domain_names import KeyId from space_game.events.Event import Event @dataclass class KeyPressedEvent(Event):", "import dataclass from space_game.domain_names import KeyId from space_game.events.Event import Event", "from dataclasses import dataclass from space_game.domain_names import KeyId from spa...
[ "\"User: \" + message.get(\"user\") + \" Message: \" + message.get(\"body\")", "\" + message.get(\"user\") + \" Message: \" + message.get(\"body\") try:", "message.get(\"subject\") final_message = \"User: \" + message.get(\"user\") + \" Message:", "message): heading = message.get(\"subject\") final_message = ...
[ "the Prophet model. e.g. hp.uniform(0.8, 0.95). :param metric: String. The", "model after HPO. :param data: evaluation data, a pandas dataframe", "seasonality_prior_scale, \"holidays_prior_scale\": hp.loguniform(0.01, 10) if holidays_prior_scale is None else holidays_prior_scale,", "changepoint_prior_scale=No...
[ "diagonal = -1) + \\ torch.diag(torch.ones(self.dim)) U = torch.triu(self.U, diagonal", "if i == 0: mu, alpha = self.initial_param[0], self.initial_param[1] else:", "= base_network(dim // 2, dim // 2, hidden_dim) self.s2 =", "s1_transformed = self.s1(lower) upper = t1_transformed + upper * torch.exp(s1_transf...
[ "} fn = { \"sin\": math.sin, \"cos\": math.cos, \"tan\": math.tan,", "return bnf def evaluate_stack(s, stats): op, num_args = s.pop(), 0", "# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN", "div expop = Literal(\"^\") expr = Forward() expr_list = delimitedList(Group(expr))", "be # included in all copies or ...
[ "((scan.src == recent.dst) and (scan.dst == recent.src))): scan.type = 'TCP", "Ignore non-tcp, non-udp packets if type(ip.data) not in (TCP, UDP,", "b; c ^= (b>>13) a -= b; a -= c;", "(flags:%d) from %s to %s (ports:%s), average timediff %.2fs' else:", "- this list allows to keep scan information # upto", ...
[ "b): return (a > b) - (a < b) def", "visited[i] = True miggroup.append([i]) cnt += 1 for j in", "= dist closetd = i return closetd def get_domains_on_2sides(target1, target2,", "tup[0]) if not visited[i]: visited[i] = True miggroup.append([i]) cnt +=", "sort_by_strand(val): return val[0][0] def check_edge_i...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "adapt this script on your own question answering task. Pointers", "# # Licensed under the Apache License, Version 2.0 (the", "compliance with the License. # You may obtain a copy", "an \"AS IS\" BASIS, # WITHOUT WARRANT...
[ "{ 'description': ( 'This specifies whether to create the non-root", "If True, a root volume is created during RAID configuration.", "in keys: driver_internal_info.pop(key, None) task.node.driver_internal_info = driver_internal_info task.node.save() def _prepare_for_read_raid(self,", "is created during RAID c...
[ "QUEUE_EVENT_IO, QUEUE_EVENT_TYPES ) from ...base.participant import ( create_singleton_identity, NOT_PARTICIPANT, )", "for bootstrap parts of an extension. This should be imported", "from ...core.shutdown.api import ( SystemShutdownEvent, as_system_shutdown_listener, SystemShutdownFinalizeEvent, as_system_shut...
[ "info_name != \"to_string\": info = getattr(info_cls, info_name) try: info_value =", "in [ cl.mem_flags.READ_ONLY, #cl.mem_flags.READ_WRITE, #cl.mem_flags.WRITE_ONLY ]: for itype in [", "[ cl.mem_object_type.IMAGE2D, cl.mem_object_type.IMAGE3D ]: try: formats = cl.get_supported_image_formats(ctx, mf, itype)", ...
[ "on outer function template_dir = 'c_generated_code/{}_constraints/'.format(name) in_file = 'phi_e_constraint.in.h' out_file", "self.nlp_dims, self.nlp_in, stage, field, value_data_p) return def constraints_set(self, stage_, field_,", "nbx, regarding idxbx, ubx, lbx.') else: dims.nbx = nbx nbu", "self.shared_...
[ "/ 255.0 h, w = img.shape psize = min(min(patchSize, h),", "h_, start_x : start_x + w_] = sigma if saveResults:", "isinstance(pch_size, int): pch_H = pch_W = pch_size else: sys.exit('The input", "Internal number of sub-image-patches. :param dirOut: Directory where to save", "num_pch = num_H * num_W pch = np...
[ "the specified states: >>> @requires_state(AppState.RUNNING | AppState.FINISHED) ... def function(self):", "AppState changes to *FINISHED*. This is checked via the :class:`Application`", "self._state = AppState.JOINED self.clean_up() @requires_state(AppState.RUNNING | AppState.FINISHED) def cancel(self): \"\"\"...