ngram
listlengths
0
67.8k
[ "install_requires=[\"gfootball>=2.8\",], # metadata to display on PyPI author=\"<NAME>\", author_email=\"<EMAIL>\", description=\"Soccer trajectory and event", "packages=find_packages(), # Project uses reStructuredText, so ensure that the docutils get # installed", "project home page, if any project_urls={ \"Is...
[ "6, 7, 8, 9, 10, 11]) n_decoys = pd.Series([0, 0, 1, 1, 1,", "'+Ag', 0.75], ['C2H2', '+Ar', 0.0], ], columns=['formula', 'modifier', 'msm'], ) exp_sf_df = pd.DataFrame(", "msm_df = pd.DataFrame( [ ['C1', '+H', 1.0], ['C2', '+H', 0.75], ['C3', '+H', 0.5],", "'decoy_sample_size': decoy_sample_size} fdr = FDR( f...
[]
[ "= df[column] p = price.rolling(lookback).apply(end_price, raw=True).shift(-lookback+1) t = price.rolling(lookback).apply(end_time, raw=True).shift(-lookback+1) t = pd.Series(", "[t.index[int(k+i)] if not math.isnan(k+i) else np.datetime64('NaT') for i, k in enumerate(t)], index=t.index ).dropna()", "np import ...
[ "*args, **kwargs)) except OSError: pass def create_image_cache_filename(input_filepath, *args, **kwargs): if input_filepath: hash_value =", "} ) try: backend.convert_file(input_filepath=input_filepath, output_filepath=output_filepath, transformations=transformations, page=page, file_format=file_format, mimetype=m...
[ "calc decision boundary # The decision boundary is the threshold line that separates", "# plot admitted plt.scatter(x_mat[admitted, 0], x_mat[admitted, 1], color='blue', marker='+') # plot rejected plt.scatter(x_mat[rejected,", "# predict for student joe = np.array([[45, 85]]) joe_norm = (joe - x_mean)", "# a...
[ "handler used for profiling processing times t = self._processing_timer.value() self.processing_times.append(t) def _timeit_dataflow(self) ->", "1: std = round(torch.std(data).item(), 5) return [total, min_index, max_index, mean, std] event_handler_stats =", "given {type(engine)}\") if not engine.has_event_hand...
[ "\"\"\" from __future__ import annotations from collections import namedtuple from datetime import datetime", "quick compute) # - websockets with potential arbitrage (including fees - detailed data", "to get: quote_curr -- (buy_price - fee) --> base_curr self.df[base][quote] = ((100 -", "log import pandas as ...
[ "BY-NC-SA 4.0 International Public License # (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/) # \"\"\" The", "Public License # (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/) # \"\"\" The Snowtire binary sensor.", "\"\"\" The Snowtire binary sensor. For more details ...
[ "-8.48731256e-01], [ -7.67315597e-01, -6.24101927e-01], [ -2.32860808e+00, -1.02510436e-01], [ -3.06641866e-03, -5.78877778e+00], [ -9.85292840e-02, -2.36626165e+00],", "[ 0.90616916, 0.09383084], [ 0.76969251, 0.23030749], [ 0.99798563, 0.00201437], [ 0.86297361, 0.13702639]] assert_array_almost_equal(y,", "nu...
[ "self.score[var] -= 1 def callback_factory(scoring: AbstactVariableScoring): if isinstance(scoring, VariableRanking): output = __build_callback__(scoring) else:", "v in solution.vars.items()} def get_value(self, var_name): return self.score[var_name] def success_update_score(self, curr_kernel, curr_bucket): raise...
[ "is being invoked by an old script wrapper. This will \" \"fail in", "wrappers for the current one. \"\"\" sys.stderr.write( \"WARNING: pip is being invoked by", "entrypoints defined. Because of issues arising from PATH, sys.path, multiple Pythons, their interactions,", "mechanism for warning users and direct...
[ "return def Sections_To_Lines(doc_text_sections): ''' Converts a dict of {section label: text} to a", "and pick out the cues. tree = etree.parse(str(xml_path)) root = tree.xpath('/*')[0] cues =", "= spec.root_path / rel_path # Get lines for all files. doc_lines = []", "'overview', then a series of names of cu...
[ "numbers a = 30 b = 17 print(\"Sum of a and b is\",a", "= 30 b = 17 print(\"Sum of a and b is\",a + b)", "two numbers a = 30 b = 17 print(\"Sum of a and b", "#Addition of two numbers a = 30 b = 17 print(\"Sum of a", "a = 30 b = 17 print(\"Sum of a and b is\",a +", "of two numbers a = 30 b = 17 print(\"Sum...
[ "<reponame>andersonssh/aprendendo-pyqt5<filename>curso 1/04 - caixa de texto/a4.py import sys from PyQt5.QtWidgets import (QApplication, QMainWindow,", "color: white;} QPushButton:hover{ background: orange; font-weight: 600}') botao2.clicked.connect(self.b2) botao3 = QPushButton('Texto', self) botao3.move(500,", ...
[ "svg += '''</svg>''' os.system('rm -rf /tmp/pdf2write') with open(f'{os.path.dirname(pdf_path)}/{os.path.basename(pdf_path).split(\".\")[0]}.svg', 'w') as f: f.write(svg) os.system(f'gzip", "<int name=\"ruleColor\" value=\"0\" /> <float name=\"marginLeft\" value=\"0\" /> <float name=\"xOffset\" value=\"-380.70175...
[ "-> ParameterValueType: param = self.get_parameter(name) return param.value def get_float_parameter_value(self, name: str) -> float:", "' + name + ' already added to this object') parameter = Parameter(name,", "parameter def add_parameter_object(self, parameter: Parameter) -> None: self._parameters[parameter.na...
[ "encapsulates a Region Of Interest, which may be either horizontal # (pixels) or", "horizontal # (pixels) or vertical (rows/lines). class ROI: def __init__(self, start, end): self.start", "a Region Of Interest, which may be either horizontal # (pixels) or vertical", "def crop(self, spectrum): return spectrum[...
[ "0x00, 0x1E, 0x07, 0x80, 0x03, 0xE0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,", "0x60, 0x80, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xF3, 0xCF, 0x30, 0x9E, 0x79, 0xE7,", "0x80, 0x87, 0x9E, 0x40, 0x8D, 0xE7, 0x9E, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00,", "0x00, 0x00, 0x00, 0x1E, 0x07, 0x80, 0x03, 0xE0, 0xF8, 0x00, 0x00, ...
[ "import bradley_thresholding_method from .contrast import contrast_thresholding_method from .feng import feng_thresholding_method from .gaussian import", "from .sauvola import sauvola_thresholding_method from .singh import singh_thresholding_method from .two_peaks import two_peaks_thresholding_method from", "fr...
[ "= ( Queue('default', exchange=Exchange('default'), routing_key='default'), # Queue('aws_uploads', routing_key='video.uploads'), ) CELERY_DEFAULT_EXCHANGE = 'default' CELERY_DEFAULT_EXCHANGE_TYPE", "CELERY_DEFAULT_EXCHANGE = 'default' CELERY_DEFAULT_EXCHANGE_TYPE = 'direct' CELERY_DEFAULT_ROUTING_KEY = 'default' ...
[ "(date, total_time)) print(\"\") print(\"*\" * 50) def main(): # print(\"Checking environment variable TIMESHEET_URL", "spreadsheet URL...\") user_full_name = os.environ.get('USER_FULL_NAME', \"\").strip() if not user_full_name: print(\"Warning: USER_FULL_NAME environment variable", "row[COL_WORK_FROM_HOME] if ...
[ "np.zeros((self.BATCH_SIZE, self.N_PLAYERS), dtype=float) hand_scores = self.evaluate_hands(community_cards, hole_cards, np.logical_not(folded)) ranks = np.argsort(hand_scores, axis=1) sorted_hands", "folded stops game, improves performance but breaks tests # test is not broken,", "None] total_winnings -= prev_...
[ "def revert_plugins(request, version_id, obj): from reversion.models import Version version = get_object_or_404(Version, pk=version_id) revs", "placeholders[pk].save() page.placeholders.add(placeholders[pk]) for plugin in cms_plugin_list: # connect plugins to the correct placeholder", "= obj lang = get_language...
[ "# 转化为int64 # print(label) label_gen_p = pd.DataFrame(label_gen_dict) label_gen_p.to_csv(gpath + 'label_delete.csv', index=False) # label_gen_p", "train_path = './AgriculturalDisease_trainingset/' valid_path = './AgriculturalDisease_validationset/' def genImage(gpath, datatype): if datatype == 'train':", "= './...
[ "import random x = range(0, 120) y = [random.randint(20, 35) for i in", "dpi=80) plt.plot(x, y) # 中文字体 chFont = font_manager.FontProperties(family=\"SimHei\") # SimHei # chFont =", "= 10 xLabels = [\"10点,{}分\".format(i) for i in range(60)] xLabels += [\"11点,{}分\".format(i) for", "= font_manager.FontProperties...
[ "canvas.plot(data, isoline, bg=1) baseline = os.path.splitext(sys.argv[1]) baselineImage = \"%s%s\"%baseline ret = regression.run_wo_terminate(canvas, \"test_vcs_isoline_labels.png\",", "isoline, bg=1) baselineImage = \"%s%d%s\"%(baseline[0], 2, baseline[1]) testImage = os.path.abspath(\"test_vcs_isoline_labels2....
[ "pnew = (1-laziness) * W.dot(p) + laziness * p0 l2norm = max(np.sqrt(sum((pnew -", "not # % need normalization when predict y_pred_ICE. # % ixsp is another", "stores the good cluster(s) for each instance, which may include even a remote", "wrong leading entrie cluster prediction is wrong, which is the reason ...
[ "tile_name, pin['wire']) cur.execute( \"\"\" SELECT track_pkey FROM node WHERE pkey = ( SELECT", "REBUF stuff rebuf_key = (feature_path[0], feature_path[1]) if rebuf_key in REBUF_SOURCES: return ' '.join([feature]", "and create synth_tiles input. All arches should have these synthetic tiles, search the", "to ...
[ "+ 'qPDFall.pdf',format='pdf', bbox_inches = 'tight') fecc.savefig('./plots/' + 'eccPDFall.pdf',format='pdf', bbox_inches = 'tight') flper.savefig('./plots/' +", "eccentricity for Andrew's circularization plots eccAll = [] eccObs = [] eccRec =", "axlper.step(lpb[0:-1], lphAll0/np.sum(lphAll0), color='black', al...
[ "), cout = cms.untracked.PSet( threshold = cms.untracked.string( \"DEBUG\" ) ), destinations = cms.untracked.vstring(", "### 2018 Prompt process.BeamSpotRcdPrinter.tagName = \"BeamSpotObjects_PCL_byLumi_v0_prompt\" process.BeamSpotRcdPrinter.startIOV = 1350646955507767 process.BeamSpotRcdPrinter.endIOV = 14068766...
[ "import ( TokenObtainPairView, TokenRefreshView, TokenVerifyView ) urlpatterns = [ path('obtain/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('refresh/',", "TokenVerifyView ) urlpatterns = [ path('obtain/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('refresh/', TokenRefresh...
[ "storbinary must accepts a STRING, since it builds a cmd and add the", "self.ftp.quit() except all_errors as e: sys.stderr.write(\"Error Closing FTP connection\\n\") sys.stderr.write(\"%s\\n\"%e) super().close() def fix(self,", "# and is an accessable file. I can infer that a failure to", "\"\", \"port\" : in...
[ "1) def testYearProperty(self): \"\"\"Tests the year property.\"\"\" knowledge_base_object = knowledge_base.KnowledgeBase() self.assertEqual(knowledge_base_object.year, 0) def", "knowledge_base_object = knowledge_base.KnowledgeBase() self.assertFalse(knowledge_base_object.HasUserAccounts()) user_account = artifac...
[ "if dp[idx] is None: dp[idx] = [] # 将目前的所有方式全部添加到新的位置,并在每个的最后追加当前的单词 for dic in dp[i]:", "for res in dp[-1]] def wordBreak_dfs(self, s: str, wordDict: List[str]) -> List[str]: def", "+ combo) memo[s] = res return res return dfs(s) s = Solution() print(s.wordBreak_dfs('catsanddog',", "if dp[i] is None: continu...
[ "testlib_api.ExpectedException(SystemExit): self._main_test_helper( ['prog', 'revision', '--autogenerate', '--%s' % branch], 'revision') def test_revision_autogenerate_conflicts_with_expand(self): self._test_revision_autogenerate_conflicts_with_branch( cli.EXPAND_BRANCH)", "Unless required by applicable law or ag...
[ "= Decimal(floor) self.ceiling = Decimal(ceiling) self.rate = Decimal(rate) def start(self): amount = self.rate", "Decimal(floor) self.ceiling = Decimal(ceiling) self.rate = Decimal(rate) def start(self): amount = self.rate *", "= Decimal(ceiling) self.rate = Decimal(rate) def start(self): amount = self.rate * ...
[ "else h humidity = h >> 12 if result: result[0] = temp result[1]", "= self.read_compensated_data() pi = float(p // 256) pd = (p % 256)/256 return", "self.dig_P9, \\ _, self.dig_H1 = unpack(\"<HhhHhhhhhhhhBB\", dig_88_a1) self.dig_H2, self.dig_H3 = unpack(\"<hB\", dig_e1_e7) e4_sign", "read_compensated_data(se...
[ "path of the secret to read Airflow Configurations (default: 'configs'). :type config_path: str", "type: (str) -> Optional[str] \"\"\" Get secret value from Vault. Store the secret", "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "elif self.auth_type == \"approle\": _client.au...
[ "lap(\"Converting 'item' column value types...\") df['items'] = df['items'].apply(literal_eval) # Group DataFrame by character_id", "adding nan pair los1 = items1.iloc[i] los2 = items2.iloc[i] pairs.append((los2, los1)) # Generate", "by text similarity. Edit Distance Metrics - Levenshtein Distance - Damerau-Lev...
[ "Board(array=array).legal_moves)) ) array[i][j] = 0 # underpromotion moves array[1, :] = Board.piece_symbol_to_int(\"P\") all_possible_moves.update(", "moves array[1, :] = Board.piece_symbol_to_int(\"P\") all_possible_moves.update( set(map(lambda move: Move(uci=move.uci()), Board(array=array).legal_moves)) ) arra...
[ "vehicle emc (float): electromechanical constant for the vehicle dt (float): simulation time step", "= 0 else: y0dot = self.y1 y1dot = net_acceleration self.y0 += y0dot *", "self.noise) return self.y0, self.y1 def get_altitude(self): \"\"\"Return the current altitude.\"\"\" return self.y0 def", "self.dt = dt ...
[ "import re from typing import Any, ClassVar, Dict, List, NoReturn, Union from cryptography.exceptions", "id = resp['id'] desc = resp['descripcion'] if id == 0 and 'Cuenta en", "InvalidInstitution, InvalidPassphrase, InvalidRfcOrCurp, InvalidTrackingKey, MandatoryField, NoOrdenesEncontradas, NoServiceResponse, P...
[ "1 ); ul.selfTest() self.assertEqual( list(ul), [1,3,2]) ul.append_front( 2 ); ul.selfTest() self.assertEqual( list(ul), [2,1,3])", "), \", \\t\\n\\r\" )(\"1,2, 3,,, \\n\\r\\t4\") self.assertEqual( l, [1,2,3,4] ) self.assertEqual( l, \"1,2,3,4\"", "ul.selfTest() ul.append( 3 ); ul.selfTest() ul.append( 1 ); ul....
[ "+ log_writer_id + \"\\t\\t\" +str(self.date) + \"/\" + str(self.current_time) + \"\\t\\t\" +email+ \"\\t\\t\"", "pass def log(self, file_object, email, log_message, log_writer_id): self.now = datetime.now() self.date = self.now.date()", "= self.now.date() self.current_time = self.now.strftime(\"%H:%M:%S\") fil...
[ "1024*MB # name of meta root dir META_DIR = \".metasync\" # batching time", "of meta root dir META_DIR = \".metasync\" # batching time for daemon SYNC_WAIT", "meta root dir META_DIR = \".metasync\" # batching time for daemon SYNC_WAIT =", "for daemon SYNC_WAIT = 3 # blob size BLOB_UNIT = 32*MB # Increase", ...
[ "test from py import valid_parentheses as vp class TestValidParentheses(unittest.TestCase): @test(vp.Solution.is_valid) def test_valid_parentheses(self) ->", "-> None: test(\"()\", result=True) test(\"()[]{}\", result=True) test(\"(]\", result=False) test(\"([)]\", result=False) test(\"{[]}\", result=True) test(\...
[ "return model def estimate_disparity(self, left_img, right_img): input_tensor = self.prepare_input(left_img, right_img) # Perform inference", "= 0 self.camera_config = camera_config # Initialize model self.model = self.initialize_model(model_path, model_type) def", "cv2.COLOR_BGR2RGB) right_img = cv2.cvtColor(r...
[ "which the plugin belongs to def get_form_field_instances(self, request=None, form_entry=None, form_element_entries=None, **kwargs): field_kwargs =", "plugin belongs to def get_form_field_instances(self, request=None, form_entry=None, form_element_entries=None, **kwargs): field_kwargs = { 'required':", "forms f...
[ "'Beam', 'Enemy', 'Friend', 'Hero', 'Launcher', 'Rotor', 'SpikeyBuddy', 'Star', 'Wizard', 'EnemyEquipedRotor', 'CyclingEnemyObject', 'Joints', 'Bomb',", "'Enemy', 'Friend', 'Hero', 'Launcher', 'Rotor', 'SpikeyBuddy', 'Star', 'Wizard', 'EnemyEquipedRotor', 'CyclingEnemyObject', 'Joints', 'Bomb', 'Contacts']", "_...
[ "0): for step, data in enumerate(zip(self.data_loader, train_loader), 0): data_1 = data[0] _, caps,", "fake_imgs = self.fake_imgs[idx] # netD.zero_grad() # Forward real_labels = self.real_labels[:batch_size] fake_labels = self.fake_labels[:batch_size]", "!= '': state_dict = torch.load(cfg.TRAIN.NET_G) netG.load...
[ "= request.forms.priimek#get(\"\") emso = request.forms.emso#get(\"\") drzava = request.forms.drzava#get(\"\") id_parcele = request.forms.id_parcele#get(\"\") od =", "dobi_postavke_racuna import datetime as dt @bottle.get('/') def root(): redirect('/domov') @bottle.get('/domov') def index(): parcele", "+ dt.tim...
[ "from espnet.nets.pytorch_backend.transformer.initializer import initialize def initializer(model, args): \"\"\"Initialize transducer model. Args: model (torch.nn.Module):", "model.dec.embed.weight.data.normal_(0, 1) for l in six.moves.range(len(model.dec.decoder)): set_forget_bias_to_one(model.dec.decoder[l].bia...
[ "= model.N M = len( trace ) likelihoods = np.ones((N, 1)) if i", "np.matrix(\"[ .02 0;\" \"0 0 0.5;\" \"0 0 0]\") P1 = np.matrix(\"[0.1 0", "trace ) likelihoods = np.ones((N, 1)) if i < M: P = main.randomization(P0,", "traces = traces_factory.traces P0 = np.matrix(\"[ .02 0;\" \"0 0 0.5;\" \"0 0", "likeliho...
[ "viewer.SetInputConnection(convertBack.GetOutputPort()) #viewer SetInputConnection [imageCanvas GetOutputPort] viewer.SetColorWindow(256) viewer.SetColorLevel(127.5) viewer.SetSize(320,320) viewer.Render() # --- end of", "imageCanvas.FillBox(50,100,0,100) imageCanvas.SetDrawColor(0,255,0) imageCanvas.FillBox(100,...
[ "csv class echa: def werehousing(self): with open('kelas_2b/echa.csv', 'r') as csvfile: csv_reader = csv.reader(csvfile,", "import csv class echa: def werehousing(self): with open('kelas_2b/echa.csv', 'r') as csvfile: csv_reader =", "def werehousing(self): with open('kelas_2b/echa.csv', 'r') as csvfile: csv_rea...
[ "float(\"inf\")) y_pred, y = TEST_SAMPLE_4 sur_metric.update([y_pred, y]) self.assertAlmostEqual(sur_metric.compute(), float(\"inf\")) def test_shape_mismatch(self): sur_metric =", "= np.ogrid[ -centre[0] : im_shape[0] - centre[0], -centre[1] : im_shape[1] - centre[1], -centre[2]", "KIND, either express or impl...
[ "= load_data(spec_file) max_rows = min(len(df), spec.get(\"max_rows\", 40000)) novelty_detection = spec.get(\"novelty\", True) normal_classes =", "rows)\" % (name, 100*prec, k, len(y_test))) precision[name].append(prec) logging.info(\"* SUMMARY %s\", spec_file) for name,", "df = df.sample(n=max_rows, replace=Fa...
[ "version': sys.version, 'platform': platform.platform(), 'optional deps. installed': optional_deps, } return '\\n'.join('{:>30} {}'.format(k +", "import_module from pathlib import Path from .main import compiled optional_deps = [] for", "'_')) except ImportError: continue optional_deps.append(p) info = { 'pydan...
[ "and Configurable not in obj.__bases__) @classmethod def purge(cls): cls.schemas = {} cls.units =", "establish a configuration chain.\"\"\" class Registry(object): \"\"\"The unit registry.\"\"\" dependencies = {} schemas", "Structure __all__ = ('Configurable', 'Registry') class Configurable(object): \"\"\"A sen...
[ "import * from .group import * from .http import * from .messaging import", "from .group import * from .http import * from .messaging import * from", "import * from .database import * from .entrypoint import * from .group import", ".messaging import * from .method import * from .operation import * from .stack...
[ "== 0: break segmentno = random.choice(range(len(words))) segment = words.pop(segmentno) tokens = segment.split() phrase_index", "args.len: words = [target] num = args.number choices = {} for i in", "args.add_eos: target = f\"{target} </s>\" if len(target.split()) >= args.len: words = [target] num", "= target...
[ "2020 <NAME> # # Permission is hereby granted, free of charge, to any", "'--exclude', 'ascii', path]) if self.return_code != 0: raise FileError('\\n'.join(self.stderr)) return '\\n'.join(self.stdout) def is_executable_elf(self,", "to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copie...
[ "other urls present on the records if --select-url is given.)\") parser.add_argument(\"--print-pub-date\", action=\"store_true\", help=\"Print", "h: len(hosts_to_urls[h])) for host in hosts: print(\"% 6d\\t%s\" % (len(hosts_to_urls[host]), host)) def print_urls_for_host(hosts_to_urls:", "every time this is call...
[ "writing, software # distributed under the License is distributed on an \"AS IS\"", "# -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the \"License\"); #", "the License. # You may obtain a copy of the License i...
[ "resource['code'] eq_(world.status, HTTP_ACCEPTED) world.location = resource['location'] world.pca = resource['object'] #@step(r'I wait until the", "Unless required by applicable law or agreed to in writing, software # distributed", "status = get_status(world.pca) while (status['code'] != int(code1) and status[...
[ "admins = ['admin1_telegram_nickname', 'admin2_telegram_nickname'] avail_days = [] TOKEN = 'bot_<PASSWORD>' group_id = id_of_group_chat", "<filename>config.py days_of_week = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday', 'Sunday'] operation = '' options = ['Info', 'Check-in/Out', 'Edit", "opera...
[ "return 'yes' in sandwich_builder(), so I made them all cost 0.25 'no':0 #", "'rye':2.0, 'wheat':1.50, 'white':1.25, 'chicken':2.0, 'turkey':1.50, 'ham':2.0, 'tofu':1.25, 'cheddar':2.0, 'swiss':2.5, 'mozzarella':2.5, 'yes':0.25, # toppings", "ip.inputChoice(['chicken', 'turkey', 'ham', 'tofu'], prompt=protein_p...
[ "builder.commands.scode import SCode, SCmd from builder.containers.chapter import Chapter from builder.containers.episode import Episode from", "(src, expect, exp_opt) (True, Story('test',), ('test',), 1), ] def checker(src, expect, exp_opt): tmp", "from builder.core import headerupdater as hd class HeaderUpdat...
[ "import numpy as np import h5py filename = \"test_vlen_datasets_np_bool.h5\" rows = [np.array([np.True_, np.False_]),", "rows[r] f.flush() f.close() f = h5py.File(filename, 'r') dsetr = f[\"vlen_matrix\"] for r in", "np.False_]), np.array([np.True_, np.True_, np.False_])] f = h5py.File(filename, 'x') # create f...
[ "bounds=None): if bounds is None: return (0.0 + a - a.min()) / (a.max()", "return (imInput, metadata) def writeVideoToFile(imVideo, filename, codec='DIVX', fps=30, isColor=False): # start timer tStart", "= time.time() print 'Writing video {} took {} seconds'.format(filename, tEnd - tStart) #", "fmt vmode = vi...
[ "if not EMAIL_ADDRESS.match(address): return None local, domain = address.split(\"@\", 1) return \"%s@%s\" %", "from smtplib import SMTP from weasyl import define, macro EMAIL_ADDRESS = re.compile(r\"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+\\Z\") def", "domain.lower()) def send(mailto, subject, content)...
[ "def test_builder_reports_warning_for_missing_process(app, status, warning): app.builder.build_all() assert \"build succeeded\" not in status.getvalue() warnings =", "warning): app.builder.build_all() assert \"build succeeded\" not in status.getvalue() warnings = warning.getvalue().strip() assert 'WARNING:", "\...
[ "#find mean value print('\\nMean: ',statistics.mean(level_score)) #find median value print('\\nMediand: ',statistics.median(level_score)) #Mode calculation #create", "#find median value print('\\nMediand: ',statistics.median(level_score)) #Mode calculation #create numPy array of values with", "vals, uni_val_cou...
[ "= conevertandsurface(vcen, r, zlen, deganglestep)# A solid is defined by vertices and surfaces", "notice = \"\"\" Cone Demo ----------------------------------- | Copyright 2022 by <NAME> | |", "isSolid = True # toggle solid or outline showoutline = False # can", "x y z coords r = 40 # radius of cone zlen =",...
[ "array to store results for plotting rmse = np.ones((25, 2)) noise = 0.01", "0 n_train = 0 while n_train < 200: n_target = 100 +100*n #", "as plt from sklearn.preprocessing import StandardScaler from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import", "White...
[ "This function must be imported and executed from the Python interpreter before the", "'heat' + codes['temperature'] else: command_postfix = codes['temperature'] codes['command'] = command_postfix return codes def", "connect_db() @app.teardown_request def teardown_request(exception): db = getattr(g, 'db', None)...
[ "float: \"\"\"Compute the norm of a vector.\"\"\" return np.sqrt(np.dot(vs, vs)) def create_random_matrix(size: int)", "\"\"\"Compute the norm of a vector.\"\"\" return np.sqrt(np.dot(vs, vs)) def create_random_matrix(size: int) ->", "return xs + xs.T def check_eigenpairs( matrix: np.ndarray, eigenvalues: np.nd...
[ "one: 哈希表 n = len(nums) flag = [False for i in range(n)] for", "range(1, len(nums)): if pre == nums[i]: return nums[i] else: pre = nums[i] return", "flag[nums[i]] = True else: return nums[i] return -1 # solution two: 排序 nums.sort()", "typing import List class Solution: def findRepeatNumber(self, nums: List[in...
[ "and testing sets so we don't cheat X_train, X_test, y_train, y_test = train_test_split(X,", "num_obs + ['blue'] * num_obs # plt.figure(figsize=(12,8)) # plt.scatter(X[:, 0], X[:, 1], c", "y, test_size=0.33, random_state=42) # Create our model network = GWUNetwork() network.add(Dense(2, 1, True,", "as np impo...
[ "np.empty(shape=(chunk_length, len(r))) for i in range(chunk_length): g_r_t_final[i, :] = np.mean(g_r_t[i::chunk_length], axis=0) g_r_t_final /=", "trajectory Parameters ---------- trj : mdtraj.Trajectory trajectory on which to compute the Van", "coeff = form_factor1 * concentration1 * form_factor2 * concentrat...
[ "\"alexnet\", \"quant_alexnet\"] from .alexnet import * from .lenet import * from .lenet5 import", "https://github.com/QDucasse # <EMAIL> from __future__ import absolute_import __all__ = [\"lenet\",\"lenet5\",\"quant_lenet5\", \"quant_cnv\", \"quant_tfc\", \"mobilenetv1\",\"quant_mobilenetv1\",", "from .mobilen...
[ "cv.imshow('Gray', gray) # blur = cv.GaussianBlur(gray, (5,5), cv.BORDER_DEFAULT) cv.imshow('Blur', blur) canny = cv.Canny(blur,", "= cv.GaussianBlur(gray, (5,5), cv.BORDER_DEFAULT) cv.imshow('Blur', blur) canny = cv.Canny(blur, 125, 175) cv.imshow('Canny Edges',", "cv.CHAIN_APPROX_SIMPLE) print(f'{len(contours...
[]
[ "Juve and contributors # For license information, please see license.txt # import frappe", "license information, please see license.txt # import frappe from frappe.model.document import Document class", "please see license.txt # import frappe from frappe.model.document import Document class Practitioner(Documen...
[ "\"/checkstyle_config.xml\")) print(\"Changing permissions for pre-commit. Has to run as root, enter password plz\")", "import urllib; from urllib.request import urlretrieve from subprocess import call def install_hooks(directory): checkstyleUrl", "(basePath + \"/.git/hooks/pre-commit\")]) if __name__ == \"__ma...
[ "the HTTPServer when there is a request to be handled.\"\"\" # Create the", "class MicroServer(object): \"\"\"Small web server.\"\"\" def __init__(self): \"\"\"Initializes the class and configures the", "from webob import Request from webob import Response from jinja2 import Environment, FileSystemLoader", "e...
[ "django.core import mail from django.conf import settings from django.core.management.base import BaseCommand import amo.utils", "the Add-on SDK's development. Feedback and engagement from developers like you are the", "will need to upgrade them to the 1.0 version of the SDK manually.", "to get in touch with ...
[ "observer who has constraints ``constraints`` target : {list, `~astropy.coordinates.SkyCoord`, `~astroplan.FixedTarget`} Target times :", "(containing the supplied ``constraints``). \"\"\" if not hasattr(constraints, '__len__'): constraints = [constraints] is_24hr_table", "= PhaseConstraint(binary, min=0.4, max...
[ "def categories(request): context = {} context['nav_active'] = 'categories' categories_list = Category.objects.all() paginator =", "@login_required() def edit_post(request, post_id): context = {} context['nav_active'] = 'posts' post = Post.objects.get(pk=post_id)", "PageNotAnInteger: posts = paginator.page(1) e...
[ "import uuid import zipfile from concurrent.futures import Future from multiprocessing.connection import Connection from", "= _mp.Process( target=_run_model_session_process, name=\"ModelSessionProcess\", kwargs={\"conn\": server_conn, \"devices\": devices, \"log_queue\": log_queue, \"model_zip\": model_zip}, )", ...
[ "launch(self, session, event): created = [] entities = event['data']['entities'] for entity in entities:", "less than SyncToAvalon event ''' priority = SyncToAvalonEvent.priority - 1 ignore_me = True", "must be less than SyncToAvalon event ''' priority = SyncToAvalonEvent.priority - 1 ignore_me", "of this eve...
[ "tests.settings_mock as settings_mock from tests.activity.classes_mock import FakeLogger from workflow.workflow_IngestAcceptedSubmission import workflow_IngestAcceptedSubmission class TestWorkflowIngestAcceptedSubmission(unittest.TestCase):", "unittest import tests.settings_mock as settings_mock from tests.activi...
[ "vumi_api def token(request, token): # We only need the redis manager here, but", "the redis manager here, but it's saner to get a whole # vumi_api", "we need to be if not user_id or request.user.id == user_id: path, _,", "being forwarded so the view handling the `redirect_to` # can lookup the token", "but ...
[ "force_unicode(text) f.is_safe = True out = text try: out = f(text) except TypogrifyError,", "template.Library() def make_safe(f): \"\"\" A function wrapper to make typogrify play nice with", "make typogrify play nice with django's unicode support. \"\"\" @wraps(f) def wrapper(text): text", "f(text) except Ty...
[ "matrix) # \"4\": Talairach transformation # \"5\": Un-Talairach transformation (1 - 5 ->", "order to represent large data sets efficiently, e.g. in # the context of", "mean intensity data, = struct.unpack('<i', f.read(4)) header[\"VMROrigV16MaxValue\"] = data # 16-bit data max", "header[\"OffsetX\"] = data d...
[ "an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND,", "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "print('Tested %s acc = %f, speed = %f img/sec' % (m, r, speed))", "express or implied. See the License for the # specific language governing permissions", ...
[ "sort the data when using TS methods. Returns ------- vDataFrame self.parent See Also", "be able to solve this issue.\" ) self.add_copy(new_name) parent = self.drop(add_history=False) parent.__add_to_history__( \"[Rename]:", "the nth most occurent element. Parameters ---------- dropna: bool, optional If set to"...
[ "= book.reprint form.removed.data = book.removed form.keepsite.data = book.keepsite return render_template('book/edit_book.html', form=form) @book.route('/del/<int:id>', methods=['GET',", "from booktags.db.basemodels import Book from booktags.flaskapp.model.models import BookMain # -------------------------------...
[ "= 'text/html' ico = 'image/bmp' jpg = 'image/jpeg' jpeg = 'image/jpeg' js =", "'application/javascript' png = 'image/png' txt = 'text/plain; charset=us-ascii' json = 'application/json' svg =", "content_type(Enum): # https://www.iana.org/assignments/media-types/media-types.xhtml css = 'text/css' gif = 'image/gi...