ngram
listlengths
0
67.8k
[ "\"CREATE TABLE IF NOT EXISTS cards('card_title' VARCHAR,\" + \\ \" 'card_text' TEXT, 'card_link_text'", "NOT EXISTS cards('card_title' VARCHAR,\" + \\ \" 'card_text' TEXT, 'card_link_text' VARCHAR, 'card_link_url' VARCHAR", "VARCHAR )\" insert_data_query = f\"INSERT INTO \" + \\ f\"cards VALUES ({card_title}, ...
[ "= super(AddBackdoorForm, self).clean() campaign = cleaned_data.get('campaign') if campaign: confidence = cleaned_data.get('confidence') if not", "AddBackdoorForm(forms.Form): \"\"\" Django form for adding a Backdoor to CRITs. \"\"\" error_css_class =", "(c.name, c.name) for c in get_item_names(Campaign, True)]...
[ ":param trajectories (int): minimum number of trajectories to evaluate. It will be rounded", "in a single environment, which is reset to state before evaluating each action", "\"\"\"Returns the best action out of a random search of action sequences. See", "into a ResettableEnv. Note all MuJoCo environments ar...
[ "= 0.0 for i in range(numTrainDocs): if trainCategory[i] == 1: p1Num += trainMatrix[i]", "trainMatrix[i] p0Denom += sum(trainMatrix[i]) p1Vect = p1Num / p1Denom p0Vect = p0Num /", "vocabSet = vocabSet | set(document) return list(vocabSet) def setOfWords2Vec(vocabList, inputSet): returnVec = [0]", "postingList...
[ ".debugger import Debugger, HaltError, NotHaltedError try: from .dwarf import ELFDebugger except ImportError: pass", "AHB from .debugger import Debugger, HaltError, NotHaltedError try: from .dwarf import ELFDebugger except", "<reponame>segrids/arduino_due<filename>py/debug/__init__.py from .swd import SWD from ...
[]
[]
[ "{ k: v for v in oldendhash.values() for k in v } def", "p1 self.p2 = p2 self.count = 1 def __len__(self): \"\"\"Line segment always has", "range(3)) def scale(self,scale): \"\"\"Translate the endpoint's vertices\"\"\" self.p1 = (self.p1[a] * scale[a] for", "in oldseghash.values() } oldendhash = self.endhash ...
[ "cls = self.__class__ peewee.DeleteQuery(cls).where(cls.key << keys).execute() def list(self, prefix=None, limit=None): cls = self.__class__", "'*' else: wildcard = '%' q = q.where(cls.key % ('%s%s' % (prefix, wildcard)))", "peewee.IntegerField(default=0) class Meta: database = peewee.Proxy() def __init__(self,...
[ "\"\"\" # yapf: enable class Flatten(Module): \"\"\"Flatten Module.\"\"\" def forward(self, input): return input.view(input.size(0),", "depth, stride): \"\"\"Intermediate Resblock of bottleneck. Args: in_channel (int): Input channels. depth (int):", "Conv2d, MaxPool2d, Module, PReLU, ReLU, Sequential, Sigmoid) ...
[ "os.getenv(\"SPOTIFY_USER_ID\")) # get last played tracks num_tracks_to_visualise = int(input(\"How many tracks would you", "the recommended tracks which will be included in your new playlist:\") for index,", "name from user and create playlist playlist_name = input(\"\\nWhat's the playlist name? \")", "seed ...
[ "query string self.assertEqual(req_span.resource, 'GET /') self.assertEqual(req_span.span_type, 'web') self.assertEqual(req_span.error, 0) self.assertIsNone(req_span.parent_id) # Request tags", "'Hello Flask', 200 res = self.client.get('/') self.assertEqual(res.status_code, 200) self.assertEqual(res.data, b'Hello...
[ "os.path.join(args.out_data_dir, \"queries.raw.tsv\") out_manual_queries_file = os.path.join(args.out_data_dir, \"queries.manual.tsv\") out_qrels_file = os.path.join(args.out_data_dir, \"qrels.tsv\") car_id_to_idx_file = os.path.join(args.out_collection_dir,", "idx = car_base_id + i car_id_to_idx[ car_id] = idx #...
[ "* 6378137.0) # Now in degrees band_sqr *= band_sqr n_dest = 0 sig_start[0]", "point and a distance Keyword arguments: pt -- polygon geojson object brng --", "= source[i][\"lat\"] - source[end][\"lat\"] if math.fabs(x23) > 180.0: x23 = 360.0 - math.fabs(x23)", "* math.sin(dist) * math.cos(rad_center[0]), math...
[ "'test' password = 'password' host = 'localhost' database = 'example' port = '5432'", "os.environ['POSTGRES_DB'] port = os.environ['POSTGRES_PORT'] ''' user = 'test' password = 'password' host =", "password = 'password' host = 'localhost' database = 'example' port = '5432' DATABASE_CONNECTION_URI", "user = os...
[ "* sxy - sx * sy) / (n * sx2 - sx**2) a", "x * y) for x, y in xy])) b = (n * sxy", "\"\"\" n = 5 xy = [map(int, input().split()) for _ in range(n)] sx,", "\"\"\" Created on Mon Jun 3 19:26:47 2019 @author: sercangul \"\"\" n =", "sxy = map(sum, zip(*[(x, y, x**2, x * y) for x, y in", "(sy / n) - b * (sx /...
[ "state = np.insert(obs, 0, 0.) qpos = state[:self.model.nq] qvel = state[self.model.nq:] self.set_state(qpos, qvel)", "def _get_obs(self): return np.concatenate([ self.sim.data.qpos.flat[1:], self.sim.data.qvel.flat, ]) def reset_obs(self, obs): state = np.insert(obs,", "= np.insert(obs, 0, 0.) qpos = state[:se...
[ "# where each feature array is a list of [field_idx, feature_idx, feature_value] tuple.", "tf.int64, [None], name=\"dnn_feat_shape\" # ) # def parser_one_line(self, line): # \"\"\"Parse one string", "hparams.FEATURE_COUNT # self.field_cnt = hparams.FIELD_COUNT # self.col_spliter = col_spliter # self.ID_spliter ...
[]
[ "requests.session() self.session.headers.update(headers) self.timeout = timeout def get_request(self, url): response = self.session.get(url, timeout=self.timeout) result", ":param song_id: :return: \"\"\" url = get_song_url(song_id) result = self.get_request(url) return result['songs'][0] def", "get_song_url fr...
[ "replace the one scheduled for deletion. What we need is a node that", "elem yield self.key if self.right: # recurse again for elem in self.right: yield", "splice out and makes the right changes. We could call `delete` recursively, but", "as the `_put` method. Notice that the `_get` method returns a `TreeNode...
[ "using the command arguments to either access a member of the current component,", "def _ParseArgs(fn_args, fn_defaults, num_required_args, kwargs, remaining_args, metadata): \"\"\"Parses the positional and named arguments", "Unless required by applicable law or agreed to in writing, software # distributed", ...
[ "[\"None\"] print(\"\\nUser didn't provided inputs to predict\") print(\"\\n=======================Action Completed========================\") print(f\"::set-output name=myOutput::{output[0]}\") if __name__", "on output variable x_train, x_test, y_train, y_test = train_test_split(x, y, test_size = 0.2,", "Predi...
[ "base64 def parse_basic_auth(header_value): \"\"\" Attempts to parse the given header value as a", "<gh_stars>1000+ import base64 def parse_basic_auth(header_value): \"\"\" Attempts to parse the given header value", "as a Base64-encoded Basic auth header. \"\"\" if not header_value: return None parts", "or pa...
[ "_signals.signal('cloned', \"\"\" Called when an event is cloned. The *sender* is the `Event`", "event is created, so that plugins can add their own fields. The *sender*", "is the event, the old category is in the `old_parent` kwarg. \"\"\") created", "= _signals.signal('moved', \"\"\" Called when an event is...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "language governing permissions and limitations # under the License. from six.moves import urllib", "fake_volume.fake_volume_obj( ctx, **{'pro...
[ "= ( (ox, 'gdf_from_place'), (ox, 'graph_from_bbox'), (requests, 'get'), (requests, 'post'), ) for module,", "a cache directory for use with the tutorials. Parameter --------- cache_dir : Path-like", "(requests, 'get'), (requests, 'post'), ) for module, func_name in make_cache: try: func =", "memory = None de...
[ "t.minutes = temp // 60000 temp %= 60000 t.seconds = temp // 1000", "Timestamp: # a speedrun.com style timestamp e.g. \"3h 53m 233s 380ms\" def __init__(self,", "other.hours: return False if self.minutes < other.minutes: return True elif self.minutes > other.minutes:", "= Timestamp(\"0ms\") temp = ms t.hours ...
[ "self.args_list = ['hx', 'start'] self.patcher = patch('hendrix.ux.findSettingsModule') self.patcher.start() def tearDown(self): super(TestMain, self).tearDown() self.devnull.close()", "test_noise_control_daemonize(self): options = self.DEFAULTS options['quiet'] = True options['daemonize'] = True stdout = sys.std...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "ApplicationCommandInteractionDataOption(TypedDict): name: str type: int value: Optional[str] # Optional[ApplicationCommandOptionType] options: Optional[ApplicationCommandInteractionDataOption] focused: Optional[bool]", "MERCHA...
[ "activeid): \"\"\"手势签到\"\"\" params = { 'courseId': courseid, 'classId': classid, 'activeId': activeid } async", "%H:%M\", time.localtime()), 'status': title } return s async def qcode_sign(self, activeid): \"\"\"二维码签到\"\"\" params", "from typing import Optional, List, Dict from aiohttp import ClientSession fro...
[ "pos = np.array(pos) data = np.array(data) result=get_beta_parameters(f1[np.isin(pos,nonbgpos)!=True]) #a=prob_bb(n1,a1,result[0],result[1]) print(pos,nonbgpos,np.isin(pos,nonbgpos)) with open(args.out_file,'w') as g:", "#plot_histogram(Q,args.output_path+'/'+args.sample_name+'.histogram.png') #if args.vc_method....
[ "KIND, either express or implied. # See the License for the specific language", "x.append(d) def sharding(x): # numpy has proper modulo op that yields non-negative results", "Unless required by applicable law or agreed to in writing, software # distributed", "language governing permissions and # limitations u...
[ "fib\\-common package configuration. This module contains definitions for the following management objects\\: fib\\:", "self.ylist_key_names = [] self._child_classes = OrderedDict([(\"pbts-forward-class-fallbacks\", (\"pbts_forward_class_fallbacks\", Fib.PbtsForwardClassFallbacks)), (\"platform\", (\"platform\", ...
[ "-> str: if self.ex_actions: return \"->\".join(map(repr, self.actions)) + \"\\tEX[\" + \"->\".join(map(repr, self.ex_actions)) +", "Sequence, TYPE_CHECKING from action import Action from core.utility import Array from core.constants import", "player, PlayerForm.ADV, act_ids, ex_act_ids=ex_act_ids) class Dragon...
[ "behavior. If set to ``True`` a permanent session will be refreshed each request", "expire if the browser window closes. Defaults to ``True``. \"\"\" class Config(_DefaultFlaskConfigForSessions): \"\"\"", "\"\"\" SESSION_FILE_DIR = os.path.join(os.getcwd(), 'flask_sessions') \"\"\" The folder where session file...
[ "\"\"\"Internal fit\"\"\" raise NotImplementedError(\"abstract method\") def _predict(self, fh, X=None, return_pred_int=False, alpha=DEFAULT_ALPHA): \"\"\" Make", "y : pd.Series Target time series to which to fit the forecaster. fh", "isinstance(y, pd.Series) and type(y.index) == pd.Int64Index: y, X = _coerce_i...
[ "try: _x = self.link_name length = len(_x) if python3 or type(_x) == unicode:", "position Quaternion orientation ================================================================================ MSG: geometry_msgs/Point # This contains the position of a", "'%s' when writing '%s'\" % (type(te), str(te), str(local...
[ "ValueError: return notebook.metadata[\"kernelspec\"] = kernelspec notebook.metadata.get(\"jupytext\", {}).pop(\"main_language\") def kernelspec_from_language(language): \"\"\"Return the python kernel", "kernelspec_from_language(language): \"\"\"Return the python kernel that matches the current env, or the first"...
[ "vs. malicious input PICKLE_KWARGS = dict(allow_pickle=False) def save_npz(file, matrix, compressed=True): \"\"\" Save a", "See Also -------- scipy.sparse.load_npz: Load a sparse matrix from a file using ``.npz``", "2 stored elements in Compressed Sparse Column format> >>> sparse_matrix.todense() matrix([[0, 0,...
[ "str, parent: str, create: bool = False) -> None: super().__init__(services, name, parent, create)", "simulator.services.services import Services class Atlas(Directory): def __init__(self, services: Services, name: str, parent: str,", "} self._save_metadata(metadata) def append(self, obj: any) -> None: self.sav...
[ "from metadata.generated.schema.api.tests.createTableTest import CreateTableTestRequest from metadata.generated.schema.tests.table import tableRowCountToEqual from metadata.generated.schema.tests.tableTest import TableTestType from", "writing, software # distributed under the License is distributed on an \"AS IS\...
[ "extent=[0, self.WIDTH, 0, self.HEIGHT]) plt.gca().add_patch(matplotlib.patches.Rectangle((bbox[0], bbox[1]), bbox[2], bbox[3], ec='r', fc='none')) plt.show() def check_dataset_image_compability(self,", "= np.zeros((num_imgs, num_objects, 4)) self.imgs = np.zeros((num_imgs, self.WIDTH, self.HEIGHT)) # set backgro...
[ "with knownNodesLock: for stream in knownNodes.keys(): try: knownNodes[stream][peer][\"rating\"] = min(knownNodes[stream][peer][\"rating\"] + increaseAmount, maxRating)", "stream in knownNodes.keys(): try: knownNodes[stream][peer][\"rating\"] = min(knownNodes[stream][peer][\"rating\"] + increaseAmount, maxRating)...
[ "source code is governed by a MIT-style # license that can be found", "in the LICENSE file. import os from chroma_agent.lib.shell import AgentShell from chroma_agent.log import", "from chroma_agent.log import console_log from chroma_agent.device_plugins.action_runner import CallbackAfterResponse from chroma_age...
[ "districts. \"\"\" return geotypes.ElementarySchoolDistrictsDownloader @decorators.downloader def download_secondary_school_districts(self): \"\"\" Download data for secondary school", "a Census API table. \"\"\" import os import logging import pathlib from .", "state. \"\"\" return geotypes.StateLegislativeLow...
[ "''}{metadata.get('RO', '')}.epub\".replace(' ', '_') with ZipFile(output_path.joinpath(output_name), 'w') as zf: os.chdir(tmpdir) # \"The first", "def load_sgf(sgfpath: Path): game = sente.sgf.load(str(sgfpath)) comments = {} seq = game.get_default_sequence() for", "possible directly in sgf-render invocation a...
[ "recommendations. Parameters ----------- length : int Coverage@length training_df : dataframe determines how many", "items = recs.index.unique() self.sum += ( self.pop_scores[ items ].sum() / len( items )", "#count the occurence of every itemid in the trainingdataset self.pop_scores = grp.size() #sort", "are ...
[ ". import views urlpatterns = [ url(r'^settings$', views.household_dashboard, name='household_dashboard'), url(r'^myinfo$', views.my_info, name='my_info'), url(r'^profile$',", "[ url(r'^settings$', views.household_dashboard, name='household_dashboard'), url(r'^myinfo$', views.my_info, name='my_info'), url(r'^prof...
[ "False return result s3.prep = custom_prep return attr settings.customise_hrm_job_title_controller = customise_hrm_job_title_controller # -----------------------------------------------------------------------------", "r.method in (\"create\", \"update\"): script = \\ '''$('#req_req_site_id').change(function(){ v...
[ "#! /usr/bin/env python # -*- coding: utf-8 -*- from main import main main(\"issue561-v1\",", "/usr/bin/env python # -*- coding: utf-8 -*- from main import main main(\"issue561-v1\", \"issue561-v2\")", "<reponame>nitinkaveriappa/downward #! /usr/bin/env python # -*- coding: utf-8 -*- from main import main" ]
[ "# # The full license is in the file LICENSE, distributed with this", "THIS_DIR = os.path.dirname(os.path.abspath(__file__)) self.badsirpath = os.path.join(THIS_DIR, 'data/foo/bin') self.goodsirpath = os.path.join(THIS_DIR, 'data/' 'sirius-linux64-headless-4.0.1/bin') #", "self.ions = qiime2.Artifact.load(os.pa...
[ "block, if over optional threshold.\" start = time.time() try: yield finally: elapsed =", "over optional threshold.\" start = time.time() try: yield finally: elapsed = time.time() -", "an object's attributes, restoring them after the block.\" stored = {} for name", "stored[name] = getattr(obj, name) setattr(o...
[ "as e: logger.error(\"task '%(task_uuid)s' errored: %(e)s\" % locals()) _notify('Errored Task', exception=e) else: logger.debug(\"task", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "locals(...
[ "\"\"' weblogo_opts += ' -C \"#CB2026\" A A' weblogo_opts += ' -C \"#34459C\"", "reading header_cols = ('', 'consensus', 'annotation', 'ic', 'mean', 'std') print('%3s %19s %10s %5s", "ic_start += 1 # trim PWM of uninformative suffix ic_end = filter_pwm.shape[0] -", "Unless required by applicable law or agreed...
[ "path('checkout/', views.CheckOut.as_view(), name=\"checkout\"), path('checkout/<int:address_pk>/', views.CheckOut.as_view(), name=\"checkout\"), path('payment/', views.PaymentChoice.as_view(), name=\"payment-choice\"), path('payment/order/<int:pk>/', views.MomoPayment.as_view(), name=\"momo-payment\"), path('payme...
[ "------- Q : scalar or numpy array The quantiles for the Weibull distribution", "np.array([.1, .2, .3, .4, .5]) >>> ExpoWeibull.qf(p, 3, 4, 1.2) array([1.89361341, 2.2261045 ,", "---------- x : numpy array or scalar The values at which the function", "rate for the ExpoWeibull Distribution: .. math:: h(x) = \\...
[ "# tab = table(a) # assert_iterable_equal(tab.values.flatten(), [10] * 4) tab = table(a, exclude=None)", "24 #----------------- a = letters[:3] tab = table(a, sample(a)) assert sum(tab.values.flatten()) == 3", "'B' not in tab.columns #------------------- d = factor(rep(c(\"A\",\"B\",\"C\"), 10), levels=c(\"A\",...
[ "'d')) us.add_where_clause(WhereClause('a', EqualsOperator(), 'x')) self.assertEqual(unicode(us), 'UPDATE table SET \"a\" = :0, \"c\" =", "UpdateStatementTests(TestCase): def test_table_rendering(self): \"\"\" tests that fields are properly added to the select", "import UpdateStatement, WhereClause, AssignmentC...
[ "self.callback = cb def _handle_event(self, e): if self.enabled and e.inaxes == self.ax: #", "def _handle_event(self, e): if self.enabled and e.inaxes == self.ax: # TODO: exclude spacing", "a bit of spacing self.ax.add_patch(Rectangle((0,(1.0-rsize)/2), rsize, rsize, fill=True)) # setup event handling self.canv...
[ "\"--size\", type=int, default=3, help='Generate SxS field. size must be in [3, 8]. Default", "x: ' '.join(map(str, x)), data) with open(output_file, 'w', encoding='utf-8') as f: f.write('\\n'.join(lines)) def", "hitori_generator import Generator from argparse import ArgumentParser def generate(n: int, output_f...
[ "= dictionary['Filter'] del dictionary['Filter'] if dictionary.has_key('DecodeParms'): selected_params = dictionary['DecodeParms'] deletion_list.append((dictionary, 'DecodeParms')) #del dictionary['DecodeParms']", "self.text = \"%d %d\"%(n,g) def to_python(self): return tuple([int(i) for i in self.text.split(' ')...
[ "bias_variable([32]) h_conv1 = tf.nn.relu(conv2d(x_image, w_conv1) + b_conv1) h_pool1 = max_pool_2x2(h_conv1) w_conv2 = weight_variable([5,", "tf.nn.relu(conv2d(h_pool1, w_conv2) + b_conv2) h_pool2 = max_pool_2x2(h_conv2) # 全连接层 w_fc1 = weight_variable([7 *", "y = tf.nn.softmax(tf.matmul(x, a) + b) return y, [a...
[ "txinfo.transfers_net if len(transfers_in) == 1 and len(transfers_out) == 1: sent_amount, sent_currency, _, _", "= txinfo.transfers_net if \"MintTo\" in log_instructions and len(transfers_out) == 1 and len(transfers_in) ==", "from sol.handle_simple import handle_unknown_detect_transfers def handle_metaplex(expo...
[ "U-centered matrices u_x = _dcor_internals._distance_matrix_generic( x, centering=_dcor_internals.double_centered, exponent=exponent) u_y = _dcor_internals._distance_matrix_generic( y, centering=_dcor_internals.double_centered,", ":func:`distance_correlation_t_test`. Parameters ---------- x: array_like First rand...
[ "for CIS properties. \"\"\" print(\"printing cis\") print(\" fname: {}\".format(self.fname)) print(\" classname: {}\".format(self.classname)) print(\"", "type, min, max): \"\"\" Add a variable to the set of variables. \"\"\"", "variable = self.variables[name] return variable def get_image(self,name): \"\"\" Ret...
[ "#pyglet.options['debug_gl_trace'] = True #pyglet.options['debug_texture'] = True #fos modules from fos.actor.axes import Axes from", "== '__main__': subject = 5 seeds = 1 qb_dist = 30 #load T1", "tracks registered in MNI space fdpyw = 'data/subj_'+(\"%02d\" % subject)+'/101_32/DTI/tracks_gqi_'+str(seeds)+'M_li...
[ "gray, scaleFactor=1.2, minNeighbors=3, minSize=(140, 140)) gender_classifier = load_model( \"classifier/gender_models/simple_CNN.81-0.96.hdf5\") gender_labels = {0: '女',", "face = img[(y - 60):(y + h + 60), (x - 30):(x +", "keras.models import load_model import numpy as np import chineseText img = cv2.imread(\...
[ "exp_code, msg=fail_msg(endpoint, resp)) return resp def req_fails_perms(self, method, endpoint, data=None): \"\"\" Performs a", "self.request(method, endpoint, exp_code=status.HTTP_200_OK, data=data) # ----- MODEL GENERATION ----- def random_objs(clazz, n=1): \"\"\"", "method, endpoint, exp_code=None, data=Non...
[ "calcCubicArcLength_cached(p0, p1, p2, p3) elif t == \"lineTo\": pass # todo return length", "b[0]), b[1] + (2/3)*(a[1] - b[1])) c3 = (b[0], b[1]) return [c1, c2,", "t == \"curveTo\": p1, p2, p3 = pts p0 = self.pen.value[i-1][-1][-1] length_arc =", "calcCubicArcLength_cached(*a) if _length + length_a > end: e...
[ "set initial score score = 0 while True: action = agent.act(state, eps) env_info", "the environment, your agent must get an average score of +13 over 100", "maximum number of training episodes eps_start (float): starting value of epsilon, for epsilon-greedy", "many yellow bananas as possible while avoiding bl...
[ "ECABasicBlock planes = [32, 64, 64, 128, 128, 128, 128] layers = [1,", "MinkLoc(in_channels=in_channels, feature_size=model_params.feature_size, output_dim=model_params.output_dim, planes=model_params.planes, layers=model_params.layers, num_top_down=model_params.num_top_down, conv0_kernel_size=model_params.conv0...
[ "PhidgetException(result) def openWaitForAttachment(self, timeout): _timeout = ctypes.c_uint32(timeout) __func = PhidgetSupport.getDll().Phidget_openWaitForAttachment __func.restype = ctypes.c_int32", "= ctypes.c_int32 result = __func(ctypes.byref(_LibraryVersion)) if result > 0: raise PhidgetException(result) re...
[ "'/auctions' response = self.app.post_json(entrypoint, request_data) self.assertEqual(response.status, expected_http_status) def create_auction_check_minNumberOfQualifiedBids(self): expected_minNumberOfQualifiedBids = 2 request_data", "= {\"data\": self.auction} entrypoint = '/auctions' response = self.app.post_j...
[ ") assert result == \"Hello World!\" assert len(tracked_requests) == 1 tracked_request = tracked_requests[0]", "broker=\"memory://\") # Enable Scout by default in tests. if config is None: config", "tracked_request.tags[\"is_eager\"] is False assert tracked_request.tags[\"exchange\"] == \"\" assert tracked_requ...
[ "('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50, db_index=True)), ('article', self.gf('django.db.models.fields.CharField')(max_length=2)), ('verbose_name', self.gf('django.db.models.fields.TextField')()), ('verbose_name_plu...
[ "# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK", "def type(self) -> str: \"\"\" Resource type \"\"\" return pulumi.get(self, \"type\") @property @pulumi.getter(name=\"updatedAt\")", "topic_name: The topic name. \"\"\" __args__ = dict() __args__['namespaceName'] = namespace_name __args_...
[ "Target 60Hz frame rate, using the largest possible line time in order to", "to be an overt act of # relinquishment in perpetuity of all present", "TOUCH_RESISTIVE = False TOUCH_CAPACITIVE = False TOUCH_GOODIX_CAPACITIVE = False # Define RGB output", "constants needed by the EVE based on the timing # Active h...
[ "None] = None, protocol='app', n_prevpoints: int = None, n_repetitions: int = 1, eval_budget:", "= None, n_repetitions: int = 1, eval_budget: int = None, error: Union[Callable, str]", "{qp.error.QUANTIFICATION_ERROR_NAMES}') def __generate_predictions(self, model, val_split): commons = { 'n_repetitions': self.n...
[ "@app.cli.command() def test(): \"\"\" run the unit tests \"\"\" import unittest tests =", "from app.models import User, Role, PoseToLocation app = create_app(os.getenv('FLASK_CONFIG') or 'default') migrate =", "or 'default') migrate = Migrate(app, db) # migrate 的新建 我们需要扫描到这些文件我们才能创建 @app.shell_context_processo...
[ "with open(INPUT_FILE) as f: heights = [[int(x) for x in line.strip()] for line", "\"\"\" Parses the input and returns a Heightmap \"\"\" with open(INPUT_FILE) as f:", "= get_basins(heightmap, low_points) basin_sizes = sorted((len(basin) for basin in basins), reverse=True) return basin_sizes[0]", "low_points ...
[ "GObject GObject.threads_init() import time from lib.args import Args from lib.loghandler import LogHandler import", "Connection def testCallback(args): log = logging.getLogger(\"Test\") log.info(str(args)) class Voctoconfig(object): def __init__(self): self.log =", "Mainloop\") self.mainloop = GObject.MainLoop...
[ "epoch). \"\"\" def __init__( self, writer: SummaryWriter, train_interval: int = 1000, test_interval: int", "int = 1000, test_interval: int = 1, update_interval: int = 1000, save_interval: int", "1000, test_interval: int = 1, update_interval: int = 1000, save_interval: int = 1,", "Default to 1 (save at the en...
[ "get_position_y(self): self._jetfuel.Menu_get_position_y.argtypes = [c_void_p]; self._jetfuel.Menu_get_position_y.restype = c_int; return self.Menu_get_position_y(self.drawableref); def set_position(self, x, y):", "KIND, either express or implied. # See the License for the specific language", "def __init__(self...
[ "init_rng, 'dropout': init_rng}, jnp.ones(io_shape, jnp.float32), jnp.ones(io_shape, jnp.float32), jnp.ones(program_shape, jnp.float32)) optimizer_def = optim.Adam( FLAGS.lr,", "predicted = tohost(predicted) inputs, outputs, programs = map(tohost, (inputs, outputs, programs)) pred_denominator +=", "local device...
[ "{lat1}°) and (lon: {lon2}°, lat: {lat2}°)\") plt.ylabel(\"depth(km)\") plt.show() if __name__ == \"__main__\": main()", "required=True, type=float, help=\"lon2\") @click.option('--lat1', required=True, type=float, help=\"lat1\") @click.option('--lat2', required=True, type=float, help=\"lat2\") @click.option('--d...
[ "import HerokuConfig def create_sample_app(): app = Flask('testapp') HerokuConfig(app) return app def test_herokupostgres(monkeypatch): monkeypatch.setenv('HEROKU_POSTGRESQL_ORANGE_URL',", "HerokuConfig(app) return app def test_herokupostgres(monkeypatch): monkeypatch.setenv('HEROKU_POSTGRESQL_ORANGE_URL', 'herok...
[ "logger \"\"\" logger = logging.getLogger('FLASK_LOG') logger.setLevel(logging.DEBUG) stream_log = logging.StreamHandler() stream_log.setFormatter(formatter) logger.addHandler(stream_log) # if", "datefmt='%Y-%m-%d:%H:%M:%S') \"\"\" Set Flask logger \"\"\" logger = logging.getLogger('FLASK_LOG') logger.setLevel(lo...
[ "sys.stdout.write( \"\\r%s %s / %s (%.2f%%)\" % ( self._filename, self._seen_so_far, self._size, percentage)) sys.stdout.flush()", "to %s on S3 bucket %s' % (full_path, s3_object_name, settings.S3_BACKUP_BUCKET)) s3.upload_file(full_path, settings.S3_BACKUP_BUCKET, s3_object_name,", "bytes_amount percentage = (...
[ "self.vnf_config[\"vnf\"], \"topology_template.groups\")) # Class attributes for instance, vnf and module VF self.service_infos =", "self.vnf_config[\"vnf\"], \"metadata.UUID\") def set_vnf_var(self): \"\"\" set vnf variables from the config file \"\"\"", "we set mrf kwargs[\"case\"] = \"mrf\" self.vnf_config[\...
[ "self._control1.add_event( b, e, track=random.randint(0,self.N_TRACKS) ) self._control1.value = e def __addEvent2(self): b = self._control2.value", "self._start) def __addEvent1(self): b = self._control1.value e = b+self.INTERVAL self._control1.add_event( b, e, track=random.randint(0,self.N_TRACKS)", "the forms...
[ ") self.image_window = image_window self.geot = geot return crop def get_candidate_images(self): return self.image_manager.get_candidate_images(", "if self.images_in_list: if self.current_image not in self.images_in_list: self.bring_new_image(self.images_in_list[0]) else: self.bring_new_image(self.current_image) ...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "def _test_show_security_group_default_rule(self, bytes_body=False): self.check_service_client_function( self.client.show_security_group_default...
[ "the random passoword. return \"\".join(JoinChars[0:PassLen]) # Code Logic here. LOG.WARN_LOG(\"Initialized PassGen!\") LOG.STATUS_LOG(\"Generating a", "LOG: def INFO_LOG(message): CurrentTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') print(f\"{CurrentTime} - INFO: {message}\") def STATUS_LOG(messag...
[ "= Memo.valid_references(references) for i in range(len(refs['valid_refs'])): parsed_ref = Memo.parse_reference(refs['valid_refs'][i]) user = User.find(username=parsed_ref[0]) MemoReference.add_ref(self.id,ref_user_id=user.username,ref_memo_number=parsed_ref[1],ref_memo_version=parsed_ref[2])", "Memo(number = mem...
[ "\"http://localhost/fake/base/url\" settings.MITX_ALT_URL = \"http://localhost/fake/alt/url\" return settings @pytest.fixture(autouse=True) def oll_settings(settings): \"\"\"Test settings for MITx", "fixtures\"\"\" import json import pytest @pytest.fixture(autouse=True) def mitx_settings(settings): \"\"\"Test set...
[ "output PNG file to write on disk \"\"\" # Get a complex value", "Vertical mirroring and concatenate juliamirror = np.flip(julia, axis=0) julia = np.concatenate((julia, juliamirror), axis=0)", "dictionary and set attributes. :param kwargs: a dictionary in the form `{'arg1':value, ...,", "is mirrored horizonta...
[ "detect eyes using webcam # tutorial: https://www.roytuts.com/real-time-eye-detection-in-webcam-using-python-3/ import cv2 import math import numpy", "+ h, x : x + w] eyes = eyeCascade.detectMultiScale(roi_gray) for (ex, ey,", "as np def main(): faceCascade = cv2.CascadeClassifier(\"haarcascade_frontalface_alt....
[ "fh: fh.readline() for line in fh: cols = line.strip('\\n').split('\\t') if cols[1]: descripts[cols[0]] =", "cols = line.strip('\\n').split('\\t') if cols[1]: descripts[cols[0]] = cols[1].split('[')[0].strip() else: descripts[cols[0]] = cols[1] with", "{} with open('macaca_genes.txt') as fh: fh.readline() for l...
[ "num_sources, event_parameters, allow_repeated_label ) return _args args = [arg_tuple(i) for i in range(num_mixtures)]", "logging.exception( f\"Got an error for {label} @ {_source_file}. Moving on...\") sc.generate( path_to_file, path_to_file.replace('.wav',", "args = [arg_tuple(i) for i in range(num_mixtures)]...