ngram
listlengths
0
67.8k
[ "junction in annotated_junctions_: if junction[:4] not in seen: sources = \",\".join(sorted(junc2datasource[junction[:4]])) print \"%s\\t%s\"", "of annotated_junctions.tsv.gz is (tab-separated fields), one per junction 1. Chromosome 2. Start position", "int(tokens[1]) + 2 tokens[2] = int(tokens[2]) if tokens[2]...
[ "for k in range(K-1): #accumulator sum_uk = u_hat_plus[k][n,:] + sum_uk - u_hat_plus[k+1][n-1,:] #mode", "future generalizations: individual alpha for each mode Alpha = alpha * np.ones(K) #", "converged and below iterations limit #update first mode accumulator k = 0 sum_uk", "= alpha * np.ones(K) # Construct ...
[ "... def first(self): ... def last(self): ... def is_empty(self): ... def __len__(self): ...", "class Deque: def add_first(self, value): ... def add_last(self, value): ... def delete_first(self): ...", "... def add_last(self, value): ... def delete_first(self): ... def delete_last(self): ... def first(self):", ...
[ "\"Content2\") post3= models.Post(\"Post3\", \"Content3\") #member store member_store=stores.MemberStore() member_store.add(member1) member_store.add(member2) print (member_store.get_all()) post_store=stores.PostStore() post_store.add(post1)", "member2 =models.Member(\"mohamed\",30) post1=models.Post(\"Post1\", \...
[ "from urllib2 import Request, urlopen, URLError negative = '\\033[91m' positive = '\\033[32m' wait", "Request, urlopen, URLError negative = '\\033[91m' positive = '\\033[32m' wait = '\\033[95m' final", ": \", total_scanned_global print positive+\"\\nPossible shells: \",found_scanned_global print final+\"\\nFoll...
[ "V and W are properly nested strings. # For example, the string \"{[()()]}\"", "is O(N); # expected worst-case space complexity is O(N) (not counting the storage", "is O(N) (not counting the storage required for input arguments). def solution(s): sets", "in s: if(bracket in sets): collector.append(sets[bracke...
[ "x,y,z in iter.product(range(spielfeld_von,spielfeld_bis), repeat = 3): o = bpy.data.objects.new(n, m) o.location = (x,", "= spielfeld - spielfeld2 new = spielfeld2 - spielfeld spielfeld = spielfeld2 if", "feld_bis), rnd.randint( feld_von, feld_bis), rnd.randint(feld_von, feld_bis)) for _ in range(anz)} animate...
[ "as an xr_batch_processor so it can run after SelectPVSystemsNearCenterOfImage. \"\"\" requested_num_pv_systems: int def", "class ReduceNumPVSystems: \"\"\"Reduce the number of PV systems per example to `requested_num_pv_systems`. Randomly", "example to `requested_num_pv_systems`. Randomly select PV systems for...
[ "\"timed_test.log\" logger = logging.getLogger(\"YouLoggerName\") logger.setLevel(logging.INFO) handler = TimedRotatingFileHandler(logFilePath, when=\"d\", interval=1, backupCount=7) formatter =", "logger.setLevel(logging.INFO) handler = TimedRotatingFileHandler(logFilePath, when=\"d\", interval=1, backupCount=7)...
[ "__str__(self): return self.action def __eq__(self, other): return eq(self.action, other.action) # Necessary when __cmp__", "return self.action def __eq__(self, other): return eq(self.action, other.action) # Necessary when __cmp__ or", "eq(self.action, other.action) # Necessary when __cmp__ or __eq__ is defined...
[ "more information\") elif len(sys.argv)==6: if sys.argv[2]==\"-php\": if system==\"ubuntu\": os.system(\"sudo python3 core/server.py -php \"+sys.argv[3]+\"", "# Author :- LordReaper # Date :- 13/11/2018 - 9/11/2019 # Powered By", "core/host.py \"+sys.argv[2]+\" \"+sys.argv[3]+\" \"+sys.argv[4]) else: os.system(...
[ "test gen_epub. \"\"\" from tmx2epub.gen_epub import gen_epub def test_gen_epub2(): \"\"\" test_gen_epub2. \"\"\" from", "gen_epub. \"\"\" from tmx2epub.gen_epub import gen_epub def test_gen_epub2(): \"\"\" test_gen_epub2. \"\"\" from pathlib", "from tmx2epub.gen_epub import gen_epub def test_gen_epub2(): \"\"\...
[ "'http://localhost') + ':' + os.getenv( 'DAPR_HTTP_PORT', '3500') PUBSUB_NAME = 'order_pub_sub' TOPIC = 'orders'", "% ( base_url, PUBSUB_NAME, TOPIC)) for i in range(1, 10): order = {'orderId':", "PUBSUB_NAME, TOPIC)) for i in range(1, 10): order = {'orderId': i} # Publish", "= os.getenv('BASE_URL', 'http://l...
[ "False cl.sendMessage(msg.to,\"Reply Message off\") #==============================================================================# elif text.lower() == 'groupcreator': group = cl.getGroup(to) GS", "elif text.lower() == 'groupinfo': group = cl.getGroup(to) try: gCreator = group.creator.displayName except: gCreat...
[ "'message': yield m def send(self, channel_id, payload): # Fanout emitter return self.connection.publish(channel_id, payload)", "if not hasattr(self, '_channel'): self._channel = self.connection.pubsub() return self._channel def subscribe(self, channels=[]): #", "self.connection.pubsub() return self._channel de...
[ "python from btmacd.binance_fetcher import BinanceFetcher def main(): fetcher = BinanceFetcher(\"BTCUSDT\", filename=\"binance_ohlc.csv\", start_date=\"01.01.2018\") fetcher.fetch()", "import BinanceFetcher def main(): fetcher = BinanceFetcher(\"BTCUSDT\", filename=\"binance_ohlc.csv\", start_date=\"01.01.2018\")...
[ "array) is not efficiently computable. Therefore, we try constant_value then # check for", "elements of `x` in `axis`, as type `x.dtype`.\"\"\" if axis is None: return", "Unless required by applicable law or agreed to in writing, software # distributed", "= ps.concat([[x_len // 2, 2], ps.shape(x)[1:]], axis=0...
[ "import nn as nn from .base_model import BaseModel from ..nn.conv2d import DenseConv2d from", "DenseConv2d(32, 32, kernel_size=3, padding=1), nn.BatchNorm2d(32), nn.MaxPool2d(2), DenseConv2d(32, 32, kernel_size=3, padding=2), nn.BatchNorm2d(32), nn.MaxPool2d(2), DenseConv2d(32,", "nn.BatchNorm2d(32), nn.MaxPool...
[ "for line in input_seed: fields = line.strip().split(\"\\t\") seeds.add(fields[0].lower()) input_seed.close() # Output node file", ") #print \"Translation\",protein,translation #print(\"{0}\\t'{1}'\\n\".format(protein,translation)) else: for current_id in uE.get_attribute(attribute_identifier=options.ttype): tran...
[ "manifests produced by TBD. To use it, you must import it in another", "if x.endswith(file_ext) ] if matches: file_ext = max(matches, key=len) else: file_ext = None", "lambda x: file_format(x) ) return df[df[CONCEPT.GENOMIC_FILE.FILE_FORMAT].notnull()] source_data_url = ( 'https://localhost:5002/download/study/...
[ "\"warning\": \"\", \"wiki_url\": \"\", \"tracker_url\": \"\", \"category\": \"Animation\"} @persistent def stopPlaybackAtEnd(scene): if scene.frame_current", "\"location\": \"\", \"description\": \"Playback once.\", \"warning\": \"\", \"wiki_url\": \"\", \"tracker_url\": \"\", \"category\": \"Animation\"}", "\...
[ "from ...challenge import Challenge from random import randint x = [] for _", "value of {', '.join(str(_) for _ in x[:-1])} and {x[-1]}. (values: x)\" def", "10)): x.append(randint(1, 100)) intro = f\"You have to print the lowest value of", "range(randint(2, 10)): x.append(randint(1, 100)) intro = f\"You have...
[ "assert created_cluster is not None assert isinstance(created_cluster, dict) assert \"id\" in created_cluster async", "= await director_v2_api.list_clusters(client.app, user_id=user_id) assert isinstance(list_of_clusters, list) assert len(list_of_clusters) > 0 async def", "cluster_id: ClusterID ): await directo...
[ "= csv.reader(f) # for row in reader: # df_row = [] # df_row.append(row[0])", "# df = [] # with open(self.data) as f: # reader = csv.reader(f)", "df_row.append(row[0]) # df_row.append(row[0]) # df_row.append(row[0]) # df.append(row) # self.tooltip = df[0][0] # def", "df = [] # with open(self.data) as f: # rea...
[ "images in a batch patch_size: int, size of the image returned, patch is", "batch_size=1, crop_size=0, patch_size=256, bbox= None, augmentation=False): ''' image: nparray, must have 3 dimension", "the image from channels-first (rasterio format) to channels-last (default tensorflow format) img_patch =", "augme...
[ "serializers.empty: field_info['placeholder'] = placeholder serializer = getattr(field, 'parent', None) if serializer and hasattr(serializer,", "the serializer. if field == 'type' and hasattr(serializer, 'get_type_choices'): meta['choices'] = serializer.get_type_choices() #", "} if field.field_name in field_hel...
[ "else: spec = data['key'] return {'installer': 'pipenv', 'spec': spec, 'source': 'pypi', 'name': data['package_name'],", "graph --json\") yield AppendStdout(res.stdout) yield AppendStderr(res.stderr) yield SetProperty(\"dependencies\", list(pipenv_graph2deps(deps.stdout))) return True @washertask def", "data: s...
[ "allSiteProfiles[sp[\"siteName\"]] = [] for device in sp[\"devicesAvailable\"]: for i in range(device[\"deviceCounter\"]): allSiteProfiles[sp[\"siteName\"]].append(device[\"deviceName\"]) return", "json_data = json.load(json_file) return json_data # get all site profile def getAllSiteProfiles(site_folder): allSit...
[ "[] coll_rate_list = [] succ_rate_list = [] succ_len_list = [] for ttc in", "3.0, 4.0, 5.0, 10.0, 20.0] ttcs = [0.1, 0.3, 0.5, 1, 2, 3]", "= env.step(ac) cur_ep_ret += rew cur_ep_ret_detail += np.array(list(info['reward_dict'].values())) cur_ep_len += 1 cur_ep_obs.append(ob) cur_ep_acs.append(ac)", "leader_sp...
[ "= parse.parse_file('data/pendigits-test') centroids = training.get_digit_kmeans_centroids( train_digits, 256 - 3) training.set_digit_observations( train_digits, centroids, 256)", "def main(): parse = parser.Parser(); train_digits = parse.parse_file('data/pendigits-train'); test_digits = parse.parse_file('data/pe...
[ "'{validator.__name__}'\") else: validator_classes.append(validator) error_summary = {} # Process validators for validator_class in validator_classes:", "return skipped return False class CommitValidator(abc.ABC): \"\"\"A commit validator\"\"\" @abc.abstractmethod def run(self, commit:", "validator = module.get...
[ "be an integer >= 4') if n < (2 * snippet_size): raise ValueError('Time", "the algorithm to use. Parameters ---------- ts : array_like The time series. snippet_size", "is the algorithm to use. Parameters ---------- ts : array_like The time series.", "np.minimum(distances[index, :], minis) actual_index = indic...
[ "import re from copy import copy from logging import Formatter from .profile import", "in browser with javascript. \"\"\" KEYS = {'created', 'filename', 'funcName', 'levelname', 'lineno', 'msg',", "**seq) return super().format(cr) class PlainFormatter(Formatter): \"\"\"Remove all control chars from the log and"...
[]
[ "'off' # Re-publish initial events so that the retry succeeds sse_server.publish(make_initial_event()) sse_server.publish(make_occupancy('control_pri', 2))", "else 'off', 'size': 100}, {'treatment': 'off' if on else 'on', 'size': 0} ]", "def make_split_with_segment(name, cn, active, killed, default_treatment, t...
[ "def __init__(self): self.url = \"\" self.name = \"\" self.city = \"\" self.country =", "self.country} def parse_price(self, info_tag: str) -> str: prices_with_mon = self.pricepat_monetary.findall(info_tag) prices = []", "[] for price in prices_with_mon: parsed_price = self.pricepat_plain.findall(price) if len(...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "not None: dense_tensor = self.pad(dense_tensor) result.append(dense_tensor) else: result.append(val) return tuple(result) @property def iterator(s...
[ "self.pc += 1 @instruction(name=\"PHY\", mode=\"imp\", cycles=3) def inst_0x5a(self): self.stPush(self.y) @instruction(name=\"STZ\", mode=\"imp\", cycles=3) def", "self.pc += 1 @instruction(name=\"AND\", mode=\"zpi\", cycles=5) def inst_0x32(self): self.opAND(self.ZeroPageIndirectAddr) self.pc += 1 @instruction(n...
[ "is not a dataframe\" assert expected_cols == result.columns.to_list(), result.columns assert all(result.polarity == \"-\"),", "all(result.polarity == \"+\"), f'Polarity should be \"+\"\\n{result}' def test__mzml_to_pandas_df_pyteomics_neg(): result = mzml_to_pandas_df_pyteomics(TEST_MZML_NEG) expected_cols", "...
[ "form.is_valid(): form.save() return redirect('home') else: form = DocumentForm() return render(request, 'core/model_form_upload.html', { 'form':", "import image_cv2 def home(request): documents = Document.objects.all() number = len(image_cv2.myList) return render(request, 'core/home.html',", "= len(image_cv2.m...
[ "> 1: t = t + -0.0003 if sex < 1: t =", "* N_capital_gain + -0.0002 * N_capital_loss + 1.0003 if sex > 1: t", "capital_loss = gaussian(87.0152, 161032.4157) else: age = gaussian(38.2668, 187.2747) capital_loss = gaussian(101.7672, 189798.1926)", "/ 62.0 N_capital_gain = (capital_gain - 0.0) / 22040.0 N_capita...
[ "0: out_dimension = self.hiddenlayers[0] _linear = torch.nn.Linear(input_dimension, out_dimension) linears.append(_linear) linears.append(activation[self.activation]()) # This is", "want numpy arrays or tensors. Returns ------- activations : DataFrame A DataFrame with", "s ) ) logger.info(\" \") # Define optimi...
[ "TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.", "name) return self.badges.print_error(\"No such payload database connected!\") def disconnect_module_database(self, name): if self.local_storage.get(\"connected_module_databases\"): if", "path } } if not self.local_...
[ "1, 10)) with pytest.warns(UserWarning): list(print_summary_wrapper(scan([det], motor, -1, 1, 10))) with pytest.warns(UserWarning): plan =", "from bluesky.simulators import (print_summary, print_summary_wrapper, summarize_plan, check_limits, plot_raster_path) import pytest from bluesky.plans import", "3)) # che...
[ "goal -= entered entered_numbers.append(entered) if goal < 0: goal = target_amount entered_numbers =", "< amount: total += random.randint(1, 6) i+=1 return total def choose_dice_amount(): amount =", "return False k = j+1 while k < len(numbers_list): if numbers_list[i] + numbers_list[j]", "+= score_game() aver...
[ "{'policy': 'targeted', 'mls_enabled': True, 'enabled': True, 'runtime_mode': 'enforcing', 'static_mode': 'enforcing'} assert SELinuxFacts(**expected_data) ==", "'targeted', 'mls_enabled': False, 'enabled': False, 'runtime_mode': 'permissive', 'static_mode': 'permissive'} assert SELinuxFacts(**expected_data) == g...
[ "not found in the array, return [0, 0]. Input: [5, 7, 7, 8,", "Output: [0, 5] Input: [1, 3, 6, 9, 13, 14] target value =", "of a given value from a given array of integers and find the", "new length of the given array. Sample Output: 5 4 4. Write a", "dollars. Sample Output: 10 7 0 5. Write a Python program...
[ "Int32ul, \"IPv4Prefix\" / Int32ul ) @declare(guid=guid(\"3e5ac668-af52-4c15-b99b-a3e7a6616ebd\"), event_id=1006, version=0) class Microsoft_Windows_IPxlatCfg_1006_0(Etw): pattern = Struct(", "version=0) class Microsoft_Windows_IPxlatCfg_1102_0(Etw): pattern = Struct( \"InterfaceLuid\" / Int64ul, \"Metric\" / Int...
[ "-*- coding: utf-8 -*- import os from distutils.util import strtobool class Config: DEBUG", "HOST = os.getenv('HOST', '127.0.0.1') PORT = int(os.getenv('PORT', 8000)) SECRET = os.getenv('SECRET', 'secret') LOGIN_MIN_LENGTH", "\"False\"))) DATABASE_URI = os.getenv('DATABASE_URI', '127.0.0.1:27017') WORKERS = int...
[ "{ const: const, y : y, z: z, }} const = lambda x,", "\\y -> x; y <- const #true #true; z <- const #false #false;", "<- const #false #false; #record { const: const, y : y, z: z,", "z <- const #false #false; #record { const: const, y : y, z:", "\\x -> \\y -> x; y <- const #true #true; z <- const", "}} cons...
[ "the model and weights model = tf.saved_model.loader.load(sess, ['vgg16'], vgg_path) # Get Tensors to", "the last layer of output \"\"\" # Use a shorter variable name for", "vgg_path): \"\"\" Load Pretrained VGG Model into TensorFlow. sess: TensorFlow Session vgg_path: Path", "from VGG model (image_input, kee...
[ "include_children=False, writer_identity=('serviceAccount:<PASSWORD>@' 'gcp-sa-logging.iam.gserviceaccount.com'), parent=self.proj_1, raw_json='_SINK_2_' ) ] actual_violations = rules_engine.find_violations( self.proj_1, log_sinks) self.assertEqual(set(),", "# +-----------------------> proj-3 self.org_234 = Organ...
[ "pass #orgId generation @staticmethod def generate_org_id(): \"\"\"UUID generation for org registeration\"\"\" return(uuid.uuid4().hex) @staticmethod", "{e}\") return post_error(\"Database connection exception\", \"An error occurred while connecting to the database:{}\".format(str(e)),", "0, \"active\": 1}) if ...
[ "setup(name='diffvg', version='0.0.1', install_requires=[\"svgpathtools\"], description='Differentiable Vector Graphics', ext_modules=[CMakeExtension('diffvg', '', build_with_cuda)], cmdclass=dict(build_ext=Build, install=install), packages=packages, zip_safe=False)", "+= ['--', '/m'] else: cmake_args += ['-DCMAK...
[ "- self.last_update_time return time_since_last_update <= IO_TIMEOUT_SECONDS def getByteCount(self): return self.byte_count def getUpdateCount(self): return", "as e: logger.warning(\"Error reading configuration data, retrying (%s)\", e) success = False Timer.delay(0.5)", "Timer import logging logger = logging.g...
[ "= 0 self.time_offset = 0 self.time_scale = 1 self.enabled = False self.enabled_and_selected =", "disable=invalid-name #pylint: disable=too-many-instance-attributes #pylint: disable=too-many-return-statements #pylint: disable=too-many-statements \"\"\" Class structure and methods for", "s = fformat % (number * ...
[ "classes=classes, ann_file='raubtierv2a/train/_annotations.coco.json'), val=dict( img_prefix='raubtierv2a/valid/', classes=classes, ann_file='raubtierv2a/valid/_annotations.coco.json'), test=dict( img_prefix='raubtierv2a/test/', classes=classes, ann_file='raubtierv2a/test/_annotations.coco.json')) #optimizer = dict...
[ "import setup, Extension setup(name = 'qconf_py', version = '1.2.2', ext_modules = [Extension('qconf_py', ['lib/python_qconf.cc'],", "setup, Extension setup(name = 'qconf_py', version = '1.2.2', ext_modules = [Extension('qconf_py', ['lib/python_qconf.cc'], include_dirs=['/usr/local/include/qconf'],", "from dist...
[ "1 b = 1 c = 1 while h >= a: a =", "= 1 b = 1 c = 1 while h >= a: a", "= 1 c = 1 while h >= a: a = 2 **", "i += 1 s = 0 t = True for j in range(1,", "b = 1 c = 1 while h >= a: a = 2", "t = True for j in range(1, i-1): c += 2 ** j", "h >= a: a = 2 ** i i += 1 s =", "h = int(input()) i = 1 a = 1 b = 1 c...
[ "we receive an update notification = gopro.get_update() # Update data points if they", "last_bars = ( notification.data[StatusId.BATT_LEVEL] if StatusId.BATT_LEVEL in notification.data else last_bars ) # Append", "with battery level notifications while True: time.sleep(1) # Otherwise, poll else: with console.st...
[]
[ "import SyncStep from core.models import Service from hpc.models import ServiceProvider, ContentProvider, CDNPrefix, OriginServer", "url}) ors.silent = True ors.save() def delete_record(self, m): if m.origin_server_id is not None:", "#print os_dict if not ors.origin_server_id: id = self.client.onev.Create(\"Ori...
[ "b): tmp = b b = g // 2 g = tmp r", "= tmp r = r // 2 return r, g, b def main():", "python3 from PIL import Image def tranform(r, g, b): tmp = b b", "return r, g, b def main(): im = Image.open('blue-flames.jpg') input_pixels = im.getdata() output_pixels", "from PIL import Image def tranform(r, g, b): tmp = ...
[ "We do this by adding the # swig2 converter to the default list", "do something like this:: $ swig -c++ -python -I. -o swig2_ext_wrap.cxx swig2_ext.i $", "be an APtr instance. b.thisown = 1 # Prevent memory leaks. code =", "BSD Style. \"\"\" # Import our SWIG2 wrapped library import swig2_ext import scipy.wea...
[ "return 'E' else: return s.name[7:] def parse(exp): symbol = parseGlobalSymbol(exp) if symbol: return", "2: res = [f] + args[0] + args[1] args = args[2:] for arg", "= parseGlobalSymbol(exp) if symbol: return [symbol] else: f = str(exp.head) args = list(map(parse,", "= -p if p >= 2: p = p - 2 res1 =", "ass =...
[ "Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='<EMAIL>', packages=['firetv'],", "import setup setup( name='firetv', version='1.0.7', description='Communicate with an Amazon Fire TV device via", "'console_script...
[ "data as they are in files. Developper are encourage to use neo.rawio. When", "of channel with same units _prefered_signal_group_mode = 'group-by-same-units' def __init__(self, filename=''): ExampleRawIO.__init__(self, filename=filename)", "give raw data as they are in files. Developper are encourage to use", ...
[ "migrations, models class Migration(migrations.Migration): dependencies = [ ('scrapyproject', '0002_auto_20170208_1738'), ] operations = [", "= [ migrations.AlterField( model_name='project', name='link_generator', field=models.TextField(blank=True), ), migrations.AlterField( model_name='project', name='scraper_fu...
[ "range(1, 21)] class CartAddCourseForm(forms.Form): quantity = forms.TypedChoiceField( choices=COURSE_QUANTITY_CHOICES, coerce=int, label=_(\"Quantité\") ) override =", "from django.utils.translation import gettext_lazy as _ COURSE_QUANTITY_CHOICES = [(i, str(i)) for i in", "i in range(1, 21)] class CartAddCour...
[]
[ "is governed by the Apache v2.0 license that can be # found in", "with self.assertRaises(TypeError): DJP(prop=[]) def test_BytesComputedProperty(self): self.assertEqual('\\x00', BP().prop) BP().put() self.assertEqual('\\x00', BP.query().get().prop) if __name__ ==", "google.appengine.ext import ndb from componen...
[ "port['resource_request']['request_groups'][0]['required'] ) self.assertEqual( {orc.NET_PACKET_RATE_KILOPACKET_PER_SEC: 10}, port['resource_request']['request_groups'][0]['resources'], ) self.assertEqual( ['fake_uuid'], port['resource_request']['same_subtree'], ) def test__extend_port_resource_request_min_bw_and_pp...
[ "any word into covfefe \"\"\" def __init__(self, bot): self.bot = bot async def", "return None async def red_delete_data_for_user(self, **kwargs): \"\"\" Nothing to delete \"\"\" return @commands.command()", "Convert almost any word into covfefe \"\"\" def __init__(self, bot): self.bot = bot", "async def covf...
[ "serializers as local_serializers from .models import GeneralLog, LogIn, ResetPassword class GeneralLogViewSet(AdvancedModelViewSet, AdvancedListAPIView): queryset", "\"\"\" from bkuser_core.common.viewset import AdvancedListAPIView, AdvancedModelViewSet from . import serializers as local_serializers from", "to...
[ "from models_gqa.config import build_cfg_from_argparse from util.gqa_train.data_reader import DataReader import json # Load config", "print('imdb has no answer labels. Using dummy labels.\\n\\n' '**The final accuracy will be", "output_predictions = [] answer_word_list = data_reader.batch_loader.answer_dict.word...
[ "for coord in page: callback(coord, page_num, i) i += 1 def create_page(self, page_num):", "> self.last_col and self.cur_row == self.last_row): raise StopIteration elif self.cur_col == self.num_col_page: self.cur_col", "__init__(self, num_pages, first_page_col_start, first_page_row_start, last_page_row_start, l...
[ "{\"a\": 123}, \"https://www.domain.com/path?param1=param1#anchor\", ) == \"https://www.domain.com/path?param1=param1&a=123#anchor\" ) def test_add_to_query_string2(): assert ( url_utils.add_to_query_string( {\"param1\":", "url_utils.add_to_query_string( {\"a\": 123}, \"https://www.domain.com/path?param1=param1#a...
[ "# Feie # --- EDIT ------------------ # Make a grid object f =", "y0, x1, y1] # Make a Section object sec = roppy.linear_section(i0, i1, j0,", "a Section object sec = roppy.linear_section(i0, i1, j0, j1, grd) # Read in", "= grd.ll2xy(lon1, lat1) # Find nearest rho-points i0, j0, i1, j1 = [int(round(v))", "-...
[ "file format: TypeError: TestFileReadability argument %Id: %V \"\"\" from pathlib import Path import", "data file format: TypeError: TestFileReadability argument %Id: %V \"\"\" from pathlib import Path", "%V \"\"\" from pathlib import Path import argparse import paraview.simple as pvs p", "know your data file...
[ "\"\"\" Form for creating and modifying language objects \"\"\" class Meta: model =", "modifying language objects \"\"\" class Meta: model = Language fields = [ \"code\",", "\"\"\" class Meta: model = Language fields = [ \"code\", \"english_name\", \"native_name\", \"text_direction\",", "Form for creating and...
[ "] search_fields = [] for f in Machine._meta.fields: if f.name not in skip_fields:", "= ChoiceFieldNoValidation( initial='AND', widget=forms.HiddenInput() ) class Meta: model = SearchRow fields = ('search_models',", "def validate(self, value): pass class SaveSearchForm(forms.ModelForm): class Meta: model = Save...
[ "self.soup.find(property=\"articleBody\") paras = self.soup.find_all('div', {\"class\" : \"ssrcss-17j9f6r-RichTextContainer e5tfeyi1\"}) #for para in paras: #", "in imgs: # print(img['src']) paras = self.soup.find_all('div', {\"class\" : \"ssrcss-17j9f6r-RichTextContainer e5tfeyi1\"}) #for para", "self.soup = b...
[ "parameters N = 2283 #Totala befolkningen N=s(t)+I(t)+R(t) D = 4.0 #infections last four", "y dSdt = -beta * S * I / N # S(t) –", "delta): S, E, I, R = y dSdt = -beta * S *", "R0 * S(t)/Ntot* (1 – b). b = effekt av policy och beteendeförändringar", "I / N - gamma * E dIdt = delta * E -", "odeint(deriv, ...
[ "input('trabajas desde casa? ') if pregunta == True: print 'Eres afortunado' if pregunta", "pregunta = input('trabajas desde casa? ') if pregunta == True: print 'Eres afortunado'", "False: print 'Trabajas fuera de casa' tiempo = input('Cuantos minutos haces al trabajo:", "casa' tiempo = input('Cuantos minutos...
[ "adds appropriate cache headers to GET and HEAD methods. NOTE: /checker, /get-token, /metrics", "(and later middleware) are called. response = self.get_response(request) # Code to be executed", "in ('GET', 'HEAD') and not request.path.startswith(urlparse(settings.STATIC_URL).path) ): logger.debug( \"Patching ca...
[ "if self.train_cfg.teacher.backbone_at: for i in self.train_cfg.teacher.backbone_at_idxes: feats += (backbone_feats[i],) if self.with_neck: neck_feats =", "SingleStageDetector from ...registry import DETECTORS from ...builder import build_detector @DETECTORS.register_module class KDSingleStageDetector(SingleStage...
[ "tcp_opened = 0 object_grasped = reach reward = 10 * reward_utils.hamacher_product(reach, in_place) return", "object_grasped = reach reward = 10 * reward_utils.hamacher_product(reach, in_place) return (reward, tcp_to_obj, tcp_opened,", "np.linalg.norm(target_to_obj) target_to_obj_init = (self.dial_push_position...
[ "next_token(self): self.current_token, self.peek_token = self.peek_token, self.lexer.next_token() def parse_program(self): program = Program() while self.current_token.type", "self.current_token, self.peek_token = self.peek_token, self.lexer.next_token() def parse_program(self): program = Program() while self.cur...
[ "files: with open(join(root,f),'r',encoding=\"utf-8\") as fi: lines = fi.readlines() for l in lines: if", "os import walk from os.path import abspath,join, pardir categories_folder = abspath(join(__file__,pardir,pardir,\"category\")) post_folder =", "fi: lines = fi.readlines() for l in lines: if l.find(\"catego...
[ "\"/web\") if not os.path.exists(\"temp/\"): os.makedirs(\"temp/\") print(\"- -- --- -- - Generating single-file HTML", "included in docs!\") if unknown: print(\"Add the new files to makedoc.py, soloud.tex and", "subprocess.call([\"xelatex\", \"SoLoud.tex\"], stdout=outfile) print(\"- -- --- -- - Generating pdf...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "(self.role, self.party_id).__hash__() def __str__(self): return f\"Party(role={self.role}, party_id={self.party_id})\" def __repr__(self): return se...
[ "import absolute_import, print_function from sentry.logging import LoggingFormat from sentry.options import ( FLAG_IMMUTABLE, FLAG_NOSTORE,", "include a trailing slash. register('system.url-prefix', ttl=60, grace=3600, flags=FLAG_REQUIRED | FLAG_PRIORITIZE_DISK) register('system.root-api-key', flags=FLAG_PRIORITI...
[ "download_unicodedata(version, output=HOME, no_zip=False): \"\"\"Download Unicode data scripts and blocks.\"\"\" ver = tuple([int(x) for", "= os.path.join(output, 'unicodedata', version) zip_target = os.path.join(output, 'unicodedata', '%s.zip' % version) if not", "'PropertyValueAliases.txt', 'PropertyAliases.t...
[ "direct_cache import direct_cache as cache elif OPTS.associativity == associativity.N_WAY: from n_way_cache import n_way_cache", "cpaths[\"use\"] for k, cpath in cpaths.items(): debug.print_raw(\"Config: Writing to {}\".format(cpath)) self.config_write(cpaths) print_time(\"Config\", datetime.datetime.now(),", "...
[ "data_df['time'] = pd.to_datetime(data_df['time'], format=\"%Y-%m-%d-%H.%M.%S.%f\") # calculate the time interval since the start time", "get the first start, end index, end time for cur_time in time_data: if", "return event_count_matrix, labels def deepia_data_loader(para): \"\"\" load the logs and the log_eve...
[ "args: with open(origFilename, \"r\") as f: html_doc = f.read() prog = re.compile('\\<mso\\:URL.*?\\>(.*?),.*?\\<\\/mso\\:URL\\>', re.M)", "v1.0') print('Usage:') print(sys.argv[0]+' -d -h filename(s)') print('-d : Delete original file') print('-h :", "try: opts, args = getopt.getopt(sys.argv[1:], \"hd\") excep...
[ "v = \"hello world\" \"\"\") self.assertTypesMatchPytd(ty, \"\"\" sys = ... # type: module", "posix x = posix.urandom(10) \"\"\") self.assertTypesMatchPytd(ty, \"\"\" posix = ... # type: module", "test_base class StdlibTests(test_base.TargetPython27FeatureTest): \"\"\"Tests for files in typeshed/stdlib.\"\"\" d...
[ "<reponame>oicr-gsi/pysmmips # -*- coding: utf-8 -*- \"\"\" Created on Tue Oct 20 16:04:52", "utf-8 -*- \"\"\" Created on Tue Oct 20 16:04:52 2020 @author: rjovelin \"\"\"", "-*- coding: utf-8 -*- \"\"\" Created on Tue Oct 20 16:04:52 2020 @author:", "coding: utf-8 -*- \"\"\" Created on Tue Oct 20 16:04:52 20...
[ "for post in doc: custom_post_item = SocialPost() custom_post_item.set_dictionary(post) social_post_list.append(custom_post_item) return social_post_list def get_users(self):", "access_token) return 0 def read_access_token(self, source): existing_dict = self.db.storeAccessToken.find_one({'source': source}) return...
[ "subprocess has exited already pass else: return output, err error_message = '%s, error", "%s', OS_RELEASE_PATH) return 'unknown' def write_stunnel_config_file(config, state_file_dir, fs_id, mountpoint, tls_port, dns_name, verify_level, ocsp_enabled,", "except ValueError: logging.warning('Bad state_file_dir_mod...