ngram
listlengths
0
67.8k
[ "import os import sys django.setup() # env os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djspace.settings.shell') from django.contrib.auth.models import User", "''' if apps: for a in apps: #print a print a.__dict__ #print a._state.__dict__", "django import os import sys django.setup() # env os.environ.setdef...
[ "import ASTNode from .if_node import IfNode class LineNode(ASTNode): def __init__(self, expression, depth, no_end", "def __repr__(self): return f\"[{self.expression}]\" def interpret(self, interpreter): return self.get_expression(interpreter) def transpile(self, transpiler): transpiler.depth", "interpret(self, ...
[ "class KarakTea: def __init__(self, tea_type): self.__tea_type = tea_type @property def tea_type(self): return self.__tea_type", "TeaMaker: def __init__(self): self.__available_tea = dict() def make(self, preference): if preference not in", "__init__(self): self.__available_tea = dict() def make(self, preferenc...
[ "-*- from pathlib import Path from csv import DictReader from pymisp import MISPEvent,", "event.add_tag('tlp:white') if make_feed: event.orgc = org else: e = misp.search(eventinfo=event.info, metadata=True, pythonify=True) if", "path = Path('/home/raphael/gits/COVID-19/csse_covid_19_data/csse_covid_19_daily_rep...
[ "f.write(line+'\\n') #----- MAIN PART if __name__ == \"__main__\": # read shop list with", "in test_index] # get pages train_pages = getPagesForShops(train_shops) test_pages = getPagesForShops(test_shops) createListFile('split_'+str(split_num)+'_train.txt',train_pages) createListFile('split_'+str(split_num)+'_tes...
[ "# # 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", "XLS. This module contain all the XLS build rules/macros that requi...
[ "__future__ import absolute_import from erlpack import pack def test_nil(): assert pack(None) == b'\\x83s\\x03nil'", "from __future__ import absolute_import from erlpack import pack def test_nil(): assert pack(None) ==" ]
[ "def __get_and_test(path, since): ftp_creds = operative.FTPCredentials(**TEST_FTP_LOGIN) line_item_reports = LineItemReport().get_report_files(ftp_credentials=ftp_creds, ftp_path=path, since=since) for lir", "zero files - using \"since\" __get_and_test(path='/flatfile', since=datetime.datetime(2014, 2, 1)) # get ...
[ "#import importlib #where_am_i=\"/000_where_am_i\" #sys.path.append(os.getcwd()) #import 000_where_am_i #pm = __import__(where_am_i) #find_where_am_i() import mysql.connector from", "py_wd=os.getcwd() #print(\"DEBUG: thiscwd is: %r\" % py_wd) project_dir=strip_end(py_wd, \"/pys\") #print(\"DEBUG: stripcwd is: %r\...
[ "Image.open(encoded_io) width, height = image.size format = image.format image_stat = ImageStat.Stat(image) mean =", "int(label_map[full_path]) example = tf.train.Example(features=tf.train.Features(feature={ 'image/height': dataset_utils.int64_feature(height), 'image/width': dataset_utils.int64_feature(width), 'i...
[ "import Path print(f\"[{orange}]Running example: {Path(__file__).name}\") brainrender.settings.BACKGROUND_COLOR = [ 0.22, 0.22, 0.22, ] #", "the axes display ) # make scenes with different shader styles for shader", "# turn off the axes display ) # make scenes with different shader", "style) which can be chan...
[]
[ "utc class Migration(migrations.Migration): dependencies = [ ('patients', '0014_auto_20220304_2228'), ('visits', '0004_auto_20220304_2225'), ] operations =", "16:58 import datetime from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import", "58, 46, 499184, tzin...
[ "class CityLocation(BaseModel): city: str state: str | None = Field(default=None, max_length=3) country: str", "str | None = None weather: str | None = None lat: float", "city: str state: str | None = Field(default=None, max_length=3) country: str | None", "Config: schema_extra = { \"example\": { \"lat\": \"5...
[ "RETURNING id \"\"\", ( # INSERT clause collection.name, collection.slug, '', '', '', 'True',", "left left += 1 for child in pc.children: child.lft = left child.rght =", "raw_product[value_key]): product_attribute = ProductAttribute(raw_product[name_key], [ProductAttributeValue( raw_product[value_key])]) pt.add...
[ "ForgotPasswordForm(Form): email = TextField('email', validators=[validators.Required(), validators.Email()]) class ProfileForm(Form): fullname = TextField('fullname', validators=[validators.Required(), validators.Length(min=3,", "message='City field must be 50 characters long.')]) profile = SelectField('gender',...
[ "<filename>docker/molecule/tests/test_docker.py import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') def test_is_docker_installed(host): package_docker =", "import testinfra.utils.ansible_runner test...
[]
[ "on 2017-03-04 20:13 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration):", "django.db import migrations class Migration(migrations.Migration): dependencies = [ ('redditpoller', '0013_watchedsubreddit_watchedsubredditthreads'), ] operations =", "utf-8 -...
[ "comparision.. please add files in 'Compare Funds' folder to compare!\") exit(0) print(f\"Comparing following", "compare!\") exit(0) print(f\"Comparing following {len(amcs)} funds:\") for fund_name in amcs: print(f\" - {fund_name}\")", "= 1 for i in common_companies: print(f\"[{counter}]. {i}\") counter += 1 fi...
[ "############################################################################## class RegistryUserGroupSerializer(serializers.HyperlinkedModelSerializer): group_name = serializers.CharField(source='get_group_name') # FIXME: The following is excluded as", ") read_only_fields = ('group', 'owner', ) class RegistryUs...
[ "= \"Step C must be finished before step A can begin.\\nStep C must", "with patch(\"builtins.open\", mock_open(read_data=DATA)): self.assertEqual(\"CABDFE\", step_order()) def test_time_required(self): with patch(\"builtins.open\", mock_open(read_data=DATA)): self.assertEqual(15, time_required(0, 2))", "mock_op...
[ "coding: utf-8 -*- \"\"\"Top-level package for Secure Data Store.\"\"\" __author__ = \"\"\"<NAME>\"\"\" __email__", "\"\"\"Top-level package for Secure Data Store.\"\"\" __author__ = \"\"\"<NAME>\"\"\" __email__ = '<EMAIL>' __version__", "package for Secure Data Store.\"\"\" __author__ = \"\"\"<NAME>\"\"\" __em...
[ "= codeOut sys.stderr = codeErr try: exec(code) except: sys.stdout = \"error\" sys.stderr =", "codeErr try: exec(code) except: sys.stdout = \"error\" sys.stderr = \"error\" # restore stdout", "# linux networking files def set_env(): return def dummy_exec(code): # create file-like string", "# for get_ip_addres...
[ "template_name: str): message = MessageSchema( subject=subject, recipients=emails.emails, template_body=emails.body, subtype='html', ) fm = FastMail(conf)", "os from fastapi import BackgroundTasks from fastapi_mail import ConnectionConfig, FastMail, MessageSchema from core.settings", "FastMail, MessageSchema fr...
[ "print(paren, is_valid(paren)) paren = \"[]()[]\" print(paren, is_valid(paren)) paren = \"[[[]]\" print(paren, is_valid(paren)) paren", "= \"[[[]]\" print(paren, is_valid(paren)) paren = \"{([])}\" print(paren, is_valid(paren)) paren = \"(}\" print(paren,", "\"__main__\": paren = \"[]\" print(paren, is_valid(pa...
[ "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,", "only acquisition that has timeframe_origin=True) \"\"\" # Add a new key in the", "S2Acquisition \"\"\" return self.SENSOR_S2_KEY in self[name] def get_s1_acquisition(self, name): \"\"\" Return the s1_acquisition", "== 0 and ...
[ "'file:......directory1..file.json'), ('http://www.service.domain/swagger/specs.json', 'http:....www.service.domain..swagger..specs.json'), ('https://www.service.domain/swagger/specs.json', 'https:....www.service.domain..swagger..specs.json'), ('/api_docs/file.json#/definitions/object', 'file:......api_docs..file.j...
[ "def __init__( self, name: str, activation: ActivationFunctions, merge: Optional[MergeInputs] = None, initializer: Initialization", "@property @abstractmethod def weights_shape(self) -> Shape: ... @property def weights(self) -> np.ndarray: if", "return self._weights def set_weights(self, data_mean: float = 0.0,...
[ "ccutils.viz.set_plotting_style() # Increase dpi #%% # Find home directory for repo repo =", "f'{homedir}/fig/si/' datadir = f'{homedir}/data/mRNA_FISH/' mcmcdir = f'{homedir}/data/mcmc/' # %% # Read the data", "pickle.Unpickler(file) gauss_flatchain = unpickler.load() gauss_flatlnprobability = unpickler.load()...
[ "packets transmitted, 0 packets received, 100.0% packet loss\" in str(out[0])): print(host) return host", "str(out[0])): print(host) return host def send(self): p = Pool(self.pool_num) return p.map(self._shell, self.hosts) if", "return p.map(self._shell, self.hosts) if __name__ == '__main__': hosts = ['192.168....
[ "def checkpoint(shared_model, shared_dataset, args): try: while True: # Save dataset file = open(args.data,", "dataset file = open(args.data, 'wb') pickle.dump(list(shared_dataset), file) file.close() # Save model now =", "True: # Save dataset file = open(args.data, 'wb') pickle.dump(list(shared_dataset), file)...
[ "import Counter, GNTFig6_6, Geometric, VaryingActionNumber, make_russell_norvig_grid from msdm.domains import GridWorld class MyTestCase(unittest.TestCase): def", "1/2, frozendict({'dx': -1, 'dy': 0}): 0, frozendict({'dy': 1, 'dx': 0}): 1/2, frozendict({'dy': -1,", "np.isclose(vi_res._qvaluemat, pi_res._qvaluem...
[ "= PDFPageInterpreter(rsrcmgr, device) for page in PDFPage.get_pages(fp, check_extractable=True): interpreter.process_page(page) device.close() text = retstr.getvalue()", "in 'rb' mode to read PDF bytes interpreter = PDFPageInterpreter(rsrcmgr, device) for page", "\"\"\" rsrcmgr = PDFResourceManager() retstr = ...
[ "= ''.join([subdomain, netloc, path]) return re.compile(pattern, re.I) def strip_csv_row(row): \"\"\" Strip values in", "= re.escape(clean_path+'/') # Join the parts. pattern = ''.join([subdomain, netloc, path]) return re.compile(pattern,", "require a matching subdomain. subdomain = '' tld = tldextract.extract(...
[ ".models import Profile #when a user is saved then send this signal which", "from django.contrib.auth.models import User from django.dispatch import receiver from .models import Profile #when", "user is saved then send this signal which be revieved by this #receiver,", "import receiver from .models import Pro...
[ "as final output layer0 (bool): If True, return the outputs of the first", "of size (batch_size, timesteps). Otherwise, a Float Tensor of size (batch_size, timesteps, features).", "a Float Tensor of size (batch_size, timesteps, features). lengths (Long Tensor): lenghts of", "also concatenated along the last d...
[ "self.assertEqual([('a', 1), ('b', 2), ('c', 5)], self.G._nodes['a'].full_power()) self.assertEqual([('c', 1), ('a', 3), ('d', 4),", "utf-8 -*- \"\"\" Test some edge cases. \"\"\" import unittest from socialgraph import", "some edge cases. \"\"\" import unittest from socialgraph import autommittee class TestPow...
[ "return 0 elif self == 1: return 2 else: return 1 def incr(self,", "a frame, integer value of 0, 1, or 2. This is also an", "return Frame(2) elif phase == 2: return Frame(1) else: raise PycbioException(\"invalid phase: {}\".format(phase))", "(-amt) % 3 return Frame((val - (amt - amt3)) % 3) def __add__(self,"...
[ "for pert in perturbations: state = pert(state, self) #* Obtain actions using controller.", "range in (-pi,pi] self.theta = self.theta % (2*np.pi) #(self.theta, self.theta + 2*np.pi)[self.theta <", "is a boolean attribute active if the robot stores food. \"\"\" self._food =", "'orient' : orient_id, } return c...
[ "Flask class FlaskLearn(object): def __init__(self): self.name = 'FlaskLearn' def startup(self): print('Flask学习程序') def hello_world(self):", "<filename>util/flask_learn.py from flask import Flask class FlaskLearn(object): def __init__(self): self.name = 'FlaskLearn' def", "class FlaskLearn(object): def __init__...
[ "e.g. 2012.19') return 1 sprint = argv[0] print(HEADER) print('') print('Working on %s' %", "bug_ids) return {} return dict((h['id'], h['history']) for h in history) def get_comments(self, bug_ids):", "'creation_time', 'last_change_time', 'target_milestone', ] UNWANTED_COMPONENT_FIELDS = [ 'sort_key', 'is_activ...
[ "'rb') as f: return pickle.load(f) else: return [] def put_ids(file, ids): with open(file,", "return pickle.load(f) else: return [] def put_ids(file, ids): with open(file, 'wb') as f:", "else: return [] def put_ids(file, ids): with open(file, 'wb') as f: pickle.dump(ids, f)", "as f: return pickle.load(f) else...
[ ":return: \"\"\" # 获取股价 df = get_stock_price(code, True) # 均线指标 # K线提示 def", "= ts.get_today_all() df_code = df_today[df_today['code']==code] df_code = df_code[['trade']] df_code['date'] = GetNowDate() df_code.rename(columns={'trade': 'close'},", "df = df[['close']] df['date'] = df.index if include_realtime_pri...
[ "# when info_str = float_field._info() # then assert ( info_str == \"<Float\\n spark", "FieldParentError, FieldNameError from sparkql import Float, Struct class TestBaseField: @staticmethod def should_give_correct_info_string(): #", "# when, then with pytest.raises(FieldNameError): float_field._field_name @stat...
[ "Stage 1: exit-->_start payload = fsb( pos = 6, writes = {elf.got(\"exit\"): elf.symbol(\"_start\")", "size = 2, bits = 64 ) print(payload) sock.recvuntil(\"input: \") sock.sendline(payload) # Stage", "# Stage 3: printf-->system payload = fsb( pos = 6, writes = {elf.got(\"printf\"):", "64 ) sock.recvuntil(\"i...
[ "= enabled def get_enabled(self): return self._enabled version_context_manager = Manager() class VersionContextAwareApiViewMixin(object): def initialize_request(self,", "get_enabled(self): return self._enabled version_context_manager = Manager() class VersionContextAwareApiViewMixin(object): def initialize_reques...
[ "] operations = [ migrations.AlterField( model_name='chatmessage', name='user_id', field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='sender'), ), ]", "django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migratio...
[ "VAR3_REGEX = r'\\'.+\\'' VAR4_REGEX = r'\\\".+\\\"' VAR1_EX_REGEX = r'\\$\\{(.+)\\}' VAR2_EX_REGEX = r'\\$(.+)\\W*\\{' VAR3_EX_REGEX", "CASE_REGEX = r'case\\W+.+\\W*\\{' USER_REGEX = r'user\\W*\\{\\W*.+:' COMMENT_REGEX = r'\\A#|\\n#' HARDCODED_VALUE_REGEX = r'= \\d+|=>", "r'(?:^|\\n)\\s*(?:include|require|cont...
[ "get_args.pop('framed') if get_args: url += '?' + get_args.urlencode() res = '<html><head><script>window.parent.location.replace(\"{}\");</script></head></html>'.format(url) return HttpResponse(res)", "re from urllib.parse import urlencode from typing import Callable, List, Optional from .payment", "it has a tr...
[ "1871056, 1872821, 1995519, 1996180, 2141783, 2142522, 2161536, 2162635, 2164169, 2165002, 2302548, 2303903, 2304320,", "j=0 while i<n2: if s2.teff[j]>0 and s2.cdpp3[j]!=0: dataset[i,0] = s2.kepid[j] dataset[i,1] = s2.kepmag[j]", "'cyan' elif i==sunlike: col[h] = 'white' elif i==kdwarf: col[h] = 'white' elif i=...
[ "numpy as np import pandas as pd # forbid GUI import matplotlib as", "plot marker : str point style to plot linestyle : str line style", "KIND, either express or implied. # See the License for the specific language", "if vmax: ax.set_ylim(ymax=vmax) self.cnt[row_id][col_id] += 1 def legend(self): \"\"\"Place ...
[]
[ "10, 1) ), 'tags_id_media:1' ]) res2 = mc.sentenceCount('Clinton', solr_filter=[mc.publish_date_query( datetime.date( 2016, 9, 1),", "res2 = mc.sentenceCount('Clinton', solr_filter=[mc.publish_date_query( datetime.date( 2016, 9, 1), datetime.date( 2016, 10, 1) ),", "res['count'] > res2['count'] else 'Clinton' p...
[]
[ "the specific language governing permissions and # limitations under the License. from arjuna.tpi.helper.arjtype", "writing, software # distributed under the License is distributed on an \"AS IS\"", "# Copyright 2015-2021 <NAME> # Website: www.RahulVerma.net # Licensed under the Apache License,", "HttpUnexpec...
[ "pipe.delete(ConstDB.gateway + id) pipe.delete(ConstDB.gateway_pull + id) pipe.execute() def obj_to_dict(self): dd = { 'id':", "if time is not None: self.time = int(time) def __setattr__(self, key, value): try:", "delete(self): db_sql.session.delete(self) db_sql.session.commit() # delete from sql id = hexlify(s...
[ "= ALL[actor] delta = direction * SPEED * dt if actor.left + delta.x", "Y = Vector2(0, 1) def add(direction: Tuple[int, int]): actor = Actor(WALK_IMAGES[0]) ALL[actor] =", "Tuple from pgzero.builtins import Actor from pygame import Vector2 from .settings import ANIMATION_SPEED,", "typing import Tuple from pgz...
[]
[ "a request session with the access token \"\"\" session = requests.Session() session.headers.update({ \"Authorization\":", "\"\"\" url = urljoin(settings.CANVAS_BASE_URL, \"/api/v1/courses/{course_id}/assignments\".format( course_id=self.canvas_course_id )) return self._paginate(url) def get_assignments_by_int_id...
[ "ShdlcCmdDeviceVersionBase(ShdlcCommand): \"\"\" SHDLC command 0xD1: \"Get Version\". \"\"\" def __init__(self, *args, **kwargs): super(ShdlcCmdDeviceVersionBase,", "absolute_import, division, print_function from ..command import ShdlcCommand from ..types import FirmwareVersion, HardwareVersion, ProtocolVersion,"...
[ "# -*- coding: utf-8 -*- from .command_help import CommandHelp from .command_commands import CommandCommands", "<filename>swine/terminal/commands/standard/__init__.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from .command_help import CommandHelp from", "#!/usr/bin/env python # -*- coding: utf...
[ "def _compute_similarity_kernel(self): g_is = [] for item in range(math.ceil(len(self.grads_per_elem) / self.kernel_batch_size)): inputs =", "== \"Diversity\": dist = torch.exp((-1 * torch.pow(x - y, exp).sum(2))/2) return dist def", "+ 1) * embDim) + self.target_classes].view(-1, 1)) + self.prev_grads_sum[0][j...
[ "packet_num): packet = '{}:{}:{}:{}:{}'.format(MAGIC.decode('ascii'), hash, hex(i+1)[2:], hex(packet_num)[2:], big_tx[i*MAX_SIZE:(i+1)*MAX_SIZE].decode('ascii')) serwrite(packet) time.sleep(2) out = serread()", "in range(0, packet_num): packet = '{}:{}:{}:{}:{}'.format(MAGIC.decode('ascii'), hash, hex(i+1)[2:], h...
[ "astlib.with_deep_replacements(target, repl_map, output_mapping) return target, output_mapping def templatize( target: astlib.AstNode, true_exprs: Collection[astlib.BaseExpression], free_vars:", "not in free_vars: continue if node in constants: repl_dict[node] = astlib.parse_expr(repr(constants[node])) if len(rep...
[ "of append in file file = open(\"abc.txt\", \"a+\") file.write(\"what are you doing!\\n\") print(file.tell())", "\\nYeah its great! ! \\n\") file. write (\"Hello Priyanka!\\n\") file.close() # Read through", "file = open(\"abc.txt\", \"a+\") file.write(\"How are you!\\n\") file.write(\"What are you doing today!...
[ "torch import Tensor from torch_geometric.typing import PairTensor, Adj class PtConv(MessagePassing): def __init__(self, nn:", "Callable, Union from torch import Tensor from torch_geometric.typing import PairTensor, Adj class PtConv(MessagePassing):", "Callable, aggr: str = 'max', **kwargs): super(PtConv, self)...
[ "anagram in enumerate(anagrams): key = ''.join(sorted(anagram)) if hashes.get(key) is None: hashes[key] = index", "{} indexes = {} for index, anagram in enumerate(anagrams): key = ''.join(sorted(anagram)) if", "indexes[index] = [index] else: indexes[hashes[key]].append(index) for index in indexes.keys(): print(...
[ "not config.validate_credentials(): print(\"Failed to validate app credentials, will exit. Did you remember to", "to Twitter. tweepy_auth = tweepy.OAuthHandler(config.OAUTH_CONSUMER_KEY, config.OAUTH_CONSUMER_SECRET) tweepy_auth.set_access_token(config.OAUTH_ACCESS_TOKEN, config.OAUTH_ACCESS_SECRET) tweepy_api = ...
[]
[ "PolygonViewSet # Routers provide an easy way of automatically determining the URL conf.", "cosmopolitan.viewsets import CountryPolygonViewSet from cosmopolitan.viewsets import CityPolygonViewSet from cosmopolitan.viewsets import RegionPolygonViewSet from cosmopolitan.viewsets", "router.register(r'polygons', Po...
[ "request): return self.oai_response(**request.GET) def post(self, request): return self.oai_response(**request.POST) def oai_response(self, **kwargs): repository =", "'text/xml' def get(self, request): return self.oai_response(**request.GET) def post(self, request): return self.oai_response(**request.POST) def oa...
[ "NEEDED` The `action` is run when klarg detects the help flag. What klarg", "it can encounter, one being that the value it got was not a", "typing import Callable, Union # Some information about this package __version__ = \"1.1.0\"", "command line arguments `[\"-f\", \"reply\", \"-n\", \"12\", \"example.txt\"...
[ "pandas as pd import psycopg2 #from sqlalchemy import create_engine psql_credeintal = { 'database':", "{ 'database': 'wode', 'user': 'wode', 'password': '***', 'host': '192.168.3.11', 'port': '5432' } con", "winrate FROM positions WHERE user_id='%s' order by position\" % user_id query_results = pd.read_sql_quer...
[ "number with two decimals txt = 'The price is {:.2f} dollars.' print(txt.format(price)) #", "# index number myorder = 'I want {0} pieces of item number {1}", "number. age = 36 name = 'John' txt = 'His name is {1}.", "= 'I want {} pieces of item number {} for {:.2f} dollars.' print(myorder.format(quantity,", ...
[ "rights reserved. from .images import ImageInferenceJob from .job import InferenceJob __all__ = [", "NVIDIA CORPORATION. All rights reserved. from .images import ImageInferenceJob from .job import InferenceJob", "reserved. from .images import ImageInferenceJob from .job import InferenceJob __all__ = [ 'Inferenc...
[ "EmmentalModel = None ) -> Iterator[Any]: \"\"\"Generate batch generator from all dataloaders for", "= None ) -> Iterator[Any]: \"\"\"Generate batch generator from all dataloaders for one", "import EmmentalDataLoader from emmental.model import EmmentalModel class Scheduler(ABC): \"\"\"Generate batch generator f...
[ "data.split(';base64') decoded_image = base64.b64decode(image_binary) img_name = str(uuid.uuid4())[:10] + '.png' data = ContentFile(decoded_image, name=img_name)", "= base64.b64decode(image_binary) img_name = str(uuid.uuid4())[:10] + '.png' data = ContentFile(decoded_image, name=img_name) return data", "Content...
[ "# # ex usage: persistence.exe install, start, stop, remove # # You can", "evtsrc_dll = os.path.abspath(servicemanager.__file__) servicemanager.PrepareToHostSingle(aservice) servicemanager.Initialize('aservice', evtsrc_dll) servicemanager.StartServiceCtrlDispatcher() except win32service.error as details: if detai...
[ "= np.random.choice(self.prec_test.shape[0], size=batch_size) return self.prec_test[idx,:,:,:], self.era5_test[idx,:,:,:] else: idx = np.random.choice(self.prec_train.shape[0], size=batch_size) return self.prec_train[idx,:,:,:],", "z500 = (z500 - z500.min()) / (z500.max() - z500.min()) z800 = era5_ds2.Geopotentia...
[ "data == [\"a\", \"b\", \"c\"] pdos.remove(path) assert pdos.readFile(path) is None def test_pdosq(): \"\"\"", "\"interface\", \"name\": \"wan\", \"comment\": \"chute\"} assert config.getConfig(match) == [] assert config.getConfigIgnoreComments(empty) == []", "result2 == result line = \"option key '<PASSWORD>'\...
[ "import RedirectView urlpatterns = [ path(\"\", views.CategoriesView.as_view(), name=\"products.category\"), # path(\"detail/\", RedirectView.as_view(url=\"/b2b/products/\")), path(\"detail/<slug:slug>\", views.ProductDetail.as_view(),", "views.ProductDetail.as_view(), name=\"products.detail\"), path(\"<str:cat>/...
[ "np.dot(parameters['w' + str(length - i)].T, dz) dz = da dz[Z[length - i -", "1. / m * np.dot(dz, A[length - i - 1].T) db = 1.", "1)], db, learning_rate) return parameters def plot_costs(costs, learning_rate): \"\"\" 把cost图形化输出 Args: costs: 训练迭代过程中的cost", "str(length - i - 1)] = update_parameters( parameters[...
[ "'name', 'type', 'location'] return _map_attrs_values(Board, attrs, response) def _parse_json_to_epic(response): attrs = ['id', 'name',", "value in response['values']: values.append(_map_attrs_values(result_class, attrs, value)) return values def _get_attr_value(attr, values, default=None): if", "issue.custom[k...
[]
[ "delay time (to match Kluster, I do this so that times are unique", "sbet.is_sbet(sbet_file) def is_smrmsg(smrmsg_file: str): \"\"\" Check if the file is an smrmsg file.", "provide the year of the posfiles here weekstart_week must provide the gpsweek of", "cntrsorted = np.argsort(cntrs) tms = tms[cntrsorted] ...
[ "= float(input('Informe a media em metros: ')) cent = int(metro * 100) print(f'Convertendo", "um Programa que converta metros para centímetros.''' # Resposta: metro = float(input('Informe a", "converta metros para centímetros.''' # Resposta: metro = float(input('Informe a media em metros:", "# Resposta: metro...
[ "data = \"Unknown CAM id:0\" response = requests.get(url=\"http://\"+slave_ip+\":\"+restPort+\"/api/v1/cameras/0/rtsp\", auth=auth) user_resp_code = \"404\" assert", "n = data1[\"message\"] assert data == n # Запрос на получение поля rtsp/live", "data == n # Запрос на получение поля rtsp объекта CAM def test_Ge...
[ "scelta_parola[posizione] if lettera == indovina: campo_gioco[posizione] = lettera print(f\"{' '.join(campo_gioco)}\") if indovina not", "lettera: ') for posizione in range(len(scelta_parola)): lettera = scelta_parola[posizione] if lettera == indovina:", "print(f\"Hai tentato con la lettera {indovina}, non è la...
[ "fm == \"M\": print(\"M - Masculino\") if fm == \"F\": print(\"F - Feminino\")", "Masculino\") if fm == \"F\": print(\"F - Feminino\") def si(): while fm !=", "\"M\": print(\"M - Masculino\") if fm == \"F\": print(\"F - Feminino\") def si():", "def foum(): if fm == \"M\": print(\"M - Masculino\") if fm == \"F...
[ "Quad( NamedNode(\"http://example.com/s\"), NamedNode(\"http://example.com/p\"), NamedNode(\"http://example.com/o\"), ), Quad( NamedNode(\"http://example.com/s\"), NamedNode(\"http://example.com/p\"), NamedNode(\"http://example.com/o\"), DefaultGraph(), ), ) def", "self.assertEqual(Literal(\"foo\", datatype=XSD_I...
[ "= \"Enter the password: \") # by default it shows 'password' print(f\"The entered", "getpass # importing getpass dpass = getpass.getpass(prompt = \"Enter the password: \") #", "getpass dpass = getpass.getpass(prompt = \"Enter the password: \") # by default it", "getpass.getpass(prompt = \"Enter the password:...
[ "url = models.CharField(max_length=255) school_name = models.CharField(max_length=255, default='') russian_fullname = models.CharField(max_length=255, default='') job_category =", "models.CharField(max_length=200) postal_code = models.CharField(max_length=200) scopus_affiliation_link = models.CharField(max_length...
[ "importing :mod:`graphtransliterator.transliterators`. Each is an instance of :mod:`graphtransliterator.bundled.Bundled`. \"\"\" from .bundled import Bundled", "skipped.\"\"\" return name == \"Bundled\" or name.startswith(\"_\") def add_transliterators(path=__path__): \"\"\"Walk submodules and loads", "with _ i...
[ "SenderBots.access_request_chat_bot = SenderBots.createBot(access_chat_bot) @staticmethod def createBot(chat_bot): if chat_bot.botType.messenger_type == MessengerType.Telegram.name: return TelegramBot(chat_bot.token) if", "= SenderBots.createBot(access_chat_bot) @staticmethod def createBot(chat_bot): if chat_bot....
[ "# start it like: scripts/generate_gantt_chart.py # from the project folder import PUMI.utils.resource_profiler as", "start it like: scripts/generate_gantt_chart.py # from the project folder import PUMI.utils.resource_profiler as rp", "<reponame>spisakt/PUMI #!/usr/bin/env python # start it like: scripts/genera...
[ "-*- coding: utf-8 -*- from sqlalchemy.ext.declarative import declarative_base # 数字货币tick from zvdata.contract import", "CoinTickCommon CoinTickKdataBase = declarative_base() class CoinTickKdata(CoinTickKdataBase, CoinTickCommon): __tablename__ = 'coin_tick_kdata' register_schema(providers=['ccxt'], db_name='coin...
[ "<reponame>ytyaru/GitHub.Upload.UserRegister.Insert.Token.201704031122 #!python3 #encoding:utf-8 import sqlite3 #from AuthList import AuthList import AuthList import traceback", "class AccountGetter: def __init__(self): def connect(self, db_path): self.connector = sqlite3.connect(db_path) self.cursor = connector....
[ "to its in-degree.\"\"\" # Store threshold assignment in a dictionary thresholds = dict()", "each node for node in graph.Nodes(): thresholds[node.GetId()] = value return thresholds def degree_proportional_thresholds(graph,", "a threshold for every node of the graph to be proportional to its", "a threshold for...
[ "if ann_line[0][0] == 'T': entity_list.append(ann_line) #print('bupt') ''' def convert_text(text): space_all = find_all(' ',", "entity_dict[temp_entity[0]] = dict_temp return entity_result, entity_dict def convert_relation_new(relation, text_list, entity_dict): relation_result = []", "len(text_list[row_index-1]...