ngram
listlengths
0
67.8k
[ "= get_file_per_folder(folder) for d in sorted(files): norm = normalize_name_and_numbers(files[d]) for r in norm:", "= normalize_name_and_numbers(files[d]) for r in norm: if r[-2] != r[-1]: pat = os.path.join(folder,", "file names. \"\"\" import os import re from pyquickhelper.loghelper import noLOG from pyquic...
[ "if not isinstance(x, stype): raise AssertionError(f\"{label} should be {stype}, {type(x)} instead\") def ert_multiTypes(x,", "be greater than 0\") elif x < 0: raise AssertionError(f\"{label} should be greater", "raise AssertionError(f\"{label} should be {stype}, {type(x)} instead\") def ert_multiTypes(x, types...
[ "method. \"\"\" def __init__(self, model): self.model = model def predict(self, X): \"\"\"Wraps the", "files], key=str.lower) def apk(actual, predicted, k=3): \"\"\" Source: https://github.com/benhamner/Metrics/blob/master/Python/ml_metrics/average_precision.py \"\"\" if len(predicted) >", "+= num_hits / (i + 1...
[ "under the terms of the LGPLv3 or higher. from PyQt5.QtCore import Qt, pyqtSlot", "in quality_changes_group_dict.values(): if quality_changes_group.quality_type not in available_quality_types: continue quality_group = quality_group_dict[quality_changes_group.quality_type] item =", "= Qt.UserRole + 3 QualityChan...
[ "from backward feature selection from: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/feature_selection/rfe.py Given an external estimator that assigns weights", "False, False], dtype=bool) >>> selector.ranking_ array([1, 1, 1, 1, 1, 6, 4, 3,", "shape [n_samples, n_features] The input samples....
[ "# fp = tempfile.TemporaryFile() # bh = list(map(lambda v: v.encode(\"utf-8\"), regular_entry_base_meta_columns)) no_t =", "ts: datetime.strftime(ts, \"%Y\"), \"last_edit_ts\": lambda ts: datetime.strftime(ts, \"%Y\"), \"template\": lambda template: template.title, \"actors\":", "resolve_values(aspect, value): ...
[ "response = {'ok': True, 'message': 'no record found'} return jsonify(response), 200 else: return", "True, 'message': 'User created successfully!', 'user': user}), 200 else: return jsonify({'ok': False, 'message':", "user['email']}) if db_response.deleted_count == 1: response = {'ok': True, 'message': 'record d...
[ "if not conf.get(\"general\", \"import\") == \"\": conf3 = ExtendedConfigParser() conf3.read(conf.get(\"general\", \"import\")) conf.merge(conf3) conf.filename", "in defaults # If new option found, warn and ignore it def warn_opt(section,", "\"\": return None else: return tuple(datetime.datetime.strptime(e.stri...
[ "c in cols] RESULT+=\"\\n\"+Begin+\" \"+Category+\" \"+title+\" \"+size toplevel = Toplevel() label= Label(toplevel,text=RESULT,height=0,width=100) label.pack()", "BeautifulSoup as BS class window(Tkinter.Tk): Ip_text = '' def __init__(self,parent): Tkinter.Tk.__init__(self,parent) self.parent =", "= httplib.HT...
[ "}) db.session.add(subview) try: db.session.commit() except IntegrityError: db.session.rollback() abort(400) resp = jsonify({'view_id': view.id}) resp.status_code", "'refresh_time' in request_data.iterkeys(): if not view.check_refresh_time(request_data['refresh_time']): abort(400) for key, value in request_data.i...
[ "CORS from fileIO import commit_file # importing methods from SQL handler module for", "API documentation for available API endpoints and methods.\" # defination for Items #", "# extract item details from request body form param=request.form['details'] print (param) # insert", "pass id to handler method to re...
[ "= color_space[:,2].tolist() # Publish ColorSpace-message self.pub_color_space.publish(color_space_msg) class Pointfinder(): def __init__(self, debug_printer, threshold, kernel_radius):", "Set params self.queue_max_size = vision_config['dynamic_color_space_queue_max_size'] self.color_value_queue = deque(maxlen=se...
[ "as f: long_description = f.read() setup( name='pituo', packages=['pituo'], version='0.0.2', license='MIT', description='Go-styled errors in", "License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 2',", "Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programmi...
[ "IN THE # SOFTWARE. \"\"\" Basic classes to read/write a binary Kaldi ark", "writer = KaldiIntVectorArkWriter() reader.open(args.input_ark) writer.open(args.output_ark) for uttid2data in reader: print(('uttid: %s' %list(uttid2data.keys())[0])) if", "args.type == 'f': reader = KaldiFeatArkReader() writer = Kaldi...
[ "None, None) reporter.report_success(it_block, 1000) reporter.report_success(it_block, 500) printed_text.clear() reporter.report_end_result() expect(printed_text[0]).to_contain(\"2 passed in 1.50 seconds\")", "pynetest.expectations import expect from pynetest.lib.result_reporters.printing_reporter import Printing...
[ "import ray.train as train import zipfile from raypipe import logger from raypipe.core.distribution import", "raypipe.core.rpipe.utils import zip_dir class TrainReportCallback(Callback): def on_epoch_end(self, epoch:int, logs=None): train.report(**logs) class DistModelSaveCallBack(ModelCheckpoint): def", "impor...
[ "delay function (proof of time) developed by Chia\" + \"Networks.\", classifiers=[ 'Development Status", "Alpha', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6',", "Python :: 3.6', 'Programming Language :: Python :: 3.7', 'License :: OSI Approved", "Python :: 3', 'Programming L...
[ "\"--convert\", '[{\"id\": 1, \"text\": content.decode(\"utf-8\")}]', \"--id\", \"id\", ] + options, catch_exceptions=False, ) assert", "\"Tonic 2\"}, # This line has changed from \"Rum\" to \"Rum Pony\": {\"product_id\":", "\"-m\", \"main\"], cwd=str(repo_dir)) (repo_dir / \"items.json\").write_text( json.dump...
[ "user_trace_token=<PASSWORD>1<PASSWORD>; LGUID=20180611153613-1e11da71-6d4a-11e8-9446-5254005c3644; JSESSIONID=ABAAABAAAGFABEFA887FF2126C2345351E1CF33022A085A; _gid=GA1.2.295504001.1536894927; LGSID=20180914111529-6ee84ad5-b7cc-11e8-b939-5254005c3644; Hm_lvt_4233e74dff0ae5bd0a3d81c6ccf756e6=1536894927; index_locati...
[ "!= 0 def test_3(): \"\"\" checks that the header has been poped \"\"\"", "get_input() vch = VcfHeader(i) output = vch.get_raw_header() output_no_chrom = pop_header(output) return output_no_chrom def", "that output is not empty \"\"\" assert len(get_no_chrom()) != 0 def test_3(): \"\"\"", "the header has been...
[ "เช่น โชว์ Basic แต่เซฟด้วย B นะ ('B', 'Basic'), ('M', 'Medium'), ('A', 'Advance'), )", "name = models.CharField(max_length=100) class Meta: verbose_name_plural = \"Category\" def __str__(self): return self.name class", "allow tage เพื่อให้มันแปลความหมายของ tag ข้างบน def get_comment_count(self): return self.bo...
[ "comments to # have as much context between the comments as possible. Everything", "0.002% of the cases threshold = len(output) * 0.00002 chars_to_remove = [] for", "text.strip() @profile def create_output(self): \"\"\"Generates one big cp1252 string\"\"\" output = ''.join(self.batches) #Remove", "yield row d...
[ "# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-15 12:47", "models class Migration(migrations.Migration): dependencies = [ ('logger', '0002_auto_20161231_1740'), ] operations = [ migrations.AddField(", "2017-09-15 12:47 from __future__ import unicode_literals from django.db import migrations, m...
[ "forward(self, x): x = F.relu(self.conv_1(x)) x = F.relu(self.conv_2(x)) x = F.max_pool2d(x, 2) x", "F.max_pool2d(x, 2) x = self.dropout(x) x = torch.flatten(x, 1) x = self.dropout(F.relu(self.fc_1(x))) out", "nn.Conv2d(32, 64, 3, 1) self.dropout = nn.Dropout(p=0.5) self.fc_1 = nn.Linear(9216, 128) self.out =",...
[ "enumerate(reader): for cindex, col in enumerate(row): try: worksheet.write(rindex,cindex, float(col)) except ValueError: worksheet.write(rindex, cindex,", "= os.path.abspath(csvpath) if outname is None: filename = os.path.basename(directory_path + \".xlsx\") else: filename", "cindex, col) workbook.close() def ...
[ "user = context['request'].user.id tenant = context['request'].user.tenant_id keystone = get_admin_ksclient() if OPENSTACK_API_VERSIONS['identity'] == 3:", "def allowed(self, context): # check if user has special signup role user =", "horizon from openstack_dashboard.local.local_settings import SIGNUP_ROLES, OP...
[ "answer=input_number(\"What is \" + str(num1) + \" x \" + str(num2) + \"?\")", "break except ValueError: print(\"Oops! That wasn't a valid number. Try again.\") return number", "\" x \" + str(num2) + \"?\") if answer==num1*num2: print(\"Correct!\") return True else:", "int(duration), \"seconds\") print(\"This...
[ "a non reviewer to review if (self.request.user.userprofile not in review.reviewers.all()) and (not review.public):", "review.reviewers.all()) and (not review.public): messages.add_message( self.request, messages.WARNING, _('Sorry, you do not have access", "messages.WARNING, _(\"You need to be logged in to revi...
[ "var, new_var): \"\"\"Finds the difference between the current and previous variable. Requires a", "= [] for direct in (\"A\", \"B\", \"R\", \"L\"): tups = generate_clone_tuples(cl_corn, direct)", "string else string def to_24_hour(datetime): \"\"\"Converts datetime.datetime type to 24 hour float type.", "min...
[ "= js['answers'] return predictions def calculate_scores(answers, predictions): scores = [] for key in", "predictions): scores = [] for key in answers: # import ipdb # ipdb.set_trace()", "Copyright (c) Microsoft Corporation. # Licensed under the MIT license. # Adapted from", "sys.exit() flag = False for rank,...
[ "self._value -= 1 def set(self, amount: int): with self._lock: self._value += amount def", "return self._value def increment(self): with self._lock: self._value += 1 def decrement(self): with self._lock:", "def increment(self): with self._lock: self._value += 1 def decrement(self): with self._lock: self._value ...
[ "CorpusRegistry() # this has to be at the bottom to avoid circular references", "from randompoetry import PoemFormRegistry, CorpusRegistry app = Flask(__name__) app.config.from_object(Config) pfr = PoemFormRegistry.from_json('poemforms.json') cr", "PoemFormRegistry, CorpusRegistry app = Flask(__name__) app.conf...
[ "= rospy.Time.now() + rospy.Duration(0.2) traj_msg.trajectory.joint_names = ['JOINT0', 'JOINT1', 'JOINT2', 'JOINT3', 'JOINT4', 'JOINT5', 'JOINT6',", "%f -(%f)-> max %f'%(msg.angle_min, msg.angle_increment, msg.angle_max)) # トピック名,メッセージ型を使って ActionLib client を定義 client =", "'JOINT13', 'JOINT14', 'JOINT15', 'JOIN...
[ "right def verifyPostorder1(self, postorder: List[int]) -> bool: \"\"\"递归分治:https://leetcode-cn.com/problems/er-cha-sou-suo-shu-de-hou-xu-bian-li-xu-lie-lcof/solution/mian-shi-ti-33-er-cha-sou-suo-shu-de-hou-xu-bian-6/\"\"\" def recur(i, j): #终止条件: 当", "def recur(i, j): #终止条件: 当 i >= j ,说明此子树节点数量 <=1,无需判别正确性,因此直接...
[ "= http_response.json() assert response[\"content\"] == resource_data[\"content\"] def resource_json_is(resource_data): response = http_response.json() assert response", "import Http # noqa: F401 from safetydance_test.step_extension import step_extension from scrud_django.models import Resource,", "isinstance(r...
[ "app.utils.base_service import BaseService from .model import Entity from .interfaces import EntityInterfaces class EntityService(BaseService):", ".model import Entity from .interfaces import EntityInterfaces class EntityService(BaseService): model = Entity interfaces", "BaseService from .model import Entity fr...
[ "django.urls import path # Localfolder Library from .views.paypal_config import UpdatePaypalConfigView # http://www.secnot.com/django-shop-paypal-rest-1.html app_name", "import path # Localfolder Library from .views.paypal_config import UpdatePaypalConfigView # http://www.secnot.com/django-shop-paypal-rest-1.html...
[ "case id is valid\") text = str(re.sub(\"','|', '\", 'USCIS website', text)) status_message =", "status_message) if p is not None: match = p.group(0) last_update_date = datetime.strptime(str(match), \"%B", "= datetime.strptime(str(match), \"%B %d, %Y\") last_update_date = last_update_date.strftime('%m/%d/%Y') r...
[ "def fromFile(self, f): ## Parse XML ## logging.info(\"Reading from scene file `%s'.\", f)", "in child.attrib: key = child.attrib[\"key\"] if key in self.metaData: raise SceneFileException(\"MetaData key already", "must have key attribute.\") elif child.tag == \"command\": if (\"start\" in child.attrib) and", ...
[ "loading caption file of output \" \"marked for report.\", e) @property def is_img(self):", "prepare end times timeline = [{\"rule\": rec.rule, \"starttime\": datetime.datetime.fromtimestamp(rec.starttime).isoformat(), \"endtime\": datetime.datetime.fromtimestamp(rec.endtime).isoformat()} for rec", "except KeyE...
[ "with open('argfile','r') as f: data=pickle.load(f) #data[0].u_rules=['stochastic_lb','Lb','stochastic_lb_double'] data[0].u_rules=['Lb-NN_refined_sto_double','Lb-NN_refined','Lb-NN_refined_sto'] data[0].s_rules=['GS','Random','all'] #data[0].u_rules=['Lb-NN_refined_sto'] #data[0].s_rules=['all'] data[0].loss_names...
[ "validate(x, y): if np.shape(x) != np.shape(y): return False else: if x.any() == y.any():", "#!/usr/bin/env python # coding=utf-8 import numpy as np def validate(x, y): if np.shape(x)", "coding=utf-8 import numpy as np def validate(x, y): if np.shape(x) != np.shape(y): return", "y): if np.shape(x) != np.shape...
[ "request.files['image'] }) except: return 'Sorry, we\\'re probably over capacity. Please try again later.'", "request.form['voted'].replace('-', ''), 'data': request.files['image'] }) except: return 'Sorry, we\\'re probably over capacity. Please", "Strips HTML from a string. \"\"\" return re.compile(r'</?\\S([^...
[ "Aran-Fey https://chat.stackoverflow.com/transcript/message/47258396#47258396 def circle_octant(r): r2 = r ** 2 y = 0 while", "\"white\") draw = ImageDraw.Draw(img) if r <= 0.5: logical_circle((0, 0), r, outline=\"black\") else:", "int(x), y-1 else: yield int(x)+1, y x = int(x) yield x, y if", "SIZE screen_r ...
[ "import pyOcean_cpu as ocean s = ocean.cdouble(3+4j) print(s) print(s.asPython()) print(s.imag.asPython()) print(s.real.asPython()) print(int(s.real)) print(float(s.real))" ]
[ ". import factory def create_app(settings_override=None): # Returns the app API application instance app", "create_app(settings_override=None): # Returns the app API application instance app = factory.create_app(__name__, __path__, settings_override)", "Returns the app API application instance app = factory.cre...
[ "FastAPI, Body app = FastAPI() @app.get(\"/\") def read_root(): return {\"Hello\": \"World\"} @app.get(\"/items/{item_id}\") def", "else: def create_application(): from typing import Optional from fastapi import FastAPI, Body app", "create_application(): from typing import Optional from fastapi import FastAPI, ...
[ "self.r[self.ip] if self.hacked and self.i == 1 and max(self.r) > 5: self.r[0] =", "int(d)] for a, b, c, d in lines] return ip, lines funcs =", "= hacked self.ip = ip self.i = 0 self.d = d self.r =", "self.d[self.i] op = funcs[opname] self.r[self.ip] = self.i op(self.r, a, b, c) self.r[self.ip] +=", "def pa...
[ "'verbose_name_plural': 'Carta de Juegos', }, ), migrations.AddField( model_name='board', name='game', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='game.Game'), ), ]", "'verbose_name': 'Tablero', 'verbose_name_plural': 'Tableros', }, ), migrations.CreateModel( name='Game', fields=[ ('i...
[ "<filename>BasicRead.py<gh_stars>0 from arduino import grove_si114x import time SI1145 = grove_si114x() while True: print('Visible", "arduino import grove_si114x import time SI1145 = grove_si114x() while True: print('Visible %03d UV", "= grove_si114x() while True: print('Visible %03d UV %.2f IR %03d' % (SI1145....
[ "tof.ranging_mode = RANGING_MODE_AUTONOMOUS tof.integration_time_ms = 10 tof.start_ranging((DATA_DISTANCE_MM, DATA_TARGET_STATUS)) for _ in range(10): lightsleep()", "from vl53l5cx import RESOLUTION_4X4, RANGING_MODE_AUTONOMOUS, POWER_MODE_SLEEP def main(): wake_on_ext1([Pin(13, Pin.IN)], WAKEUP_ALL_LOW) trigger ...
[ "template is compiled once and read from # memory instead of reading from", "from # memory instead of reading from disk on each load. TEMPLATE_LOADERS =", "reading from disk on each load. TEMPLATE_LOADERS = ( ('django.template.loaders.cached.Loader', ( 'django.template.loaders.filesystem.Loader', 'django.templa...
[ "pi from IPython.display import display from pyvlm import LatticeResult, LatticeOptimum from pyvlm import", "the lifting surface. lopt1 = LatticeOptimum('Unconstrained Optimised', lsys)#, sym=False) lopt1.set_state() lopt1.add_constraint('L', L) lopt1.add_record('l',", "Elliptical. # Note: You have to consider ...
[ "= [ path('', views.review, name='review'), path('avaloq/', include('avaloq_app.urls')), path('admin/', admin.site.urls), path('accounts/', include('registration.backends.default.urls')), ] handler404", "views.review, name='review'), path('avaloq/', include('avaloq_app.urls')), path('admin/', admin.site.urls), pa...
[ "print(\"\\n\\t- Right click the opengui.bat\") print(\"\\t- Select Properties\") print(\"\\t- Click the Shortcut tab\")", ") print(\" =====================================================\\n\") # menu def start(): os.system(\"cls || clear\") print(\"\"\" __ __", "[ENTER] >>> \") return True # launch_teams(\"\\...
[ "{}'.format( op_slice_sizes, output_op_slices_sizes)) op_handler_util.group_op_with_inputs_and_outputs( op, [], output_op_slices, op_slice_sizes, op_reg_manager) def _get_output_op_slices(self, output_ops, op_reg_manager):", "op_reg_manager.get_op_slices(op) output_op_slices = op_handler_util.get_op_slices( outpu...
[ "+ str(left_d) + \" \" + str(top_d)) self.move(left, top, left_d, top_d) left =", "self.h or x2 < 0 or y2 < 0 or x2 > self.w", "self.board[x2][y2] = color self.board[(x1 - 1)][y1 + sign] = 0 return else: return", "left_d = POS[args[i][0]] top_d = 7-(int(args[i][1])-1) except KeyError as e: await ctx.send(\"in...
[ "assert '00' == eta_hms(0) assert '09' == eta_hms(9) assert '59' == eta_hms(59) assert", "assert '0:00:09' == eta_hms(9, always_show_hours=True) assert '0:00:59' == eta_hms(59, always_show_hours=True) assert '0:01:00' ==", "def test_always_show_hours_hours_leading_zero(): assert '00:00:00' == eta_hms(0, hours_l...
[ "chosen metric. Parameters ---------- scores : pandas.DataFrame Scores containing the `epoch` column and", "training and validation scores will be plotted for the chosen metric. Parameters ----------", "\"\"\"Display a metric vs. epochs plot. Both the training and validation scores will", "scores[f'val_{metri...
[ "asset self.amount = amount @classmethod def get_fields(cls): return { 1: ('source_account', p.UnicodeType, 0),", "('source_account', p.UnicodeType, 0), 2: ('destination_account', p.UnicodeType, 0), 3: ('asset', StellarAssetType, 0), 4: ('amount',", "StellarAssetType class StellarPaymentOp(p.MessageType): MESSA...
[ "dp or len(dp[newSkills]) > len(team) + 1: dp[newSkills] = team + [i] return", "p: if s in table: curr |= table[s] for skills, team in list(dp.items()):", "i) for i, skill in enumerate(req_skills)} dp = {0 : []} for i,", "s in p: if s in table: curr |= table[s] for skills, team", "in table: curr |= table[s]...
[ "for x in line.split(', ')] # data = [x for x in line]", "in enumerate(fileinput.input()): line = line.strip() # data = [x for x in line.split(',", "# product('ABCD', repeat=2) AA AB AC AD BA BB BC BD CA CB", "permutations('ABCD', 2) AB AC AD BA BC BD CA CB CD DA DB", "DD # permutations('ABCD', 2) AB AC AD ...
[ "- STN.Y_ijt (batch sizes, float) - STN.Y_st (stored material quantities, float) - STN.Y_st_inflow", "self.P = np.array([[0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0,", "solved, transform the solution dictionaries (self.x_ijt, self.y_ijt) into np.arrays for easier inspection/plotting. The", "80] ) return constraint_kon...
[ "- VALOR DO EMPRESTIMO: 80000.00; - SALARIO EMPREGADO: 1.600; - ANOS DE FINANCIAMENTO:", "EMPRESTIMO: 80000.00; - SALARIO EMPREGADO: 1.600; - ANOS DE FINANCIAMENTO: 7 ANOS; -", "EMPRESTIMO PARA COMPRA DE UMA CASA. - VALOR DO EMPRESTIMO: 80000.00; - SALARIO", "DE UMA CASA. - VALOR DO EMPRESTIMO: 80000.00; - SA...
[ "x: 2 * 0.648437 if x == 2 else 0.648437, lambda x: -(math.log(x)", "as np import math from scipy.stats import truncnorm from time import time from", "3 * math.log(np.cbrt(x ** 2) + 1) / 2,\\ lambda x: math.log(np.abs(x +", "end = time() norm_res.append(\"%.4f\" % monte_int) norm_times.append(\"%.4f\" % (end ...
[ "its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version", "governing # permissions and limitations under the License. from io import BytesIO from", "_write_to(w, events): write_event_types = [] for event in events: write_event_types.append(w.send(event)) return write_event_types def...
[ "dim=1) contrast_loss = contrast_criterion(features) ce_loss = 0 for label_idx in range(5): tgt =", "checkpoint def checkpoint(epoch): print('=====> Saving checkpoint...') state = { 'model': model.state_dict(), 'epoch': epoch,", "contrast_loss + ce_loss * args.ce_weight loss.backward() optimizer.step() train_lo...
[ "the figure format: # e.g., nameFig = 'Position.png' or nameFig = 'linearVelocity.eps' import", "nameFig = os.path.join(\"/content/Figures/\",nameFig) fig.savefig(nameFig, dpi=300, bbox_inches='tight') #--- # Save Figure: def saveFig(fig,nameFig): #", "the name must contain the figure format: # e.g., nameFig = ...
[ "elif (layer.strip() == \"t2m\"): ylab = 'T2m (K)' elif (layer.strip() == \"d2m\"): ylab", "\"u10\"): ylab = 'windspeed u component (m s-1)' elif (layer.strip() == \"v10\"): ylab", "getPixelVals(netcdffile, layer, longitude, latitude): \"\"\" Function to query pixels values for a given", "West, South, East. D...
[]
[ "from tqdm import tqdm from torch.nn.utils import clip_grad_norm_ from torch.optim.lr_scheduler import ReduceLROnPlateau from", "torch.nn as nn import torch.optim as optim from pathlib import Path from tqdm", "torch.optim as optim from pathlib import Path from tqdm import tqdm from torch.nn.utils", "clip_grad...
[ "(f.read()) f.close() rules = whole_text.split('\\n') # Start of each group is indicated by", "this tree. total_inside = 0 for each_inside, num_inside in rule_dict[root]: total_inside += num_inside", "pairs, one pair per rule. # k = bag that the rule is", "muted yellow bags.\" # {'light red': [('bright white'...
[]
[ "document_root=None): messages.error(request, \"접근 불가\") return redirect('/') urlpatterns = [ path('', views.AllListView.as_view(), name='all_list'), path('free/',", "views.free_detail_view, name='free_detail'), path('<int:pk>/edit/', views.free_edit_view, name='free_edit'), path('<int:pk>/delete/', views.free_de...
[ "dt.fit(X_train, y_train) preds = dt.predict(X_test) accuracies.append((preds == y_test).mean()) f, ax = plt.subplots(figsize=(7, 5))", "21:04:18 2017 @author: pd \"\"\" #from IPython import get_ipython #get_ipython().magic('reset -sf') import numpy", "-sf') import numpy as np from sklearn import datasets from ...
[ "!= y: value = Levenshtein.distance(lines[x], lines[y]) distances[x,y] = value if value < 5:", "# coding: utf-8 import sys import Levenshtein import numpy as np assert len(sys.argv)", "if value < 5: message = \"lines {} and {} look similar\\n{}{}\\n\".format(x, y,", "np assert len(sys.argv) > 1 with open(sys....
[ "import List import uvicorn from fastapi import FastAPI, HTTPException, status from pydantic import", "-c 5M </dev/urandom > archive1` return FileResponse(\"archive1\") if __name__ == \"__main__\": uvicorn.run(\"mock_gh_api:app\", host=\"0.0.0.0\",", "deepcopy(test_data[\"status\"][id]) # Add some delay to the ...
[ "null=True, verbose_name='Sales'), ), migrations.AlterField( model_name='mystrategyvalue', name='method', field=models.IntegerField(choices=[(1, 'daily return'), (2, 'overnight return'), (3,", "(2, 'overnight return'), (3, 'night day consistency'), (4, 'two daily trend'), (5, 'night", "new_name='ar', ), migrati...
[ "<filename>error_propagation/__init__.py from error_propagation.core import arrays_to_complex from error_propagation.core import Complex __all__ = [\"Complex\", \"arrays_to_complex\"]" ]
[ "s = s.replace(k, v) for k in deletions: if k in s: s", "while \"--\" in s: s = s.replace(\"--\", \"-\") for (ks, v) in substitutions.items():", "for k in deletions: if k in s: s = s.replace(k, \"\") s", "\", \"&\": \" <AND>\", } deletions = {\"¿\", \"¡\"} def normalize(s): s =", "s = s.lower().replace(\".\...
[ "parser.add_argument(\"xsd\", help=\"XSD schema to validate against\") return parser.parse_args() def validate(xml, xsd): try: parseAndValidate(xml,", "genxmlif import GenXmlIfError from minixsv.xsvalErrorHandler import XsvalError ValidationResult = namedtuple(\"Result\", \"passed message\") def", "file against...
[ "one face\")) continue X.append(face_recognition.face_encodings(image, known_face_locations=faces_bboxes)[0]) y.append(class_dir) if n_neighbors is None: n_neighbors = int(round(sqrt(len(X))))", "from face_recognition import face_locations from face_recognition.cli import image_files_in_folder import cv2 def trai...
[ "import BaseModel class Chat(BaseModel): telegram_id = BigIntegerField(unique=True) title = TextField(null=True) link = TextField(null=True)", "from peewee import * from .base_model import BaseModel class Chat(BaseModel): telegram_id = BigIntegerField(unique=True)", "from .base_model import BaseModel class Chat...
[ "data_quiz, columns=['Chapter','Problem Set','Percent','Date','Completed'] ) quiz_df['Percent'] = pd.to_numeric(quiz_df['Percent']) quiz_df['days ago'] = pd.to_datetime(quiz_df['Date'])\\ .apply(lambda x:", "locally\"\"\" studytimes = get_logins(sid,token) completion = get_completion_perc(sid,token) quiz_df = get...
[ "# rsa.encrypt(plainMessage, ) pass def do_decrypt(cipher_data): pass if __name__ == \"__main__\": message =", "import rsa def do_encrypt(plain_data): # rsa.encrypt(plainMessage, ) pass def do_decrypt(cipher_data): pass if __name__", "def do_encrypt(plain_data): # rsa.encrypt(plainMessage, ) pass def do_decrypt...
[ "number of edge combinations \"\"\" # Copy the given degree sequence to use", "the s function e, p, c = s(deg_seq) # Append the edges edges.append(e)", "greater than 0 i = np.where(r == np.amin(r[r > 0]))[0][-1] c *= factorial(r[i])", "is True: print \"Total computation time : \" + str(time_elapsed) return es...
[ "Windows, builds of binutils based on Cygwin end lines with # \\n while", "'--disassemble-all', '--disassemble-zeroes', '--insn-width=15', tmp.name], stdout=subprocess.PIPE, # On Windows, builds of binutils based on", "be # found in the LICENSE file. import os import subprocess import sys", "source code is go...
[ "if people < dogs: print(f'The world is dry') dogs += 5 if people", "world is dry') dogs += 5 if people >= dogs: print(f'people are greater", "if people > cats: print(f'Not many cats! The world is saved') if people", "print(f'Too many Cats! The world is doomed!') if people > cats: print(f'Not many", "dogs +...
[ "options.config_path) elif options.task_name == TaskName.PC_Classify_Task: train_task.pc_classify_train(options.model, 0, options.config_path) print(\"process end!\") if __name__ ==", "cfg_path) def pc_classify_train(self, cfg_path, gpu_id, config_path): pc_cls_train_task = PointCloudClassifyTrain(cfg_path, gpu_i...
[ "} else: ro_env = { 'gui_parent': gui_parent, 'app': gui_parent.app_manager, } ro_setup = 'from", "import guisupport import qdarkstyle from rayoptics.gui.appmanager import ModelInfo from rayoptics.util import colors default_template", "if is_dark: ipy_console.setStyleSheet( qdarkstyle.load_stylesheet(qt_api='py...
[ "\" + str(web_url.getcode())) # read the data from the URL and print it", "code and print it print (\"result code: \" + str(web_url.getcode())) # read the", "code: \" + str(web_url.getcode())) # read the data from the URL and print", "for retrieving data from the internet # import urllib.request def main(): #...
[ "return cls._instances[api_key] def __init__(self, *, api_key: str = \"\"): self.api_key: str = api_key", "crafting(self, *, data, ids: list = None): \"\"\" Fetch daily craftable items by", "async def worldbosses(self, *, data, ids: list = None): \"\"\" Fetch daily world", "= None): \"\"\" Fetch daily hero's ...
[ "self.values def __str__(self): return str(self.values) def FindSolvables(self, potentials): potentials: set return potentials.intersection(set(self.values.keys())) def", "return potentials.intersection(set(self.values.keys())) def SolveWith(self, other): other: (int, DictionaryVector) if other[0] not in self.val...
[ "from Question import Question from Arrow_Model import Arrow_Model from Model import Model class", "'ArrowSelection' ).error( '[APPLICATION] Arm_Length does not exists' ) def set_height(self, user_data): try: self._model.height", "Model import Model class Application(object): def __init__(self): # Load the rule...
[ "/> <probability> <probabilityItem probability=\"0.5\"> <ride busStop=\"2\" modes=\"public\" /> <probability> <probabilityItem probability=\"0.5\"> <stop busStop=\"2\"", "Basically, you can have: .. code-block:: xml <personRoute id=\"route\"> <walk from=\"edge1\" busStop=\"1\"> <probability>", "default is 1 - r...
[ "views from students.views import StudentsView,StudentViewusingID router = routers.DefaultRouter() router.register('',views.StudentsView) urlpatterns = [ #path('<int:pk>/',", "students.views import StudentsView,StudentViewusingID router = routers.DefaultRouter() router.register('',views.StudentsView) urlpatterns ...
[ "fc(*fs): return functools.reduce( lambda fa, fb: lambda x: fa(fb(x)), *fs) a = 1", "f2(x): return x * 6 def f3(x): return x - 9 def fc(*fs):", "utf-8 -*- from __future__ import unicode_literals import functools def f1(x): return x +", "lambda fa, fb: lambda x: fa(fb(x)), *fs) a = 1 b = f3(f2(f1(a)))", "*fs...
[ "TrainingData = [] TrainingResult = [] TestSampleData = [] TestActualResult = [] def", "for row in datas: if row is None or len(row) == 0: continue", "pickle TrainingData = [] TrainingResult = [] TestSampleData = [] TestActualResult = []", "\"\"\" Created on Wed Oct 25 17:14:19 2017 @author: Student \"\"\" fr...
[ "('sources', '0023_add_person_owned_by_field_for_dive_relationship'), ] operations = [ migrations.RemoveField( model_name='person', name='owned_by', ), migrations.AddField( model_name='person', name='exportable_by',", "import migrations, models class Migration(migrations.Migration): dependencies = [ ('sources', '...
[ "product in category.values(): for website in product.values(): website[\"info\"] = {\"id\": \"\", \"url\": \"\",", "\"\", \"currency\": \"\"} website[\"datapoints\"] = [] Filemanager.save_record_data(data) def hard_reset(): print(\"Hard resetting data...\") logging.getLogger(__name__).info(\"Hard", "for produc...