ngram
listlengths
0
67.8k
[ "= os.path.join('./data', args.data) processed_base_path = os.path.join(base_path, 'processed') processed_test_path = os.path.join(processed_base_path, 'test.npz') save_path =", "os import torch from torch import nn from torch.utils.data.dataloader import DataLoader from src.data_process.dataset", "model = torc...
[ "resp = '' result_size = 0 try: utcnow = datetime.utcnow() midnight_utc = datetime.combine(utcnow.date(),", "'', line_no_formatting) line_noquotes = re.sub(r'\"', '', line_noprefix) line_end_format = re.sub(r'(&.*?)$', '', line_noquotes) return", "fallback_json result_size = 0 return result_size def run_log(que...
[ "\"Web interface for Passari workflow\" ) LONG_DESCRIPTION = DESCRIPTION AUTHOR = \"<NAME>\" AUTHOR_EMAIL", "install_requires=[ \"Flask\", \"Flask-Security-Too\", \"click>=7\", \"click<8\", \"SQLAlchemy\", \"psycopg2\", \"rq>=1\", \"rq-dashboard>=0.6\", \"toml\", \"bcrypt\", \"Flask-SQLAlchemy\", \"Flask-WTF\",",...
[ "MultinomialNB, BernoulliNB from data_manager import DataManager correct_labels = ['Premise', 'Claim', 'MajorClaim'] correct_links =", "f: pickle.dump(classifier, f) @staticmethod def getFeatures(words): content = DataManager().get_content(words) features = nltk.FreqDist(content).keys() return", "= [] pass def ...
[ "import views app_name=\"blog\" #Works as namespace urlpatterns = [ path('', views.blogs, name=\"blog\"), path('<int:blog_id>',", "#Works as namespace urlpatterns = [ path('', views.blogs, name=\"blog\"), path('<int:blog_id>', views.detail, name=\"detail\") ]", "from . import views app_name=\"blog\" #Works as n...
[ "In edit mode taskIndex = new_list.index(editTask) # Get list position new_list[taskIndex].update({'name': newTask}) #", "not None: # In edit mode taskIndex = new_list.index(editTask) # Get list position", "'editBox', 'onChange': handleChange, 'value': newTask } ), el('input', {'type': 'submit'}), el('ol', None...
[ "Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7',", "Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Natural Language", "import test as TestCommand import appstore class Tox(TestCommand): def finalize_options(self): TestCommand.finalize_opt...
[ "ours ### START CODE HERE ### (approx. 6 lines of code) W1 =", "W1, \"b1\": b1, \"W2\": W2, \"b2\": b2, \"W3\": W3, \"b3\": b3} return parameters", "= tf.get_variable(\"W3\", [6, 12], initializer=tf.contrib.layers.xavier_initializer(seed=1)) b3 = tf.get_variable(\"b3\", [6, 1], initializer=tf.zeros_initializer(...
[ "get_local_dist(package_name): working_set = dict( (dist.project_name, dist) for dist in pkg_resources.WorkingSet() ) return working_set[package_name]", "'dist-info' metadata_file = 'METADATA' elif isinstance(dist, pkg_resources.Distribution): ext = os.path.join('egg', 'EGG-INFO') metadata_file =", "isinstance(...
[ "def get_client(self, API=client.CoreV1Api, **kwargs): \"\"\"Gets a k8s api client Args: API (client.<type>) -", "equivalent to Annotations in Kubernetes API\") class Meta: abstract = True class KubernetesNetworkingBase(KubernetesMetadataObjBase):", "deployed, deleted \"\"\" id = models.UUIDField(default=uuid4,...
[ "int(batch_size) transformer = StyleTransferDemo( model_path=model_path, input_shape=image_size, scope='style_transfer_cnn' ) original_frames = get_frames(video_path=video_path) original_frames =", "that need to process.', default='../data/videos/Africa.mp4') @click.option('--result_path', help='Path to file wher...
[ "return login() email = get_user()[\"email\"] if not is_admin(course=\"cs61a\", email=email): abort(401) service_list = \"\\n\".join(", "service[\"metadata\"][\"name\"] for service in loads( sh( \"gcloud\", \"run\", \"services\", \"list\", \"--platform\", \"managed\", \"--region\",", "email=email): abort(401) i...
[ "FocalLoss from data import CaseDataset from torchvision.transforms import Compose from transform import Crop,", "Adam(model.parameters(), lr=1e-4) loss = HybirdLoss(weight_v=[1, 148, 191], alpha=0.9, beta=0.1) metrics = {'dsc': DiceLoss(weight_v=[1,", "loss = HybirdLoss(weight_v=[1, 148, 191], alpha=0.9, beta=...
[ "string \"{string}\"') def step_a_string(context, string): context.first = string @when('we compare it to itself')", "distance): assert context.distance == distance @given('the first string \"{first}\" and the second string", "<filename>features/steps/levenshtein_steps.py import random from behave import given,...
[ "### DO NOT CHANGE THIS FILE ### ### The code is auto generated,", "if status_code is not None: self.status_code = status_code @add_status_code(422) class UnprocessableEntity(JSONException): pass @add_status_code(401)", "code, message=None, errors=None, status_code=None): super().__init__(message) self.error_co...
[ "``(3, 3, 3, 3)`` .. note:: The three angles (``alpha``, ``beta``, ``gam``) correspond", "= a0**2 b0 = b0**2 if cf.wvtype=='P': t1 += cf.thickn[i]*np.sqrt(1./a0 - (slow*1.e-3)**2) elif", "(np.ndarray): Elastic tensor with shape ``(3, 3, 3, 3)`` alpha (float): Angle in", "pl)*np.pi/180. # Get tensor with horiz...
[ "Bar(models.Model): name = models.CharField(max_length=200) description = models.TextField() beers = models.ManyToManyField(Beer, related_name='bars') slug =", "= models.ForeignKey(User) def __unicode__(self): return unicode(self.user) class UserProfile(models.Model): user = models.ForeignKey(User, null=True, bla...
[ "import platform import socket serialPort = Serial('COM3' if platform.system() == 'Windows' else '/dev/ttyUSB0',", "import Serial import time import platform import socket serialPort = Serial('COM3' if platform.system()", "= Serial('COM3' if platform.system() == 'Windows' else '/dev/ttyUSB0', 9600) time.sleep(2...
[ "app.models.res import Res from app.utils.teacher_class.teacher_class_utils import get_teacher_class @stu.route('/class/teacher', methods=['POST']) def teacher_class_get(): username =", "Time : 2019/7/27 16:15 Author : Hansybx \"\"\" from flask import request, jsonify", "Res from app.utils.teacher_class.teacher...
[ "import base64 from jinja2 import Template import sys import os import urllib.request def", "def encodebase64(filename): fin = open(filename, 'rb') contents = fin.read() data_url = base64.b64encode(contents) fin.close()", "if os.path.exists(basename): return get_local_file(basename) else: with urllib.request.ur...
[ "<filename>setup.py from distutils.core import setup setup( name='MACD', version='1.0', py_modules=[\"Average\", \"MACD\"], license='MIT', author='<NAME>', author_email='<EMAIL>'", "from distutils.core import setup setup( name='MACD', version='1.0', py_modules=[\"Average\", \"MACD\"], license='MIT', author='<NAME...
[ "number of data points. Parameters ---------- ipath: str Input path. tests: List of", "get_spline() or init(). Returns ------- p-value: float P-value for given test. \"\"\" #tests", "data size dependence of the parameters of the gamma distributions representing cumulative Shannon", "init(). Returns ------- p-...
[ "Textarea, TextInput from .models import Review from django import forms from django.contrib.auth.models import", ".models import Review from django import forms from django.contrib.auth.models import User # Form", "# Form to take display to take user's review class ReviewForm(ModelForm): class Meta:", "class...
[ "import Flask from flask_restful import Api from resources.vagas import VagasEmpregoResource App = Flask(__name__)", "o banco e todas aas suas tabelas @App.before_first_request def cria_banco(): banco.create_all() def set_routes(Api):", "from resources.vagas import VagasEmpregoResource App = Flask(__name__) App...
[ ".items import * from .functions import * from .base_materials import * from .materials", "from .materials import * from .operators import * from .display import * from", "* from .functions import * from .base_materials import * from .materials import *", "import * from .operators import * from .display impor...
[ "class Meta: name = \"A\" value: Optional[int] = field( default=None, metadata={ \"required\": True,", "A1: class Meta: name = \"A\" value: Optional[int] = field( default=None, metadata={ \"required\":", "value: Optional[int] = field( default=None, metadata={ \"required\": True, } ) t: Optional[int] =", "\"ty...
[ "state, action, Q1=False): state_action = jnp.concatenate([state, action], axis=1) q1 = nn.Dense(state_action, features=500) q1", "class TD3Actor(nn.Module): def apply(self, x, action_dim, max_action): x = nn.Dense(x, features=256) x =", "= nn.elu(x) x = nn.Dense(x, features=2 * action_dim) mu, log_sig = jnp.sp...
[ "设置列表页展示条目数比较小,可提高打开列表页性能 list_per_page = 10 # list_filter是性能杀手,尽量不要开启 # list_filter = ('user', 'post',) # 开始没有加id进入list_display导致第一项title没法编辑,出现以上问题,后来加了个id在前面解决", "search_fields = ('user','location', 'url','job_title',) # 设置列表页展示条目数比较小,可提高打开列表页性能 list_per_page = 10 # list_filter是性能杀手,尽量不要开启 # list_filter", "i...
[ "anagram class TestAnagram(unittest.TestCase): @classmethod def setUpClass(cls): cls.parser = anagram.args_options() cls.mock_path = '/path/to/folder' @classmethod", "import join import anagram.anagram as anagram class TestAnagram(unittest.TestCase): @classmethod def setUpClass(cls): cls.parser =", "an empty ou...
[ "src_stamps, generator) def gen_build_rules(generator: ninja_syntax.Writer): \"\"\" Generate yocto build rules for ninja \"\"\"", "build_dir: str, src_stamps: List[str], generator: ninja_syntax.Writer): \"\"\" Return configured AndroidKernel class \"\"\" return", "build\" return [os.path.join(self.build_dir, t....
[ "KIND, either express or implied. # See the License for the specific language", "the License. # import logging from datetime import datetime from django.conf import settings", "Unless required by applicable law or agreed to in writing, software # distributed", "!= order: screenshot.order = order screenshot.sa...
[ "config.add(allow_games) config.add(nsfw) config.add(short_date_time_format) def games_allowed_only(f): @wraps(f) async def wrapper(message, *args, **kwargs): if not", "def wrapper(message, *args, **kwargs): if not scoped_config.get(allow_games, message.channel): raise CommandError( \"Games aren't allowed", "`y...
[ "d6_b = Dice.sum( [d6 @ c * 1, d6 @ c * 2,", "12), 6: Fraction(1, 12), }, Fraction(1), ) assert result == expected def test_sum_to_half():", "Dice.from_dice(6) for c in [ Fraction(1), Fraction(1, 2), Fraction(1, 6), ]: assert d6", "d6_b = Dice.sum([1 * d6, 2 * d6, 3 * d6, 4 *", "= Dice.from_external( { 1: F...
[ "create_urllib3_context # create_urllib3_context() from chembl_webresource_client.new_client import new_client molecule = new_client.molecule def get_smiles(_id): mol", "to fetch smiles using chembl id # Source: https://www.ebi.ac.uk/chembl/ws # For monkey patching", "Source: https://www.ebi.ac.uk/chembl/ws # F...
[ "Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the", "writing, software # distributed under the License is distributed on an \"AS IS\"", "tensorflow as tf from tensorflow.python.platform import gfile from sqlflow_submitter import db import os", "as tf from tensorflow.python.p...
[ "os.path.dirname(os.path.dirname(path)) else: path = '' return path def build_dso(hou_app_dir, library_dir): hcustom = os.path.join(hou_app_dir,", "[]): command += ['-I', os.path.join(library_dir, path)] for path in config.get('dsoLibdir', []): command +=", "TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A...
[ "= secondary.bodylengths_moved(experiment=experiment) if callback: cb_sec(0.8) save_processed_data(data, experiment) if callback: cb_sec(1) # dump it", "if experiment is None: # load experiment experiment = wio.Experiment(experiment_id=ex_id, callback=cb_load) talk('Loaded experiment", "cb = lambda x: cb_pri_st...
[ "#self.last_aa_pos = aa_data[self.aa_p] #rh_data = self.rh.get()['data'] pos = np.hstack(( aa_data[self.aa_p], rh_data[self.rh_p] )) vel", "= [settings.ARMASSIST_UDP_SERVER_ADDR, settings.REHAND_UDP_SERVER_ADDR] self.socks = [socket.socket(socket.AF_INET, socket.SOCK_DGRAM), socket.socket(socket.AF_INET, socket.S...
[ "constraints_scale=constraints_scale, model_vars=model_vars, mode=pkg_constants.HESSIAN_MODE, noise_model=noise_model, iterator=True, update_a=True, update_b=True, dtype=dtype ) # Fisher information matrix", ":param constraints_scale: tensor (all parameters x dependent parameters) Tensor that encodes how complete...
[ ":return: base**exponent % modulus \"\"\" if USE_GMPY2: return gmpy2.powmod(base, exponent, modulus) # else", "prime number in the range [low, high). Returns GMPY2 MPZ integer if available.", "a*x + b*y = gcd. :param num_a: First number a. :param num_b: Second", "high: int) -> int: \"\"\" Generate a random pr...
[ "OpenAPI spec version: 3 Generated by: https://github.com/swagger-api/swagger-codegen.git \"\"\" from pprint import pformat from", "getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x,", "errors_count of this BulkCreateResponse. The number of enrollment id...
[ "torch import torch.nn as nn from torchvision.models.utils import load_state_dict_from_url model_urls = { 'vgg16':", "-> 14,14,512 -> 7,7,512 cfgs = { 'D': [64, 64, 'M', 128, 128,", "if pretrained: state_dict = load_state_dict_from_url(model_urls['vgg16'], model_dir='./model_data', progress=progress) model.load...
[ "based on the status of previous operators task.trigger_rule = 'dummy' task.render_template_fields(task.generate_context()) task.pre_execute(context) task.execute(context)", "exclude_cols = exclude_cols or [] e_cols = list(task.exclude_columns) + exclude_cols actual = actual.drop(e_cols,", "isinstance(actual, t...
[ "@app.post(\"/token\", response_class=JSONResponse) async def login(form_data: OAuth2PasswordRequestForm = Depends()): \"\"\" 仅用于docs页面测试返回用 \"\"\" user =", ") class L(BaseModel): username: str password: <PASSWORD> @app.post(\"/index\", summary=\"登录\") async def index(request: Request,", "\"bearer\"} async def ...
[ "#fraction of entire training period over which the exploration rate is annealed exploration_final_eps=0.02", "buffer_size = 50000 #size of the replay buffer exploration_fraction=0.1 #fraction of entire training", "= gym.make('Boxoban-Train-v1') model = DQN(MlpPolicy, env, gamma=gamma, learning_rate=learning_ra...
[ "def SetArm(self, gesture, left): for p in range(0,len(gesture)): id = gesture[p][0] value =", "servoManager = SmartServoManager(lX16AServos=servos, ramp=0, maxSpeed=1) tester = Arms(servoManager) #tester.MirrorRightArmToLeft(); #tester.PrintRightArmValues() tester.PrintLeftArmValues(); servoManager.Start(); #tim...
[ "output_path = os.path.join(\"Resources\", \"Election Analysis\") # Open and read csv with open(poll_path, newline=\"\")", "votes each candidate won for x in range(len(candidates_names)): vote_percent = round(candidate_votes[x]/total_votes *100, 4)", "candidate_votes = [] # Winning Candidate and Winning Count T...
[ "self.keys: if not key in params: raise KeyError(key) if not isinstance(params[key], expected_type): raise", "expected_type in self.keys: if not key in params: raise KeyError(key) if not isinstance(params[key],", "not key in params: raise KeyError(key) if not isinstance(params[key], expected_type): raise TypeEr...
[ "1 items = [] for product_type, quantity in grouped_products.items(): items.extend(get_product_items(PRODUCTS[product_type], quantity)) return items", "seat.appointment.email, _get_items_for_seats([seat])) def send_appointment_invoice(appointment): _send_invoice(appointment.billing_detail, appointment.email, _get...
[ "histogram of velocities using a bar chart. Parameters: ---------- :param int nbin: number", "hdf5 file must be supplied') self.__hdf5 = Hdf5Reader(hdf5) @property def keys(self): \"\"\" Property", "self.bt['ncpr'].as_matrix() / self.ncol x0 = np.array([D, R]) return least_squares(self.__van_genuchten_residuals...
[ "def test_function_0(self): self.assertParsesTo(parser.function, \"function a(){}\", ast.Function) def test_function_1(self): self.assertParsesTo(parser.function, \"function a() -> int", "test_func_call_0(self): self.assertParsesTo(parser.func_call, \"call()\", ast.FuncCall) def test_func_call_1(self): self.asser...
[ "''' import pysam ''' Read a FASTA file as a dict if a", "name is given. If not, return an empty dict. ''' def read_fasta(ref_fn: str)", "2021 ''' import pysam ''' Read a FASTA file as a dict if", "{} if ref_fn != '': f = pysam.FastaFile(ref_fn) for r in f.references: ref[r]", "read_fasta(ref_fn: str) -> di...
[ "= path_multi_label + '/error.csv' # 路径抽象层 path_label = path_multi_label_labels path_train = path_multi_label_train path_valid", "path_model = path_model_dir + '/model_fast_text.h5' # 超参数保存地址 path_hyper_parameters = path_model_dir + '/hyper_parameters.json' #", "!/usr/bin/python # @time :2019/6/5 21:04 # @autho...
[ "0 T = int(input()) for i in range(0,T): inp = input() if(inp ==", "res = 0 T = int(input()) for i in range(0,T): inp = input()", "= 0 T = int(input()) for i in range(0,T): inp = input() if(inp", "= input() if(inp == 'report'): print(res) else: inp_arr = inp.split(' ') res +=", "= int(input()) for i in rang...
[ "retreive_secret(\"storage-conn-string\") COG_SEARCH_END_POINT = env.get(\"AZURE_COG_SEARCH_END_POINT\", \"\") COG_SEARCH_API_VERSION = \"?api-version=2020-06-30\" COG_SEARCH_API_HEADERS = {'Content-Type': 'application/json', 'api-key':", "client = get_kv_client(kv_uri) return client.get_secret(key).value COG_SEA...
[ "django.urls import reverse from isimip_data.caveats.models import Caveat, Comment def test_annotation_add_get(db, client): client.login(username='admin', password='<PASSWORD>')", "= client.post(url, { 'title': 'New Caveat', 'description': 'Lorem ipsum dolor sit amet, consetetur", "args=[1]) response = client.g...
[ "self).setUp() user_authentication_token = Token.objects.create(user=self.user) self.client.credentials(HTTP_AUTHORIZATION=f'Token {user_authentication_token.key}') @classmethod def setUpTestData(cls): cls.user = User.objects.create_user(username=cls.USER, password=cls.PASSWORD,", "rest_framework.authtoken.models...
[ "expected by sdg-build. df = pd.melt(df, id_vars=['year'], var_name='gender', value_name='value') # We also rename", "inputs and schema, for JSON for Open SDG. opensdg_output = sdg.outputs.OutputOpenSdg( inputs=inputs, schema=schema,", "JSON for Open SDG. opensdg_output = sdg.outputs.OutputOpenSdg( inputs=input...
[ "= ymax YbottomOrigin = ymax - low_resolution lowres_cells = [] exception_cells = []", "#assign veh_avail and block_groups the same index block_groups_gdf_crs.index = block_groups_gdf_crs.GEOID newidx = []", "= grid['POP10'].groupby(maup.assign(grid, bg_pieces)).sum() bg_weights = maup.normalize(bg_weights, lev...
[ "print(list_of_numbers) #extending it list_of_numbers.extend([6,7,8]) print(list_of_numbers) #slicing it piece = list_of_numbers[:4] #beginning to 4", "<reponame>mnishitha/INF502-Fall2020 list_of_numbers = [1,2,3,4,5] len(list_of_numbers) list_of_numbers[0] print(list_of_numbers) list_of_numbers[4] print(list_of_...
[ "MEDIUM_SAFE_METHODS = ['GET', 'PUT','PATCH','HEAD','OPTIONS'] TOP_SAFE_METHODS = ['GET','DELETE','PUT','PATCH','HEAD','OPTIONS'] class Permission(permissions.BasePermission): \"\"\"manage permissions based on", "user choice\"\"\" def has_object_permission(self, request, view, obj): print(request.method in permis...
[ "current_read = read_id if current_read in parser1.reads: parser1.reads[current_read].read_id_line = line if current_read in", "reference database if not os.path.exists( os.path.join( parser1.options.get_project_dir(parser1.sample.sample_id), parser1.sample.sample_id + '_' + parser1.end +", "+ parser.options.pe...
[ "int: size = int((len(arr)) / 4) loose = max(1, size) for index in", "arr[idx+len(arr)//4]: return num __________________________________________________________________________________________________ sample 80 ms submission class Solution: def findSpecialInteger(self, arr:", "+ loose)) right = bisect.bisect_r...
[ "if N==1:print(\"1\");exit() if N<4:print(\"NO SOLUTION\");exit() [print(i) for i in range(1,N+1,2)] [print(i) for i", "3\");exit() if N==1:print(\"1\");exit() if N<4:print(\"NO SOLUTION\");exit() [print(i) for i in range(1,N+1,2)] [print(i) for", "if N==4:print(\"2 4 1 3\");exit() if N==1:print(\"1\");exit() i...
[]
[ "if vlan['tagged']: mapping = mac + \"-\" + str(vlan['vlan_id']) mappings.append(mapping) return mappings def", "None) # We dont care, just remove if there if len(task_data) > 1:", "governing permissions and # # limitations under the License. # ###################################################################...
[ "in queue] keys = [message.get('key') for message in messages] model_inputs = [pre_process(message.get('model_input')) for", "self.redis_queue = redis_queue assert 'predict' in dir(model_class), 'No predict function in model class'", "== 0: mq_miss = 0 if self.collection and model: model = None print('model", ...
[ "schema = graphene_settings.SCHEMA LOGGER.debug(\"GraphQL - set query variable to device.\") variables = {\"device\":", "GraphQL query from the ORM.\"\"\" import logging from django.utils.module_loading import import_string from graphene_django.settings", "data[\"devices\"][0] if PLUGIN_CFG.get(\"sot_agg_transp...
[ "n_output]) # Parameters learning_rate = 0.001 training_epochs = 10 batch_size = 100 display_step", "import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data get_ipython().run_line_magic('matplotlib',", "cost: %.9f\" % (epoch, training_epochs, avg_cost))...
[ "QtGui, QtCore from widgets.window_analisys import Analysis_Window class Analise_View(QtGui.QMainWindow): def __init__(self, controle): QtGui.QMainWindow.__init__(self) self.controle", "QtGui.QShortcut(QtGui.QKeySequence(\"home\"), self, self.controle.first_view) QtCore.QObject.connect(self.ui.actionAbrir_Conjunt...
[ "input('Digite se nome: ') cont = 0 while cont < 10: print(f'Hello word", "<reponame>DouglasCarvalhoPereira/Interact-OS-PYTHON<filename>M1/Aula1.py name = input('Digite se nome: ') cont = 0 while cont <", "= input('Digite se nome: ') cont = 0 while cont < 10: print(f'Hello", "nome: ') cont = 0 while cont < 10...
[ "0.25 self.add_widget(button) class ColorFilter(GridLayout): def __init__(self, **kwargs): super().__init__(**kwargs) self.spacing = 8 self.padding =", "8 self.padding = 10 self.cols = 8 self.rows = 5 for i in", "__init__(self, **kwargs): super().__init__(**kwargs) self.cols = 3 self.rows = 3 for i in range(sel...
[ "src=args) # Initialize and return the module instance = cls(**dct) if hasattr(instance, '__post_init__'):", "are two or greater params to be received assert len(call_params) == 2,('__call__ must", "an interface via argparse. ''' epilog = None if hasattr(cls, 'contributors'): # ==========================", "v...
[ "\"log=%s\" % f2[1], \"errors=0\", \"silent=all\"], stdout=f, stderr=None, stdin=None) p.communicate() if p.returncode != 0:", "stdout=f, stderr=None, stdin=None) p.communicate() if p.returncode != 0: error(\"SQLLDR exited with code %d\"", "any code except 0, then there was some error if p.returncode != 0:", ...
[ "4 self.eval_metric = 'auc' self.num_round = 10 self.verbose = 1 self.help = {", "self.max_depth = 2 self.eta = 1 self.objective = 'binary:logistic' self.nthread = 4 self.eval_metric", "self.eval_metric = 'auc' self.num_round = 10 self.verbose = 1 self.help = { }", "XGB: class Params: def __init__(self): self...
[ "hands[hand].update({top_card[0]: [top_card[1]]}) dealer = choose_dealer(new_game, winner) if dealer == 0: print('{} is the", "is 'posix') else: _ = system('clear') def create_deck(): deck = [] map =", "if got_wish and not game_over and not player.Computer: player.print_hand() return game_over def request_wish(...
[ "template.policies: policy.entity_tpl[\"targets\"] = [ node.name for node in policy.targets_list ] def _normalise_requirement_node_refs(requirements): \"\"\"Remove", "param.default for param in template.inputs if param.name == key ][0] except IndexError: logger.error(f\"Input", "| parsed_params: dictionary cont...
[ "id = Column(Integer, primary_key = True) discord_id = Column(String, nullable = False) score", "class to keep track of community giveaways class Giveaway(Base): __tablename__ = 'giveaway' id", "= False) image_url = Column(String, nullable = True) position = Column(Integer, nullable =", "class EventMessage(Ba...
[ "dest = self.ssyms.AddSymbol(dest) while src >= self.NumStates(): self.AddState() while dest >= self.NumStates(): self.AddState()", "infile != None: self.read(infile) def read(self, infile): \"\"\" Read probability definition from a", "lm, n, sidtab): \"\"\" Add states and arcs for all N-grams in the", "is a ...
[ "# coding=utf-8 def add(a, b): return a + b c = add(288, 500)", "#!/usr/bin/env python # coding=utf-8 def add(a, b): return a + b c =", "python # coding=utf-8 def add(a, b): return a + b c = add(288," ]
[ "typing import List, Union from typing_extensions import Literal Oses = Literal[\"macos\", \"ubuntu\", \"windows\"]", "Defaults are conservative. parallel: Union[bool, int, Literal[\"auto\"]] = False checkout_blocks_and_plots = False install_timelord", "False install_timelord = False check_resource_usage = Fals...
[ "= preds[0].asnumpy() label = labels[0].asnumpy().astype('int32') cls = pred_cls[np.arange(label.shape[0]), label] cls += config.EPS cls_loss", "mx import numpy as np from rcnn.config import config class LogLossMetric(mx.metric.EvalMetric): def __init__(self):", "def update(self, labels, preds): pred_cls = pred...
[ "# Client to add follows data def _add_follow_requests(self, follow_requests): if len(follow_requests) > 0:", "post in posts: p = post.to_dict() p['timestamp'] = str(post.timestamp) ps.append(p) url = base_url", "timelines): ts = [] for timeline in timelines: posts = timeline['posts'] for post", "url = base_u...
[ "G50_省エネレベル'] == 1) & (self.df[one+'運転モード'] == 2)),one+'運転モード'] = 2 # 運転状態が1で省エネレベルが1で運転モードが2のとき暖房(2) if (one", "\"C5F 事務室南 PACG_設定温度\":\"設定温度6\", \"C5F 事務室南 PACG_運転モード\":\"運転モード6\", \"C5F 事務室南 PACG_風速\":\"風速6\", \"C5F 事務室南 PACG_吸込温度_2\":\"吸込温度7\", \"C5F", "column in self.df.columns: columns_list.append('温度取り_'...
[ "containing optimizer state and encoder/decoder weights. Parameters ---------- path : str Path to", "decode(embedding) Generate matrices from embeddings. save_weights(enc_path, dec_path) Save encoder/decoder weights. load_weights(enc_path, dec_path) Load", "way. Only necessary for bad # hyperparam config such a...
[ "w, sim in out2} assert out1[0][1] == pytest.approx(out2[0][1]) @pytest.mark.parametrize('word1, word2, model_name', [ ('белый',", "small_model = method(big_ft, **params) assert cosine_sim(vec0, small_model[word1]) > 0.75 out1 = small_model.most_similar(word1) assert", "(sum(x**2) * sum(y**2)) ** 0.5 @pytest.ma...
[ "print 'ODD NEGATIVE' else: if x % 2 == 0: print 'EVEN POSITIVE'", "x < 0: if x % 2 == 0: print 'EVEN NEGATIVE' else:", "if x % 2 == 0: print 'EVEN NEGATIVE' else: print 'ODD NEGATIVE'", "0: print 'EVEN NEGATIVE' else: print 'ODD NEGATIVE' else: if x % 2", "% 2 == 0: print 'EVEN NEGATIVE' else: print 'ODD N...
[ "print(configs) py_files = ReqParser.__get_py_files(configs) reqs = ReqParser.__get_reqs(py_files) with open(\"requirements.txt\", 'w+') as req_f: req_f.write('\\n'.join(reqs))", "'catboost\\n', 'category_encoders\\n', 'collections\\n', 'datetime\\n', 'eli5\\n', 'gc\\n', 'itertools\\n', 'joblib\\n', 'json\\n', 'l...
[ "None otherwise. \"\"\" action_name = action_name.lower(); lookup = { 'build': self.buildAction, 'test': self.testAction,", "os.listdir(dir_path): scheme_file_path = os.path.join(dir_path, scheme_file); if not scheme_file.startswith('.') and scheme_file_path.endswith('.xcscheme') and os.path.isfile(scheme_file_pa...
[ "migrations.AddField( model_name='invitation', name='invitation_message', field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='itk_invitations.InvitationMessage'), ), migrations.AddField( model_name='invitation', name='invitee', field=models.ForeignKey(blank=True, null=Tr...
[]
[ "node2 print(node3) # Tensor(\"mul:0\", shape=(), dtype=float32) with tf.Session() as sess: output = sess.run([node1,", "tf.constant(4.0) print(node1) # Tensor(\"Const:0\", shape=(), dtype=float32) print(node2) # Tensor(\"Const_1:0\", shape=(), dtype=float32) node3 =", "node1 * node2 print(node3) # Tensor(\"mul...
[ "blockData toCompressM[ hashId ] = curMethod if cnt % cpu_n == 0: for", "recompress %s blocks.\" % hashCount) cur = tableHash.getCursor(True) _fuse.operations.getManager().setAutocommit(False) tableBlock.begin() tableHashCT.begin() _fuse.operations.getManager().setAutocommit(True) #", "!= curMethod: cMethodId =...
[ "if r in team.picks and len(team.assigned_committees) < team.num_delegates: # print(team.name, team.preferences) for pref", "row['Number of Spots'], row['Delegation Size']) committees[row['Committee']] = comm max_at_conf += row['Delegation Size'] for", "return schools, comms def format_for_main(schools, comms):...
[ "not begin with a number\") else: return False if re.search(r\"[^a-zA-Z_0-9]\", name) is not", "of equal sign is a valid key return cls._is_key_or_section_name_valid(line[:equal_index], suppress_exceptions=True) @classmethod def _get_key_from_line(cls,", "parse_float: value = cls._attempt_parse_float(value) if ...
[ "with DBConnectionHendler() as db_connection: try: return ( db_connection.session.query(Client) .filter_by(id=client_id) .first() ) except: db_connection.session.rollback()", "new(cls, nome): \"\"\"someting\"\"\" with DBConnectionHendler() as db_connection: try: client = Client(name=nome.upper()) db_connection.se...
[ "Bucket(10, 1, 5) def test_state(the_bucket): assert 4.99 < the_bucket.state() < 5 def test_push(the_bucket):", "assert 9.99 < the_bucket.state() < 10 def test_timeToWait(the_bucket): assert 4.99 < the_bucket.timeToWait(10) <", "from ccxt_microservice.bucket import Bucket import pytest @pytest.fixture def the_b...
[ "stepsizes for the parameter arrays. \"\"\" from astropy.io import fits import numpy as", "\"\"\" low_wave, low_spec = [], [] for i in range(len(spec)/px - 1): idx", "-N/2. * np.log(X2 / N) # Find highest likelihood values maximum = np.nanmax(lnL)", "= args.nights data_path = args.datapath model_path = args.m...
[ "'.json': create_symlink('ro-crate-metadata.jsonld', this_crate.metadata_path) elif os.path.splitext(this_crate.metadata_path) == '.jsonld': create_symlink('ro-crate-metadata.json', this_crate.metadata_path) log.info('ROCrate ready to publish')", "class CrateObj(): def __init__(self, crate_dir): self.crate_dir = ...
[ "class DataSetStatisticGeneratorTestDummyCases(DataSetStatisticReporterTestBase): def setUp(self): self.data_set_statistic_reporter = Container.statistic_reporter_data_set() self.columns_statistic_generator = ColumnNamesStatisticGenerator([]) self.range_statistic_generator = RangeStatisticGenerator(['Year'])", "[...