ngram
listlengths
0
67.8k
[ "bin_args = map(lambda a: a.decode(_ENCODE), args) return os.path.join(*bin_args).encode(_ENCODE) def str_join(s, l): bin_args =", "os import sys if sys.version_info[0] == 2: _ENCODE = sys.getfilesystemencoding() def path_join(*args): bin_args", "return b.join(bin_args).encode(_ENCODE) logfile_open = open else:...
[ "extended tests\") class VOMTestCase(VppTestCase): \"\"\" VPP Object Model Test \"\"\" def test_vom_cpp(self): \"\"\"", "error: raise Exception( \"Timeout! Worker did not finish in %ss\" % timeout) self.assert_equal(worker.result,", "running_extended_tests, \\ VppTestRunner, Worker @unittest.skipUnless(running_...
[ "text/javascript, */*; q=0.01', 'Referer': 'https://www.kfc.com/store-locator?query=90210', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Requested-With': 'XMLHttpRequest', 'x-appkey':'store-locator-web-cde' } yield", "DAYS[key]+' '+'Closed'+';' return clean_time def start_requests(self):...
[ "new_cols, mixin_cols, exclude_classes=()): \"\"\"Carry out processing needed to serialize ``col`` in an output", "- format: possibly irrelevant but settable post-object creation [DO store] # - description:", "x, None)): col_attr = getattr(col.info, attr) if nontrivial(col_attr): info[attr] = xform(col_attr) if...
[ "in milliseconds: %d \" % (millis2 - millis1)) self.makeOutput() def sequential(self): self.getInput() millis1", "* F * day) currH += amountRise if currH > H: return 'success", "self.results = p.map(solve, self.input) millis2 = int(round(time.time() * 1000)) print(\"Time in milliseconds: %d", "day += 1 class ...
[ "CategoricalAccuracy & F1. \"\"\" def __init__(self, vocab: Vocabulary, text_field_embedder: TextFieldEmbedder, text_encoder: Seq2SeqEncoder, classifier_feedforward:", "containing the original tokenization of the premise and hypothesis with 'premise_tokens' and 'hypothesis_tokens'", "feedforward layer Optimized...
[ "# pylint: disable=unused-argument with context.cd(TASK_ROOT_STR): dirs = ['.pytest_cache', '.cache', '.coverage'] rmrf(dirs) namespace_clean.add_task(pytest_clean, 'pytest')", "dist/*') # namespace.add_task(pypi) # @invoke.task(pre=[sdist, wheel]) # def pypi_test(context): # \"\"\"Build and upload", "TASK_ROOT...
[ "def __init__(self): pass def pre_iteration(self, finding_max_rate, run_results=None, **kwargs): \"\"\" Function ran before each", "for the first time, trying to find the max rate. In this is", "import stl_path class MyNDRPlugin(): def __init__(self): pass def pre_iteration(self, finding_max_rate, run_results=N...
[ "['Inklevel Black', '%', 'mdi:water'], 'magenta': ['Inklevel Magenta', '%', 'mdi:water'], 'cyan': ['Inklevel Cyan', '%',", "self._unit = MONITORED_CONDITIONS[self._id][1] self._icon = MONITORED_CONDITIONS[self._id][2] @property def name(self): \"\"\"Return the name of", "value is expressed in.\"\"\" return self...
[ "a channel. scheduling.create_task(self.move_to_available(), name=f\"help_claim_{message.id}\") def create_channel_queue(self) -> asyncio.Queue: \"\"\" Return a queue of", "ready!\") async def move_idle_channel(self, channel: discord.TextChannel, has_task: bool = True) -> None: \"\"\"", "int, is_auto: bool) -> ...
[ "etc.) results = EventQueue() # Convenience params = event.get_params() # Fetch the widget", "), \"@item-cost\": xml_encode( \"%d\" % item.get_cost() ) }) # Compile template root =", "\"game:unpause\" ) #hmenu.slide(DIR_LEFT, percent = 1.0) #row_menu.slide(DIR_RIGHT, percent = 1.0) # Resume game,", "handle_sh...
[ "None logging.debug(\"Searching for installed '%s'...\" % filename) which = procutils.which(filename, os.X_OK) if len(which)", "proc.returncode else: print(\"Sucessfully generated %s descriptors.\" % str(count)) del subprocess return statuscode def", "# :copyright: (c) 2007-2015, The Tor Project, Inc. # (c) 200...
[ "make this to a generic clone app, I need to deal with all", "'%s is not a block device.' % devname) sys.exit(1) # NOTREACHED pass part", "task_unmount(\"Unmount target\", disk=self.disk, partition_id=self.partition_id) task.set_teardown_task() self.tasks.append(task) self.tasks.append(task_fsck(\"fsck partitio...
[ "import logging import apache_beam as beam from apache_beam.io import WriteToBigQuery from apache_beam.io import", "new_element['Category'] = element['Category'] new_element['Genres'] = element['Genres'] new_element['App'] = element['App'] new_element['Content_Rating'] = element['Content_Rating'] new_element['Rev...
[ "return {'status': 'fail', 'message': 'Error handling request'}, 422 data = message_schema.load(json_data) message =", "' does not exist'}, 404 messages = messages_schema.dump(messages) if not Message.query.filter_by(messageID=upper).first(): # the", "return {'status': 'fail', 'message': 'No message with ID ' +...
[ "\"\", \"follow\", \"RRTConnect\", False) # sleeping 10 seconds to publish rospy.sleep(1) pub.publish(task_msg) if", "0., 0., 0.707, 0.707]), ObjectMsg('pepper0', 'package://wecook_assets/data/objects/black_pepper.urdf', [0., 0.9, 0.75, 0., 0., 0.707, 0.707]),", "[0.75, 0.05, 0., 0., 0., 0., 1.]), ObjectMsg('wa...
[ "United States Government or any agency thereof. # # PACIFIC NORTHWEST NATIONAL LABORATORY", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "the United States Government nor the # United State...
[ "a single scalar property. This calls _get_single_property and then checks that the result", "= [prop for prop in properties if prop.get(\"name\") == property_name] if len(matching_props) ==", ") heat_treatment_4_temp = self._get_scalar_property( properties, \"Heat treatment 4 Temperature\", units=\"$^{\\\\circ...
[ "output: assert \"name\" in evt[\"postgresql\"][\"database\"] assert \"oid\" in evt[\"postgresql\"][\"database\"] assert \"blocks\" in evt[\"postgresql\"][\"database\"]", "assert \"deadlocks\" in evt[\"postgresql\"][\"database\"] @unittest.skipUnless(metricbeat.INTEGRATION_TESTS, \"integration test\") @pytest.mar...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "KIND, either express or implied. # See the License for the specific language", "trainer, cluster_environment=None): super().__init__(trainer, clus...
[ "from books.models import Genre, Author, Book, TBR # Register your models here. admin.site.register(Genre)", "books.models import Genre, Author, Book, TBR # Register your models here. admin.site.register(Genre) admin.site.register(Author)", "Genre, Author, Book, TBR # Register your models here. admin.site.regis...
[ "CONFIG_DEFAULT_VHOSTS = { 'rabbitmq_api_url': URL, 'rabbitmq_user': 'guest', 'rabbitmq_pass': '<PASSWORD>', 'vhosts': ['/', 'test'], }", "'<PASSWORD>', 'queues_regexes': [r'test\\d+'], 'exchanges_regexes': [r'test\\d+'], } CONFIG_VHOSTS = { 'rabbitmq_api_url': URL, 'rabbitmq_user': 'guest',", "RABBITMQ_VERSION...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "\"\"\" pack_ref = None # The rules for the pack ref are as", "valid name # criteria, we use that if metadata.get('ref', None): pack_ref = metada...
[ "# How many of the items are not weapons? (137) NON_WEAPONS = \"\"\"", "many of the items are not weapons? (137) NON_WEAPONS = \"\"\" SELECT COUNT(items.name)", "fighters; # \"\"\" CLASS = \"SELECT COUNT(*) FROM charactercreator_\" # How many total", "character, charactercreator_character_inventory AS invento...
[ "return self.geodataframe.join(s_) self._derived_properties[\"geodataframe\"] = self.geodataframe.join(s_) # --------- # # GETTER # # ---------", "vertices\") try: pixels = np.mean(vertices, axis=1) except: # Means vertices have different size.", "name=name, index=indexes) if not inplace: return self.geodatafra...
[ "((MAGIC_LEN + struct.calcsize(fmt) + hlen) % ARRAY_ALIGN) try: header_prefix = magic(*version) + struct.pack(fmt,", "See `open_memmap`. - Can be read from a filelike stream object instead of", "not valid: {!r}\" raise ValueError(msg.format(d['shape'])) if not isinstance(d['fortran_order'], bool): msg = \"fortr...
[ "(case sensitive) \"\"\" self.symbols = kwargs.get('symbols', ()) def __call__(self, value: Any) -> bool:", "<gh_stars>0 \"\"\" Enumerator Test \"\"\" from typing import Any class is_valid_enum(): \"\"\" Test", "valid values \"\"\" __slots__ = ('symbols') def __init__(self, **kwargs): \"\"\" -> \"type\": \"enum...
[ "hex2rgb(hex, alpha=None): \"\"\"Convert a string to all caps.\"\"\" if not hex.startswith(\"#\"): return hex", "dateutil.parser import parse from flask_assets import Bundle, Environment from logzero import logger, setup_logger", "{err}\") return h if alpha is None: return f\"rgb({rgb[0]}, {rgb[1]}, {rgb[2]})\"...
[ "default='/n/home/desiobserver/focus_scan_pngs', type=str, help='output directory for plot PNGs') parser.add_argument('--no_popups', default=False, action='store_true', help='write PNGs without", "fits import numpy as np import os import matplotlib.pyplot as plt import argparse", "keep def focus_plots(night, ex...
[ "ddq.topics.topic import Topic class Logic(Topic): def references(self) -> List[Reference]: return [ Reference(\"Classical and", "import Topic class Logic(Topic): def references(self) -> List[Reference]: return [ Reference(\"Classical and Nonclassical", "import Reference from ddq.topics.topic import Topic class...
[ "iteration): if self.summary_writer is None: return self.summary_writer.add_scalar(key, value, iteration) def add_scalars(self, scalar_dict, iteration):", "None) is not None: self.summary_writer.close() def write(self, x, level=\"info\", donot_print=False): if self.logger is", "+= self.timer.get_time_hhmmss(Non...
[ "project: Optional[pulumi.Input[str]] = None, resource_attributes: Optional[pulumi.Input[Sequence[pulumi.Input['AttributeArgs']]]] = None): \"\"\" The set of arguments", "# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK", "raise TypeError(\"Missing required property 'consent_store_id'\") ...
[ "html_theme = 'sphinx_rtd_theme' html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] templates_path = [os.path.join(source_path, 'phdoc_static')] html_static_path = [os.path.join(source_path,", "from conf_base import * except ImportError: sys.path.append(source_path) from conf_base import * html_theme =", ...
[ "routines for reading and working with adv data. It contains: +-----------------------------------+-----------------------------------------+ | Name", "| correction. | +-----------------------------------+-----------------------------------------+ | :class:`~dolfyn.\\ | A class for breaking ADV data", "| | func...
[ "Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.AlterField( model_name='task', name='author',", "'0001_initial'), ] operations = [ migrations.AlterField( model_name='task', name='author', field=models.CharField(default='Anonymous', max_length=100), ), migrat...
[ "sender = None if sender == \"\" else sender if isinstance(key, str): key", "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "return 0 return mongo_events[0].version def add_event(self, event: BaseEvent, uuid: str): kwargs = {", "License for the # specific language governing per...
[ "class CspSingleRPConnection(ConfdConnection): os = 'confd' series = 'csp' chassis_type = 'single_rp' state_machine_class =", "CspServiceList(ConfdServiceList): def __init__(self): super().__init__() delattr(self, 'cli_style') self.reload = csp_svc.Reload class CspSingleRPConnection(ConfdConnection): os =", "= ...
[ "as package def readme(): with open('README.rst') as f: return ''.join(f.readlines()[11:]) setup( name=package.__name__, version=package.__version__,", "long_description=readme(), author=package.__author__, author_email=package.__email__, license=package.__license__, url=package.__url__, download_url=package.__do...
[ "except ImportError: description = '' setuptools.setup( name = 'macpack', packages = setuptools.find_packages(), version", "= 'Makes a macOS binary redistributable by searching the dependency tree and copying/patching", "['macos', 'bundle', 'package', 'redistribute', 'redistributable', 'install_name_tool', 'oto...
[ "reader.SetFileName(\"../data/wind_image.vti\") reader.Update() print(reader.GetOutput()) # Convert the image to a polydata imageDataGeometryFilter = vtk.vtkImageDataGeometryFilter()", "imageDataGeometryFilter = vtk.vtkImageDataGeometryFilter() imageDataGeometryFilter.SetInputConnection(reader.GetOutputPort()) im...
[ "1]) self._env.env.data.qvel = qvel.reshape([-1, 1]) else: self._env.env.sim.data.qpos = qpos.reshape([-1]) self._env.env.sim.data.qvel = qpos.reshape([-1]) self._env.env.model._compute_subtree()", "elif target == 'action': derivative_data = np.zeros( [num_data, self._env_info['action_size']], dtype=np.float ) el...
[ "import * from .image import * from .line import * from .mesh import", "import * from .text import * from .VisdomFigure import * from .VisdomScene import", "import * from .create_session import * from .image import * from .line import", ".create_session import * from .image import * from .line import * from ....
[ "appcontext_tearing_down, request from multiprocessing import Process, Queue from multiprocessing.connection import Client import atexit", "return render_template('index.html') MODE=\"mode\" @app.route('/mode/<name>', methods=['POST']) def mode(name): text = request.args.get(\"val\", default=\"\", type=str) messa...
[ "from watcher.common import exception from watcher.decision_engine.datasources import manager from watcher.decision_engine.model import model_root from", "def test_global_preference_reverse(self, m_conf, m_manager): \"\"\"Test if the global preference is used with another", "Unless required by applicable law or...
[ "|51 | 4|9 | | 9| 3| | ------------- | | 9| |", "| | 6 |4 3| | | 5| 7 | ------------- | 7", "| | 9| | | 2| | 98| | 83|1 |2 | -------------", "| | 2| | 98| | 83|1 |2 | ------------- ''' ) print(s)", "Sudoku def main(): s = Sudoku.parse( ''' ------------- | |2 | | |", "= Sudoku.parse( ''' ------------- | |2...
[ "import numpy as np import pandas as pd from autogbt.sampler import MajorityUnderSampler def", "3.0) assert len(idx) == 40000 assert y[idx].sum() == 10000 def test_sample_with_series(): y =", "40000 assert y[idx].sum() == 10000 def test_sample_with_series(): y = pd.Series(np.concatenate([np.ones((10000)), np.ze...
[ "binarr) t += 1 i += 1 i = 0 for data in", "t, num_classes) wisard.train(train_bin, train_label) rank_result = wisard.rank(test_bin) num_hits = 0 for i in", "ths[t].binarize(v) train_bin[i] = np.append(train_bin[i], binarr) t += 1 i += 1 i =", "range(test_length): if rank_result[i] == test_label[i]: num_hits ...
[ "numpy as np class Starter(PygameHelper): def __init__(self): self.w, self.h = 800, 600 PygameHelper.__init__(self,", "* from vec2d import * from random import uniform import numpy as np", "vec2d import * from random import uniform import numpy as np class Starter(PygameHelper):", "import * from vec2d import ...
[ "in [\"-d\", \"--dir\"]: OUTDIR = a[i + 1] i += 1 i +=", "[Options]\" % (os.path.basename(sys.argv[0]))) print() print(\"Options :\") print(\" -d, --dir : Output directory\") print(\"", "i += 1 def usage(): print(\"Record your favorite Twitch streams!\") print(\"Check an example", "\"\" def parse_args(a): glo...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "'/protectables' } ]), policy.DocumentedRuleDefault( name=INSTANCES_GET_POLICY, check_str=base.RULE_ADMIN_OR_OWNER, description='Show a protecta...
[ "directory) # Each application has its own root-static files. # domain: the domain", "None to disable the removal of application names from outgoing URLs. # domains:", "a measure of security. # If it is changed, the application perform its", "router. # The remaining members can appear in the BASE router (as d...
[ "def Always(a: T) -> CCallableUnary[T, CContent]: ... #%% register(Call(Always(w(\"a\")), w(\"idx\")), lambda a, idx:", "s = Scalar(Int(10)) #%% @operation def Always(a: T) -> CCallableUnary[T, CContent]: ... #%%", "* #%% s = Scalar(Int(10)) #%% @operation def Always(a: T) -> CCallableUnary[T, CContent]:", "r...
[ "it, you agree to cede control over minutiae of hand-formatting. In return, Black", "depends_on('python@3.6.0:') # Needs setuptools at runtime so that `import pkg_resources` succeeds # See", "return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting.", "from spack impor...
[ "@License: Apache license vesion 2.0 from django import template from django.db.models import Q", "> 0 and testeos[0].estado == estado: send = \"selected\" return send @register.filter(name='addattrs') def", "[\"ST\", \"VD\", \"OL\", \"VT\"] @register.filter(name='document_href') def document_href(p): if p.esta...
[ "to tell if aesara used the cpu or the gpu\") print(train.maker.fgraph.toposort()) for i", "20 GpuElemwise{Composite{(i0 - (i1 * i2))}}[(0, 0)]<gpuarray>(b, GpuArrayConstant{0.00999999977648}, GpuCAReduceCuda{add}.0) 2.5% 92.6% 0.096s 9.63e-06s", "10001 2 aesara.tensor.basic.AllocEmpty 0.3% 100.0% 0.004s 1.78e-...
[ "Returns: ~numpy.ndarray: Bounding boxes translated according to the given offsets. \"\"\" out_bbox =", "given offsets. \"\"\" out_bbox = bbox.copy() out_bbox[:, :2] += (y_offset, x_offset) out_bbox[:, 2:]", "shape :math:`(R, 4)`, where :math:`R` is the number of bounding boxes in the", "as padding and croppi...
[ "# Reading the browser type from the configuration file helper_func = get_browser(config.get('Environment', 'Browser'))", "ConfigParser() print((os.path.join(os.getcwd(), 'setup.cfg'))) my_file = (os.path.join(os.getcwd(), 'setup.cfg')) config.read(my_file) # Reading the browser type", "'setup.cfg'))) my_file =...
[ "None: if event.event_type == EventType.SOURCE_SET: self._label_source_directory.configure(text=event.payload.name) self.__load_recipes(event.payload) def __get_row_index(self) -> int: current_index =", "= self.__get_row_index() for index, recipe in enumerate(recipes): if index % self._MAX_COLUMN_COUNT == 0:", ...
[ "class Spot(AutotoolsPackage): \"\"\"Spot is a C++11 library for omega-automata manipulation and model checking.\"\"\"", "is a C++11 library for omega-automata manipulation and model checking.\"\"\" homepage = \"https://spot.lrde.epita.fr/\"", "# # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import ...
[]
[ "2) - 0.1, 100), 2.75 * np.ones(100), c='gray') plt.plot(((time_extended[-1001] + time_extended[-1000]) / 2)", "in range(neural_network_m): P[:-1, col] = lsq_signal[(-(neural_network_m + neural_network_k - col)):(-(neural_network_m - col))] P[-1,", "* 0.75, box_0.height * 0.9]) ax.legend(loc='center left', bbox...
[ "args.local_rank not in [-1, 0]: torch.distributed.barrier() tokenizer = GPT2Tokenizer.from_pretrained(args.model) model = GPT2LMHeadModel.from_pretrained(args.model) #model", "= torch.device(\"cuda\") args.n_gpu = 1 else: torch.cuda.set_device(args.local_rank) device = torch.device('cuda', args.local_rank) torch...
[ "You can install it with ' 'pip: \"pip install google-cloud-storage\"' ) gcs =", "Returns: :obj:`str`: location of safe local path \"\"\" shutil.copytree(bundle_path, target_dir) @resolve_remote_bundle def load_from_dir(bundle_path):", "may only available during the bundle save process model_service_class._env....
[ "op.execute(\"ALTER TABLE services ALTER rate_limit SET DEFAULT '3000'\") op.execute(\"ALTER TABLE services_history ALTER rate_limit", "DEFAULT\") def downgrade(): op.execute(\"ALTER TABLE services ALTER rate_limit SET DEFAULT '3000'\") op.execute(\"ALTER TABLE", "ID: 0158_remove_rate_limit_default Revises: 015...
[ "create directory!!!!!\") raise print(\"Generating post : \",f_dir) with open(f_dir, 'w') as f: f.write('---')", "Post\\n\") post_name = input('Input Post Name: ') date_time = datetime.now() date_time_dir = date_time.strftime(\"%Y-%m-%d\")", "\",\"-\") p_name = p_name.replace(\"[\",\"\") p_name = p_name.replace...
[ "'7.92389e-09', '2.62777e-09', '1.10053e-09']] Kplist = self.reaction2.getEquilibriumConstants(Tlist, type='Kp') for i in range(len(Tlist)): self.assertAlmostEqual(Kplist[i] /", "reactants.reverse() products.reverse() self.assertFalse(self.reaction.hasTemplate(reactants, products)) self.assertFalse(self.reaction....
[ "import views as blogViews from snippets import views as snippetsViews from projects import", "from contents import views as contentsViews from contact import views as contactViews router", "snippetsViews.ProgrammingLanguageViewSet) router.register(r\"projects\", projectsViews.ProjectViewSet) router.register(r\...
[ "* from visualizers import * from milp_formulation import * from robot import *", "try: map_gen_robot_count = int(sys.argv[1]) map_gen_seedval = int(sys.argv[2]) H_control = int(sys.argv[3]) robust_param = int(sys.argv[4])", "pl_opt = ProgressLog() # pl_opt.settings = \"objective_value\" # print(\"pl_opt.settin...
[ "unittest.mock import patch import rfidsecuritysvc.model.guest as model from rfidsecuritysvc.model.color import Color from rfidsecuritysvc.model.guest", "0xABCDEF) @patch('rfidsecuritysvc.model.guest.sound_model') @patch('rfidsecuritysvc.model.guest.table') def test_update_no_prefs(table, sound, default_sound): t...
[ "console.extensions == \"\": return True # Normalize the extension based on the things", "encoding: utf-8 import os import roms def console_roms_directory(configuration, console): \"\"\" If the user", "console_roms_directory(configuration, console): \"\"\" If the user has specified a custom ROMs directory in", ...
[ "K.mean( K.sparse_categorical_crossentropy(y_true, y_pred, from_logits=True) ) def multichoice_accuracy(y_true, y_pred): \"\"\"多项选择的准确率 \"\"\" y_true = K.cast(y_true,", "fw.close() if __name__ == '__main__': evaluator = Evaluator() model.fit_generator( train_generator.forfit(), steps_per_epoch=len(train_generator...
[ "import benchmark # pylint: disable=protected-access def CustomizeBrowserOptionsForOopRasterization(options): \"\"\"Enables flags needed for out of", "found in the LICENSE file. from benchmarks import smoothness,thread_times import page_sets from telemetry", "source code is governed by a BSD-style license that ...
[ "deep_transitive_get(key, d): \"\"\" Transitive get that propagates within tuples >>> from logpy.util import", "+ \")\" return str(g) def index(tup, ind): \"\"\" Fancy indexing with tuples \"\"\"", "and len(t) >= 1 and callable(t[0]): return t[0](*t[1:]) else: return t def intersection(*seqs):", "callable(t[0...
[ "bot.loadfile(filepath) # now comes the custom plugin logic shift = bot.get_arg('shift', type=float, required=True)", "outname = bot.no_extension() + '-shift-%s.txt' % shift # then we set up the", "set up the output outpath = bot.output_filepath(outname) np.savetxt(outpath, data) if __name__ == \"__main__\":", ...
[ "import time \"\"\" examle of usage: cache.memcache=MemcacheClient(request,[127.0.0.1:11211],debug=true) \"\"\" import cPickle as pickle import", "import thread locker = thread.allocate_lock() def MemcacheClient(*a, **b): locker.acquire() if not hasattr(MemcacheClient, '__mc_instance'):", "\"\"\" examle of usag...
[ "= \"some_literal\" class Something(Some_enum): pass class Reference: pass __book_url__ = \"dummy\" __book_version__ =", "class Some_enum(Enum): some_literal = \"some_literal\" class Something(Some_enum): pass class Reference: pass __book_url__ =", "Some_enum(Enum): some_literal = \"some_literal\" class Somethi...
[ "import numbers import os import re import sys from itertools import chain import", "or int, default=1.0 ignore terms that have a document frequency higher than the", "import pickle from .model import get_convo_nn2 from .stop_words import THAI_STOP_WORDS from .utils import", ": type, optional Example ======= ...
[ "if not BoxOps.has_boost(): raise NotImplementedError( \"this op require spconv built with boost, download", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "normal context manager, when a part...
[ "that can be # found in the LICENSE file. \"\"\"Runs Android's lint tool.\"\"\"", "_RunLint(lint_path, config_path, processed_config_path, manifest_path, result_path, product_dir, src_dirs, classes_dir): def _RelativizePath(path): \"\"\"Returns relative path", "with open(result_path, 'wb') as f: f.write(content...
[ "#includes and headers.\"\"\" includes = set() for decl in self._ast.decls: includes.add(decl.cpp_file) if decl.decltype", "headers.\"\"\" includes = set() for decl in self._ast.decls: includes.add(decl.cpp_file) if decl.decltype == ast_pb2.Decl.Type.CONST:", "'' if func_decl.cpp_void_return: return_type = 'voi...
[ "padding=0), # nn.LeakyReLU(negative_slope=0.2, inplace=True), # # nn.Conv2d(ndf * 4, ndf * 8, kernel_size=4,", "nn.Sequential( nn.Conv2d(num_classes, ndf * 4, kernel_size=1, stride=1, padding=0), # x=self.dropout(x) nn.LeakyReLU(negative_slope=0.2, inplace=True), nn.Conv2d(ndf", "* 2, kernel_size=4, stride=2, ...
[ "self.check(): return '%s (%s)' % (self.installed_version, self.OK) else: return '%s (%s)' % (self.installed_version,", "dependency is installed\"\"\" for dependency in DEPENDENCIES: if dependency.modname == modname: return dependency.check()", "[Dependency(modname, features, required_version, installed_version...
[ "3.8', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent'", "setup( name='chemprop', version=__version__, author='<NAME>, <NAME>, <NAME>, <NAME>, <NAME>', author_email='<EMAIL>', description='Molecular Property Prediction with", "open('README.md', encoding='utf-8') as f: long_descrip...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "@classmethod def execute(cls, ctx, op): inp = ctx[op.inputs[0].key] if op.input.ndim == 0 and", "KIND, either express or implied. # See the Licens...
[ "scope): super(FutureImportation, self).__init__(name, source, '__future__') self.used = (scope, source) class Argument(Binding): \"\"\" Represents", "is only used when the submodule import is without an 'as' clause. pyflakes", "if not PY2: for keywordNode in node.keywords: self.handleNode(keywordNode, node) se...
[ "= \"Screenshots\" self.new_folder = directory + \"/\" + datetime.now().strftime(\"%Y_%m_%d-%I_%M_%p\") # all images to", "# Date: 26-10-2020 # License: MIT from pyscreenshot import grab from PIL import", "first image img1 = grab(bbox=self.cords) now = datetime.now().strftime(\"%Y_%m_%d-%I_%M_%S_%p\") fname = s...
[ "= [ \"user_log\", \"system_log\", \"user_system_log\", ] DATETIME_FORMAT = \"%Y-%m-%d %H:%M:%S.%f\" def user_std_handler_log_formatter(record, handler):", "# * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”),您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/l...
[ "_unicode_output(cursor, name, default_type, size, precision, scale): ''' Return strings values as python unicode", "pillar. Filter by args .. code-block:: bash salt '*' oracle.show_dbs salt '*' oracle.show_dbs", "salt '*' oracle.run_query my_db \"select * from my_table\" ''' log.debug('run query on {0}:", "=...
[ "the other shorter c.agent.service.register( 'foo', service_id='foo:1', check=Check.ttl('10s'), tags=['tag:foo:1']) c.agent.service.register( 'foo', service_id='foo:2', check=Check.ttl('100ms')) time.sleep(40/1000.0)", "# session.destroy pytest.raises( consul.ConsulException, c.session.destroy, session_id, dc='dc...
[ "dia = 0 for side_length in range(3,100001,2): hi = side_length**2 for i in", "for i in range(3, int(math.sqrt(n))+1,2)) tot = 1 dia = 0 for side_length", "n % 2 == 0 and n > 2: return False return all(n", "i in range(3, int(math.sqrt(n))+1,2)) tot = 1 dia = 0 for side_length in", "if is_prime(hi-i*side_len...
[ "формулы: для пальто (V/6.5 + 0.5), для костюма (2 * H + 0.3).", "метод\") class Costume(Clothes): def __init__(self, v): self.v = v @property def need_material(self): return", "реализовать абстрактные классы для основных классов проекта, проверить на практике работу декоратора @property.", "__init__(self, h)...
[ "again', LogLevel.Warning) time.sleep(2) def get_movie(tmdb_id): return _get(video_type='movie', movie_id=tmdb_id) def get_show(tvdb_id): return _get(video_type='series', movie_id=tvdb_id)", "and n < 10: try: return __request(req) except urllib2.HTTPError: n += 1 try_again", "def __request(request): log('Send F...
[ "truth image and predicted image. see https://www.geeksforgeeks.org/python-peak-signal-to-noise-ratio-psnr/ for reference Parameters ---------- true image", "np.mean(yb)**2) M = sigma_rgyb + 0.3 * mu_rgyb return M def main(): import", "on Mon Nov 15 10:55:16 2021 @author: Yucheng Parameters ---------- img : cv2...
[ "import InsightFactory pytestmark = pytest.mark.django_db def test_create_new_fake_visitor_instance_using_factory(visitor): pass def test_create_new_instance_using_model_factory(insight): pass def test_fake_instance_is_valid(insight):", "way it should.\"\"\" import pytest from django.core.exceptions import Valida...
[ "# not thread-safe \"test-guppy-guppyTest\", # not thread-safe \"test-smokeTests-brainTests\", # manual (executable test) \"test-batch-GoogleBucketManifestGenerationTest\",", "long-running test \"test-google-googleServiceAccountKeyTest\", # long-running test \"test-portal-dataUploadTest\", # SUPER long-running te...
[ "\"ALL_PLUGIN_EXECUTORS\", []) ALL_EXECUTORS = [ HiveQueryExecutor, PrestoQueryExecutor, MysqlQueryExecutor, DruidQueryExecutor, SqliteQueryExecutor, BigQueryQueryExecutor, SnowflakeQueryExecutor, ]", "SnowflakeQueryExecutor, ] + ALL_PLUGIN_EXECUTORS def get_executor_class(language: str, name: str): for executor ...
[ "= escape_markdown(info[\"summary\"]) # Summary could be completely empty, or just whitespace. if summary", "from bot.bot import Bot from bot.constants import Colours, NEGATIVE_REPLIES, RedirectOutput from bot.log import", "# Summary could be completely empty, or just whitespace. if summary and not", "= \"The...
[ "f(*args, **kwargs) return decorated_function return decorator def admin_required(f): return permission_required(Permission.ADMINISTER)(f) ======= def permission_required(permission):", "current_user from .models import Permission <<<<<<< HEAD def permission_required(permission): def decorator(f): @wraps(f) def",...
[ "x = np.arange(1000) y = np.random.normal(size=(3, 1000)) plotWidget = pg.plot(title='Three plot curves') for", "# -*- coding:utf-8 -*- # @Datetime : 2019/11/14 上午2:26 # @Author : Fangyang", "import pyqtgraph as pg import numpy as np app = QApplication(sys.argv) x =", "np.random.normal(size=(3, 1000)) plotWid...
[ "CStructHelper, OpenCLConverter, detect_type, ocl_detect_type, py2c ) from .types import KnownType, annotate, declare from", "import ExtModule from .extern import Extern from .low_level import Kernel, LocalMem, Cython, cast", "from .extern import Extern from .low_level import Kernel, LocalMem, Cython, cast from...