ngram
listlengths
0
67.8k
[ "\"\\\", \\\"\" + DeptName + \"\\\");\") cursor.execute(sql) finally: connection.close() def newBAssociation(): print(\"All of", "+ \"\\\", \\\"\" + City + \"\\\", \\\"\" + State + \"\\\", \\\"\"", "(userInput == 5): newBAssociation() elif (userInput == 6): return elif (userInput == 7):", "name of the represe...
[ "np.arctan(np.sqrt(1.0 - ql**2.0) * sx_r / (psi + rc)) dy_tmp = (re *", "/ (psi + rc * ql**2.0)) dx = dx_tmp * cs - dy_tmp", "sy * cs psi = np.sqrt(ql**2.0 * (rc**2.0 + sx_r**2.0) + sy_r**2.0) dx_tmp", "potential_nie(x0, y0, theta, ql, re, rc, ext_shears, ext_angle, ext_kappa, x, y): tr =", "sx + sn2 * sy) ...
[ "def get_success_url(self): return reverse(\"users:detail\", kwargs={\"username\": self.request.user.username}) def get_object(self): return User.objects.get(username=self.request.user.username) user_update_view = UserUpdateView.as_view()", "import FacebookOAuth2Adapter from allauth.socialaccount.providers.github...
[ "= UTIL.asIntPtr() origin = OpenMaya.MPoint(pointPosition) normal = OpenMaya.MVector() targetFnMesh.getClosestNormal( origin, normal, self.SPACE, ptr_int)", "+ 1.0) TV *= x NV *= y BV *= z except TypeError:", "intersectPoint = OpenMaya.MFloatPoint( result = fnMesh.closestIntersection( OpenMaya.MFloatPoint( poin...
[ "__future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('measure_mate',", "from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('measure_mate', '0011_auto_20160225_1305'), ('measure_mate', '0014_auto_2016022...
[]
[ "self.send('ping') except BaseException: with self.state_lock: self._remote_closed = True def force_closed(self): with self.state_lock: return", "return compile( r\"\"\" (?P<exec>\\![a-z]+) | ((?P<exec>\\![a-z]+)\\s(?P<execparam>[a-zA-Z0-9.\\/\\\\\\-\\_\\s]+)\\s*) | (?P<func>[a-z]+) | ((?P<func>[a-z]+)\\s(?P<para...
[ "and not valid_item_name(item_dict[kw]): return (False, \"Name not valid\") if kw == 'description' and", "link else False def test_new_item(item_dict): ''' takes an item dictionary and checks if", "and digits ''' return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in xrange(size)) def val...
[ "name = \"U\", summ = False, fixed = fix_U) self.kern = OperatorKernel(sf0=sf0, ell0=ell0,", "__str__(self): rep = '\\ndiff signal variance: ' + str(self.kern.sf.eval()) + \\ '\\ndiff lengthscales:", "diffus: BrownianMotion object for diffusion GP interpolation s: Integer parameterizing how denser the", "opti...
[ "= float(randrange(ELECTION_TIMEOUT_MAX / 2, ELECTION_TIMEOUT_MAX)) def heartbeat(self): while not self.stopped: logging.info(f'{self} send heartbeat", "else: logging.info(f'{self} got heartbeat from follower: None') logging.info('========================================================================') time.sle...
[ "to the \"BoilerComplianceQueryServlet\". #There should be exactly one such url. for i in", "been prescreened to ensure that data exist. \"\"\" allUrls = soup.find_all('a') #get the", "such url. for i in allUrls: if i['href'].find(\"BoilerComplianceQueryServlet\") != -1: url = \"http://a810-bisweb.nyc.gov/biswe...
[ "target_location): \"\"\" Calculate the distance of the given location along the route Note:", "location, use the corresponding wp as location target_location_from_wp = wmap.get_waypoint(target_location).transform.location for trans, _", "corresponding wp as location target_location_from_wp = wmap.get_waypoint(...
[ "identifiers on which this node depends. :param application_dependency_node_ids: The application_dependency_node_ids of this ApplicationDependencyVulnerabilitySummary.", "__repr__(self): return formatted_flat_dict(self) def __eq__(self, other): if other is None: return False return", "= gav @property def node_i...
[ "= \"topic: feature\" SENDER_EMAIL = \"Typing Bot <<EMAIL>>\" RECEIVER_EMAIL = \"<EMAIL>\" @dataclass class", "= [] updated = [] for issue in issues: if issue.created.date() >= since:", "s = f\"#{issue.number:<5} \" if issue.pull_request: s += \"[PR] \" s += f\"{issue.title}\\n\"", "week, excluding closed iss...
[ "while not tag: tag = self.write_no_block(8, text) return tag def write_no_block(self, sector, text):", "0 for i in range(0, 5): n = n * 256 + uid[i]", "TagType) = self.READER.MFRC522_Request(self.READER.PICC_REQIDL) if status != self.READER.MI_OK: return None (status, uid) = self.READER.MFRC522_Anticoll()", ...
[ "download_projects(projects, output_dir, full_fetch=False): with ThreadPoolExecutor() as executor: executor.map(lambda p: download_project(p, output_dir, full_fetch=full_fetch), projects)", "open(input_file, \"r\") as f: return [Project(project) for project in json.load(f)] def download_projects_command(args): pr...
[ "import glob import json import logging as lg from pathlib import Path from", "filename='log.txt', filemode='a+' template_loader = FileSystemLoader('./templates') template_env = Environment(loader=template_loader) TEMPLATE = \"template.html\" template =", "dpi=1200, bbox_inches='tight') #plt.show() # Make index...
[ "= u\"─\" if y_off is not None and y_rep is not None: if", "import numpy as np from color_schemes import color_func def get_term_size(): rows, columns =", "= Pos(self.current_line, (self.cols - len(hist[0]) * bar_width) / 2) self.add_frame(Pos(height + 3, len(hist[0])*bar_width", "A_right_shaded): # fully sha...
[ "sys webui_root = \"webui/\" points = [] for i in range(1, len(sys.argv)): points.append(sys.argv[i])", "matplotlib # prevents pyplot from trying to connect to x windowing matplotlib.use('Agg') import", "<reponame>twmarshall/tbd import matplotlib # prevents pyplot from trying to connect to x windowing", "plt ...
[ "open(\"input/5.txt\") as f: #with open(\"input/5.test\") as f: poly = f.read().strip() def is_reactable(x,y): return", "f: #with open(\"input/5.test\") as f: poly = f.read().strip() def is_reactable(x,y): return x.lower()==y.lower() and", "# tail if is_reactable(p, q): result = result[:-1] # remove tail else: ...
[ "by Django 2.1.12 on 2019-09-11 05:50 from django.db import migrations class Migration(migrations.Migration): dependencies", "on 2019-09-11 05:50 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core',", "django.db import migrations class Migration(migrations.Migration)...
[ "link=[], ) # loop over authors logger.info('Getting brainglobe papers') for author_n, author_id in", "{paper[\"title\"]} to avoid duplicates') continue # skip duplicates logger.debug(f'Found brainglobe paper: \"{paper[\"title\"]}\" @", "logger from rich import print from rich.table import Table from mdutils.md...
[ "auth_response.content.decode(\"utf-8\"))[\"Document\"] auth_token = { \"token\": bearer_token, \"timestamp\": datetime.datetime.now().strftime(\"%m/%d/%Y, %H:%M:%S\") } with open(token_file_path, \"w\")", "response[0] == 200: with open(os.path.join(os.path.dirname(__file__), \"data\", \"data_{}{}.json\".format(m...
[ "functions of other StateButtons :return: None \"\"\" def disable_buttons() -> None: \"\"\" Disable", "to specify \"grid\" if it needs to be redrawn :param kwargs: See the", "then clear channel, fills are made before blits. All the program's fill and", "the random walls button, 10% of the nodes in the grid wi...
[ "wing(side(Side), Ss)) << segments(Side, Ss), segments(Side, segments(Ss)) << findall(segment(Id, S), segment(Side, Id) &", "point(8, 9)]), section(3, [point(11, 12), point(13, 14)]), section(3, [point(15, 16), point(17, 18)]), section(4,", "segments(Side, segments(Ss)) << findall(segment(Id, S), segment(Side, ...
[ "import random_util class MyTestCase(unittest.TestCase): def test_visualize_results(self): column_width = 20 print(\"Generated id:\".rjust(column_width, ' ')", "MyTestCase(unittest.TestCase): def test_visualize_results(self): column_width = 20 print(\"Generated id:\".rjust(column_width, ' ') + random_util.generat...
[ "django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True", "fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('password', models.CharField(max_length=128, v...
[ "self.name) logger.time_log('Testing Complete.\\n') if cv is not None: evaluator.evaluate_fold_scores(fold_scores) evaluator.evaluate_classifier_result( self.estimator, test_evaluation_frame, train=train_evaluation_frame,", "y_train, train_index, test_index, record_predict_proba, verbose, fit_increment, warm_star...
[ "from almanak.file import compress, decompress, extract, fileinfo __ALL__ = ['compress', 'decompress', 'extract', 'fileinfo']" ]
[ "not self._wlan.ifconfig()[0]=='0.0.0.0': self._state = STATE_WLAN_CONNECTED print(\"wlan connected\") def __updateWlanConnectedState(self): if self._mqtt: print(\"connecting to", "== STATE_WLAN_CONNECTED: self.__updateWlanConnectedState() if self._state == STATE_MQTT_CONNECTING: self.__updateMqttConnectingState(...
[ "distutils.core distutils.core.setup( name='Ymir', author='<NAME>', author_email='<EMAIL>', version='0.1dev', packages=['ymir', ], license='LICENSE.txt', url='http://pypi.python.org/pypi/Ymir/', description='script to manage", "<reponame>karlcow/ymir<filename>setup.py<gh_stars>1-10 import distutils.core distutils...
[ "<reponame>yq-wen/probabilistic_nlg config_fingerprint = None config = None log_writer = None isTrain = True" ]
[ "noinspection PyUnresolvedReferences from db import order # noinspection PyUnresolvedReferences from db import user", "<reponame>rcastleman/twilio-and-sendgrid-python-course<gh_stars>10-100 # noinspection PyUnresolvedReferences from db import order # noinspection PyUnresolvedReferences from db", "# noinspection...
[ "departmental dropdown choices. class Department(models.Model): name = models.CharField(max_length=255, unique=True) def __str__(self): return self.name", "logging.getLogger(__name__) # PSU Mailcode class Mailcode(models.Model): code = models.CharField(max_length=40) description = models.CharField(max_length=255)...
[ "isinstance(obj, decimal.Decimal): return str(obj) if isinstance(obj, GEOSGeometry): return json.JSONDecoder().decode(obj.geojson) if isinstance(obj, models.Model): return", "} for entry in features: feature = { 'type': 'Feature', 'geometry': entry.get(geometry_field, None),", "in entry.iteritems(): if k != geo...
[]
[ "= points def deletePoints(self, event, xCoordinate, yCoordinate, flags, params): if event == cv2.EVENT_RBUTTONDOWN:", "deletePoints(self, event, xCoordinate, yCoordinate, flags, params): if event == cv2.EVENT_RBUTTONDOWN: diff = list()", "in self._points: xd = math.pow((point[0] - xCoordinate), 2) yd = math.po...
[ "cluster = Cluster() cluster.commands_setting_env = [ \"PROJET_DIR=/fsnet/project/meige/2020/20CONVECTION\", \"source /etc/profile\", \"source $PROJET_DIR/miniconda3/etc/profile.d/conda.sh\", \"conda activate", "\"conda activate env-snek\", \"export NEK_SOURCE_ROOT=$HOME/Dev/snek5000/lib/Nek5000\", \"export PATH=...
[ "typing import Dict, List, TypedDict class Dependency(TypedDict): name: str labels: Dict[str, str] statuses:", "engineConfig: Dict[str, str] tests: SetupConfig reports: SetupConfig class Metadata(TypedDict): name: str namespace: str", "pvc: str mountPath: str remotePath: str localPath: str class Spec(TypedDict)...
[ "in sys.argv: keep = 1 for site_crit in SiteCrits: crit_name = site_crit['table_column'].split('.')[1] if", "pmag_env import set_env import operator OPS = {'<' : operator.lt, '<=' : operator.le,", "= [] for crit in crits: if crit[crit_col] == \"DE-SITE\": SiteCrits.append(crit) #break #", "pmag.fshdev(kappa) ...
[ "from reikna.algorithms import PureParallel from matplotlib import cm import time as t import", "(0,1)) fftc = fft.compile(thr) data_f = thr.array(data0.shape, dtype=np.complex128) shift = FFTShift(data_f, (0,1)) shiftc", "= plt.subplots() summ = 0 while i<100: t1 = t.clock() data0 = data[j:(j+1)*batch,", "40...
[ "180.0001 which is a jump, but smaller than the definition of # a", "= numpy.arange(0,151,30.0) w2 = numpy.arange(180,360,30.0) w2[0] = 180 + epsilon lon_world = numpy.concatenate((w1,", "<gh_stars>1-10 from kapteyn import maputils import numpy from service import * fignum =", "Y = numpy.arange(-75,90,15.0) #...
[ "from .models import QuestionComment, ExamComment class QuestionCommentFilter(django_filters.FilterSet): is_resolved = django_filters.BooleanFilter() class Meta: model", "django_filters from .models import QuestionComment, ExamComment class QuestionCommentFilter(django_filters.FilterSet): is_resolved = django_fil...
[ "from .hartmann6 import neg_hartmann6 from .holder_table import neg_holder_table from .michalewicz import neg_michalewicz from", "import neg_eggholder from .hartmann6 import neg_hartmann6 from .holder_table import neg_holder_table from .michalewicz import", "from .styblinski_tang import neg_styblinski_tang __al...
[ "Homework') homeworks = [] for homework in cur.fetchall(): homeworks.append(Homework(homework[1], homework[2], homework[3], homework[4], homework[5],", "def getAll(self): cur = self._db.cursor() cur.execute('SELECT * FROM Homework') homeworks = [] for", "db def getAll(self): cur = self._db.cursor() cur.execute(...
[ "'.json', 'w') reader = csv.reader(open(files, 'rU')) fieldnames = () out = 0 for", "'rU')) fieldnames = () out = 0 for row in reader: temp =", "+= ': \"' temp += a temp += '\",' nameCounter += 1 itemCounter", "0 for row in reader: temp = [] # print row fieldnames =", "temp = temp[:-1] temp += \"}\" # print...
[ "def test_string_with_only_spaces(self): self.assertMultiLineEqual(test.encrypt(' '), ' ') def test_string_no_wrap_around(self): self.assertMultiLineEqual(test.encrypt('abc'), 'zyx') def test_string_wrap_around(self): self.assertMultiLineEqual(", "Hence the test is skipped here class AtbashCipherDecryptTests(unit...
[ "25 is 1/HIGH/True - LED ON\") GPIO.output(24, 1) LedOn() #result=firebase.put('/data/','user_1',{'gasleakage':'1'}) else: print (\"Port", "firebase import RPi.GPIO as GPIO import plivo from time import sleep # this", "while True: if GPIO.input(25): print (\"Port 25 is 1/HIGH/True - LED ON\") GPIO.output(24,", ...
[ "\"\"\" class VEnvTypeProtocol(Protocol): _manager = None def validate(self, *args, **kwargs): \"\"\" Make sure", "typing import Protocol class VEnvProtocol(Protocol): path = None def activate(self): \"\"\" Activate virtual", "VEnvProtocol(Protocol): path = None def activate(self): \"\"\" Activate virtual envir...
[ "[\"v\"] assert form.a() == \"\"\"<input id=\"a\" name=\"a\" type=\"number\" value=\"v\">\"\"\" assert form.b.data == -15", "form.b._value() == \"9\" form = F(DummyPostData(), data=dict(b=\"v\")) assert form.b.data is None assert form.a._value()", "assert form.b() == \"\"\"<input id=\"b\" name=\"b\" type=\"numb...
[ "raise ErrorUninstallingException def uninstall(package): cmd = '\"{}\" uninstall \"{}\"'.format(config.ADB_PATH, package) try: request_pipe(cmd) except", "except Exception as e: if 'not enough space' in str(e): raise NotEnoughSpaceException() raise", "file.read() return data def get_api_level(): cmd = \"{} she...
[ "= K.Model(input_tensor, output_tensor) model.compile(optimizer=\"sgd\", loss=\"categorical_crossentropy\", metrics=[\"accuracy\"]) # Train model if lazy: model.fit(x=train, epochs=epochs,", "import FLIRDataset def grid_search(train_labels: str, test_labels: str, output:str, res:tuple=(120, 160), lazy:bool=True, ...
[ "Entrez.email = \"<EMAIL>\" # The maximum number of search results to be displayed", "= input(\"enter your search query: \") filter_option = input(\"would you like to use", "the email must be the user's individual/personal email (NOT an institutional email or", "maximum number of search results to be displaye...
[ "DATA_PATH = expanduser(\"~/jarbasHiveMind\") if not isdir(DATA_PATH): makedirs(DATA_PATH) CERTS_PATH = join(DATA_PATH, \"certs\") if not", "join(DATA_PATH, \"certs\") if not isdir(CERTS_PATH): makedirs(CERTS_PATH) DB_PATH = join(DATA_PATH, \"database\") if not isdir(DB_PATH):", "<gh_stars>10-100 from os import...
[ "line2 = l2[i].split() val = (int(line1[3]) + int(line2[3])) / 2 res.writelines(line1[0] + '", "super(Item, self).__init__() l1 = open(file1_name, 'r').readlines() l2 = open(file2_name, 'r').readlines() res = open('res','w')", "open(file2_name, 'r').readlines() res = open('res','w') def run(): for i in range(le...
[ ":param is_folder:是否是文件夹 :param name:文件/文件夹名称 :param parent_folder:父文件夹对象 :param child_nodes:文件夹内容 :param data:文件数据 :return:文件/文件夹对象。若同路径存在重名返回-1,磁盘分配错误返回-2 \"\"\" if", "in child_node_names: print('新名称在同路径下冲突') return -1 else: folder_obj.folder_name = new_name return 1 def renameFile(old_name:", "return -2 pare...
[ "the program will not remove all intermediary files in the folder tmp after", "(home + \"tmp/\"+job_ID+\"/\") print (true_output) print (counter) print ('###############') ###Calling spades_recipee.py to generate", "os.listdir(true_output+name+\"_no_reduc_busco\"): if e.find(\"specific\") > -1: noredubusco = e ...
[ "sqlite3 db = sqlite3.connect('data.db') c=db.cursor() c.execute('create table users (id integer primary key, name", "<gh_stars>0 import sqlite3 db = sqlite3.connect('data.db') c=db.cursor() c.execute('create table users (id integer primary", "db = sqlite3.connect('data.db') c=db.cursor() c.execute('create tabl...
[ "DOXY_VERSION + '.*', DOXY_VERSION + version) # Update CMakeLists.txt replace('CMakeLists.txt', '''SET\\\\(CBOR_VERSION_MAJOR \"0\"\\\\) SET\\\\(CBOR_VERSION_MINOR", "pattern, replacement): updated = re.sub(pattern, replacement, open(file_path).read()) with open(file_path, 'w') as f: f.write(updated)", "# Updat...
[]
[ "] if m[1] is not None)) class TweakedSlectedKernelOperation(nn.Sequential): def __init__(self, in_channels, out_channels, stride,", "for m in [ ('norm1', normalization(in_channels)), ('act1', activation(inplace=True)), ('conv1', nn.Conv2d( in_channels, out_channels, kernel_size=1,", "bias=False)), ('norm2', no...
[ "#Get StartTimes and StopTimes as lists startTimes = list(compAcc.DataSets.GetDataSetByName(\"Start Time\").GetValues()) stopTimes = list(compAcc.DataSets.GetDataSetByName(\"Stop", "builtin type method #type(app) #More info is available via python built in dir", "each Facility to the constellation. facCount = s...
[]
[ "line) in enumerate(lines): if i == 0: continue guid = \"train-%d\" % (i)", "Unless required by applicable law or agreed to in writing, software # distributed", "guid = \"%s-%s\" % (set_type, i) text_a = tokenization.convert_to_unicode(line[3]) text_b = tokenization.convert_to_unicode(line[4]) if", "set_type ...
[ "new_row['sentiment_actual_previous'] = 1 if ((price_minus1.iloc[0]['Closing Price'] - price_minus1.iloc[0]['Opening Price']) >= 0) else -1", "import WordNetLemmatizer class LoadData: @classmethod def preprocess_stocktwits_data(cls, file_location, columns=['datetime', 'message']): \"\"\" preprocess the", "price...
[ "TEST_LOGGER = getLogger(__name__) def count_features(json_profile_filename): if not os.path.isfile(json_profile_filename): raise ValueError(f\"{json_profile_filename} is not a", "# Log a smaller dataframe to get more features before rotation sleep(sleep_interval) profiler.disable()", "Load the full lending clu...
[ "and the following disclaimer in the documentation # and/or other materials provided with", "SUCH DAMAGE. # ------------------------------------------------------------------------------ from django.contrib.auth.models import User from django.db import models class", "WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ...
[ "arr def gap_insertion_sort(arr, start, gap): n = len(arr) for i in range(start, n,", "n//2 while gap >= 1: for start in range(gap): gap_insertion_sort(arr, start, gap) gap", "# space complexity O(1) def shell_sort(arr): n = len(arr) gap = n//2 while", "gap_insertion_sort(arr, start, gap) gap = gap//2 return ...
[ "5])) assert parameter.max_date == datetime(2015, 8, 5, 0, 0) assert parameter.min_date == datetime(2015,", "parameter.max == 12.0 assert parameter.min == 1.0 def test_max_min_date(dates_daily): parameter = Parameter(name =", "np.array([1, 2, np.nan, 4, 5])) assert parameter.max_date == datetime(2015, 8, 5, 0, ...
[]
[ "k = [1, 2, 3, 4] for a in k: for b in", "!= b and a != c and a != d and b !=", "d and b != c and b != d and c != d:", "and b != d and c != d: print(\"%s%s%s%s\" % (a, b, c,", "a != b and a != c and a != d and b", "!= d and b != c and b != d and c !=", "全排列2 求1、2、3、4的全排列 \"\"\" k = [1, 2, 3, 4] for a in...
[ "django.http import HttpResponse from django.template import loader from haitiwater.settings import PROJECT_VERSION, PROJECT_NAME from", "'unpaid_bills': 42, # Todo, but for later as we can't mark a payment", "django.contrib.auth.decorators import login_required from django.http import HttpResponse from django....
[ "'current_asset' query = (f'SELECT date FROM {table} ' f'WHERE id=(SELECT MAX(id) FROM {table});')", "{table} ' f'WHERE id=(SELECT MAX(id) FROM {table});') self.db.run_query(query) date_format = '%Y-%m-%d' today =", "TypeError: self.db.insert(table, record, msg=False) else: if today > latest_date: self.db.inser...
[ "<gh_stars>10-100 from browser import window def wrap(func): # Transforms a function f into", "traceback in case of exception def f(*args, **kw): try: return func(*args, **kw) except", "{0.args[0]}'.format(exc) import sys sys.stderr.write(msg) return f clear_interval = window.clearInterval clear_timeout = windo...
[ "if is_more: max_version = file_version max_key = filename if not max_key: logger.info(\"No new", "filename) try: out_dirname = os.path.dirname(out_filename) os.makedirs(out_dirname) except: pass target = file(out_filename, \"wb\") with", "\"wb\") with source, target: shutil.copyfileobj(source, target) zip_file...
[ "EmailStr = None # search patterns salary_max: Optional[int] = 0 salary_min: Optional[int] =", "from typing import Optional from pydantic import BaseModel, EmailStr class EmailSub(BaseModel): email: EmailStr", "import Optional from pydantic import BaseModel, EmailStr class EmailSub(BaseModel): email: EmailStr =...
[ "for g in geneset if g in assoc): for x in assoc[gene]: if", "= [g for g in geneset if g in assoc] for gene in", "group \"\"\" term2itemids = defaultdict(set) genes = [g for g in geneset if", "/n is different between the study group and the population \"\"\" if min_ratio", "-*- __copyright__ = \"Copyright (...
[ "baselines.common import tf_util as U from baselines import logger from baselines.ppo1 import pposgd_simple", "baselines.ppo1 import pposgd_simple from cartpole.cartpole_sim import cartpole_policy def train(env_id, num_timesteps, seed=0): U.make_session(num_cpu=1).__enter__() def", "from baselines.common.cmd_ut...
[ "programmatic access to this door\"}) ]) class KeypadDoorSettings(AutoFormSettings): spec = OrderedDict([ (\"direction\", {\"type\":", "('name_from_east', {'type': 'str', 'label': 'name from east', 'tooltip': 'String used to describe this", "to unlock this door\"}), (\"prompt\", {\"type\": \"str\", \"label\": \...
[ "tearDown(self): pass def test_stopwatch(self): stopwatch = Stopwatch() for _ in range(3): time.sleep(1) self.assertEqual(round(stopwatch.lap()),", "from timingsutil import Stopwatch import logging_helper logging = logging_helper.setup_logging() class TestConfiguration(unittest.TestCase): def setUp(self):", "de...
[ "elemento raíz do documento l_elem_root = l_xdoc_apx.documentElement() assert l_elem_root is not None #", "faz o parse do elemento ldct_tmp = parser.parse_aproximacao(l_element) # atualiza o dicionário com", "is not None # carrega os dados de procedimento de aproximação a partir", "# logger l_log = logging.ge...
[ "get currents state current_box_state = box_state_trace[i - 1, :] current_finger1_state = finger1_state_trace[i -", "box and the ground. args: box_state: current (x, z, theta, vx, vz, omega)", "box_mass_kg) finger1_state_dot = finger1_state_dot.at[2:].add(finger1_forces / finger_mass_kg) finger2_state_dot = fin...
[ "2021-01-18 03:51 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies =", "migrations, models class Migration(migrations.Migration): dependencies = [ ('classes', '0003_auto_20210117_2058'), ] operations = [", "= [ ('classes', '0003_auto_2021...
[ "print(r[0]) # cur.close() # # #--- #act_1 = python_act('db_1', test_script_1, substitutions=substitutions_1) expected_stdout_1 =", "?, 1) ||'-01' )\" # cur.execute( sttm, ( 3, ) ) # for", "end # ''' # # db_conn.execute_immediate( proc_ddl ) # db_conn.commit() # # cur=db_conn.cursor()", "#--- #act_1 = python_...
[ "competitive_cpc_base_classes = \\ initialize_priors(params, module_class) # Module setup for the simulator mods =", "AuctionAttributesModule from ssa_sim_v2.simulator.modules.vickrey_auction.vickrey_auction_module import VickreyAuctionModule from ssa_sim_v2.simulator.modules.competitive_click_probability.competi...
[ "2)) / K) pbar.update(end - start) pbar.close() return entropies_N def compute_entropy(probs_N_K_C: torch.Tensor) ->", "List import torch import math from tqdm.auto import tqdm from toma import toma", "from typing import List import torch import math from tqdm.auto import tqdm from", "N) candidate_indices = [...
[ "image=\"data_more/\"+nti[nti.rfind(\"/\")+1:nti.find(\"_cut\")]+\".grd\"; cmd=\"\\ngrdinfo \"+nti+\"\\n\"; pipe=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE).stdout; info=pipe.read().strip(); pipe.close(); zmax=info[re.search(\"z_max:\\s*\",info).end(0):re.search(\"z_max:\\s*\\S*\\s*\",info).end(0)].stri...
[]
[ "= QLabel('') self.label1.setAlignment(Qt.AlignCenter) self.label2.setAlignment(Qt.AlignCenter) self.label1.setFont(font3) self.label2.setFont(font3) self.fbox = QFormLayout() self.fbox.setAlignment(Qt.AlignCenter) self.fbox.setContentsMargins(20, 20, 20,", "res2==None: format_str = \"INSERT INTO users_present (i...
[ "import csv import pandas as pd f= open(\"data-errors.txt\",'r',encoding=\"utf8\") fc = f.read() fcbRegex =", "delimiter=\"\\t\") writer = csv.writer(open('amazon_reviews_us_Watches_v1_00_clean.tsv', 'w',encoding=\"utf8\"), delimiter=\"\\t\") for row in reader: if count in", "f= open(\"data-errors.txt\",'r',enc...
[ "the result of a task\"\"\" class TaskSystemExit(Exception): \"\"\"For when the task raised a", "# Run whatever task we've been given result = task_function() logger.debug(\"Completed task\") #", "socket.recv() raise logger.debug(\"Sending result of %d bytes\", len(result)) socket.send(result) # Await the ok", ...
[ "self.href = href self.this_milestone = this_milestone def __iter__(self): if self.this_milestone is not None:", "if self.this_milestone is not None: # for /milestone/xxx milestone = self.this_milestone else: milestone", "if key not in worker_hours: worker_hours[key] = 0 if milestone and milestone !=", "i in ...
[ "GeneralConfigurationEnvelope from running_modes.configurations.transfer_learning.link_invent_learning_rate_configuration import \\ LinkInventLearningRateConfiguration from running_modes.configurations.transfer_learning.link_invent_transfer_learning_configuration import \\ LinkInventTransferLearningConfiguration fr...
[ "convert loaded images to greyscale (1 channel). If 1, always convert loaded images", "{0, 1}, default 1 If 0, always convert loaded images to greyscale (1", "filename in sorted(os.listdir(path)): filename = os.path.join(path, filename) ext = os.path.splitext(filename)[1] if ext.lower() not", "root/bus/123.jp...
[ "# Get the sum of the tracts tracts_sum = add_tracts(tracts, tracts_to_sum_index) # Save", "affine = img.get_affine() np_matrix_3d_nii = nib.Nifti1Image(np_matrix_3d,affine) nib.save(np_matrix_3d_nii, output_image) # copy geometric information sct.run('fslcpgeom", "contains scripts, to be able to load modules s...
[ "as a compiled binary, for any purpose, commercial or non-commercial, and by any", "of our heirs and successors. We intend this dedication to be an overt", "the public domain. We make this dedication for the benefit of the public", "domain. We make this dedication for the benefit of the public at large", "c...
[ "length = 1 step = 0 rotations = 0 first, second = False,", "data += 1 if data == number: first = True # Sum of", "+= 1 if data == number: first = True # Sum of all", "all adjecant squares adjecant_sum = 0 for d in directions: x_1 = x", "1 x, y = (0, 0) direction = 0 directions = [(1, 0),", "= 1 second_re...
[ "with open(\"keys.txt\",'a') as w: w.write(\"-------------------------\\n\") for e in users: if e in [\"\",\"", "in pro: if ' Key Content : ' in i: passwrd=i break passwrd=passwrd[29:]", "w: w.write(\"-------------------------\\n\") for e in users: if e in [\"\",\" \"]: continue e=(\"\\\"\"+e+\"\\\"\")", "as ...
[ "import setup setup( name='pyr', version='0.4.1', description='A nicer REPL for Python.', author='<NAME>', author_email='<EMAIL>', url='https://github.com/zain/pyr',", "from setuptools import setup setup( name='pyr', version='0.4.1', description='A nicer REPL for Python.', author='<NAME>',", "version='0.4.1', d...
[ "* x**ix * y**iy i += 1 for ix in range(order2 + 1):", "fitorder) res = optimize.minimize(_corrval, coef_lin, args=(x, y, filtered, polyorder, trimfrac, coef_opt), method='Powell', options={'xtol':", "mode='same') unfiltered /= signal.convolve2d(inImage.ivar, gaussian, mode='same') + 1e-10 filtered = ndimage.in...