ngram
listlengths
0
82k
[ "l): bin_args = map(lambda a: a.decode(_ENCODE), l) b = s.decode(_ENCODE)", "= s.decode(_ENCODE) return b.join(bin_args).encode(_ENCODE) logfile_open = open else: path_join =", "a: a.decode(_ENCODE), args) return os.path.join(*bin_args).encode(_ENCODE) def str_join(s, l): bin_args =", "a.decode(_ENCODE), l) b...
[ "worker.result) error = False if worker.result is None: try: error", "self.assertIsNotNone(built_root, \"Environment variable `%s' not set\" % var) executable =", "\"part of extended tests\") class VOMTestCase(VppTestCase): \"\"\" VPP Object Model", "process\") if error: raise Exception( \"Timeout! Worker did...
[ "'we': 'We', 'fr': 'Fr', 'th': 'Th', 'sa': 'Sa', 'su': 'Su',", "'Sa', 'su': 'Su', } class TescoSpider(scrapy.Spider): name = \"tesco\" allowed_domains", "store['location']['id'], 'name': store['location']['name'], 'addr_full': addr_full, 'city': store['location']['contact']['address']['town'], 'state': '', 'cou...
[ "# plain Column objects (in new_cols) + metadata (in mixin_cols).", "Table, QTable, has_info_class from astropy.units.quantity import QuantityInfo __construct_mixin_classes = ('astropy.time.core.Time',", "= col for ii, name in enumerate(colnames): if ii >=", "x], names=['sc', 'x']) >>> represent_mixins_as_col...
[ "F = par day = 0 amountRise = U currH", "False infinity = 1 << 30 def solve(par): H, U,", "[] def parallel(self): self.getInput() p = Pool(4) millis1 = int(round(time.time()", "= 0 while True: amountRise = U * (1 -", "% (day + 1) currH -= D if currH <", "millis1)) self.makeOutput() def makeOutput(self): f...
[ "lambda text, mask: util.get_final_encoder_states(text, mask, bidirectional=True) initializer(self) @overrides def forward(self,", "(default = None) Metadata containing the original tokenization of the", "metadata : ``List[Dict[str, Any]]``, optional, (default = None) Metadata containing", "float]: metric_dic...
[ "--rcfile=tests/pylintrc tests') namespace.add_task(pylint_tests) ##### # # build and distribute #", "set() for root, dirnames, files in os.walk(os.curdir): if '__pycache__' in", "disable=unused-argument dirs = set() for root, dirnames, files in os.walk(os.curdir):", "sdist') namespace.add_task(sdist) @invoke...
[ "run. # You can receive tunables in the command line,", "find the max rate. If this is the case, some", "or any other thing that might make you want to", "after each iteration. :parameters: finding_max_rate: boolean Indicates whether we are", "groups. cpu_util: CPU utilization percentage. tx_pps: TX in pps....
[ "use in the frontend, if any.\"\"\" return self._icon @property def", "timedelta import logging import voluptuous as vol from homeassistant.components.sensor import", "for condition in config[CONF_MONITORED_CONDITIONS]] add_devices(sensors, True) class EpsonPrinterCartridge(Entity): \"\"\"Representation of", ...
[ "be made dormant.\" ) await self.unclaim_channel(channel) else: # Cancel the", "be dormant after the cooldown expires. if claimant_id in self.scheduler:", "def move_to_available(self) -> None: \"\"\"Make a channel available.\"\"\" log.trace(\"Making a", "else: idle_seconds = constants.HelpChannels.deleted_idl...
[ ") # We're going to keep a handle to the", ") # Fetch the appropriate template for an individual item", "= int( options[\"min-quality\"] ) if ( \"max-quality\" in options ):", "# Check for an onpurchase script (perhaps the game reacts", "vendor... self.vendor.remove_erstwhile_acquired_items_from_inventory(u...
[ "logging.debug(\"Searching for installed '%s'...\" % filename) which = procutils.which(filename, os.X_OK)", "count else 3 try: proc = subprocess.Popen([script, '-n', str(count)], close_fds=True,", "extra-info descriptors, and networkstatus document. .. warning: This function can", "this directory as the curre...
[ "part destdir') sys.exit(0) # NOTREACHED pass devname = sys.argv[1] if", "devname = sys.argv[1] if not is_block_device(devname): print( '%s is not", "self.tasks.append(task_fsck(\"fsck partition\", disk=self.disk, partition_id=self.partition_id)) self.tasks.append(task_shrink_partition(\"Shrink partition to sma...
[ "with beam.Pipeline(options=pipeline_options) as pipeline: raw_lines = pipeline | 'ReadFromCsv' >>", "= rating if not math.isnan(rating) else None new_element['Size'] = string_to_megabyte(element['Size'])", "%d, %Y').strftime('%Y-%m-%d') new_element['Category'] = element['Category'] new_element['Genres'] = elem...
[ "exists'}, 404 message.delete() db.session.commit() return {'status': 'sucess', 'message': 'Message Deleted'},", "'Message already exists'}, 400 message = Message(orig_msg=data.get('orig_msg'), tl_msg=data.get('tl_msg'), country=data.get('country'), username=data.get('username'))", "if not message.first(): retu...
[ "1.]), ObjectMsg('lime0', 'package://wecook_assets/data/food/lime.urdf', [0.3, -0.3, 0.757, 0., 0., 0., 1.]),", "0.707, 0.707]), ObjectMsg('chicken0', 'package://wecook_assets/data/food/chicken.urdf', [0.3, 0.075, 0.757, 0., 0., 0.,", "0., 1.]), ObjectMsg('knife0', 'package://wecook_assets/data/objects/knife_bi...
[ "Heartbeat(SubsystemBase): def __init__(self, owner, core, rpc, pubsub, heartbeat_autostart, heartbeat_period): self.owner", "self.pubsub = weakref.ref(pubsub) self.autostart = heartbeat_autostart self.period = heartbeat_period self.enabled", "2.0 (the \"License\"); # you may not use this file", "# Copyright ...
[ "the desired property. \"\"\" category = self._get_single_property(properties, property_name) try: return", "element_name + str(element_amount) return composition_str @staticmethod def _parse_composition_as_dict(raw_composition: List[dict]) ->", "composition has an asterisk in it, which occurs for 6", "dtype=...
[ "username, password = self.get_hosts() self.render_config_template(modules=[{ \"name\": \"postgresql\", \"metricsets\": [\"bgwriter\"], \"hosts\":", "username = \"postgres\" host = self.compose_host() dsn = \"postgres://{}?sslmode=disable\".format(host) return", "['postgresql'] def common_checks(self, output): ...
[ "import torch from pytorch_lightning.accelerators.base_backend import Accelerator from pytorch_lightning.utilities import AMPType,", "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "+ cpu is not supported. Please use a GPU option')", "MisconfigurationException class CPU...
[ "Author, Book, TBR # Register your models here. admin.site.register(Genre) admin.site.register(Author)", "django.contrib import admin from books.models import Genre, Author, Book, TBR", "from books.models import Genre, Author, Book, TBR # Register your", "TBR # Register your models here. admin.site.register(G...
[ "= 'http://{}:{}/api/'.format(HOST, PORT) CONFIG = { 'rabbitmq_api_url': URL, 'rabbitmq_user': 'guest',", "'vhosts': ['test', 'test2'], } EXCHANGE_MESSAGE_STATS = { 'ack': 1.0, 'ack_details':", "['test1'], 'tags': [\"tag1:1\", \"tag2\"], 'exchanges': ['test1'], 'collect_node_metrics': False, } CONFIG_REGEX", ...
[ "a valid semver version string (0.2.0). :rtype: ``str`` \"\"\" version", "'the config or the default values in the schema.') except", "that if metadata.get('ref', None): pack_ref = metadata['ref'] elif pack_directory_name and", "= pack_name or 'unknown' schema = util_schema.get_schema_for_resource_parameters(...
[ "charactercreator_character_inventory AS inventory WHERE character.character_id = inventory.character_id GROUP BY character.name", "COUNT(DISTINCT weapon.item_ptr_id) as weapon_count FROM charactercreator_character AS character LEFT JOIN", "inventory -- characters may have zero items ON character.character_id =...
[ "self.npixels: raise AssertionError(\"`shape` must be unique or have the same", "\"\"\" \"\"\" return len(np.shape(self.shape))==2 @property def geodataframe(self): \"\"\" \"\"\" if", "'geometry', 'id', 'x', 'y') asgrid: [bool] -optional- Should this return", "axis=0) if shift_origin is not None: # not += bec...
[ "dtype.\" raise ValueError(msg) offset = fp.tell() if fortran_order: order =", "is invalid. IOError If the file is not found or", "numpy.dtype({'names': names, 'formats': formats, 'titles': titles, 'offsets': offsets, 'itemsize': offset})", "method. File extensions --------------- We recommend using the ``.np...
[ "list of allowed values (case sensitive) \"\"\" self.symbols = kwargs.get('symbols',", "__slots__ = ('symbols') def __init__(self, **kwargs): \"\"\" -> \"type\": \"enum\",", "= ('symbols') def __init__(self, **kwargs): \"\"\" -> \"type\": \"enum\", \"symbols\":", "return value and value in self.symbols def __...
[ "{ # define nested Bundle \"style\": Bundle( \"scss/*.scss\", filters=(libsass), output=\"style.css\",", "+ 2], 16) for i in (0, 2, 4)) #", "import flask from dateutil.parser import parse from flask_assets import Bundle,", "4)) # noqa except Exception as err: logger.exception(f\"unable to convert", "Environ...
[ "scan if (i == 0) & (tab[0]['EXPTIME'] < 1.1): print('SKIPPING", "plt.subplot(6, len(expids), len(expids)*j + i + 1) plt.xticks([]) plt.yticks([]) im", "c='r') expid_min = int(np.min(expids)) print(focus_z) print(fwhm_pix) plt.savefig(os.path.join(outdir, 'stamps_focus_scan-' + str(expid_min).zfill(8)+'.png'),"...
[ "references(self) -> List[Reference]: return [ Reference(\"Classical and Nonclassical Logics\", [(\"Eric\",", "import Reference from ddq.topics.topic import Topic class Logic(Topic): def references(self)", "List from ddq.taxonomy.reference import Reference from ddq.topics.topic import Topic class", "ddq.topic...
[ "self._single_log_map = set() def __del__(self): if getattr(self, \"summary_writer\", None) is", "Add handler to file channel = logging.FileHandler(filename=self.log_filename, mode=\"a\") channel.setFormatter(formatter) self.logger.addHandler(channel)", "= set() def __del__(self): if getattr(self, \"summary_wri...
[ "None, project: Optional[pulumi.Input[str]] = None, resource_attributes: Optional[pulumi.Input[Sequence[pulumi.Input['AttributeArgs']]]] = None): \"\"\"", "of the resource. :param pulumi.ResourceOptions opts: Options for the resource.", "= pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions)...
[ "import sphinx_rtd_theme source_path = os.path.normpath( os.path.join( os.path.abspath( os.path.split(__file__)[0]))) try: from", "'phdoc_static')] html_static_path = [os.path.join(source_path, 'phdoc_static')] if not os.path.exists(templates_path[0]): raise FileNotFoundError(templates_path[0])", "= [os.path.jo...
[ "systems | +-----------------------------------+-----------------------------------------+ | :mod:`motion <dolfyn.adv.rotate>` | A module containing", "format. | +-----------------------------------+-----------------------------------------+ | :func:`~dolfyn.adv.base.mmload` | A function for loading", "| | | di...
[ "operations = [ migrations.AlterField( model_name='task', name='author', field=models.CharField(default='Anonymous', max_length=100), ), migrations.AlterField(", "[ migrations.AlterField( model_name='task', name='author', field=models.CharField(default='Anonymous', max_length=100), ), migrations.AlterField( model...
[ "OF ANY # KIND, either express or implied. See the", "str = None, sender: str = None): key = None", "\"\" else namespace sender = None if sender == \"\"", "more contributor license agreements. See the NOTICE file # distributed", "= MongoEvent.get_base_events_by_time(start_time) return res def list_all_event...
[ "import ConfdServiceList, ConfdConnection, ConfdConnectionProvider from .statemachine import CspStateMachine from .settings", "'single_rp' state_machine_class = CspStateMachine connection_provider_class = ConfdConnectionProvider subcommand_list = CspServiceList", "from .statemachine import CspStateMachine from ...
[ "name=package.__name__, version=package.__version__, description=package.__description__, long_description=readme(), author=package.__author__, author_email=package.__email__, license=package.__license__, url=package.__url__, download_url=package.__download_url__, keywords", "readme(): with open('README.rst') as ...
[ "= ['macos', 'bundle', 'package', 'redistribute', 'redistributable', 'install_name_tool', 'otool', 'mach'], classifiers", "'rst') if os.path.exists('README.md') else '' except ImportError: description = ''", "'https://github.com/chearon/macpack', download_url = 'https://github.com/chearon/macpack/tarball/v1.0.3...
[ "contoursMapper.ScalarVisibilityOn() contoursMapper.SelectColorArray(\"JPEGImage\") contoursMapper.SetScalarRange(scalarRange) contoursActor = vtk.vtkActor() contoursActor.SetMapper(contoursMapper) actor = vtk.vtkActor()", "vtk.vtkContourFilter() contoursFilter.SetInputConnection(imageDataGeometryFilter.GetOutput...
[ "ob, 'action': action}) ob_error = np.sum(np.abs(newob_from_api - new_ob)) ob =", "self._env.env.sim.data.qpos qvel = self._env.env.sim.data.qvel \"\"\" if self._env_name == 'gym_doublePendulum': if", "----------------------------------------------------------------------------- # @brief: # Tingwu: reset the re...
[ "from .line import * from .mesh import * from .pie", ".line import * from .mesh import * from .pie import", "import * from .mesh import * from .pie import *", "from .create_session import * from .image import * from .line", "* from .image import * from .line import * from", "from .pie import * from .text ...
[ "Uses zmq to speak to daemon controlling screen. from flask", "print(\"Terminating\") if message_process: message_process.terminate() atexit.register(stop_message_loop) @app.before_first_request def setup_ipc(): global message_process", "Queue() message_process = None def message_loop(message_queue): print(\"St...
[ "test_exception_model(self): self.m_c_model.return_value = None self.assertRaises( exception.ClusterStateNotDefined, self.strategy.execute) def test_exception_stale_cdm(self): self.fake_c_cluster.set_cluster_data_model_as_stale()", "2.0 (the \"License\"); # you may not use this file", "watcher.decision_engine.s...
[ "|4 3| | | 5| 7 | ------------- | 7", "| 9| 3| | ------------- | | 9| | |", "Sudoku def main(): s = Sudoku.parse( ''' ------------- | |2", "|51 | 4|9 | | 9| 3| | ------------- |", "|2 | ------------- ''' ) print(s) print(s.solve()) if __name__ ==", "98| | 83|1 |2 | ------------- ''' ) print(s) print(s.sol...
[ "pd.Series(np.concatenate([np.ones((10000)), np.zeros((100000))])) y = y.sample(frac=1.0) _test_sample(y) def test_sample_with_ndarray(): y =", "np.concatenate([ 2*np.ones((10000)), 1*np.ones((10000)), 0*np.ones((10000)), ]) sampler = MajorityUnderSampler() idx =", "y = y.sample(frac=1.0) _test_sample(y) def te...
[ "= [2, 4, 8, 14, 16, 18, 20, 22, 24,", "if rank_result[i] == test_label[i]: num_hits += 1 acc_list.append(float(num_hits)/float(test_length)) #Bloom Wisard", "sys from timeit import default_timer as timer sys.path.append(\"../../\") from core", "data in train_data: train_bin.append(np.array([], dtype=bool)) t...
[ "keyUp(self, key): pass def mouseUp(self, button, pos): pass def mouseMotion(self,", "pass def keyUp(self, key): pass def mouseUp(self, button, pos): pass", "random import uniform import numpy as np class Starter(PygameHelper): def", "self.w, self.h = 800, 600 PygameHelper.__init__(self, size=(self.w, self.h)...
[ "in all_inst: inst.start() for inst in all_inst: inst.join() def main():", "-h, --help : Help\") sys.exit(1) def load_streams(): all_inst = []", "a stream to record\") print() print(\"Usage: %s [Options]\" % (os.path.basename(sys.argv[0])))", "print(\"Options :\") print(\" -d, --dir : Output directory\") prin...
[ "governing permissions and limitations # under the License. from oslo_policy", "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR", "check_str=base.RULE_ADMIN_OR_OWNER, description='List protectable types.', opera...
[ "applications to None to disable the removal of application names", "out=True) '/fcn?query#anchor' >>> filter_url('http://domain.com/appadmin/fcn-1') '/welcome/appadmin/fcn_1' >>> filter_url('http://domain.com/welcome/appadmin/fcn_1', out=True) '/appadmin/fcn-1' >>>", "# '*' as a wildcard. # # The error handlin...
[ "def Always(a: T) -> CCallableUnary[T, CContent]: ... #%% register(Call(Always(w(\"a\")), w(\"idx\")),", "a, idx: a) #%% a_ten = Always(s) #%% s =", "CContent]: ... #%% register(Call(Always(w(\"a\")), w(\"idx\")), lambda a, idx: a) #%%", "w(\"idx\")), lambda a, idx: a) #%% a_ten = Always(s) #%%", "from uarr...
[ "#8843 and #8689 for examples of setuptools added as a", "of hand-formatting. In return, Black gives you speed, determinism, and", "\"https://github.com/psf/black\" url = \"https://pypi.io/packages/source/b/black/black-20.8b1.tar.gz\" version('20.8b1', sha256='1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeea...
[ "testeos[0].estado == estado: send = \"selected\" return send @register.filter(name='addattrs') def", "= compras[0] return p.estado in [\"ST\", \"VD\", \"OL\", \"VT\"] and", "args_parse = args.replace(\"'\", '\"') attr = json.loads(args_parse) except Exception as", "get_producto_pk(f): return f.get_producto_p...
[ "i3))}}[(0, 0)]<gpuarray>(GpuElemwise{Composite{((-i0) - i1)}}[(0, 0)]<gpuarray>.0, GpuArrayConstant{[-1.]}, y, GpuElemwise{Cast{float32}}[]<gpuarray>.0, GpuElemwise{ScalarSigmoid}[(0, 0)]<gpuarray>.0,", "Aesara symbolic variables x = aesara.shared(D[0], name=\"x\") y = aesara.shared(D[1],", "- ((scalar_sigmoid...
[ "shape is :math:`(R, 4)`. :math:`R` is the number of bounding", "+= (y_offset, x_offset) out_bbox[:, 2:] += (y_offset, x_offset) return out_bbox", "axis. Returns: ~numpy.ndarray: Bounding boxes translated according to the given", "point of the image from coordinate :math:`(0, 0)` to coordinate", "number of ...
[ "import ConfigParser from helper.helper_web import get_browser def before_all(context): config =", "type from the configuration file helper_func = get_browser(config.get('Environment', 'Browser')) context.helperfunc", "'setup.cfg'))) my_file = (os.path.join(os.getcwd(), 'setup.cfg')) config.read(my_file) # Read...
[ "def __get_row_index(self) -> int: current_index = self._row_index self._row_index += 1", "<filename>recipe_organizer/gui/recipe_list/recipe_source.py from pathlib import Path from tkinter import Frame, Label", "= file.read() try: recipe = Recipe.from_json(json_data) except KeyError: pass else:", "if event.ev...
[ "manipulation and model checking.\"\"\" homepage = \"https://spot.lrde.epita.fr/\" url = \"http://www.lrde.epita.fr/dload/spot/spot-1.99.3.tar.gz\"", "# SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class", "C++11 library for omega-automata manipulation and model checking.\"\"\" homepage =", ...
[]
[ "np.pi, 5 * np.pi]) axs[0].set_xticklabels(['', '', '', '', '', ''])", "axis += 1 plt.savefig('jss_figures/Duffing_equation_imfs.png') plt.show() hs_ouputs = hilbert_spectrum(t, emd_duff, emd_ht_duff,", "emd.empirical_mode_decomposition(edge_effect='anti-symmetric', optimise_knots=2, verbose=False) fig, axs = p...
[ "type=str, help=\"whether to train or test the model\") parser.add_argument('--id', default='models',", "break avg_loss = 0 if args.local_rank in [-1, 0]: if", "% args.every == 0 and idx > 0: tb_writer.add_scalar(\"perplexity\", math.exp(avg_loss", "if __name__ == '__main__': parser = argparse.ArgumentParser(...
[ "contextlib import contextmanager from urllib.parse import urlparse from typing import", "import PureWindowsPath, PurePosixPath from bentoml.utils.s3 import is_s3_url from bentoml.utils.gcs import", "service_name prefix, for loading from a installed PyPi module_file_path =", "files generated from BentoService...
[ "def upgrade(): op.execute(\"ALTER TABLE services ALTER rate_limit DROP DEFAULT\") op.execute(\"ALTER", "TABLE services ALTER rate_limit DROP DEFAULT\") op.execute(\"ALTER TABLE services_history ALTER", "def downgrade(): op.execute(\"ALTER TABLE services ALTER rate_limit SET DEFAULT '3000'\")", "Revises: 0157...
[ "os.makedirs(os.path.join(dir)) except OSError as e: if e.errno != errno.EEXIST: print(\"Failed", "as f: f.write('---') f.write('\\n') f.write('draft: true') f.write('\\n') f.write('title: \\\"'+post_name+'\\\"') f.write('\\n')", "Post Name: ') date_time = datetime.now() date_time_dir = date_time.strftime(\"%Y-...
[ "comment = \"\"\"H + CH3 -> CH4\"\"\" lindemann = Lindemann(", "other.label.lower() class TestReactionIsomorphism(unittest.TestCase): \"\"\" Contains unit tests of the isomorphism", "SphericalTopRotor from rmgpy.statmech.vibration import Vibration, HarmonicOscillator from rmgpy.statmech.torsion import Torsion,"...
[ "views as tagsViews from contents import views as contentsViews from", "router.register(r\"contents\", contentsViews.ContentViewSet) router.register(r\"contact\", contactViews.MessageViewSet) # List or url patterns for", "as contentsViews from contact import views as contactViews router =", "from snippets imp...
[ "optimal ordering defined by ADG \"\"\" import sys import yaml", "robots_done = [] time_to_goal = {} colors = plt.cm.rainbow( np.arange(len(robot_plan))/len(robot_plan)", "for idx, t in time_to_goal.items(): total_time += t logger.info(\"Total time", "goal_positions = determine_ADG(plans, show_graph=False) no...
[ "table.create.assert_called_once_with('first', 'last', default_sound.id, 0xABCDEF) @patch('rfidsecuritysvc.model.guest.sound_model') @patch('rfidsecuritysvc.model.guest.table') def test_create_SoundNotFoundError(table, sound, default_sound):", "model.list() table.list.assert_called_once() assert models == [_defau...
[ "directory in consoles.txt then return that. Otherwise, append the shortname", "If the user has specified a custom ROMs directory in", "True # Normalize the extension based on the things we", "a custom ROMs directory in consoles.txt then return that. Otherwise,", "ignore. # Aka capitalization, whitespace, a...
[ "0. for x_true, y_true in data: y_pred = model.predict(x_true).reshape((-1, num_classes))", "self.best_val_acc = val_acc model.save_weights('weights/c3.weights') print( u'val_acc: %.5f, best_val_acc: %.5f\\n' %", "valid_data += load_data(data_path + 'c3/d-dev.json') class data_generator(DataGenerator): \"\"\"数据...
[ "with oop rasterization. \"\"\" tag = 'oop_rasterization' page_set = page_sets.Top25SmoothPageSet", "license that can be # found in the LICENSE file.", "{'story_tag_filter': 'fastpath'} def SetExtraBrowserOptions(self, options): super(ThreadTimesOopRasterKeyMobile, self).SetExtraBrowserOptions(options) Customiz...
[ "groupsizes(total, len): \"\"\" Groups of length len that add up", "intersection(*seqs): return (item for item in seqs[0] if all(item in", "0: return tuple(seq) return tuple(it.islice(seq, 0, n)) def evalt(t): \"\"\"", "of goals \"\"\" if callable(g) and hasattr(g, '__name__'): return g.__name__", ">>> from...
[ "index = bot.index_from_args(data) data[index] = data[index] + shift outname =", "+ '-shift-%s.txt' % shift # then we set up the", "= bot.get_arg('shift', type=float, required=True) index = bot.index_from_args(data) data[index] = data[index]", "logic shift = bot.get_arg('shift', type=float, required=True) ind...
[ "MemcacheClient.__mc_instance = _MemcacheClient(*a, **b) locker.release() return MemcacheClient.__mc_instance class _MemcacheClient(Client): def", "if obj: return Client.incr(self,newKey,value) else: self.set(newKey,value,time_expire) return value def set(self,key,value,time_expire=300):", "servers, debug=0, pi...
[ "\"some_literal\" class Something(Some_enum): pass class Reference: pass __book_url__ = \"dummy\"", "= \"some_literal\" class Something(Some_enum): pass class Reference: pass __book_url__ =", "class Some_enum(Enum): some_literal = \"some_literal\" class Something(Some_enum): pass class Reference:", "class Som...
[ "encoding: utf-8 import numbers import os import re import sys", "default=1.0 ignore terms that have a document frequency higher than", "mask &= dfs <= high if low is not None:", "values, row_indices, col_indices = [], [], [] for r, tokens", "0, 2, 1], [0, 1, 1, 0, 1, 0, 1,", "str, Thai text string custom...
[ "cm = optional_cm if condition else nullcontext() with cm: #", "CPU_ONLY_BUILD from spconv.core_cc.csrc.utils.boxops import BoxOps from spconv.core_cc.csrc.sparse.all.ops_cpu1d import Point2VoxelCPU as", "overlap def rbbox_intersection(box_corners: np.ndarray, qbox_corners: np.ndarray, standup_iou: np.ndarray, ...
[ "= issue.getElementsByTagName('location')[0] path = location_elem.attributes['file'].value line = location_elem.getAttribute('line') if line:", "product dir.') parser.add_option('--src-dirs', help='Directories containing java files.') parser.add_option('--classes-dir', help='Directory containing", "Run \"python...
[ "for decl in self._ast.decls: includes.add(decl.cpp_file) if decl.decltype == ast_pb2.Decl.Type.CONST: self._generate_const_variables_headers(decl.const,", "{decl.class_.name.cpp_name}::{decl.class_.name.native};') for member in virtual_members: yield from self._generate_virtual_function( decl.class_.name.native,...
[ "nn.Conv2d(num_classes, ndf * 4, kernel_size=4, stride=2, padding=1), # nn.LeakyReLU(negative_slope=0.2, inplace=True),", "kernel_size=4, stride=2, padding=1), nn.LeakyReLU(negative_slope=0.2, inplace=True), nn.Conv2d(ndf * 4, ndf *", "ndf=64): # H/8,H/8,(1024 -> 256 -> 128 -> 64 ->", "stride=1, padding=0), #...
[ "RuntimeError(\"Unkwown dependency %s\" % modname) def status(deps=DEPENDENCIES, linesep=os.linesep): \"\"\"Return a", "OK = 'OK' NOK = 'NOK' def __init__(self, modname, features,", "under the terms of the MIT License # (see spyder/__init__.py", "add(modname, features, required_version, installed_version=None...
[ "'Demo': 'http://chemprop.csail.mit.edu/', }, license='MIT', packages=find_packages(), package_data={'chemprop': ['py.typed']}, entry_points={ 'console_scripts': [", "install_requires=[ 'flask>=1.1.2', 'hyperopt>=0.2.3', 'matplotlib>=3.1.3', 'numpy>=1.18.1', 'pandas>=1.0.3', 'pandas-flavor>=0.2.0', 'scikit-learn>...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "__init__(self, slices=None, dtype=None, sparse=False, **kw): super().__init__(_slices=slices, _dtype=dtype, _sparse=sparse, **kw) @property", "if inp is None or inp.order == TensorOrder.C_ORDER: return TensorOrder.C_ORDER",...
[ "DoctestScope)) @property def futuresAllowed(self): if not all(isinstance(scope, ModuleScope) for scope", "self.deferAssignment(checkUnusedAssignments) if PY32: def checkReturnWithArgumentInsideGenerator(): \"\"\" Check to see if", "= all_binding # Look for imported names that aren't used.", "'parent'): n, n_...
[ "of screen when any change take place. # Author: Mani", "class AutoScreenshot: def __init__(self, master): self.root = root root.title('Auto Screenshot')", "bg=\"#f44336\", activebackground=\"#ff7043\", activeforeground=\"white\", font=fontRoboto) btn_start.pack(padx=\"10\", pady=\"10\", fill=BOTH) def start(se...
[ "= Logger(\"user_system_log\") # 用于用户异常的详细日志打印 user_detail_log = Logger(\"user_detail_log\") # user_detail_log.handlers.append(StderrHandler(bubble=True)) #", "dt = Environment.get_instance().calendar_dt.strftime(DATETIME_FORMAT) except Exception: dt = datetime.now().strftime(DATETIME_FORMAT) log =", "[] user_s...
[ "in format: user/password@host[:port]/sid[ as {sysdba|sysoper}] ''' import os import logging", "= {} for db in dbs: result[db] = __salt__['pillar.get']('oracle:dbs:' +", "cx_Oracle.connect(user, password, cx_Oracle.makedsn(host, port, sid), mode) conn.outputtypehandler = _unicode_output return", "if HAS_CX_OR...
[ "catalog.register pytest.raises( consul.ConsulException, c.catalog.register, 'foo', '10.1.10.11', dc='dc2') assert c.catalog.register( 'n1',", "True time.sleep(40/1000.0) index, nodes = c.health.service(service_name) assert [node['Service']['ID'] for node", "the behavior assert c.kv.put('foo', '1', acquire=s) i...
[ "int(math.sqrt(n))+1,2)) tot = 1 dia = 0 for side_length in", "False if n % 2 == 0 and n >", "2 == 0 and n > 2: return False return", "side_length**2 for i in range(4): if is_prime(hi-i*side_length+i): dia = dia+1", "1: return False if n % 2 == 0 and", "= dia+1 tot = tot+4 if dia/tot < 0.1: print(side_len...
[ "одежды. Основная сущность (класс) этого проекта — одежда, которая может", "классы для основных классов проекта, проверить на практике работу декоратора", "(V/6.5 + 0.5), для костюма (2 * H + 0.3).", "для основных классов проекта, проверить на практике работу декоратора @property.", "(для пальто) и рост (дл...
[ "request.replace(config.fanart.api_key, 'XXX'), 'DEBUG') headers = {'Accept': 'application/json'} _request = urllib2.Request(request,", "def __request(request): log('Send Fanart Request: ' + request.replace(config.fanart.api_key, 'XXX'), 'DEBUG')", "__request(req) except urllib2.HTTPError: n += 1 try_again = Tr...
[ "| |averagely colourful | 45 | |quite colourful | 59", "from math import log10, sqrt import cv2 import numpy as", "Returns ------- PSNR score ''' mse = np.mean((original - compressed)", "et al., section 7 rg = R - G yb", "M def main(): import matplotlib.pyplot as plt original = cv2.imread(\"test_imgs/origin...
[ "pass def test_fake_instance_is_valid(insight): # Should not raise ValidationError insight.full_clean() def", "import pytest from django.core.exceptions import ValidationError from django.db import DataError", "pass def test_create_new_instance_using_model_factory(insight): pass def test_fake_instance_is_valid(...
[ "(disabled test) \"test-dream-challenge-synapaseLoginTest\", # legacy (disabled test) \"test-prod-checkAllProjectsBucketAccessTest\", # prod", "test) \"test-regressions-generateTestData\", # legacy (disabled test) \"test-regressions-queryPerformanceTest\", # legacy (disabled", "= test_script[0 : test_script.ind...
[ "DruidQueryExecutor, SqliteQueryExecutor, SnowflakeQueryExecutor, ) from .executors.bigquery import BigQueryQueryExecutor ALL_PLUGIN_EXECUTORS =", "ALL_PLUGIN_EXECUTORS = import_plugin(\"executor_plugin\", \"ALL_PLUGIN_EXECUTORS\", []) ALL_EXECUTORS = [ HiveQueryExecutor, PrestoQueryExecutor,", "BigQueryQueryEx...
[ "PYPI_COLOURS = itertools.cycle((Colours.yellow, Colours.blue, Colours.white)) ILLEGAL_CHARACTERS = re.compile(r\"[^-_.a-zA-Z0-9]+\") INVALID_INPUT_DELETE_DELAY =", "package.\" log.trace(f\"Error when fetching PyPi package: {response.status}.\") if error: error_message", "\"\"\"Cog for getting information about...
[ "current_user.can(permission): abort(403) return f(*args, **kwargs) return decorated_function return decorator def", "decorated_function(*args,**kwargs): if not current_user.can(permission): abort(403) return f(*args,**kwargs) return decorated_function return", "wraps from flask import abort from flask_login im...
[ "# @Author : Fangyang # @Software : PyCharm import sys", "# -*- coding:utf-8 -*- # @Datetime : 2019/11/14 上午2:26 #", "import QApplication import pyqtgraph as pg import numpy as np", "1000)) plotWidget = pg.plot(title='Three plot curves') for i in range(3):", "<reponame>jojoquant/jnpy # !/usr/bin/env python3...
[ "Config from .cython_generator import ( CythonGenerator, get_func_definition ) from .ext_module", "Scan, elementwise ) from .profile import ( get_profile_info, named_profile, profile,", ") from .translator import ( CConverter, CStructHelper, OpenCLConverter, detect_type, ocl_detect_type,", "from .types import...