ngram
listlengths
0
82k
[ "= \"CREATE TABLE IF NOT EXISTS cards('card_title' VARCHAR,\" + \\", "+ \\ f\"cards VALUES ({card_title}, {card_text}, {card_link_text}, {card_link_url})\" try: cur.execute(create_table_query)", "{card_link_url})\" try: cur.execute(create_table_query) cur.execute(insert_data_query) con.commit() except: print(\"...
[ "'low'), ('medium', 'medium'), ('high', 'high')] self.fields['source'].choices = [ (c.name, c.name)", "super(AddBackdoorForm, self).clean() campaign = cleaned_data.get('campaign') if campaign: confidence = cleaned_data.get('confidence')", "crits.core import form_consts from crits.vocabulary.relationships import...
[ "\"\"\"Shuts down parallel workers.\"\"\" for remote in self.remotes: remote.send((\"close\", None))", "dynamics = dynamic_fn_wrapper.var() dynamics.reset() mc = MonteCarloSingle(dynamics, horizon, trajectories) try:", "process crashes, we should not cause things to hang process.start()", "in range(self.traje...
[ "p0Num += trainMatrix[i] p0Denom += sum(trainMatrix[i]) p1Vect = p1Num /", "[0, 1, 0, 1, 0, 1] # 1 is abusive,", "'stupid'], ['my', 'dalmation', 'is', 'so', 'cute', 'I', 'love', 'him'], ['stop',", "'him', 'to', 'dog', 'park', 'stupid'], ['my', 'dalmation', 'is', 'so', 'cute',", "'please'], #[0,0,1,1,1.........
[ "Debugger, HaltError, NotHaltedError try: from .dwarf import ELFDebugger except ImportError:", ".ahb import AHB from .debugger import Debugger, HaltError, NotHaltedError try:", "HaltError, NotHaltedError try: from .dwarf import ELFDebugger except ImportError: pass", "AHB from .debugger import Debugger, HaltEr...
[]
[]
[ "\"\"\"Given 2 endpoints, return the (new or cached) LineSegment3D inst.\"\"\"", "(p2, p1) if key not in self.seghash: return None return", "for a in range(3)) self.p2 = (self.p2[a] + offset[a] for", "+ sfx def __repr__(self): \"\"\"Standard string representation.\"\"\" return \"<LineSegment3D: {0}>\".format(...
[ "if table_name: self._meta.db_table = table_name self._meta.database.initialize(db_connection) def multiget(self, keys): cls", "multiget(self, keys): cls = self.__class__ res = self.select(cls.key, cls.value) \\", "= self.__class__ res = self.select(cls.key, cls.value) \\ .where(cls.key << keys", "unique=True...
[ "Must be one of [50, 100, 152]'. format(num_layers)) return blocks", "bias=False), PReLU(depth), Conv2d(depth, depth, (3, 3), stride, 1, bias=False), BatchNorm2d(depth),", "A list of block configs. \"\"\" if num_layers == 50:", "i in range(num_units - 1)] def get_blocks(num_layers): \"\"\"Get block configs", ...
[ "playlist playlist_name = input(\"\\nWhat's the playlist name? \") playlist =", "tracks you'd like to use as seeds. Use indexes separated", "are the recommended tracks which will be included in your", "create playlist playlist_name = input(\"\\nWhat's the playlist name? \") playlist", "track in enumerate(la...
[ "200) # Handler span handler_span = spans[4] self.assertEqual(handler_span.service, 'flask') self.assertEqual(handler_span.name,", "'fivehundredone') self.assertEqual(req_span.get_tag('flask.url_rule'), '/501') # Dispatch span dispatch_span = spans[3] self.assertEqual(dispatch_span.service,", "created self.asse...
[ "passage ids into a dictionary \"\"\" sim_dict = {} lines", "text)) print(\"Removed \" + str(removed) + \" passages\") print(\"Dumping id", "as f: car_id_to_idx = pickle.load(f) else: sim_dict = parse_sim_file(sim_file) car_base_id", "line in lines: data = line.strip().split(':') if len(data[1]) > 0:", "top...
[ "further processing n_stack += 1 sig_start[n_stack - 1] = sig", "http://paulbourke.net/geometry/polyarea/javascript.txt Keyword arguments: poly -- polygon geojson object return polygon", "coordTransform_utils import wgs84togcj02 from coordTransform_utils import gcj02tobd09 def linestrings_intersect(line1, line2...
[ "os.environ['POSTGRES_USER'] password = os.environ['<PASSWORD>'] host = os.environ['POSTGRES_HOST'] database = os.environ['POSTGRES_DB']", "user = 'test' password = 'password' host = 'localhost' database", "'password' host = 'localhost' database = 'example' port = '5432'", "= os.environ['<PASSWORD>'] host = o...
[ "b * (sx / n) print('{:.3f}'.format(a + b * 80))", "zip(*[(x, y, x**2, x * y) for x, y in", "= 5 xy = [map(int, input().split()) for _ in range(n)]", "xy = [map(int, input().split()) for _ in range(n)] sx, sy,", "input().split()) for _ in range(n)] sx, sy, sx2, sxy =", "n) - b * (sx / n) print('{:.3f}'.fo...
[ "]) def reset_obs(self, obs): state = np.insert(obs, 0, 0.) qpos", "def reset_obs(self, obs): state = np.insert(obs, 0, 0.) qpos =", "reset_obs(self, obs): state = np.insert(obs, 0, 0.) qpos = state[:self.model.nq]", "obs): state = np.insert(obs, 0, 0.) qpos = state[:self.model.nq] qvel", "import numpy as n...
[ "An iterator that will yields parsed results, in the format", "self.batch_size: # res = self._convert_data(label_list, features_list) # yield self.gen_feed_dict(res), impression_id_list,", "# impression_id_list.append(impression_id) # cnt += 1 # if cnt ==", "further operation. # Args: # labels (list): a list ...
[ "create_array(n): res=[] i=1 while i<=n: res.append(i) i += 1 return", "def create_array(n): res=[] i=1 while i<=n: res.append(i) i += 1", "res=[] i=1 while i<=n: res.append(i) i += 1 return res" ]
[ ":return: \"\"\" url = song_download_url csrf = '' params =", "'br': bit_rate, 'csrf_token': csrf} result = self.post_request(url, params) song_url =", "get_song(self, song_id): \"\"\" Get song info by song id :param", ":return: \"\"\" url = get_artist_url(artist_id) result = self.get_request(url) return resu...
[ "key value in the right subtree of the node having", "`_get` and return `True` if `_get` returns a value, or", "we begin our implementation with the `put` functionality. In order", "operator. One of the more interesting methods of `TreeNode` provides", "the key we want to delete, there are three cases", "...
[ "if inspect.isclass(component) or inspect.isroutine(component): # The component is a class", "remaining_args[1:] filename = None lineno = None component_trace.AddAccessedProperty( component, target,", "show_help = parsed_flag_args.help show_trace = parsed_flag_args.trace # component can be", "line is fewer th...
[ "pandas as pd from sklearn.svm import SVC from sklearn.model_selection import", "= train_test_split(x, y, test_size = 0.2, random_state=0) #define a pipeline", "output = pipe.predict([inputs]) print(output) else: output = [\"None\"] print(\"\\nUser didn't", "pd.read_csv(dataset_path) print() print(data.descri...
[ "= header_value.split(\" \") if len(parts) != 2 or parts[0].lower() !=", "Attempts to parse the given header value as a Base64-encoded", "a Base64-encoded Basic auth header. \"\"\" if not header_value: return", "\"basic\": return None try: basic_parts = base64.b64decode(parts[1]).split(\":\", 1) if len(basic_...
[ "is the event object. The `user` kwarg contains the user", "available. \"\"\") updated = _signals.signal('updated', \"\"\" Called when basic data", "object. The `user` kwarg contains the user performing the deletion", "the session. \"\"\") session_block_deleted = _signals.signal('session-block-deleted', \"\"\...
[ "from cinder import exception from cinder.tests.unit import fake_constants as fake", "``ScaleIODriver.delete_volume()``\"\"\" def setUp(self): \"\"\"Setup a test case environment. Creates a", "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "distributed on an \"AS IS\" B...
[ "with the tutorials. Parameter --------- cache_dir : Path-like or False,", "osmnx as ox import joblib import requests from .files import", "location = None memory = joblib.Memory(location, compress=compress, verbose=verbose, **kwargs) make_cache", "memory, cache_dir if location is None: location = appdirs.use...
[ "except Exception as e: return False class Timestamp: # a", "requests.models import PreparedRequest def is_valid_url(url): prepared_request = PreparedRequest() try: prepared_request.prepare_url(url,", "return True elif self.minutes > other.minutes: return False if self.seconds", "other.minutes and self.second...
[ "from hendrix import ux from mock import patch class TestMain(HendrixTestCase):", "with patch('time.sleep'): with patch('subprocess.Popen') as popen: popen.return_value = Process() ux.main()", "django_settings) def test_settings_wsgi_absense(self): with patch('hendrix.ux.findSettingsModule') as findSettingsMod:...
[ "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO", "7] class _InteractionResponseOptional(TypedDict, total=False): data: InteractionApplicationCommandCallbackData class InteractionResponse(_InteractionResponseOptional): type: InteractionResponseType", "substantial portions of the So...
[ "text } async def addr_sign(self, activeid): \"\"\"位置签到\"\"\" params = {", "* from message import server_chan_send class AutoSign(object): def __init__(self, username,", "签到课程, 签到时间, 签到状态 sign_msg = { 'name': d['classname'], 'date': resp['date'],", "url = 'https://pan-yz.chaoxing.com/api/token/uservalid' asyn...
[ "scipy.special import comb import argparse import sys def parseArgs(): '''Function", "file with non-background positions') parser.add_argument('-out', '--out_file',dest='out_file',help=\"name of output file, default", "/ v-1 ) b0=(1-m)*(m * (1-m) / v-1 ) result=fmin(betaNLL,[a0,b0],args=(data,))", "import bet...
[ "np.testing.assert_array_equal( expected, workspace.FetchBlob(name) ) if __name__ == \"__main__\": import unittest", "2.0 (the \"License\"); # you may not use this file", "language governing permissions and # limitations under the License. ########################################################################...
[ "'fib-common-cfg' _revision = '2017-05-01' def __init__(self): super(Fib, self).__init__() self._top_entity =", "super(Fib, self).__init__() self._top_entity = None self.yang_name = \"fib\" self.yang_parent_name =", "= 'fib-common-cfg' _revision = '2017-05-01' def __init__(self): super(Fib, self).__init__() sel...
[ "from __future__ import annotations from typing import Optional, Sequence, TYPE_CHECKING", "Array from core.constants import PlayerForm, SimActKind, MomentType from core.database import", "kind=SimActKind.COMBO, form=form, index=idx + 1)) self.ex_actions = None if ex_act_ids:", "combo chain\"\"\" from __futur...
[ "A :class:`~flask_unchained.bundles.sqlalchemy.SQLAlchemy` extension instance. \"\"\" SESSION_SQLALCHEMY_TABLE = 'flask_sessions' \"\"\" The", "only be attached to requests if those requests are \"same-site\".", "\"\"\" Set this if you need to customize the :class:`~flask_unchained.bundles.sqlalchemy.BaseModel`...
[ "start to end of forecasting # horizon, but only return", "numpy as np import pandas as pd from sktime.forecasting.base._base import", "end) # statsmodels forecasts all periods from start to end", "optional (default=None) The forecasters horizon with the steps ahead to", "coding: utf-8 -*- __author__ = [\"<...
[ "= 0. self.ixx = 0. self.ixy = 0. self.ixz =", "inertia float64 iyz # moment of inertia float64 izz #", "composed of position and orientation. Point position Quaternion orientation ================================================================================", "as e: raise genpy.DeserializationError(e) # m...
[ "name, \"language\": language, \"display_name\": kernel_specs.display_name, } raise ValueError(\"No kernel found", "reraise try: # I prefer not to take a dependency", "def kernelspec_from_language(language): \"\"\"Return the python kernel that matches the current", "kernel found that matches the current pytho...
[ "loaded. Returns ------- result : csc_matrix, csr_matrix, bsr_matrix, dia_matrix or", "will be loaded. Returns ------- result : csc_matrix, csr_matrix, bsr_matrix,", "cls((loaded['data'], loaded['indices'], loaded['indptr']), shape=loaded['shape']) elif matrix_format == 'dia': return cls((loaded['data'],", "s...
[ "-> None: self.save(str(self._get_next_index()), obj) self._increment_index() def load_all(self, max_els: int =", "if create: metadata: Dict[str, any] = { \"next_index\": 0, }", "Dict[str, any]) -> None: super().save(\"metadata\", metadata) def _get_metadata(self) -> Dict[str,", "Atlas(Directory): def __init_...
[ "compliance with the License. # You may obtain a copy", "an \"AS IS\" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF", "2.0 (the \"License\"); # you may not use this file", "agreed to in writing, software # distributed under the License", "file except in compliance with the License. # You may", "on an \"AS ...
[ "min(y1 + h1, y2 + h2) - max(y1, y2) if", "annot[1] * self.HEIGHT return [x,y,w,h] def convertYoloAnnotToCoord(self, yolo_annot): ''' yolo_annot", "i_subplot in range(1, 11): plt.subplot(1, 10, i_subplot) i = np.random.randint(len(pred_bboxes))", "for i_img in range(num_imgs): for i_object in range(num_object...
[ "KeyError: pass def decreaseRating(peer): decreaseAmount = 0.1 minRating = -1", "def increaseRating(peer): increaseAmount = 0.1 maxRating = 1 with knownNodesLock:", "= None): if dirName is None: dirName = state.appdata with", "oldestList = sorted(knownNodes[recAddrStream], key=lambda x: x['lastseen'])[:knownN...
[ "console_log from chroma_agent.device_plugins.action_runner import CallbackAfterResponse from chroma_agent.lib.pacemaker import PacemakerConfig def", "at_time]) console_log.info(\"Terminating\") os._exit(0) raise CallbackAfterResponse(None, _shutdown) def reboot_server(at_time=\"now\"): def _reboot():", "This w...
[ "for all divisions. \"\"\" return geotypes.DivisionsDownloader @decorators.downloader def download_states(self): \"\"\"", "all divisions. \"\"\" return geotypes.DivisionsDownloader @decorators.downloader def download_states(self): \"\"\" Download", "in the provided state. \"\"\" return geotypes.StateLegislative...
[ "print(f'{output_path.joinpath(output_name)} generated') if __name__ == \"__main__\": parser = argparse.ArgumentParser( description='')", "master file print('Prepare content.opf file') template = jinja2.Template( TEMPLATEDIR.joinpath('EPUB', 'content.opf').open().read())", "'page_001.html').open().read()) print...
[ "session=0, pop_bin=None, position=None): ''' Update the metric with a result", "self.train_actions = len(training_df.index) #group the data by the itemIds grp", "''' return (\"Popularity@\" + str( self.length ) + \": \"),", "must be sorted correctly. Parameters -------- result: pandas.Series Series of", "s...
[ "from . import views urlpatterns = [ url(r'^settings$', views.household_dashboard, name='household_dashboard'),", "[ url(r'^settings$', views.household_dashboard, name='household_dashboard'), url(r'^myinfo$', views.my_info, name='my_info'), url(r'^profile$', views.household_profile, name='maintain_household'),", ...
[ "True, # module_type = 10 # )), (\"asset\", Storage( name_nice", "#3: T(\"Reject\"), #4: T(\"Surplus\") } # ----------------------------------------------------------------------------- # Organisations #", "\"eden_nyc\" # Uncomment to show created_by/modified_by using Names not Emails", "Uncomment to disable ...
[ "# -*- coding: utf-8 -*- from main import main main(\"issue561-v1\",", "/usr/bin/env python # -*- coding: utf-8 -*- from main import", "python # -*- coding: utf-8 -*- from main import main", "<reponame>nitinkaveriappa/downward #! /usr/bin/env python # -*- coding: utf-8 -*- from", "#! /usr/bin/env python # -...
[ "= os.listdir(result.get_path()) self.assertTrue(('summary_csi_fingerid.csv' in contents)) if __name__ == '__main__': main()", "TestCase, main import qiime2 import os from q2_qemistree import MGFDirFmt,", "main import qiime2 import os from q2_qemistree import MGFDirFmt, SiriusDirFmt,", "in the file LICENSE, d...
[ "time import datetime import contextlib @contextlib.contextmanager def patch(obj, **attrs): \"Monkey", "patch an object's attributes, restoring them after the block.\" stored", "of a block, if over optional threshold.\" start = time.time()", "stored[name] = getattr(obj, name) setattr(obj, name, attrs[name]) t...
[ "cfg.OptGroup(name='worker', title='Worker options') CFG.register_group(worker_group) CFG.register_opts(worker_opts, group=worker_group) def _perform_task(task): def _notify(event_type,", "import db from tempo import notifier from tempo import queue", "as a daemon'), cfg.StrOpt('publisher_id', default='host', h...
[ "t0)) # adjust for fourier job['fourier'] = 'train_out_imag' in data_open", "seq = line.rstrip() nsites += 1 if len(pwm_counts) == 0:", "left_pad # print fasta file of positive outputs filter_fasta_out =", "NO --fineprint \"\"' weblogo_opts += ' -C \"#CB2026\" A A'", "p = spearmanr(filter_outs_seq[:, fi], s...
[ "name=\"payment-choice\"), path('payment/order/<int:pk>/', views.MomoPayment.as_view(), name=\"momo-payment\"), path('payment/momo/<int:pk>/confirm/', views.ConfirmMomoPayment.as_view(), name=\"confirm-momo-payment\"), path('orders/', views.OrderList.as_view(), name=\"order-list\"),", "views.add_product_to_cart_j...
[ "0.8, 0.9, 0.95, 0.99, 0.999, 0.9999] self.param_names = ['alpha', 'beta',", "import integrate from scipy.optimize import minimize from surpyval import parametric", "* np.exp(-(x/alpha)**beta) def hf(self, x, alpha, beta, mu): r\"\"\" Instantaneous", "value(s) of the instantaneous hazard rate at x. Examples -...
[ "== 6 #----------------- with data_context(airquality) as _: qt = stats.quantile(f.Temp)", "iris) with pytest.raises(ValueError): table(warpbreaks.wool, iris) with pytest.raises(ValueError): table(iris.iloc[:, []]) with", "3) tab = table(b, exclude=\"B\") assert tab.shape == (1, 2)", "['A', 'B'] assert_iterab...
[ "import * class UpdateStatementTests(TestCase): def test_table_rendering(self): \"\"\" tests that fields", "UpdateStatement, WhereClause, AssignmentClause from cqlengine.operators import * class UpdateStatementTests(TestCase): def", "self.assertEqual(us.get_context(), {'0': 'b', '1': 'd', '2': 'x'}) def test_co...
[ "None: self.label = name # reuse else: self.label = label", "self.callback = cb def _handle_event(self, e): if self.enabled and e.inaxes", "not self.ticked self.redraw() if self.callback != None: self.callback(self.name, self.ticked) def", "self.ax.figure.canvas # draw text if len(self.label): self.text = sel...
[ "8]. Default is 3') args = p.parse_args() generate(args.size, args.filename) if", "8: print(\"It isn't valid size\") exit(4) generator = Generator(n) data", "-> None: if n < 3 or n > 8:", "def generate(n: int, output_file: str) -> None: if n <", "p.add_argument('filename', type=str, help='Path to output fil...
[ "attribs['span'] for attr_key, attr_val in attribs.items(): xml.set(attr_key, str(attr_val)) for child", "in self.xpath('./indirect_object')]) def has_key(self,key): key = \"%d %d\"%key return len(self.xpath('./indirect_object[@id=\"%s\"]'%key))>0", "dest = \"%d %d\"%r.value dotdata += '\\t\"%s\" -> \"%s\";\\n'...
[ "= tf.Variable(tf.zeros([784, 10]), name=\"a\") b = tf.Variable(tf.zeros([10]), name=\"b\") y =", "convolutional(x, keep_prob): def conv2d(x, w): return tf.nn.conv2d(x, w, [1, 1,", "1, 1, 1], padding='SAME') def max_pool_2x2(x): return tf.nn.max_pool( x, ksize=[1,", "ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], ...
[ "handle_nft_mint(exporter, txinfo): transfers_in, transfers_out, transfers_unknown = txinfo.transfers_net if len(transfers_in) ==", "= txinfo.transfers_net if len(transfers_in) == 1 and len(transfers_out) == 1:", "log_instructions and len(transfers_out) == 1 and len(transfers_in) == 0: return", "handle_metapl...
[ "u_y = _dcor_internals._distance_matrix_generic( y, centering=_dcor_internals.double_centered, exponent=exponent) # Use the dcov", "proj(u_x) p_yz = proj(u_y) # Use the pdcor statistic def", "0, 1], ... [0, 1, 1, 1], ... [1, 1,", "for two random vectors. The test is a permutation test", "dcor.independence.d...
[ "colormap = None if name in self.colormaps: colormap = self.colormaps[name]", "# check for duplicates self.images[name] = image.image(name) return self.images[name] def", "yield i def set_dims(self, w, h): \"\"\" Set the dimensions", "check for duplicates self.variables[name] = {'type':type, 'min':min, 'max':...
[ "Spaghetti using Diffusion Imaging in Python (dipy.org) and Free On", "labeler import TrackLabeler from fos.actor.slicer import Slicer #dipy modules from", "the world to the window wi.attach(w) #create a manager which", "wi.attach(w) #create a manager which can handle multiple windows wm", "== '__main__': s...
[ "= chineseText.cv2ImgAddText(img, gender, x + h, y, color, 30) cv2.imshow(\"Image\",", "w + 30)] face = cv2.resize(face, (48, 48)) face =", ") gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces = face_classifier.detectMultiScale( gray, scaleFactor=1.2,", "w, h) in faces: face = img[(y - 60):(y +", "= cv2.Ca...
[ "blank attendances as necessary. Returns the created profile. \"\"\" student", "for them as follows: - 2 coords per course -", "role=role ) def create_empty_section_for(mentor): \"\"\" Creates a section for MENTOR", "range(JM_COUNT): jm = assign(Profile.JUNIOR_MENTOR, sm, c, juniors) for _ in", "6)): studen...
[ "p2, p3) if _length + length_arc < end: _length +=", "if not ended: out.append((t, pts)) if out[-1][0] != \"endPath\": out.append((\"endPath\",[]))", "end: ended = True out.append((\"curveTo\", a[1:])) else: t += inc", "__length_cache[abcd] = l return l class CurveCutter(): def __init__(self, g,", "if _leng...
[ "scores eps = eps_start # initialize epsilon for i_episode in", "torch device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\") \"\"\" Unity", "actions. Four discrete actions are available, corresponding to: 0 -", "this information, the agent has to learn how to best", "with ray-based per...
[ "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_kernel_size, block=model_params.block, pooling_method=model_params.pooling) elif model_params.model ==", "= False local_normalize = True if mode...
[ "raise PhidgetException(result) return _DeviceSerialNumber.value def setDeviceSerialNumber(self, DeviceSerialNumber): _DeviceSerialNumber = ctypes.c_int32(DeviceSerialNumber)", "> 0: raise PhidgetException(result) return _DeviceLabel.value.decode('utf-8') def setDeviceLabel(self, DeviceLabel): _DeviceLabel", "R...
[ "request_data = {\"data\": self.auction} entrypoint = '/auctions' response = self.app.post_json(entrypoint,", "'/auctions' response = self.app.post_json(entrypoint, request_data) self.assertEqual(response.status, expected_http_status) def create_auction_check_minNumberOfQualifiedBids(self): expected_minNumberOfQu...
[ "pass @contextmanager def app_with_scout(app=None, config=None): \"\"\" Context manager that configures", "finally: scout_apm.celery.uninstall() # Reset Scout configuration. Config.reset_all() def test_hello_eager(tracked_requests): with", "1 tracked_request = tracked_requests[0] assert \"task_id\" in tracked_r...
[ "\"orm['places.EntityType']\"}), 'geometry': ('django.contrib.gis.db.models.fields.GeometryField', [], {'null': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key':", "'EntityType' db.create_table('places_entitytype_subtype_of', ( ('id', models.AutoField(verbose_name='ID', primary_key=True, a...
[ "accessed_at) if auto_delete_on_idle and not isinstance(auto_delete_on_idle, str): raise TypeError(\"Expected argument", "dead_lettering_on_message_expiration) if default_message_time_to_live and not isinstance(default_message_time_to_live, str): raise TypeError(\"Expected argument", "__args__['resourceGroupNam...
[ "HPX # Start of horizontal sync pulse LCD_HSYNC0 = HFP", "= 20 # Horizontal Back Porch HFP = 10 #", "distribute this software, either in source code form or as", "1 here # Define the constants needed by the EVE", "using the largest possible line time in order to #", "Vertical Line Padding # FTDI needs at ...
[ "import numpy as np import quapy as qp from quapy.data.base", "elif self.protocol=='gen' and inspect.isgenerator(validation()): return training, validation else: raise ValueError(f'\"validation\"", "specified, then eval_budget is requested. Ignored if protocol!='app'. :param n_repetitions:", "invoked (only fo...
[ "migrate 的新建 我们需要扫描到这些文件我们才能创建 @app.shell_context_processor def make_shell_context(): return dict(db=db, User=User, Role=Role,", "flask_migrate import Migrate from app import create_app, db from app.models", "# -*- coding: utf-8 -*- import os from flask_migrate import", "app import create_app, db from app.mod...
[ "- basin) basin.add(point) basins.append(basin) return basins def solve_part2(heightmap: Heightmap, low_points:", "for line in f] heightmap: Heightmap = dict() for (y,", "points_to_consider = {low_point} while points_to_consider: point = points_to_consider.pop() if heightmap[point]", "- 1), (x, y + 1), (x + 1...
[ "via KeyboardInterrupt\") def quit(self): self.log.info(\"Quitting MainLoop\") self.mainloop.quit() def main(): docolor", "level = logging.DEBUG elif Args.verbose == 1: level = logging.INFO", "def __init__(self): self.log = logging.getLogger(\"Voctoconfig\") self.log.debug(\"Creating GObject Mainloop\") self.ma...
[ "except KeyError: env_step = 0 return epoch, env_step, gradient_step class", "the writer to log data. :param int train_interval: the log", "its name to TensorboardLogger in #427. This class is for", "tianshou.utils.logger.base import LOG_DATA_TYPE, BaseLogger class TensorboardLogger(BaseLogger): \"\"\"A logge...
[ "self._jetfuel.Menu_new(); print(\"Constructed empty drawableref!\"); def get_max_height(self): self._jetfuel.Menu_get_max_height.argtypes = [c_void_p]; self._jetfuel.Menu_get_max_height.restype", "2.0 (the \"License\"); # you may not use this file", "= c_uint; return self._jetfuel.Menu_get_max_height(self.draw...
[ "x: jax.lax.psum(x, 'i'), 'i', devices=devices) def pre_pmap(xs): return jax.tree_map(lambda x:", "10, 20, 50]: t_inference_start = time.time() pred_acc = 0 pred_denominator", "jax_utils.unreplicate(optimizer), step) # Periodic metric handling. # Training Metrics if", "2.0 (the \"License\"); # you may not use...
[ "value_mesh = prepare_data(data_pd, parameter) lons_plot, lats_plot, deps_plot = generate_vertical_profile_grids( lon_list,", "np.zeros((hnpts, vnpts)) for ih in range(hnpts): for iv in range(vnpts):", "vmax_round = round(np.max(values), 2) if(vmax_round > np.max(values)): vmax = vmax_round", "_ = lld2xyzr(la...
[ "test_herokupostgres(monkeypatch): monkeypatch.setenv('HEROKU_POSTGRESQL_ORANGE_URL', 'heroku-db-uri') app = create_sample_app() assert app.config['SQLALCHEMY_DATABASE_URI'] == 'heroku-db-uri'", "Flask from flask_appconfig import HerokuConfig def create_sample_app(): app = Flask('testapp')", "create_sample_app(...
[ "stream_log = logging.StreamHandler() stream_log.setFormatter(formatter) logger.addHandler(stream_log) # if disabled # logger.disabled", "Set Flask logger \"\"\" logger = logging.getLogger('FLASK_LOG') logger.setLevel(logging.DEBUG) stream_log =", "import logging \"\"\" Formatter \"\"\" formatter = logging.Form...
[ "s3 = boto3.client('s3', aws_access_key_id=settings.S3_ACCESS_KEY, aws_secret_access_key=settings.S3_SECRET) hostname = socket.gethostname().replace('-','_') s3_object_name =", "os.path.join(BACKUP_DIR, path) print('Uploading %s to %s on S3 bucket %s'", "/ %s (%.2f%%)\" % ( self._filename, self._seen_so_far, se...
[ "Clean VNF Args: * instance_id: The service instance of the", "list(onap_utils.get_template_param( self.vnf_config[\"vnf\"], \"topology_template.groups\")) # Class attributes for instance, vnf and", "the VNF service instance vnf_id: The ID of the VNF", "Solution(object): \"\"\" VNF: Class to automate the inst...
[ "o = random.randint( 0, 1000 ) self._control0.add_event( s, s+o, track=random.randint(0,self.N_TRACKS)", "__license__ = \"MIT\" __version__ = \"0.0\" __maintainer__ = \"<NAME>\" __email__", "of the forms fields self._control0 = ControlEventsGraph('Check me') self._control1 =", "self._control3.value = e def __...
[ "# pyre-fixme[16]: `OrthoPhotoView` has no attribute `geot`. x, y =", "x += self.image_window.col_off y += self.image_window.row_off h, w = self.image_manager.get_image_size(self.current_image)", "if self.images_in_list: if self.current_image not in self.images_in_list: self.bring_new_image(self.images_in_list[...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR", "may obtain # a copy of the License at #", "# # Licensed under the Apache License, Version 2.0 (the", "agreed to in writing, software # distributed under the ...
[ "with open(\"Password.log\", \"a\") as File: File.write(f\"{Password}\\n\") if (len(sys.argv) == 1)", "INFO: {message}\") def STATUS_LOG(message): CurrentTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') print(f\"{CurrentTime} -", "= datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') print(Fore.YE...
[ "sig in siglist: sig.signer = User.find(username=sig.signer_id) sig.delegate = User.find(username=sig.delegate_id) return", "none\" if user == None: return None memolist = Memo.query.join(User).filter(Memo.memo_state==MemoState.Draft,User.username==user.username).order_by(Memo.action_date.desc()).paginate(page", ...
[ "\"fake-client-id\" settings.EDX_API_CLIENT_SECRET = \"fake-client-secret\" settings.EDX_API_ACCESS_TOKEN_URL = \"http://localhost/fake/access/token/url\" settings.EDX_API_URL = \"http://localhost/fake/api/url\"", "settings.EDX_API_ACCESS_TOKEN_URL = \"http://localhost/fake/access/token/url\" settings.EDX_API_URL...
[ "it a little more unique. :param cpxTmp: complex value to", "and set attributes. :param kwargs: a dictionary in the form", "disk fig.savefig(fname+\".png\", dpi=self.dpi, pad_inches=0.05, bbox_inches='tight') def julia(**kwargs): \"\"\" temp \"\"\"", "mirror is concatenate with the original to produce a new",...
[ "cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) gray = cv2.equalizeHist(gray) faces = faceCascade.detectMultiScale(frame) for (x,", "h, x : x + w] roi_color = frame[y :", "= cv2.VideoCapture(0) print(vs) while True: ret, frame = vs.read() if", "# eye_detection.py - detect eyes using webcam # tutorial: https://www.ro...
[ "line in fh: cols = line.strip('\\n').split('\\t') if cols[1]: descripts[cols[0]] =", "= {} with open('macaca_genes.txt') as fh: fh.readline() for line in", "else: descripts[cols[0]] = cols[1] with open('gene_info.txt') as fh: for line", "cols = line.strip('\\n').split('\\t') if cols[1]: descripts[cols[0]] = ...
[ "sc.add_event(**_event_parameters) event = sc._instantiate_event(sc.fg_spec[-1]) _reset_event_spec(sc) return sc, event def make_one_mixture_coherent(sc,", "False while not check: sc, event = instantiate_and_get_event_spec( sc, labels[0],", "label)), source_time=('const', event.source_time), event_time=('const'...