ngram listlengths 0 67.8k |
|---|
[
"\"\"\" Training \"\"\" opt = Options().parse() opt.print_freq = opt.batchsize seed(opt.manualseed) print(\"Seed:\", str(torch.seed())) if",
"seed ## def main(): \"\"\" Training \"\"\" opt = Options().parse() opt.print_freq = opt.batchsize",
"= opt.batchsize seed(opt.manualseed) print(\"Seed:\", str(torch.seed(... |
[
"mixins, viewsets from ..models import Rank from ..serializers import RankSerializer class RanksViewSet(mixins.ListModelMixin, viewsets.GenericViewSet):",
"viewsets from ..models import Rank from ..serializers import RankSerializer class RanksViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): serializer_cla... |
[
"msg def remove_member(self, member_id: int): if self.state and \"members\" in self.state: self.state[\"members\"].remove(member_id) self.save_state()",
"of 1000\\n\" for player_id in self.get_members(): player = Player.load(player_id) player_leveled_up = player.add_points_and_check_for_levelup(word_points) if",
... |
[
"= 10 random_state = np.random.RandomState(1234567890) df1 = pd.DataFrame({'x': [1, 2, 1, 2], 'y':",
"1, 2, 2]}) p = (ggplot(df1, aes('x', 'y')) + geom_point(size=10) + geom_jitter(size=10, color='red',",
"= geom_point(position=position_jitter) assert isinstance(position.from_geom(geom), position_jitter) def te... |
[
"make list of 'v_|l' last names, which can possibly have multiple # tokens",
"[etal] names = name_name_sep.join(ls) if lower_name: names = names.lower() format_dict['names'] = names year",
"key == 'crossref': try: val = val['citekey'] #might be an entry except TypeError:",
"it looks like a macro, but is not: ... |
[
"frappe.db.get_value(\"Labour Information\",{\"emp_id\": emp_id}): test_record = { \"doctype\": \"Labour Information\", \"title\": \"_Test Labour Information\",",
"test_record = { \"doctype\": \"Labour Information\", \"title\": \"_Test Labour Information\", \"category\": \"STAFF\", \"name1\":\"abc\",",
"import ... |
[
"author=AUTHOR, author_email=EMAIL, python_requires=REQUIRES_PYTHON, url=URL, description=DESCRIPTION, long_description=open('README.md').read(), license=LICENSE, packages=find_packages(), keywords='Solr GOlr golr-schema', classifiers=[ 'License",
"= 'https://github.com/deepakunni3/golr-schema-generator' AUTHOR =... |
[
"command class AliasedGroup(click.Group): def get_command(self, ctx, cmd_name): rv = click.Group.get_command(self, ctx, cmd_name) if",
"if not (json_obj and json_obj != NULL and token): return json_obj index =",
"of array)\") elif len(g) > 2: message = \", \".join([str(r) for r in",
"key or key with one index... |
[
"import os BASE_DIR = os.path.abspath(os.path.dirname(__file__)) MAIN_DB_URL = os.path.join(BASE_DIR, 'bucketlist.sqlite') TEST_DB_URL = os.path.join(BASE_DIR, 'test.sqlite')",
"for the development environment ''' SQLALCHEMY_DATABASE_URI = 'sqlite:///' + MAIN_DB_URL DEBUG = True",
"ERROR_404_HELP = False DEBUG ... |
[
"a table?\" rowid = ModelTests.MyTable.insert(self.db, count=3, name=\"foobar\") found = self.db.execute(\"SELECT count, name FROM",
"from the table with a where clause?\" rowids = self._makerows() results = ModelTests.MyTable.list_where(self.db,",
"\"foo\") self.assertEqual(results.count, 2) def test_search_ma... |
[
"and extract it into a data folder. Usefull for downloading small datasets. The",
"import urllib.request from zipfile import ZipFile def download_zip(root_dir: str, url: str) -> None:",
"it into a data folder. Usefull for downloading small datasets. The zip file",
"os.path.exists(os.path.join(root_dir, datase... |
[
"only MD5 hash class :py:class:`Md5` \"\"\" from .hash import Hash from .md5 import",
"class :py:class:`Md5` \"\"\" from .hash import Hash from .md5 import Md5 __all__ =",
"contains only MD5 hash class :py:class:`Md5` \"\"\" from .hash import Hash from .md5",
":py:class:`Hash` from which all hash implementati... |
[
"numbers = tuple(map(int, input().split())) print(numpy.zeros(numbers, dtype = numpy.int), numpy.ones(numbers, dtype = numpy.int), sep='\\n')",
"numpy numbers = tuple(map(int, input().split())) print(numpy.zeros(numbers, dtype = numpy.int), numpy.ones(numbers, dtype = numpy.int),",
"import numpy numbers = tuple... |
[
"{status}', u'Computer Name: {computer_name}', u'Terminal: {terminal}'] FORMAT_STRING_SHORT_PIECES = [u'User: {user}'] SOURCE_LONG = u'UTMPX",
"of FormatterMediator). event_object: the event object (instance of EventObject). Returns: A tuple containing",
"event_values.get(u'status_type', None) if status_type is... |
[
"# License: MIT # from time import localtime as ltime def saveLog(content, tag=\"INFO\"):",
"into log file like normal log ''' saveLog('In {0} error: {1}'.format(path, error), 'error')",
"behaviors into log file # Author: @k1k9 # License: MIT # from time",
"Config logDate = '{0}/{1}/{2} {3}:{4}:{5}'.format(lt... |
[
"'param3'] action2 [-arg1 'param1' -arg2] action3 [-arg1 -arg2] # Run any script from",
"not the greatest dimension.') return parser def nuc_args(self, parser): # Add specific arguments",
"[skip]') top_parser.add_argument('-dt', '--delete_temp', action='store_true', help='Delete temp files upon completion [Fals... |
[
"def test_KDClassifierRF(data): X, y = data clf = KDClassifierRF() assert hasattr(clf, 'approx') assert",
"'rbf_sampler_') y_pred = clf.predict(X) assert y_pred.shape == (X.shape[0],) def test_KDClassifierSORF(data): X, y =",
"= KDClassifierRF(approx=approx, sampler=RBFSamplerORF()) clf.fit(X, y) assert hasattr... |
[
"applications. Sample use cases include: Golden training sets management Reproducibility (dataset training snapshot)",
"before any major process. For example, a snapshot can serve as a roll-back",
"a reference to the original binary and not a new copy of the",
"datasets on the same item. * Different datasets ... |
[
"ansible.utils as utils import ansible.errors as errors def flatten_hash_to_list(terms): ret = [] for",
"distributed in the hope that it will be useful, # but WITHOUT ANY",
"= basedir def run(self, terms, inject=None, **kwargs): terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject) if",
"file... |
[
"seconds.', line) reindeer, speed, time, rest = m.groups() distances[reindeer] = cycle([int(speed)] * int(time)",
"r'but then must rest for (\\d+) seconds.', line) reindeer, speed, time, rest =",
"fly (\\d+) km/s for (\\d+) seconds, ' r'but then must rest for (\\d+)",
"(\\d+) seconds, ' r'but then must rest f... |
[
"# Uncomment the next two lines to enable the admin: from django.contrib import",
"admin: from django.contrib import admin from django.conf.urls.static import static from django.conf import settings",
"url from dolove import views # Uncomment the next two lines to enable",
"next two lines to enable the admin:... |
[
"PASSWORD = \"<PASSWORD>\" today = dt.datetime.now() today_tuple = (today.month, today.day) data = pandas.read_csv(\"birthdays.csv\")",
"contents = contents.replace(\"[NAME]\", birthday_person[\"name\"]) with smtplib.SMTP_SSL(\"smtp.gmail.com\") as connection: connection.login(MY_EMAIL, PASSWORD) connection.sendm... |
[
"(subsequent calls will use xout from first integration). y0 : array_like Passed on",
"array_like Positive, monotonically increasing 1D array. x : array_like Passed on to ``odesys.integrate``",
"ValueError(\"Neither atol nor rtol are allowed in kwargs\") if not np.all(atols > 0)",
"to obey strict positive mon... |
[
"PremiumizeMe(MultiAccount): __name__ = \"PremiumizeMe\" __type__ = \"account\" __version__ = \"0.30\" __status__ = \"testing\"",
"= \"0.5\" __config__ = [ (\"mh_mode\", \"all;listed;unlisted\", \"Filter hosters to use\", \"all\"), (\"mh_list\",",
"= \"0.30\" __status__ = \"testing\" __pyload_version__ = \"0.5\... |
[
"from django.urls import path from . import views urlpatterns = [ path('item/', views.ItemListCreate.as_view()),",
"django.urls import path from . import views urlpatterns = [ path('item/', views.ItemListCreate.as_view()), ]",
"<gh_stars>0 from django.urls import path from . import views urlpatterns = [ path('i... |
[
"os.path.join('.', 'requirements.txt') with open(reqs_path, 'r') as f: requirements = [line.rstrip() for line in",
"version='0.1.0', description='Sample package for Python-Guide.org', long_description=readme, author='<NAME>', author_email='<EMAIL>', install_requires=read_requirements(), url='test', license=licens... |
[
"model.to_json() assert json == REGISTRY def test_registry_model_add_image(): model = RegistryModel.from_json(REGISTRY) image = ImageModel.from_json(IMAGE1)",
"\"value1\"}, \"Architecture\": \"ppc64le\", \"Digest\": \"sha256:beebee\", \"Labels\": {\"key2\": \"value2\"}, \"MediaType\": \"application/vnd.docker.dis... |
[
"return None for path in scriptPaths: testPath = path +'/' + _filename if",
"return cmds.file(q=True, sn=True).split('/')[-1] def getPathFindFile(_filename): u''' MAYA_SCRIPT_PATH안에 파일이 있으면 경로값을, 없으면 None을 반환",
"한칸 읽어오기(unicode) return cmds.file(q=True, sn=True).split('/')[-1] def getPathFindFile(_filename): u'... |
[
"django.apps import AppConfig class AppConfigTrade(AppConfig): name = \"trades\" def ready(self): from trades.signals.post_save import",
"from django.apps import AppConfig class AppConfigTrade(AppConfig): name = \"trades\" def ready(self): from trades.signals.post_save",
"import AppConfig class AppConfigTrade(A... |
[
"program has taken') print('given the fact that I know it used MT19937!') print('\\nNow",
"super-insecure randomness using timestamp!') else: print('Huh? That\\'s all you have? The real timestamp",
"def main(): start_time = time.time() print('Pending...') delay(random.randint(40,1000)) timestamp = int(time.time... |
[
"# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you",
"writing, software # distributed under the License is distributed on an \"AS IS\"",
"var to a port of a socket server. See `guild.cmd_notify` for details. \"\"\"",
"from guild import log from guild import util def main(args): _init... |
[
"def wifi(): class Communicator(WifiCommunicator): def __init__(self): self.commands = WifiCommands(self) self.settings = WifiSettings(self) def",
"Communicator() def test_get_with_no_params(wifi): url = wifi.commands.set_third_party_client_info() assert url == \"gp/gpControl/command/set_client_info\" def test_ge... |
[
"from praline.client.project.pipeline.stages.stage import stage from praline.client.repository.remote_proxy import RemoteProxy from praline.common.file_system import FileSystem, join",
"pass def predicate(file_system: FileSystem, program_arguments: Dict[str, Any], configuration: Dict[str, Any]): return not progra... |
[
"if cleaned.get('password'): logger.info(\"%s successfully logged in\", self.cleaned_data['username']) else: logger.warn(\"Failed login attempt for %s\",",
"( AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm) from django.utils.translation import ugettext_lazy as _ from contenteditor import",
"that ... |
[
"= \"kalliochannel\" self.message = \"kalliomessage\" def testParameters(self): def run_test(parameters_to_test): with self.assertRaises(MissingParameterException): Slack(**parameters_to_test) #",
"\"kalliochannel\" self.message = \"kalliomessage\" def testParameters(self): def run_test(parameters_to_test): with ... |
[
"req = msgs.SpannerProjectsInstanceConfigsGetRequest( name=ref.RelativeName()) return client.projects_instanceConfigs.Get(req) def List(): \"\"\"List instance configs in the",
"KIND, either express or implied. # See the License for the specific language",
"Unless required by applicable law or agreed to in writi... |
[
"{\"ANT\": \"walk\", \"BEE\": \"flies\", \"CAT\": \"meows\", \"DOG\": \"barks\"} Animal = Enum(\"Animal\", {k: k",
"import Enum from typing import Optional import uvicorn from fastapi import FastAPI, Query",
"doug = \"doug\" @app.get(\"/hello\") async def hello(name: NameEnum = Query(NameEnum.empty, alias=\"fir... |
[
"True))[0] except IndexError: return autocomplete.__version__ return pkg.version version = autocomplete.get_mercurial_version() or get_metadata_version() setup(",
"= 'http://bitbucket.org/tyrion/django-autocomplete', download_url = 'http://bitbucket.org/tyrion/django-autocomplete/downloads', packages = ['autocomp... |
[
"\"\"\" style_paths = [ plots.styles(s) for s in plots.get_available_styles()] assert all(os.path.isfile(s) for s",
"sizes.\"\"\" ret = plots.figsize(10) assert ret == (10, 6.1803398874989481) def test_get_subplot_arrangement(self): \"\"\"Test the",
"determination of subplot arrangements.\"\"\" shape = plots.ge... |
[
"toolkit.get_action('package_search')({}, {'rows': 1}) if result.get('count'): count = result.get('count') return count def get_hero_images(): resources",
"plugins.implements(plugins.ITemplateHelpers) # IConfigurer def update_config(self, config_): toolkit.add_template_directory(config_, 'templates') toolkit.add_... |
[
"= logging.getLogger('graphsignal') class GraphsignalTest(unittest.TestCase): def setUp(self): if len(logger.handlers) == 0: logger.addHandler(logging.StreamHandler(sys.stdout)) graphsignal.configure(api_key='k1', debug_mode=True)",
"class GraphsignalTest(unittest.TestCase): def setUp(self): if len(logger.handler... |
[
"Exception(g) class PathBuilder: def __init__(self, objects): self.objects = objects self.objects_by_id = {o['id']:o for",
"= [] parent['children_ids'].append(o['id']) self.__build_path_helper__(parent) parent_ids = parent['ids'] parent_names = parent['names'] o['ids'] = parent_ids",
"g in groups: if g['groupMe... |
[
"# Gets folder where icons are located for file in os.listdir(directory): # Gets",
"folder that name ends with .png \"\"\" directory = os.fsencode( \"icons/\") # Gets",
"folder where icons are located for file in os.listdir(directory): # Gets every file",
"PIL import Image # https://pillow.readthedocs.io/en/s... |
[
"os.path.join( os.path.split(sys.argv[0])[0], \"reader\", \"importer\", \"perseus_import_policy.json\") selection_policy = JSONImportPolicy() selection_policy.load_policy( import_policy_file ) perseus_batch_importer =",
"perseus_batch_importer = PerseusBatchImporter( perseus_directory= directory, book_selection_p... |
[
"config.batch_size num_batches = 1000 / batch_size eval_dataloader = DataLoader(small_eval_dataset, batch_size=8) model = AutoModelForSequenceClassification.from_pretrained(model_path)",
"print(f\"\\tRunning batch {ite+1} of {num_batches}\", end=\"\\r\") batch = {k: v.to(device) for k, v",
"v.to(device) for k, ... |
[
"HeavyIonsAnalysis.TrackAnalysis.trackAnalyzer_cfi import * anaTrack = ppTrack.clone( trackPtMin = 0.49, trackSrc = cms.InputTag(\"hiGeneralTracks\"), vertexSrc",
"cms.InputTag('hiGeneralTracks','MVAVals'), pfCandSrc = cms.InputTag(\"particleFlowTmp\"), doMVA = False ) pixelTrack = anaTrack.clone( trackPtMin =",
... |
[
"k = len(arr) for i in range(k): for j in range(k): if j",
"= [] for num in reversed(arr): if suffix_products: suffix_products.append(suffix_products[-1] * num) else: suffix_products.append(num)",
"of numbers before the i'th index and after i'th index def products(arr): #Generate",
"numbers before the i'th in... |
[
"itr in range(1, int(number_of_token)): token = { 'token': randomStringDigits(40), 'counter': 0, 'isAvailable': True,",
"\"\"\"Generate a random string of letters and digits \"\"\" lettersAndDigits = string.ascii_letters +",
"token = { 'token': randomStringDigits(40), 'counter': 0, 'isAvailable': True, 'last_ac... |
[
"conclusion): count += 1 # 输出分段,提示是否继续显示内容 continueRet, flag = self.inputContinue(i, count, total, flag,",
"else: s += \"\\n\" return s def __showDetailsBody(self, sessUUID = \"\", targConclusion =",
"\"\", sessUUID = \"\", targConclusion=\"\"): fileNameList = [] sessLogInfoDict = self.getSessLogInfoDict() newP... |
[
"import demo3_module a = np.array([[1, 2], [3, 4]], dtype=float) print \"Trace of a:\",",
"numpy as np import demo3_module a = np.array([[1, 2], [3, 4]], dtype=float) print",
"demo3_module a = np.array([[1, 2], [3, 4]], dtype=float) print \"Trace of a:\", demo3_module.trace(a)",
"import numpy as np import dem... |
[
"import add_default_exception_handling from functools import partial class NotificationWindowController(ControllerBase): \"\"\"Controller of the notification window.\"\"\"",
"import NotificationWindowView from lib.exception_feedback import add_default_exception_handling from functools import partial class Notific... |
[
"'https://github.com/nuxy/bittrex_autotrader', download_url = 'https://github.com/nuxy/bittrex_autotrader/archive/0.0.{0}.tar.gz'.format(version), keywords = ['trading-bot', 'api-client', 'cryptocurrency', 'bittrex'], classifiers = [],",
"nutshell.', author = '<NAME>', author_email = '<EMAIL>', url = 'https://git... |
[
"\"\"\" from typing import Optional, Any from smlb import ( params, Random, RandomVectorSampler,",
"_minimize(self, data: VectorSpaceData, function_tracker: TrackedTransformation): \"\"\"Generate num_samples random samples and evaluate them.\"\"\" samples",
"of `data` parameter passed to `optimize()`. rng: pseu... |
[
"val @property def user_account_control_settings(self): \"\"\" Gets and sets the userAccountControlSettings Returns: :class:`WindowsUserAccountControlSettings<onedrivesdk.model.windows_user_account_control_settings.WindowsUserAccountControlSettings>`: The",
"sets the browserEnterpriseModeSiteListLocation Returns:... |
[
"= json.dumps(data) if isinstance(proxy, bytes): proxy = proxy.decode() return proxy elif format ==",
"elif format == \"toml\": return toml.dumps(data) elif format == \"yaml\": return yaml.dump(data) elif",
"{group.upper()}\\n\") for extras, version in values.items(): result.append(f\"{extras}=={version}\\n\") ... |
[
"args.launchEuler: launchEuler(NUS[i], EPS[i], RUN[i]) #for nu in [0.002, 0.004, 0.008] : # for",
"for nu in np.logspace(np.log10(0.002), np.log10(0.02), 16) : for eps in np.logspace(np.log10(0.01), np.log10(2.0), 16)",
"python3 import os, numpy as np, argparse def relFit(nu, eps): return 7.33972668 *",
"laun... |
[
"x in enumerate(score_vector[1:], 1): if max_ending_here < 0: max_ending_here = x begin_temp =",
"def compute_max_subarrays_sequence(seq=None, score=None, min_subarray_size=None, max_subarray_size=None, output='minimal', margin=1): # extract subarrays for subarray in",
"(begin,end) of subarray in each element b... |
[
"is not None) # pylint: disable=E1101 tr1 = self.get_model(model) tr2 = self.get_model(new_model) X",
"skl2onnx.helpers.onnx_helper import load_onnx_model, save_onnx_model from skl2onnx.helpers.onnx_helper import select_model_inputs_outputs from skl2onnx.helpers.onnx_helper import enumerate_model_node_outputs fro... |
[
": ... def handle_data( self, data ) : data = string.replace( data, '\\r',",
"import string class Stripper( SGMLParser ) : ... def handle_data( self, data )",
"Stripper( SGMLParser ) : ... def handle_data( self, data ) : data =",
") : ... def handle_data( self, data ) : data = string.replace( data,",
"class... |
[
"# cls_reg_targets = bbox_target( # pos_proposals, # neg_proposals, # pos_gt_bboxes, # pos_gt_labels, #",
"i in range(mask_conv): # conv_m = ConvModule(1, 1, 3, padding=1, conv_cfg=conv_cfg, norm_cfg=norm_cfg) #",
"torch import torch.nn.functional as F import mmcv from mmdet.core import mask_target, mask_bg_tar... |
[
"match[\"score\"] = request.get(\"score\").replace(' ', '') return match def parse_ended_match_to_db(request): parsed_match = { \"home_team\":",
"logger = LoggerService().logger def create_match(self, data): return self.client.FMT[\"matches\"].insert_one(data).inserted_id def update_match(self, data): return self... |
[
"o preço do produto: R$')) calc = preco - ((5 / 100) *",
"preço do produto: R$')) calc = preco - ((5 / 100) * preco)",
"preco - ((5 / 100) * preco) print(f'Preço digitado R${preco}\\nDesconto: 5%\\nPreço com desconto:",
"produto: R$')) calc = preco - ((5 / 100) * preco) print(f'Preço digitado",
"- ((5 / 100... |
[
"= None, processes=1) -> None: \"\"\" Iterates over each ASFProduct and downloads them",
"in self] } def __str__(self): return json.dumps(self.geojson(), indent=2, sort_keys=True) def download(self, path: str,",
"product in self] pool.map(_download_product, args) pool.close() pool.join() def _download_product(a... |
[
"and high is not None and low > high: raise InvalidSubsettingException( \"Invalid bounds:",
"False return True def _check_subset(self, subset): if not isinstance(subset, Subset): raise ValueError(\"Supplied argument",
"== \"contains\": if high is not None: qs = qs.filter( end_time__lte=high ) if",
"InvalidSub... |
[
"import sys from typing import Dict, Optional, Tuple, cast SRC_VERSION_RE = re.compile(r\"^.*\\(([^=]*)===?([^=]*)\\)$\") VERSION_RE",
"Parse plain and editable versions. See test_genversion.py for examples. \"\"\" src_matcher = SRC_VERSION_RE.match(comp)",
"typing import Dict, Optional, Tuple, cast SRC_VERSION... |
[
"@property def record_type(self): try: return self.__record_type except AttributeError: return None @property def domain_id(self):",
"def record_type(self): try: return self.__record_type except AttributeError: return None @property def domain_id(self): try:",
"= protocol self.__domain = domain @property def re... |
[
"# Default primary fraction range to be used if it is not defined",
"scaling factors Type 2: Zero-attenuator direct beams Type 3: Data that we don't",
"show_dx=False) else: plot_div = plot1d(first_run_of_set+r, [[x, y, dy, dx]], instrument='REF_L', x_title=u\"q (1/A)\", x_log=True,",
"ScalingWavelengthCutoff=... |
[
"content2 = fp.read() finally: fp.close() # The not-handled exception may be raised here",
"self.mimes) if not fobj: try: if realfname : fname = realfname else: try:",
"= obj f = True for ext in obj._getExtensions(): self.exts[ext] = obj f",
"obj): f = False for mime in obj._getMimeTypes(): self.mimes[mime] =... |
[
"model): allowed_chars = {line.strip() for line in open(allowed_chars_file, encoding='utf-8') if len(line.strip()) == 1}",
"data/kws_prep/dev.words\") print(\"This script prints a stdout word and its morpheme constituents according to",
"import morfessor import sys import logging import lzma import os import ma... |
[
"return random_depth def copy_t2t(depth): my_tree = generate_data(depth-1) change_nts(my_tree) my_list = convert_to_list_inorder(my_tree,[]) infix_tree =",
"'w') elif t2t_operation == \"RELABEL_1\": data = create_examples(num_examples,max_depth, function=copy_t2t) trans = open(DATA_DIR +",
"random DATA_DIR = \"... |
[
"setuptools import setup setup( name='GroupMe Notifier', version=0.1, description='GroupMe Notifier is a tool for",
"name='GroupMe Notifier', version=0.1, description='GroupMe Notifier is a tool for getting notifications on desktop',",
"is a tool for getting notifications on desktop', author='<NAME>', author_em... |
[
"root.value < max_value): return False return check_bst_util(root.left, min, root.value) and check_bst_util(root.right, root.value, max)",
"None: return True if not (min_value < root.value < max_value): return False return",
"return True if not (min_value < root.value < max_value): return False return check_bst... |
[
"for js in js_list: self._page_js_list.append(js) self._page_updated = True self._page_lock.off() return self def head(self,",
"head(self, html): self._page_lock.on() self._page_head = html self._page_updated = True self._page_lock.off() return self def",
"key_low = key.lower() own_attrs[key_low] = '%s %s' % (v... |
[] |
[
"solver.solve_issues() # plot overall weighted census score over time (password is not required",
"Rights\",), }, policy={ \"No Internet\": -10 }) # solve issues for the nation:",
"here>\" CONTACT = \"<Nationstates demands that the User Agent contain a method of",
"\"Averageness\", \"Death Rate\", \"Taxation\... |
[
"# Generic release markers: # X.Y # X.Y.Z # For bugfix releases #",
"markers: # X.YaN # Alpha release # X.YbN # Beta release # X.YrcN",
"Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer. #",
"example! \"\"\" # PEP0440 compatible formatted version, see: # https://www.python.org/dev/peps/pep-... |
[
"# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you",
"writing, software # distributed under the License is distributed on an \"AS IS\"",
"from StringIO import StringIO except ImportError: from io import StringIO from distutils.version import",
"LooseVersion from requests.exceptions i... |
[
"draw_branch(branch_length-10, pen_size) turtle.right(20) turtle.backward(branch_length) def main(): # 画笔起始位置 turtle.right(90) turtle.penup() turtle.forward(300) turtle.pendown() turtle.left(90)",
"# 画笔起始位置 turtle.right(90) turtle.penup() turtle.forward(300) turtle.pendown() turtle.left(90) turtle.left(90) draw_b... |
[
"# # Permission is hereby granted, free of charge, to any person #",
"= False if version < 8: self.mouse_move = False if version < 9:",
"do a performance test on startup? self.performance_test = True # The language we",
"anymore.) self.mute = { } # Joystick mappings. self.joymap = dict() # The",
"False) def... |
[
"= [ ('core', '0014_auto_20190417_1639'), ] operations = [ migrations.AlterUniqueTogether( name='documentpart', unique_together={('order', 'document')}, ),",
"from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0014_auto_20190417_1639'), ] operations",
"Django 2.1.... |
[
"+ \"_internal, //data\\n\\ };\\n\\ CODE UINT8 \" + map_name + \"_collision_tiles[] = \"",
"\\\"\" + map_name + \"_tiles.h\\\"\\n\\ #include \\\"MapInfo.h\\\"\\n\\ #include \\\"types.h\\\"\\n\\ const struct MapInfoInternal \"",
"\" + map_name + \";\\n\\ extern UINT8 \" + map_name + \"_collision_tiles;\\n\\ exte... |
[
"dependencies = [ ('des', '0032_auto_20210713_2127'), ] operations = [ migrations.AlterField( model_name='astrometryjob', name='status', field=models.IntegerField(choices=[(1,",
"14:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('des', '0032_auto_20210713_2127... |
[
"(\"S\", 1), (\"W\", 2)] ) def test_nonzero(nfa, label, expected_nnz): bm = BooleanMatrices(nfa) actual_nnz",
"\"label,expected_nnz\", [(\"X\", 2), (\"Y\", 1), (\"Z\", 1), (\"S\", 1), (\"W\", 2)] ) def",
"test_symbols(nfa): bm = BooleanMatrices(nfa) actual_symbols = bm.bool_matrices.keys() expected_symbols = nf... |
[
"# -*- coding: UTF-8 -*- class Solution(object): def test76(self): ''' 题目:编写一个函数,输入n为偶数时,调用函数求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/n ''' return",
"#!/usr/local/bin/python3 # -*- coding: UTF-8 -*- class Solution(object): def test76(self): ''' 题目:编写一个函数,输入n为偶数时,调用函数求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/... |
[
"@click.pass_obj def docs(obj): \"\"\"Open the online documentation in a web browser.\"\"\" browser.open(config.documentation_url()) cli.add_command(auth)",
"endpoint): \"\"\"ElectricDB - Low latency database hosting.\"\"\" ctx.obj = NotImplemented @cli.command() @click.pass_obj def",
"auth # from .resources.ac... |
[
"reverse_lazy(\"login\") class EditMixin(LoggedInMixinDefaults, UserPassesTestMixin): \"\"\"Checks whether a user is either a superuser or",
"login_url for mixin defaults.\"\"\" login_url = reverse_lazy(\"login\") class EditMixin(LoggedInMixinDefaults, UserPassesTestMixin): \"\"\"Checks whether a",
"django.cont... |
[
"= QGridLayout() main_layout.addWidget(NameLabel('所持金'), 0, 0, 1, 1) main_layout.addWidget(self['所持金'], 0, 1, 1, 1) main_layout.addWidget(NameLabel('奖励EX'),",
"utf-8 -*- from PySide6.QtWidgets import QGridLayout, QTextEdit from widget import BackgroundFrame, ValueSpin, NameLabel",
"parameter import DataSetting ... |
[
"<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- from .event import * from",
"coding: utf-8 -*- from .event import * from .backtest_event_engine import * from .live_event_engine",
"-*- from .event import * from .backtest_event_engine import * from .live_event_engine import *",
"#!/usr/bin/env... |
[
"'FPB1'), ('FPB1', 'F2'), ('F1', 'B1'), ('B1', 'F2') ) assert set(energy_dct2.keys()) == set(ref_energy_dct2.keys()) assert",
"# Test reading the entire PES with fake wells energy_dct2, conn_lst2 = mess_io.reader.pes(",
"('B1', 'P2') ) assert set(energy_dct1.keys()) == set(ref_energy_dct1.keys()) assert all(num... |
[
"params['payment_amount'] = self.payment_amount if self.payment_idx: if hasattr(self.payment_idx, 'to_alipay_dict'): params['payment_idx'] = self.payment_idx.to_alipay_dict() else: params['payment_idx']",
"return self._payment_idx @payment_idx.setter def payment_idx(self, value): self._payment_idx = value def to_... |
[
"= False try: yield s s.commit() except: s.rollback() raise finally: s.close() def get_session():",
"scripts import tabledef from flask import session from sqlalchemy.orm import sessionmaker from contextlib",
"s.rollback() raise finally: s.close() def get_session(): return sessionmaker(bind=tabledef.engine)() d... |
[
"getQueryCriteria(starttime2, endtime2) matchCountSummary = dict() rt = Match.objects.filter(query2) for match in rt: if",
"= True break matchjsonstr = simplejson.dumps(matches) return matchjsonstr def updateMatchQuerySetEnrollInfo(matchQuerySet, user): enrolledMatch =",
"> 0: for enrollinfo in enrolledMatch: f... |
[
"if f.endswith(\".plt\")] fileset = sorted(fileset) print(\"==> Found %d files.\" % len(fileset)) of =",
"len(fileset)) of = open(outfile, \"w\") of.write(\"x y id\\n\"); for idx,f in enumerate(tqdm(fileset)): #",
"\"w\") of.write(\"x y id\\n\"); for idx,f in enumerate(tqdm(fileset)): # first skip the header",
... |
[
"from recipes.models import Recipe try: recipe = Recipe.objects.get(id=recipe.id) recipe.published=True recipe.save() except Recipe.DoesNotExist: pass",
"utf-8 -*- from celery.task import task @task def publish_recipe(recipe): from recipes.models import Recipe",
"celery.task import task @task def publish_recipe... |
[
"a Transmission JSON-RPC arguments dictionary \"\"\" self._update(other) self._commit() def keys(self) -> Generator[str, None,",
"import Client class Session: \"\"\" Session is a dict-like class holding the session",
"location - rpc version 12 - transmission version 2.20 :return: \"\"\" return self.__getattr__(... |
[
"i in range(4): link = browser.links.find_by_partial_text('Hemisphere')[i] link.click() title = browser.find_by_css('.title').first.text url = browser.find_by_text('Sample').first['href']",
"Image executable_path = {'executable_path': '/usr/local/bin/chromedriver'} browser = Browser('chrome', **executable_path, h... |
[
"self._fields.append(arg_field) # Width total_padding = padding * (len(self._fields) + 1) self._total_width = sum(f['width']",
"== 'n+': evtype_fg_colour = self._config['trigger']['note_on_colour'] elif evtype == 'h': evtype_fg_colour = self._config['trigger']['hit_colour'] elif",
"evtype_fg_colour = self._conf... |
[
"License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS",
"writing, software # distributed under the License is distributed on an \"AS IS\"",
"resp['vim_tenant_name'] == os_access['vim-tenant-name'] assert not osm.get_api().vim.delete(vim_name) <EMAIL> def test_add_multiple_accounts(se... |
[
"i) sim.sleep(expovariate(1.0/INTV_CUSTOMERS)) def customer(idx): arrive = sim.now print('%7.4f Customer%02d: Here I am' %",
"in range(NUM_CUSTOMERS): sim.process(customer, i) sim.sleep(expovariate(1.0/INTV_CUSTOMERS)) def customer(idx): arrive = sim.now print('%7.4f Customer%02d: Here",
"simpy so that we can g... |
[
"\"\"\" Class for generating the lazy cartesian product \"\"\" def __init__(self, sets: List[List[Any]]):",
"self.__max_size = 0 self.__factors = [0] * len(self.__sets) self.__modulo = [0] * len(self.__sets)",
"-> None: fac = 1 self.__max_size = 1 for i in range(len(self.__sets) -",
"in range(len(self.__sets)... |