ngram
listlengths
0
67.8k
[ "from uiObject import uiObject # main入口 if __name__ == '__main__': ui = uiObject()", "-*- coding:utf-8 -*- from uiObject import uiObject # main入口 if __name__ == '__main__':", "# -*- coding:utf-8 -*- from uiObject import uiObject # main入口 if __name__ ==", "uiObject import uiObject # main入口 if __name__ == '__ma...
[ "= models.CharField( max_length=200, null=False, blank=False ) def __str__(self): return self.name class Photo(models.Model): category", "models here. class Category(models.Model): name = models.CharField( max_length=200, null=False, blank=False ) def __str__(self):", "__str__(self): return self.name class Phot...
[ "text # def analyze_review_sentiments(text): # - Call get_request() with specified arguments # -", "Error\") status_code = response.status_code print(\"With status code {}\".format(status_code)) json_data = json.loads(response.text) return json_data,", "make HTTP GET requests # e.g., response = requests.get(url...
[ "import ConfigParser from sdk.data_uploader import DataUploader logging.basicConfig(level=logging.INFO) log = logging.getLogger() config = ConfigParser()", "import DataUploader logging.basicConfig(level=logging.INFO) log = logging.getLogger() config = ConfigParser() config.read(\"config.ini\") ##### # Datasets", ...
[ "config) print_hand_result(result) #################################################################### # Change the cost of yaku # #################################################################### config =", "#################################################################### # Tanyao hand by tsumo # #######...
[ "def _get_entry_format(self, entry): return entry.get_format_solaris() def mount_entry(self, entry): args = [\"-F\", entry.get_typename(), entry.get_fsname(),", "\"/etc/fstab\" def _get_entry_format(self, entry): return entry.get_format_solaris() def mount_entry(self, entry): args = [\"-F\", entry.get_typename(),...
[ "\"Finance\"}` \"\"\" return pulumi.get(self, \"freeform_tags\") @property @pulumi.getter def id(self) -> str: \"\"\" The", "raise TypeError(\"Expected argument 'time_created' to be a str\") pulumi.set(__self__, \"time_created\", time_created) if time_zone", "be a dict\") pulumi.set(__self__, \"operations_insig...
[ "self.noservice = None def finalize_options(self): install.finalize_options(self) def run(self): install.run(self) if not self.noservice: from", "install.run(self) if not self.noservice: from xmediusmailrelayserver import console console.install_service(['--startup', 'auto', 'install']) setup( name='xmediusmailre...
[ "## 1.next = 4.next == 5 ## 4.next = None ## 1.next.next ==", "2: # 给定链表 1->2->3->4->5, 重新排列为 1->5->2->4->3. # Definition for singly-linked list. # class", "1.next.next == 5.next = 2 ## now = 2 ## last = 3.next", "= head self.flag = True def test(node): if not node.next: # 如果 node.next", "self.flag = False ...
[ "isinstance(x, self._tag_type), \"arg must be \" + self._tag_type.__name__ self._values.remove(x) @staticmethod def write(stream, tag):", "self._tag_type), \"arg must be \" + self._tag_type.__name__ self._values.append(x) def remove(self, x): assert isinstance(x,", "remove(self, x): assert isinstance(x, self._t...
[ "12, 3]) grid = transit(grid, 13, [5, 15, 10], [0.13237609957996088, 0.22944646977966682, 0.6381774306403722]) grid", "sin(grid, 11, 7, -0.3409112713023047, 75.93313567333723) grid = transit(grid, 11, [5, 10, 7], [0.22694849313985146,", "6, 1, 4, 0], [0.2070905138265326, 0.06562120796792839, 0.17355051228662716...
[ "import set_random_seed, check_path from onmt.utils.parse import ArgumentParser from onmt.opts import dynamic_prepare_opts from onmt.inputters.corpus", "be disabled in this. Built vocab is saved in plain text format as", "opts.n_sample > 1, \\ f\"Illegal argument n_sample={opts.n_sample}.\" logger = init_logger...
[ "**kwargs ): train_cohort = Cohort(grade, train_years) df = pd.DataFrame() for model in self.models:", "isinstance(model, TFKerasModel)): continue train_data = Dataset(train_cohort, self.features_list, model.get_feature_processor(), self.labels) model.train(train_data) feats_exp = FeatureImportancesExperiment('ig...
[ "i:i+cfg.NUMBER_MSK_CHANNELS] = msk_channel i += cfg.NUMBER_MSK_CHANNELS # print(msk, msk.shape) return msk def load_weights(cfg,", "not exist. Returned file count for this path will be 0\") return total_count", "_.endswith(image_format)] total_count += len(path_list) except OSError: print(\"Directory does not ...
[ ") return self.map_zip_values( lambda v, t, s: s if t else v, spikes,", "get_sliding_window(self, window=WINDOW_DEFAULT, extend=True, default=None, as_series=True): if extend: n_min = 0 n_max = self.get_count()", "result = self.new() for n in self.get_range_numbers(): is_edge = n < center or", "+ center + 1) ...
[ "vid, \"info.json\"]) _dict = await self.read_json(json_file) if not _dict: return False # jsonの更新", "_dict[\"encode_tasks\"].remove(f\"{resolution}p\") else: _dict[\"encode_error\"].append(f\"{resolution}p\") _dict[\"encode_tasks\"].remove(f\"{resolution}p\") # jsonの書き込み self.write_json(json_file, _dict) # プレイリス...
[ "tile's address with the final two characters removed. In case of a GLOBAL", "precise, sort this later\") def constructTileFromCodeAndSize(self, plus_code, tile_size): ''' Creates a new OpenGeoTile", "from OpenLocationCode.java # A separator used to break the code into two parts", "= TileSize.NEIGHBORHOOD olc...
[ "for given value\"\"\" return ctypes.cast( cls.dataPointer(value), ctypes.POINTER( cls.baseType )) typedPointer = classmethod( typedPointer", "guess the OpenGL type of the corresponding pointer Note: this is not currently", "= classmethod( logs.logOnFail( arrayToGLType, _log ) ) def arraySize( cls, value, typeC...
[ "of symlinks to generate. transitive_sources = depset(transitive = transitive_sources) runfiles_dict = {} substrate", "substrate): \"\"\"Rewrite src filenames for the given substrate.\"\"\" return [_substrate_src(src, substrate) for src", "$(SRCS) --omit_deps={} > $@\".format( REWRITER_TARGET, \",\".join(resolv...
[ "progress_bar_size: for dump_file in dump_files: dump_file.download() progress_bar_files.update(1) progress_bar_size.update(dump_file.size) _LOGGER.info(f\"Done downloading Wikidata dump {self.version:%4Y%2m%2d}.\")", "KIND, either express or implied. # See the License for the specific language", "Unless requir...
[ "'dist_trade_df_by/pdf/ticker', 'execution-by-venue': 'dist_trade_df_by/pdf/venue'}, # Compliance page 'compliance_metric_table_trade_order': {'execution-by-anomalous': 'table_trade_df_slippage_by_worst_all', 'summary-by-broker': 'bar_trade_df_executed_notional_in_reporting_currency_by_broker_id'}, 'compliance_down...
[ "stk.BuildingBlock( smiles='BrC1=C(Br)[C+]=N1', functional_groups=[stk.BromoFactory()], ), stk.BuildingBlock( smiles=( 'Br[C+]1C2(Br)[C+]=N[C+]2[C+](Br)[C+](' 'Br)[C+2]1' ), functional_groups=[stk.BromoFactory()], ), ), lattice_size=(2,", "'C+]=N[C+]26)C2([C+]=N[C+]52)C2=C%18N=[C+]2)C2=C(N=[C+' ']2)C92[C+]=N[C+]7...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "def load_torch_checkpoint(model, cfg, path=\"./mae_finetuned_vit_base.pth\", strict=False): \"\"\" Load checkpoint from the given torch weights.",...
[]
[ "data = dset[:] if 'Latitude' is not data_name and 'Longitude' is not data_name:", "is not data_name: data = data.astype(np.float32) * dset.attrs['Slope'][0] + dset.attrs['Offset'][0] # Finish if", "np.NaN # Convert DN to physical value data = data * dset.attrs['Slope'][0] +", "dset.attrs['Offset'][0] return ...
[ "while n > 0: result.insert(0, capitals[(n-1)%len(capitals)]) n = (n-1) % len(capitals) # result.reverse()", "@return a string def convertToTitle(self, n: int) -> str: capitals = [chr(x) for", "n: int) -> str: capitals = [chr(x) for x in range(ord('A'), ord('Z')+1)] result", "class Solution: # @return a strin...
[ "subprocess.Popen. \"\"\" _ValidateAndLogCommand(args, cwd, shell) return Popen( args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell, cwd=cwd, env=env)", "doesn't stick around if we fail with an # exception. process.kill() except OSError:", "timeout. \"\"\" _ValidateAndLogCommand(args, cwd, shell)...
[ "initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='FundingOptions', fields=[", "<filename>services/server/server/apps/checkout/migrations/0001_initial.py # Generated by Django 4.0.2 on 2022-02-26 15:52 from django.db import migrations,", "max_length=255, verbose_name='funding window...
[ "if not rel.exists(): continue rel = rel[0] tube = directions.TubesRegistration.objects.filter(type__fractions=fraction) if not tube.exists():", "= defaultdict(list) for row in issledovaniya: k = row[\"pk\"] i = row[\"iss\"] for", "rel.astm_field]) else: researches[k].append([None, rel.astm_field, None, None]) ...
[ "\"00000000\\n\"\\ \"00000000\\n\"\\ \"00000000\\n\"\\ \"000000FF\\n\"\\ \"5344422D\\n\"\\ \"00020100\\n\"\\ \"00000100\\n\"\\ \"00000000\\n\"\\ \"00000200\\n\"\\ \"00030000\\n\"\\ \"80000000\\n\"\\ \"0000C594\\n\"\\ \"00000001\\n\"\\", "in range (0, len(rom_in), 4): if (i % 16 == 0): magic =", "= \"5344422D\\n...
[ "= data_in.shuffle(24) data_in = data_in.batch(1024) arch = params_in[\"Architecture\"] dropout = params_in[\"Dropout\"] lr =", "pd import tensorflow as tf from tensorflow.keras import layers os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\" #", "= {} # accuracy at given epoch def on_epoch_begin(self, epoch, logs={}...
[ "= dict(required=False, default=\"present\", choices=['present', 'absent', 'latest', 'list', 'info'], type='str'), ) return AnsibleModule(argument_spec=args,supports_check_mode=False) def", "meta=meta) from ansible.module_utils.basic import * from ansible.module_utils.urls import * if __name__ == '__main__':", ...
[ "= self.plotter.add(self.line.start) self._end_artist = self.plotter.add(self.line.end) else: points = self.clip() if points: p0, p1", "from compas.geometry import intersection_line_box_xy __all__ = ['LineArtist'] class LineArtist(Artist): \"\"\"\"\"\" zorder = 1000", "line, draw_points=False, draw_as_segment=F...
[ "np from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from lvq import SilvqModel", "prediction results and prototypes plot2d(model, x, y, title='Artificial dataset1') if __name__ == '__main__':", "# Load dataset dataset = np.loadtxt('data/artificial_dataset1.csv', d...
[ "layer in base_model.layers[:fine_tune_at]: layer.trainable = False # In[ ]: model.compile(loss='categorical_crossentropy', optimizer = tf.keras.optimizers.RMSprop(lr=base_learning_rate/10),", "model from the pre-trained model. Resnet 50 in this case base_model = tf.keras.applications.ResNet50(input_shape=IMG_SHA...
[ "# Use of this source code is governed by a BSD-style license that", "code is governed by a BSD-style license that can be # found in", "source code is governed by a BSD-style license that can be # found", "of this source code is governed by a BSD-style license that can be", "rights reserved. # Use of this s...
[ "MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework", "self.send_one_op_call_tx_with_counter_check(outputs, input_value=1000000*FGC_MIN_GAS_PRICE, should_throw=True) # Sends a tx containing 2 op_call outputs that has"...
[ "= re.search(b'_sklearn_versionq(.*\\x00)((\\d+\\.)?(\\d+\\.)?(\\*|\\d+))q', as_binary) if s: sklearn_version = s.group(2).decode() else: sklearn_version = None self._schema", "import __version__ class SklearnModelSource(DataSource): container = 'python' name = 'sklearn' version = __version__", "return f.read()...
[ "the input. This work with a ``ParamListener``. \"\"\" from itertools import chain from", "for all calls to ``func`` to find out what ``foo`` possibly is. \"\"\"", "function we execute # it, otherwise just ignore it. evaluator.eval_trailer(types, trailer) return listener.param_possibilities", "possibly is. \"...
[ "environment variable for this as well. if os.path.exists('/app/assets/GAMES.json'): linux_game_list = '/app/assets/GAMES.json' winehq_list =", "render_template import os import steamapi import json @app.route('/') def index(): return render_template(\"index.html\") @app.route('/report/<name>')", "Json object t...
[ "called `run_module`, that is executed when the module is run with `python -m", "from delphi_utils import read_params from .validate import Validator def run_module(): \"\"\"Run the validator", "`run_module`, that is executed when the module is run with `python -m delphi_validator`.", "when running the tool. ...
[ "crawl_folders(self.scenes) self.transform = transform def __getitem__(self, index): img = load_as_float(self.imgs[index]) depth = np.load(self.depth[index]).astype(np.float32)", "d = img.dirname()/(img.name[:-4] + '.npy') assert(d.isfile()), \"depth file {} not found\".format(str(d)) depth.append(d) imgs.extend(...
[ ":rtype: string \"\"\" return self.__crypt(text, self.__alphabet) def decrypt(self, text, key=None, alphabet=None): \"\"\" Decryption", "encrypt :param key: is not used :param alphabet: is not used :type text:", "class Rot18: \"\"\" The Rot18 Cipher \"\"\" __rot13 = Rot13() def __init__(self): alphabet", "alp...
[ "or database.get_prop_type(expected.name) != expected ): database.remove_prop_type(expected.name) database.add_prop_type(expected) to_save = True if to_save: database.save()", "@abstractmethod def get(self, video: Video): raise NotImplementedError() class PropError(SpecialPropType): __slots__ = () def", "for ex...
[ "both of which are required for \" \"RBAC testing.\") if not admin_role_id: missing_roles.append(CONF.identity.admin_role)", "after this function. Example:: @rbac_rule_validation.action(service='test', rules=['a:test:rule']) def test_foo(self): # Allocate test-level resources here.", "_set_override_role_called(...
[ "self.ChangeValue(a) self.SetInsertionPointEnd() e.Skip() def onTextChange(self, e): if os.name == \"nt\": if e.String ==", "wx.WXK_ESCAPE: self.KeyESC() elif c == wx.WXK_RETURN: self.KeyReturn() class DrugPicker(wx.ComboCtrl): def __init__(self, parent): super().__init__(parent,", "+= 1 self.lc.Select(self.cur...
[ "'M', 'T', 'Z']) for aresta in ['J-C', 'C-E', 'C-E', 'C-P', 'C-P', 'C-M', 'C-T',", "= Grafo(['J', 'C', 'E', 'P', 'M', 'T', 'Z']) for aresta in ['J-C', 'C-E',", "'E', 'P', 'M', 'T', 'Z']) for aresta in ['J-C', 'C-E', 'C-E', 'C-P', 'C-P',", "K3 k3 = Grafo(['A', 'B', 'C']) for aresta in ['A-B', 'B-C', 'C-A']: k3...
[ "from fuzzybee.conf import b_url, b_ak, geo_table, l_url, app_id, app_key from utils.pack_json import toJSON,", "print lean_response lean_objectId = lean_response['objectId'] # save in Baidu Map params = urlencode({", "respone.read() lean_response = fromJSON(response.read()) print lean_response lean_objectId = ...
[ "Flask from flask_cors import CORS from flask_graphql import GraphQLView from schema import Schema", "Schema def create_app(**kwargs): app = Flask(__name__) app.debug = True app.add_url_rule( '/graphql', view_func=GraphQLView.as_view('graphql', schema=Schema,", "flask import Flask from flask_cors import CORS fr...
[ ") self.optionList['mortgageDefaults'] = dict( name = 'mortgage', label = 'Mortgage', mortgageRate = '4.5%',", "'0.0%', # Cost of selling the house capitalGainsTax = '0.0%', # Paid if", "percentage of the loan otherPurchaseFees = '0.5%', # Other fees as a percentage", "percentage of home value listingFee = '6...
[ "import numpy as np class Terrain(Entity): def __init__(self, json, width, height, scale=4, terrain_types=4):", "left, right): self.splat = self._crop_map_safe(self.splat, top, bottom, left, right, self._scale) def fliplr(self, width):", "bottom*self._scale), (left*self._scale, right*self._scale), (0,0)), mode=...
[ "elif name == \"stop\": self.stop[doc[\"run_start\"]] = doc elif name == \"descriptor\": self.descriptor[doc[\"run_start\"]].append(doc) self.event[doc[\"uid\"]]", "= msg_hook def __call__(self, msg): self.msgs.append(msg) if self.msg_hook: self.msg_hook(msg) class DocCollector: def __init__(self):", "def __cal...
[ "files: print(\"No files specified.\") return 1 possible_modes = tuple(f\"--{mode}\" for mode in Checker.modes)", "= sys.argv[1:] if not files: print(\"No files specified.\") return 1 possible_modes = tuple(f\"--{mode}\"", "json.load(data), mode=mode, ).run_check() except CheckException as e: print(f\"Check for...
[ "utils.server import plain_response from sanic import response def get_mappedfile_configs(): cfgs = load_memfile_configs() return", "import plain_response from sanic import response def get_mappedfile_configs(): cfgs = load_memfile_configs() return response.json(plain_response(cfgs,", "import response def get_m...
[ "= np.sum(has_lesion) print os.path.basename(mask_nii_path), num_lesion_slices, np.shape(mask_img)[-1] if __name__ == '__main__': # for phasename", "np.asarray(liver_masks, np.uint8), np.asarray( tumor_weakly_masks, np.uint8) def statics_num_slices_lesion(nii_dir): ''' 统计每个case,有多少slice具有病灶 :param nii_dir: :retur...
[ "projects API to get all projects, users and timereports', long_description=readme(), classifiers=[ 'Development Status", "setup(name='zohoreader', version='0.1', description='A simple reader for zoho projects API to get all projects,", "def readme(): with open('README.rst') as f: return f.read() setup(name='zo...
[ "for //browsers:firefox-native. chromium: Configure repositories for //browsers:chromium-native. sauce: Configure repositories for //browser/sauce:chrome-win10. \"\"\"", "\"518080049ba83181914419d11a25d9bc9833a2d729b6a6e7469fa52851356da8\", jar_urls = [ \"https://mirror.bazel.build/repo1.maven.org/maven2/org/json...
[ "to run', type=int) parser.add_argument('--hs', dest='hs', help='Hidden size to use', type=int) parser.add_argument('--n-parallel', dest='n_parallel', help='Number", "ON_TEST_SET = True IN_TRAIN_MODE = False parser = argparse.ArgumentParser(description='Viz Single Task') parser.add_argument('--idx', dest='idx',",...
[ "1 if not arches: arches = ALL_ARCHES defs_plus = (defines or []) +", "new_hdr_name = hdr_stem + hdr_ext outs.append(new_hdr_name) # Generate lines for shim switch file.", "depset(deps or []) if not arches: arches = EMBEDDED_ARCHES fileset_name = decorate(name, \"fs\")", "\"cc_binary\", \"cc_library\", \"cc_t...
[ "\"WS-SUP720-3BXL 2 ports Supervisor Engine 720 Rev. 5.6\" PID: WS-SUP720-3BXL , VID: V05,", "parsed_output = { 'version': { 'chassis': 'CISCO3945-CHASSIS', 'chassis_sn': 'FGL161010K8', 'compiled_by': 'prod_rel_team', 'compiled_date': 'Fri", "Processor board ID FDO2028F1WK Last reset from power-on 2 Virtual Eth...
[ "Detection UniformPrior(\"testing_to_detection.assumed_cdr_parameter\", [0.009, 0.025]), UniformPrior(\"infection_fatality.multiplier\", [0.09, 0.13]), #VoC UniformPrior(\"voc_emergence.alpha_beta.start_time\", [370, 410]), UniformPrior(\"voc_emergence.alpha_beta.contact_rate_multiplier\", [3.2,", "baseline_param...
[ "= test_app.test_client() test_app_context = test_app.app_context() test_app_context.push() return testing_client, test_app_context def create_dummy_subtheme(self) -> SubTheme:", "subtheme.save() subtheme.commit() subtheme = SubTheme.get_by_name('_TEST_SUB_THEME_') return subtheme def create_admin_user(self) -> U...
[ "in meters */ uint32 q_FltFiltBGTBMeters; /* Filtered BeiDou to Glonass time bias in", "matrix */ uint8 u_EllipseConfidence; /* Statistical measure of the confidence (percentage) associated with", "if nam[i] == \"_\": ret.append(nam[i+1].upper()) i += 2 else: ret.append(nam[i]) i += 1", "*/ uint32 q_FltEllips...
[ "edit.setPlaceholderText('Search...') edit.installEventFilter(self) edit.setFont(QFont('Segoe UI')) self.setFixedHeight(26) comp = self.completer() comp.setCompletionMode(QCompleter.PopupCompletion) comp.setFilterMode(Qt.MatchContains) comp.setModelSorting(QCompleter.CaseInsensitivelySortedModel) comp.setMaxVisible...
[ "len(sys.argv) < 2: port = 8888 else: port = int(sys.argv[1]) # 1. 创建", "end=' ') #data = recv_data.decode('utf-8') #print('0x%x'%data) cnt = cnt - 1 time.sleep(0.005) print(\"\")", "2: port = 8888 else: port = int(sys.argv[1]) # 1. 创建 udp 套接字", "import sys smsg = b'\\xaa\\x08\\xfe\\x00\\xc9\\xe6\\x5f\\xee' d...
[ "class Role: def __init__(self, data): self.data = data self._update(data) def _get_json(self): return self.data", "= data self._update(data) def _get_json(self): return self.data def __repr__(self): return ( f\"<Role id={self.id}", "= data[\"color\"] self._managed = data[\"managed\"] self._name = data[\"name\"...
[ "CategoryViewSet, base_name='category') from django.contrib import admin from django.urls import path urlpatterns = [", "base_name='post') router.register(r'comment', CommentViewSet, base_name='comment') router.register(r'tags', TagViewSet, base_name='tags') router.register(r'category', CategoryViewSet, base_name...
[]
[ "self.verbose > 0: print(f'\\nEpoch {epoch + 1}: VariableScheduler assigning ' f'variable {self.variable.name} to", "self.verbose = verbose def on_epoch_begin(self, epoch, logs=None): value = self.variable.read_value() value = self.schedule(epoch,", "to assign to the variable as output. verbose: int. 0: quiet, ...
[ "#for chrom,peaks in joined_peaks.items(): #for jp in peaks: #for j,set_name in enumerate(peaksets.keys()): #control_coverage", "this script (also output regardless of the presence of a peak). Options: --max-distance=DIST", "#peak.score,peak.chip,peak.control,peak.fold_enrichment) else: s += 'NA\\tNA\\tNA\\tNA\...
[ ") else: params.append( { \"paramType\": \"query\", \"name\": each[0], \"dataType\": 'string', \"required\": True, }", "if isinstance(each, tuple): if each[1] == int: params.append( { \"paramType\": \"query\", \"name\": each[0],", "= {'title': manager.name, 'description': manager.description, 'apiVersion': mana...
[ "dash_dcc.start_server(app) # Get the inner input used for search value. input_ = dash_dcc.find_element(\"#my-dynamic-dropdown", "search_value in o[\"label\"]] dash_dcc.start_server(app) # Get the inner input used for search value.", "app.layout = html.Div(dropdown) dash_dcc.start_server(app) dash_dcc.wait_for_...
[ "encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90] while True: ret, frame = cam.read() result, frame =", "struct import time import pickle import zlib client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect(('127.0.0.1', 8485))", "socket import struct import time import pickle i...
[ "to the GRU output, state = self.gru(x) return output, state def reset_state(self, batch_size):", "d] tile_layer = tf.keras.layers.Lambda( lambda inputs: tf.tile(inputs[0], multiples=inputs[1])) a = tile_layer((a, [1, 1,", "KIND, either express or implied. # See the License for the specific language", "Args: ...
[ ":rtype: logger \"\"\" logger = logging.getLogger(name) if level is not None: logger.setLevel(level) else:", "log_file: str or None \"\"\" self.level = level self.device_key = None self.console =", "logger instance. :param name: Name of the logger :type name: str :param level:", "KIND, either express or impli...
[ "ClientError from util.log import Log from settings.aws_settings import AWSSettings from settings.telegram_settings import TelegramSettings", "log = Log.setup(name='logger') aws_settings = AWSSettings() telegram_settings = TelegramSettings() timezone = pendulum.timezone('America/Sao_Paulo') date", "data = gzip....
[ "last_rec = records[0] if site_stat: site_stat.record = last_rec site_stat.save() else: SiteStat.objects.create(user=user, record=last_rec) #raise", "valid_uri(rec) if not uri: continue # Determining the access to the site application", "SiteStat.objects.create(user=user, record=last_rec) #raise Exception(last_...
[ "this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES", "pricing file cannot be retrieved/parsed \"\"\" try: instances = _get_json_from_s3(region, \"instances/instances.json\") vcpus =", "all files and dirs rooted in path. The archive is created in memory", "if event.get(\"ResourceSta...
[ "mylistener import MyListener if __name__==\"__main__\": eventbus=EventBus() eventbus.register(MyListener()) ge=GreetEvent('world') be=ByeEvent('world') eventbus.async_post(be) eventbus.post(ge) time.sleep(0.1) eventbus.unregister(MyListener())", "time from thinkutils_plus.eventbus.eventbus import EventBus from m...
[ "= browser_options.BrowserFinderOptions() def NoAdb(*_, **__): raise OSError('not found') self._android_device_stub.subprocess.Popen = NoAdb self.assertEquals([], self._android_device_stub.logging.warnings)", "['adb_commands']) def testGetAllAttachedAndroidDevices(self): self._android_device_stub.adb_commands.att...
[ "The function obj.close() is not important, I just added it for coverage. You", "it) then whenever you want to add text, type obj.add(\"some text\"). The function", "directory to save it) then whenever you want to add text, type obj.add(\"some", "want to add text, type obj.add(\"some text\"). The function obj...
[ "process_file(file_path, data_file_role, dataset_name, target_type, max_targets, max_nodes): total_examples = 0 source_output_path = '{}.{}.{}.source.txt'.format(dataset_name, target_type,", "None and num_nodes > max_nodes: return None, None if target_type is TargetType.seq: target_pred", "in examples: if sourc...
[ "OR MIT) from spack import * class RMulticool(RPackage): \"\"\"Permutations of multisets in cool-lex", "or hash tables and to generate integer partitions. The permutation functions are based", "<DOI:10.1145/1496770.1496877> Loopless Generation of Multiset Permutations by Prefix Shifts. Symposium on Discrete Alg...
[ "files in os.walk(arguments['<irc-dir>']): for fname in files: filepath = subdir + os.sep +", "Usage: updatetranslations.py run <irc-dir> <languages-dir> updatetranslations.py --version updatetranslations.py (-h | --help) Options: <irc-dir>", "# # tl;dr this script updates our translation file with the newest, ...
[ "pub)][tenants] += 1 for k in sorted(tenant_run.keys()): print \"# ----%s------\"%(str(k)) for k2 in", "fname in fnames: f = open(fname) for l in f: if l.startswith(\"tenant\"): continue", "= l.strip().split() tenants = int(parts[0]) priv = int(parts[1]) pub = int(parts[2]) num_machines =", "(fnames): tenant_...
[ "a list containing the tasks for each core assert sum(num_each)==num_tasks assert len(num_each)==avail_cores assert", "print (\"At most \", max(num_each) , \" tasks...\") my_tasks = each_tasks[rank] return comm,rank,my_tasks", "def Get_rank(self): return 0 def Get_size(self): return 1 def Barrier(self): pass de...
[ "Resize card base_height = 500 img = Image.open('temp.jpg') height_percent = (base_height / float(img.size[1]))", "r = r.text r = json.loads(r) print(r) r = r['url'] # Fix using", "get_multiverse_id(self, name): try: name = re.sub(' ', '%20', name) r = requests.get('https://api.scryfall.com/cards/named?exact=' ...
[ "numbers: raise commands.MissingRequiredArgument(ctx.command.clean_params[\"numbers\"]) if repository is None: user = \"gurkult\" else: user, _,", "\"\"\" github_profile = _profile.GithubInfo(self.bot.http_session) embed = await github_profile.get_github_info(username) await ctx.send(embed=embed) @github_group.co...
[ "= 'chat.postMessage' BOT_NAME = 'News Bot' DEFAULT_CHANNEL = 'news_notification' def __new__(cls, *p, **k):", "= object.__new__(cls) return cls._the_instance def __init__(self): self.__slack_client = SlackClient(SLACK_API_KEY) def send_msg_to(self, text='', channel=DEFAULT_CHANNEL):", "self.__slack_client = Sl...
[ "= 1 else: major = int.from_bytes(bytes.fromhex(fitness[0]), 'big') minor = int.from_bytes(bytes.fromhex(fitness[1]), 'big') + 1", "res += forge_fitness(content['fitness']) res += bytes.fromhex(content['protocol_parameters']) return res def forge_protocol_data(protocol_data: Dict[str, Any]) ->", "b'\\x00' res +...
[ "0 else: out_data[i, c, ph, pw] = -sys.float_info.max argmax_data[i, c, ph, pw] =", "unittest import numpy as np import math import sys import paddle.compat as cpt", "KIND, either express or implied. # See the License for the specific language", "language governing permissions and # limitations under the Lice...
[ "* from test_handlers_delete import * from test_handlers_patch_response import * from test_handlers_authentication_hook import *", "test_handlers_cleanse_body import * from test_handlers_validate import * from test_handlers_clean_models import * from test_handlers_get", "from test_deserializers import * from te...
[ "grid = addLayerOnes(grid) output_grid = np.ones((len(grid),len(grid[0])),dtype=int) grid = addLayerOnes(grid) for i in range(1,len(grid)-1):", "np.zeros(len(grid[0]), dtype=int)[np.newaxis,:])) return grid def addLayerOnes(grid): #if sum(np.asarray(grid)[:,0]) > 0: grid = np.hstack((np.ones(len(grid),", "addLa...
[ "i, (text, lang) in enumerate(options): self.combo.addItem(text) self.combo.setItemData(i, lang) self.retranslateUi() @QtCore.pyqtSlot(int) def change_func(self, index):", "options = ([('English', ''), ('français', 'eng-fr' ), ('中文', 'eng-chs'), ]) for i, (text,", "self.retranslateUi() super(Demo, self).changeE...
[ "test_http_code_from_handler(app_with_raises_and_handler, client): response = client.get(\"/spec.json\") assert response.json[\"paths\"][\"/\"][\"get\"][\"responses\"] == { \"515\": { \"description\": \"KeyError", "FlaskApistrap() @app.route(\"/\", methods=[\"GET\"]) def view(): \"\"\" Something something. :raise...
[ "get_users(self, project_id): \"\"\"Get all the users in the given project. Args: project_id(long): Project", "authtoken and portal id. Args: authtoken(str): User's authtoken. portal_id(str): User's portal id. \"\"\"", "authtoken(str): User's authtoken. portal_id(str): User's portal id. \"\"\" self.details = { ...
[ "pub in self._disable_pub.values()] if not self._rs.state().enabled: self._enable_pub.publish(True) head.set_pan(0.0, 0.5, timeout=0) self._tuck_rate.sleep() if start_disabled:", "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES", "CHECK_VERSION class Tuck(object): def __in...
[ "import serializers from .models import Measurement class MeasurementSerializer(serializers.ModelSerializer): class Meta: model = Measurement", "from rest_framework import serializers from .models import Measurement class MeasurementSerializer(serializers.ModelSerializer): class Meta: model", ".models import Me...
[]
[ ">= nums[n]: n -= 1 t = n if t == 0: nums[:]", "t == 0: nums[:] = nums[::-1] return x = nums[n-1] while t <", "x < nums[t]: t += 1 temp = nums[t-1] nums[t-1] = nums[n-1] nums[n-1]", "<reponame>tedye/leetcode<gh_stars>1-10 class Solution(object): def nextPermutation(self, nums): \"\"\" :type nums: List[int] :r...