ngram
listlengths
0
67.8k
[ "trees: stage_subtree = trees[0] stage_order = root_last_traversal(target_stage, lambda n: stage_subtree[n][1]) pipeline = [(stage_subtree[stage][0],", "in required_stages: required_stages.append(suppliers[0]) required_stages_set.append(required_stages) return required_stages_set def validator(stage: str, subtree...
[ "/ t, '\\t-\\t\\t' ) error = np.array([cnn_diff, lin_diff, cos_diff, ner_diff, bsp_diff]) n_error =", "Sinc:', n_error[2].mean()) print('Nearest:', n_error[3].mean()) print('BSpline', n_error[4].mean()) print() print('NRMSE STD:') print('PixelMiner:', n_error[0].std()) print('Linear:', n_error[1].std())", "impo...
[ "the way I want it '''), epilog = \"Contact:<EMAIL>\" ) parser.add_argument(\"infile\", nargs=\"?\", type=argparse.FileType(\"r\"),", "'''), epilog = \"Contact:<EMAIL>\" ) parser.add_argument(\"infile\", nargs=\"?\", type=argparse.FileType(\"r\"), default=sys.stdin) parser.add_argument(\"ofile\", nargs=\"?\", typ...
[ "import fits import logging try: import imageio except ImportError: imageio = None try:", "np.ndarray) return colaps def writefits(img: np.ndarray, outfn: Path): outfn = Path(outfn).expanduser() f =", "from scipy.io import loadmat except ImportError: loadmat = None def meanstack( infn: Path,", "int): key = sl...
[ "# By default, VRM Importer includes leaf bones automatically. # It's cool and", "# Use this script to obliterate those leaf bones in one click. if", "models! import bpy context = bpy.context obj = context.object # By default, VRM", "import bpy context = bpy.context obj = context.object # By default, VRM Impo...
[ "\")) e=int(input(\"enter a end \")) for n in range(s,e+1): order=len(str(n)) num=0 backup=n while(n>0):", "s=int(input(\"enter start \")) e=int(input(\"enter a end \")) for n in range(s,e+1): order=len(str(n)) num=0", "start \")) e=int(input(\"enter a end \")) for n in range(s,e+1): order=len(str(n)) num=0 bac...
[ "* application = Flask(\"rsa-core\") application.config['JWT_SECRET_KEY'] = config['jwt_key'] jwt = JWTManager(application) application.url_map.converters['list'] = ListConverter", ".security import * application = Flask(\"rsa-core\") application.config['JWT_SECRET_KEY'] = config['jwt_key'] jwt = JWTManager(appli...
[ "name = du.get_dataset_name(global_name, subset) dataset_path = os.path.join(storage_data_path, global_name) original_data_path = du.get_original_data_path(global_name) # Build", "recover the study name of the image name to construct the name of", "the sub-folder for the current subset dst_folder_path = os.path...
[ "def buildTransformationName(roi, representation, transformer, input_transformation, nodeid): if input_transformation is None: return f\"{transformer.name}_rep-{representation.id}_roi-{roi.id}_node-{nodeid}\" else:", "representation, transformer, input_transformation, nodeid): if input_transformation is None: ret...
[ "image_files: image_file = os.path.join(folder, image) try: image_data = (ndimage.imread(image_file).astype(float) - pixel_depth / 2)", "% set_filename) dataset = load_letter(folder, min_num_images_per_class) try: with open(set_filename, 'wb') as f: pickle.dump(dataset,", "= merge_datasets( train_datasets, trai...
[ "Pololu protocol: 0xAA, device number, 0x33; Reference \"Get Error Flags Halting\" page 34", "time.sleep (cycle_delay) ser.write([init_cmd, jrk_id, read_current_cmd]) time.sleep (0.01) checkCurrent = ord(ser.read()) ser.write([init_cmd, jrk_id, read_feedback_cmd])", "= \"\\xA7\" get_error_cmd = \"\\x33\" # For ...
[ "for token in Filter.__iter__(self): if reached_max_length and nesting_level == 0: return if token['type']", "'\\n', description_cleaner.clean(txt) ).strip() ) class ProcessShortDescription(Filter): max_length = 200 def __iter__(self): current_length =", "Filter PARAGRAPH_TAGS = ['p', 'h1', 'h2', 'h3', 'h4', 'l...
[ "42 @classmethod def nome_e_atributo_de_clsse(cls): return f\"{cls} olhos {cls.olhos}\" if __name__ == \"__main__\": joao", "class Pessoa: olhos = 2 def __init__(self, *filhos, nome=None, idade=10): self.nome = nome", "joao = Pessoa(nome='João') pedro = Pessoa(joao,nome='Pedro') print(Pessoa.cumprimentar(pedro)...
[ "df to save as target feature(s) targ_type: type of target feature, e.g. int,'float32'", "if the matrix is in sparse COO format and should be densified later", "def fold2foldfile(df:pd.DataFrame, out_file:h5py.File, fold_idx:int, cont_feats:List[str], cat_feats:List[str], targ_feats:Union[str,List[str]], targ_t...
[ "None, None except ValueError: dc = wx.ScreenDC() # compute for font size of", "= self.xpathEval(node, self.xpContent)[0] for sId in sIds.split(): l = self.xpathEval(ndPage, './/*[@id=\"%s\"]'%sId) ndItem =", "\"\"\"A rectangle \"\"\" def __init__(self, cfg, sSurname, xpCtxt): DecoBBXYWH.__init__(self, cfg, sSu...
[ "variable is:\", first) print(\"Your second variable is:\", second) print(\"Your third variable is:\", third)", "third) # $ python ex13.py first 2nd 3rd # The script is called:", "python ex13.py first 2nd 3rd # The script is called: ex13.py # Your", "script is called: ex13.py # Your first variable is: first #...
[ "'.' LIVERELOAD = os.path.join( os.path.abspath(os.path.dirname(__file__)), 'livereload.js', ) class LiveReloadHandler(websocket.WebSocketHandler): waiters = set() _last_reload_time", "True } self._last_reload_time = time.time() for waiter in LiveReloadHandler.waiters: try: waiter.write_message(msg) except: loggi...
[ "IntegerField('Spell Crit Rating', [NumberRange(0,500)]) haste_score = IntegerField('Spell Haste Rating', [NumberRange(0,1000)]) num_fights = IntegerField('#", "import StringField, IntegerField from wtforms.fields.simple import SubmitField from wtforms.validators import DataRequired, NumberRange class", "spellp...
[ "None headers = None def __init__(self, team_id, proxy=None, headers=None, timeout=30, get_request=True): self.proxy =", "'NICKNAME', 'YEARFOUNDED', 'CITY', 'ARENA', 'ARENACAPACITY', 'OWNER', 'GENERALMANAGER', 'HEADCOACH', 'DLEAGUEAFFILIATION'], 'TeamHistory': ['TEAM_ID', 'CITY', 'NICKNAME',", "'OPPOSITETEAM'],...
[ "[ migrations.AlterModelOptions( name='tableassignment', options={'permissions': (('view_table_assignments', 'Can view table assignments'), ('edit_table_assignments', 'Can edit table", "('seating_charts', '0005_auto_20160203_1110'), ] operations = [ migrations.AlterModelOptions( name='tableassignment', options={'...
[ "n.left: queue.append(n.left) if n.right: queue.append(n.right) for level in res: print(*[n.value for n in", "in res: print(*[n.value for n in level]) return res class Test(unittest.TestCase): tree_1 =", "= node(3) tree_1.left.left = node(4) tree_1.left.right = node(5) tree_1.right.left = node(6) tree_1.right.r...
[ "rolls. dice_pool: int threshold: int prime: bool exploding: bool -> {success, rolls, totals", ": int -> list[int] \"\"\" rolls = await rolling_utils.roll(dice_pool) if 6 in rolls:", "with a boolean representing success status and a list of int lists representing", "\"totals\": { \"total_hits\": total_hits, \...
[ "os import sys if __name__ == \"__main__\": sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from Emulator.emulator import main", "import os import sys if __name__ == \"__main__\": sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from Emulator.emulator...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "e.findall(SMDX_POINT): pid = p.attrib.get(SMDX_ATTR_ID) label = desc = notes = None for a", "{SMDX_MANDATORY_FALSE: mdef.MANDATORY_FALSE, SMDX_MANDATORY_TRUE: mdef.MANDATORY_TRUE} smdx_type_types = [ SMDX_TYPE_INT16, SMDX_TYPE...
[ "fields = ('url', 'username', 'email', 'is_staff') # ViewSets define the view behavior. class", "'is_staff') # ViewSets define the view behavior. class UserViewSet(viewsets.ModelViewSet): queryset = User.objects.all() serializer_class", "print_function from __future__ import unicode_literals from __future__ imp...
[ "lth * (lth + 1) / (2 * np.pi) return nl_th else: if", "* bin_size + 2 bin_hi = (bins + 1) * bin_size + 1", "not None: ps[f] = ps[f][:lmax] if output_type == \"Cl\": ps[f] /= scale if", "lmax: integer the maximum multipole to consider spectra: list of strings needed for", "integer the number of bins lmax: i...
[ "1, 1), nn.ReLU(), nn.Conv2d(256, 512, 3, 1, 1), nn.ReLU(), nn.Conv2d(512, 256, 3, 1,", "= nn.Sequential( nn.Conv2d(n_state[0], 64, 3, 1, 1), nn.ReLU(), nn.Conv2d(64, 256, 3, 1, 1),", "256, 3, 1, 1), nn.ReLU(), nn.Conv2d(256, n_action, 4, 1, 0), nn.Flatten(), ) self.ConvNet.apply(init_weights)", "1, 1), nn.Re...
[ "objects to simplify imports in clients: .. code-block:: python from dynamorm import DynaModel", "ProjectInclude, ) # noqa from .relationships import ManyToOne, OneToMany, OneToOne # noqa from", ".model import DynaModel # noqa from .indexes import ( GlobalIndex, LocalIndex, ProjectAll, ProjectKeys,", "import ...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", "self._r = val def level(self, val, brightness=255): self._begin() for i in range(9,-1,-1) if", "IS\", WITHOUT WARRANTY OF ANY KI...
[ "threshold_max data[data < threshold_min] = threshold_min img = nibabel.Nifti1Image(data, img.get_affine(), img.get_header()) out_file, _", "= nibabel.load(file1) shape1 = np.shape(img.get_data()) affine1 = img.get_affine() img = nibabel.load(file2) shape2 =", "def check_images(file1, file2): \"\"\"Check that 2...
[ "= self.selected.values() for el in elements: current_classes = el.attrib.has_key(\"class\") and el.attrib[\"class\"].split() or []", "optionally removing the elements' styling. If inline styles are not removed, the css", "action=\"store\", type=\"string\", dest=\"name\", default=\"\", help=\"Name of css class ...
[]
[ "= GenericForeignKey() grant = models.ForeignKey(Grant, models.PROTECT) class Meta: verbose_name = \"grant rekordu\" verbose_name_plural", "CASCADE class Grant(models.Model): nazwa_projektu = models.TextField(blank=True, null=True) zrodlo_finansowania = models.TextField(blank=True, null=True) numer_projektu =", ...
[ "-*- coding: utf-8 -*- import jieba jieba.load_userdict(\"user_dict.txt\") line_list = [\"查询安顺站一号风机的电压曲线\", \"查询安各庄1母线的故障信息\", \"开始进行南京站设备状态核实\", \"看下安顺站3月1号的静态功率曲线\"]", "\"查询安各庄1母线的故障信息\", \"开始进行南京站设备状态核实\", \"看下安顺站3月1号的静态功率曲线\"] for cur_line in line_list: seg_list = jieba.cut(cur_line.strip()) print(\"jieba rst...
[ "run_python(request): \"\"\" A page to allow testing the Python sandbox on a production", "def run_python(request): \"\"\" A page to allow testing the Python sandbox on a", "from django.utils.html import escape from django.views.decorators.csrf import ensure_csrf_cookie from common.djangoapps.edxmako.shortcuts ...
[ "1, j), (i - 1, j), (i, j + 1), (i, j -", "0 <= ni < len(grid) and 0 <= nj < len(grid[0]) and grid[ni][nj]", "def closedIsland(self, grid: List[List[int]]) -> int: res = 0 for i in range(len(grid)):", "in [(i + 1, j), (i - 1, j), (i, j + 1),", "self._dfs(grid, i, j): res += 1 return res def _dfs(self, grid,...
[ "graph_largest_component(G: gt.Graph, directed: bool = False) -> NodeDataFrame: expect_nodes(G) largest_comp = gt.label_largest_component(G, directed=directed)", "gt from .nodedataframe import NodeDataFrame from .context import expect_nodes def graph_component_count(G: gt.Graph, directed:", "-> NodeDataFrame: e...
[ "argument will always be the right operand. .. caution:: Since the rhs is", "and delegate to it if it has defined the proper protocol: - ``__lazyboolnot__(self)``", "logical operators aware of laziness. \"\"\" def visit_BoolOp(self, node: BoolOp) -> Union[UnaryOp, Call]:", "typing import Union __all__ = ['__l...
[ "import views urlpatterns = [ path('signup/', views.SignUp.as_view(), name='signup'), path( 'login/', auth_views.LoginView.as_view(template_name='auth/authForm.html'), name='login' ),", "auth_views.PasswordChangeDoneView.as_view( template_name='auth/changePasswordDone.html' ), name='password_change_done' ), path(...
[ "from the environment.\"\"\" args: CLIArgs var_prefix = \"BEVY_APP_\" path_key = \"PATH\" config_file_key =", "object aggregates all options values that the Bevy.App application pulls in from the", "return self._env_options[item] return self._options[item] def __contains__(self, item: str) -> bool: return item ...
[ "value in data: if value.split(',')[122] == '1' and value.split(',')[167] == '1': COVID_&_vaccines.append(value) elif", "value.split(',')[127] == '1' and value.split(',')[148] == '1': COVID_comorbidities.append(value) #covid and more specific conditions:", "== '1': COVID_hypertension.append(value) elif value.sp...
[ "**kwargs): \"\"\"Generate default with translation uniformly b/w (-1,1) \"\"\" alphabet = LANGUAGE_MAP[language].get_alphabet(support_bold=False) fg", "background=bg, foreground=fg, rotation=0, scale=scale, translation=(0.0, 0.0), inverse_color=False, pixel_noise_scale=0.0, ) return dataset_generator(attr_sample...
[ "= self.wrapped_env.step(act) params = self._params_as_tensor() obs = np.concatenate((obs, params)) return obs, reward, done,", "self.nominal['dt'] = 1 / 100. # TODO ATTENTION! THIS CAN BE DEADLY! @Robin,", "reset(self, init_state: np.ndarray = None, domain_param: dict = None): obs = self.wrapped_env.reset(init...
[ "potential principle is matched in all subsequent attempts # This covers the intermediate", "if a['perservative']: totalPerserverative +=1 if not a['perservative']: totalNonPerserverative +=1 if (not a['perservative'] and", "False if ( test[a]['sandwiched'] and 'NOT perservative per 2c' not in test[a]['reasonin...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "should limit the number of connections to the number of threads, which is", "self.redis = redis.client.Redis(self.redis_server(), decode_respons...
[ "nn def group_norm(out_channels): num_groups = 32 if out_channels % 32 == 0: return", "group_norm(out_channels): num_groups = 32 if out_channels % 32 == 0: return nn.GroupNorm(num_groups, out_channels)", "32 if out_channels % 32 == 0: return nn.GroupNorm(num_groups, out_channels) else: return nn.GroupNorm(num_g...
[ "ㄱㅇㄱ ㄴㅇㄱ ㄷㅎㄷ ㄳㅎㄶ ㄱㅀㄹ', \"''\", '\\n\\n') _test('ㅀㄱ ㅀㄱ ㄱㅇㄱ ㄴㅇㄱ ㄷㅎㄷ ㄳㅎㄶ", "ㅄㅎㄴ ㄷㅎㄷ', \"2.5+0i\") _test('(ㄷ ㄴㄱ ㅄㅎㄷ) (ㄷ ㄴ ㅄㅎㄷ) ㄷㅎㄷ', \"4+0i\") _test('(ㄱ ㄱ", "ㄱㅀㄹ', \"'불꽃'\", '불\\n꽃') _test('ㅅㅈㅎㄱ ㅅㅈㅎㄱ ㄷㅎㄷ', \"{}\") _test('ㅅㅈㅎㄱ ㅅㅈㅎㄱ ㄴ ㄷ ㅅㅈㅎㄷ ㅅㅈㅎㄱ", "ㄴㄱ ㅄㅎㄷ ㅂ ㅅ ㄱ ㅂㅎㅀㄷ', \"True\") def test_floor_div(self): _test = se...
[ "client.call(\"ak.wwise.core.object.get\", { \"from\": { \"name\": [\"GameParameter:a\" + str(n) for n in range(5000)], }", "WaapiClient, connect, CannotConnectToWaapiException class LargePayload(unittest.TestCase): def test_large_rpc(self): with WaapiClient() as client: result =", "unittest from waapi import W...
[ "print(\"{}: {}\".format(cat, arr.shape)) label_vectors = {} for cat, n in zip(classes_to_generate, [lesion_n, pleural_n,", "Effusion', 'Pleural Other', 'Fracture', 'Support Devices'] tf.InteractiveSession() # Import pretrained Chexpert GAN. with", "file: G, D, Gs = pickle.load(file) real_labels = pd.read_csv(r...
[ "\\ (other.func, other.args, other._keys) except AttributeError: # other is not a Command return", "symbol(self): \"\"\"return a unique symbol for this Character\"\"\" # failsafe to ensure that", "self._mode.value, set(self._classes), set(self._include_chars), set(self._exclude_chars) ) @staticmethod def from_d...
[ "ast import literal_eval from flask import jsonify, request from back.mongo.data.collect.indicators.mongo import find_indicators def", "literal_eval(request.args.get(\"limit\")) if \"limit\" in request.args else 100 filter[\"_id\"] = 0 data = find_indicators(query,", "query = literal_eval(request.args.get(\"que...
[ "\" parameter no longer has any effect and may not be allowed\" \\", "\"mpunet 0.1.3 or higher requires integer targets\" \\ \" as opposed to one-hot", "targets\" \\ \" as opposed to one-hot encoded targets. Setting the 'sparse'\" \\", "as opposed to one-hot encoded targets. Setting the 'sparse'\" \\ \" param...
[ "current_vlans.list = {} obj = HANDLE.GetManagedObject(None, FabricVlan.ClassId()) if obj != None: for mo", "'n']: print '' print '*** Error: Please enter either \"yes\" or \"no\". ***'", "for org in current_orgs.list: if org in mo.getattr(prop): organization = org else: organization", "or 'n']: current_orgs(...
[ ".ptype import PacketType from .header import PacketHeader from .packet import Packet from .factory", "from .ptype import PacketType from .header import PacketHeader from .packet import Packet from", "import PacketType from .header import PacketHeader from .packet import Packet from .factory import", "<gh_sta...
[ "os.path.abspath(os.path.dirname(__file__)) package = os.path.join(here, 'Products', NAME) def _read(name): f = open(os.path.join(package, name)) return", "#Zope >= 2.9, 'setuptools', 'python-ldap >= 2.0.6', 'Products.LDAPUserFolder >= 2.9', 'Products.PluggableAuthService >= 1.4.0',", "setuptools import setup f...
[ "for old_path, new_path in zip(args.src, args.dest): methods = [] for n, path in", "path', methods[0], methods[1]) cg = changegraph.build_from_files(old_path, new_path, repo_info=repo_info) change_graphs.append(cg) miner = Miner() if", "Starting ------------------------------') if settings.get('use_stackimpact'...
[ "3: the car is behind door C: # p(open A): 0 # p(open", "doors.P(d.name) likelihood = d.P('B') print('{:^5} {:<12.5f} {:<12.5f} {:<12.5f} {:<12.5f}'.format(d.name, prior, likelihood, prior *", "behind door C: # p(open A): 0 # p(open B): 1 # p(open", "# p(open A): 0 # p(open B): 0 # p(open C): 1 hypo_2", "'P...
[ "self.access_key = env('ia_access_key_id') self.secret_key = env('ia_secret_access_key') @property def bucket(self): if not hasattr(self, '_bucket'):", "is not None: key_name = os.path.join(self.prefix, key_name) log.info(\"Uploading [%s]: %s\", self.item, key_name) key", "archive on the internet archive. This ...
[ "saves the relevant daily # volume and adjusted closing prices from Yahoo Finance.", "please note that yahoo will return a different payload than expected if #", "re import csv import os from collections import defaultdict # read a csv", "items.append(items[0]) items.reverse() items.pop() # rename the header ...
[ "\"146\", \"column\": \"52\", \"severity\": \"warning\", \"info\": \"extension used\", \"category\": \"-Wlanguage-extension-token\", \"project\": None, \"hint\":", "\"52\", \"severity\": \"warning\", \"info\": \"extension used\", \"category\": \"-Wlanguage-extension-token\", \"project\": None, \"hint\": \"\" \"ZE...
[ "that this request can be trusted signed_field_names = request.POST.get(\"signed_field_names\") if not signed_field_names: raise", "request.POST.get(\"signed_field_names\") if not signed_field_names: raise SuspiciousOperation(\"Request has no fields to verify\") signed_field_names =", "verify\") signed_field_na...
[ "permutation(stringA, stringB): listA = list(stringA) listB = list(stringB) listA.sort() listB.sort() if(listA != listB):", "list(stringA) listB = list(stringB) listA.sort() listB.sort() if(listA != listB): return False else: return", "stringB): listA = list(stringA) listB = list(stringB) listA.sort() listB.sor...
[ "browser.execute_script(\"return window.screen.height;\") # get the screen height of the web i = 1", "restaurants = browser.find_elements_by_xpath('//*[@id=\"ptl-list-content\"]/div/div/div[2]/p[2]') print(f'resto found till now: {len(restaurants)}') # Break the loop when", "elif o in (\"-h\", \"--help\"): usag...
[ "\"******You are now Backing up CISCO and ARISTA router******\" user = raw_input (\"Enter", "Backing up CISCO and ARISTA router******\" user = raw_input (\"Enter your username of", "up CISCO and ARISTA router******\" user = raw_input (\"Enter your username of CISCO", "print \"******You are now Backing up CISC...
[ "import server from apps import state, county cases = pd.read_csv('data/cases.csv') cases['report_date']=pd.to_datetime(cases.report_date) top_layout =", "2px #e3e3e3\", \"padding\": \"5px\", 'marginTop':'-15px'}) ],style = {'marginTop':'-15px'}), ], className='one-third column', id =", "COVID', style={'marginB...
[ ": [0.5, 0.5, 0.5], \"shading\" : \"Lambert\", \"specularCoef\" : 50, \"transparency\" : 1.0,", "%(faces)s } \"\"\" def tessToJson( vert, face, nvert, nface): '''Specify compatible lists of", "\"uvs\": [[]], \"faces\": %(faces)s } \"\"\" def tessToJson( vert, face, nvert, nface): '''Specify", ": 3, \"generate...
[ "can be useful for distribution or for easy writing of code and bundle", "needed to build multiple files into a single script. It can be useful", "multiple files into a single script. It can be useful for distribution or", "of code and bundle it (for example for www.codingame.com) \"\"\" import re from", "f...
[ "return response def country_choice_view(self, request, object_id=None, extra_context=None): current_url = resolve(request.path_info).url_name opts = self.model._meta", "None context = { **self.admin_site.each_context(request), \"current_url\": current_url, \"title\": \"%s (%s)\" % (_.countries, obj)", "\"title...
[ "and validation output_prefix = os.path.join(target_path, \"{}.filtered\".format(corpus_name)) dictionary_file = output_prefix + \".dictionary\" dictionary.save(dictionary_file) #", ":param corpus_name: name of UCI corpus :param target_path: output directory for dictionary file", "num_documents = len(corpus) nu...
[ "= web3fsn.ticketsByAddress(pub_key) #print(Tckts) print('Total number of tickets: ',len(Tckts)) print('\\nor using totalNumberOfTicketsByAddress: ',web3fsn.totalNumberOfTicketsByAddress(pub_key),'\\n') for", "Tckts = web3fsn.ticketsByAddress(pub_key) #print(Tckts) print('Total number of tickets: ',len(Tckts)) pr...
[ "links'.format(day)) print('----------------------') if rx_list is None: rx_list=dct[day].keys() for rx in rx_list: print('Rx {}", "= dct[day][rx][tx_g][1] total_size= total_size + dct[day][rx][tx_g][2] print('https://drive.google.com/u/0/uc?export=download&id={}'.format(lnk)) print('') print('') print('') print(...
[ "or new_date.day != old_date.day: self.stream.write(self.render_date(new_date)) # Now write the Original Content content =", "re import datetime class DateFoldStreamProxy: old_date = None date_re = re.compile(r\"(?P<year>\\d\\d\\d\\d)-(?P<month>\\d\\d)-(?P<day>\\d\\d).*\") def __init__(self,", "__init__(self, s...
[ "= r[0].strip() y = r[1].strip() example = ef.extractFeatures(x) result = '{0},{1}\\n'.format( np.array2string(example, separator=','),", "for line in input_file: r = line.split(',') x = r[0].strip() y = r[1].strip()", "'{0},{1}\\n'.format( np.array2string(example, separator=','), y ) result = result.replace('[...
[ "yet). db.init_app(app) def main(): Create tables based on each table definition in `models`", "__name__ == \"__main__\": # Allows for command line interaction with Flask application with", "from models import * from flask_session import Session app = get_app() session =", "main(): Create tables based on each...
[ "# type: pd.DataFrame def read_source_file(self, *args, **kwargs) -> pd.DataFrame: return pd.read_csv(self.input_path, sep=self.separator, index_col='ID')", "def __init__(self, input_path: str, label_id_mapper: dict, separator: str = ',', images_folder: str =", "classification: dict) -> tuple: title = classific...
[ "distribution.pop(\"description\") result = distribution_to_markdown(distribution) expected = '\\n### Convocatorias abiertas durante el año 2015\\n\\n'", "{\"title\": \"Convocatorias abiertas durante el año 2015\", \"description\": \"Listado de las convocatorias abiertas", "el \" \"sistema de contrataciones \" ...
[ "choice = raw_input(\"Which mail box do you want to open: \") try: if", "the email list in the format (box number or uid number): Subject: This", "= int(choice) if mail_type == 0: recv_body = imap_fetch(str(ch) + \" BODY[1]\") recv_header", "\"2\": date_opt = \"ON\" elif when_ch == \"3\": date_opt = \"SINCE\"...
[ "HTTPException, default_exceptions import connexion from utils.network import log_endpoints from utils.network.exc import HttpException from", "timedelta(days=1) jwt = JWTManager(app) CORS(app) @app.teardown_request def teardown_request(exception): if exception: database.Session.rollback() database.Session.remove...
[ "in range(2,len(augPattern)): s = links[k-1] stop = False while s>=1 and not stop:", "= False while s>=1 and not stop: if augPattern[s] == augPattern[k-1]: stop =", "augPattern = \"0\"+pattern links = {} links[1] = 0 for k in range(2,len(augPattern)):", "{} links[1] = 0 for k in range(2,len(augPattern)): s = ...
[ "speaker in self.event.submitters: accepted_talks = speaker.submissions.filter( event=self.event, state=SubmissionStates.ACCEPTED ).exists() confirmed_talks = speaker.submissions.filter( event=self.event,", "speaker.submissions.filter( event=self.event, state=SubmissionStates.ACCEPTED ).exists() confirmed_talks =...
[ "immediately after generation. For example: dj generate command bar dj run manage.py bar", "name. The command can be run immediately after generation. For example: dj generate", "doc): \"\"\"Generate a command with given name. The command can be run immediately", "import inflection @click.command() @click.arg...
[ "Institute for Snow' in doc.publisher[0] assert '2018' == doc.publication_year assert ['AVALANCHE ACCIDENT STATISTICS',", "(((45.81802, 10.49203), (45.81802, 47.80838), (5.95587, 47.80838), (5.95587, 10.49203), (45.81802, 10.49203)),)}\" == doc.spatial #", "doc.temporal_coverage_end_date def test_boundingbox():...
[ "image if ``True`` (default is ``False``). show : boolean, optional Show the image", "Getch() while True: ch = getch() if ch not in keys2translation.keys(): break while", "b - 1: translate('Z-') break translate('Y+P', confirm) y += 1 # To the", "produce the trajectory of the tool printing the image. ''' # Sta...
[ "from the initial lr set in the optimizer to 0, after a warmup", "def lr_lambda(current_step: int): if current_step < num_warmup_steps: return float(current_step) / float(max(1, num_warmup_steps)) return", "last_epoch=-1): \"\"\" Copied and **modified** from: https://github.com/huggingface/transformers Create a...
[ ") coder = beam.coders.registry.get_coder(examplegen.Annotation) encoded = coder.encode(annotation) self.assertEqual(annotation, coder.decode(encoded)) def test_file_annotation_relative_endpoints_within_clip(self): clip_annotation =", "relative to the file. end_seconds: Ending of the test FileAnnotation relative ...
[ "version 2 of the License, or # (at your option) any later version.", "distributed in the hope that it will be useful, # but WITHOUT ANY", "gui.widgetlib.cairoscroller import CairoScroller from gui.widgetlib.floatingwindow import FloatingWindow from gui.widgetlib.srceditor import SourceEditor from gui.widgetlib...
[ "d1, c = s.geometry, s.vertices, s.dimensions, s.constraints s.setPrimaryObject(option=SUPERIMPOSE) p = mdb.models['Model-1'].parts['Part-1'] p.projectReferencesOntoSketch(sketch=s, filter=COPLANAR_EDGES)", "p.edges #side1Edges = s.getSequenceFromMask(mask=('[#1 ]', ), ) #p.Surface(side1Edges=side1Edges, name='Su...
[ "= response.json() raise Exception(json[\"message\"]) def _release_lease(lease_id): _validate_response(requests.post(\"http://localhost:3000/leases/release\", json={\"leaseId\": lease_id})).json() def _create_lease(media_id): lease =", "return drives @contextmanager def lease_first_drive_path(): drives = _get_usb...
[ "s.split(\".\"), items) self.__add_edge_to(result, node1, node2) each_line = self.file.readline() return result @classmethod def __add_edge_to(cls,", "self.partition.borders: shortest_paths = single_source_shortest_path_length(initial_graph, each_node - 1) for each_other_node in self.partition.borders: if each_ot...
[ "{ 'ref' : value['ref'] } }) del tasks[value['ref']] elif change['type'] == 'change': print(f\"Ref", "include_initial=with_initials).run(conn) while True: change = await changes.next() if not change: break if change['type']", "graphene.types.resolver import dict_resolver from graphql import ResolveInfo from ret...
[ "1) if draw < rewards[a]: r = 1 else: r = 0 '''", "+= X[i][1] data0 /= (nb_datapoints * 100.) # data given as percentage but", "a = draw_from_discrete_proba(dist) ''' Get reward: GOTO_X -> RW_X ''' draw = random.uniform(0,", "''' out_choices, out_vcrw = rl_3target_vc(self.alpha, self.tau, self.max_steps) ''' ...
[ "= 0 soma = 0 for c in range(1, 501, 2): if c", "if c % 3 ==0: soma = soma + c cont = cont", "2): if c % 3 ==0: soma = soma + c cont =", "cont = 0 soma = 0 for c in range(1, 501, 2): if", "+ c cont = cont + 1 print(f'A soma de todos os dos", "= 0 for c in range(1, 501, 2): if c % 3 ==0:", "soma = soma +...
[ "of first image. ''' first = np.array(self.video[0:self.video.shape[0]-1, :, :,]) second = np.array(self.video[1:self.video.shape[0], :,", "you want to have in te current image. Example: alpha = (0.5, 0.5)", "def show_image(X): if len(X.shape) == 3: cv2.imshow('image', X) else: for image in X:", "for image in...
[ "MechType class ContextFlags(BitString): _map = { 0: 'delegFlag', 1: 'mutualFlag', 2: 'replayFlag', 3:", "_map = { '1.3.6.1.4.1.311.2.2.10': 'NTLMSSP - Microsoft NTLM Security Support Provider', '1.2.840.48018.1.2.2' :", "0: 'delegFlag', 1: 'mutualFlag', 2: 'replayFlag', 3: 'sequenceFlag', 4: 'anonFlag', 5: 'co...
[ "def build_and_push_image(): settings = get_settings(os.environ) sts_client = get_sts_client(settings) ecr_clients = get_ecr_clients(settings) docker_client =", "tag in settings['tags']: for repo in repos: image.tag( repository=repo['uri'], tag=tag ) def push_image(docker_client,", "region_name=region )) return...
[ "def __init__(self): super().__init__() self._aws_account_id = None @property def aws_account_id(self): return self._aws_account_id @aws_account_id.setter def", "import Context import click class LocalContext(Context): def __init__(self): super().__init__() self._aws_account_id = None @property", "super().__ini...
[ "ENGINEERING, CHAIR OF APPLIED MECHANICS, # BOLTZMANNSTRASSE 15, 85748 GARCHING/MUNICH, GERMANY, <EMAIL>. #", "OF MECHANICAL ENGINEERING, CHAIR OF APPLIED MECHANICS, # BOLTZMANNSTRASSE 15, 85748 GARCHING/MUNICH, GERMANY,", "TECHNICAL UNIVERSITY OF MUNICH, DEPARTMENT OF MECHANICAL ENGINEERING, CHAIR OF APPLIED M...
[ "problem_name ) ): vals = os.path.basename(tm_fname)[:-4].split(\"_\") _, traffic_seed, scale_factor = vals[1], int(vals[2]), float(vals[3])", "\"bimodal\", \"poisson-high-intra\", \"poisson-high-inter\", ] SCALE_FACTORS = [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0,", "import sys sys.path.append(\"..\") from lib.par...
[ "[] for datum in getFieldsInOrder(self.interface): if datum[0] in data: if data[datum[0]] != getattr(self.context,", "= '%s/edit_page.html' % folder.context.absolute_url(0) self.request.response.redirect(url) return else: retval = u'Problem creating page' assert", "# All good, so redirect to the edit page. if c...
[ "x): # self.val = x # self.next = None class Solution: # @param", "# while cur.next: # if cur.next.val >= x: # cur = cur.next #", "lower.next = None else: higher.next = head head = head.next higher = higher.next", "= None lower.next = head2.next return head1.next # if not head: return None", "example, Given...