ngram listlengths 0 67.8k |
|---|
[
"yet.\") with open(peerLogFile, \"a\") as f: print(str(data)) f.write(str(data) + \"\\n\") f.close() send_response() def",
"handler_class=Server): print(\"Start server on port 8000.\") server_address = ('', 8000) httpd = server_class(server_address,",
"import sys class Server(BaseHTTPRequestHandler) : def _set_... |
[
"if obj.image: return obj.image return 'https://image.flaticon.com/icons/svg/1738/1738691.svg' def get_following(self,instance): request = self.context.get('request',None) if request",
"image = serializers.SerializerMethodField() following = serializers.SerializerMethodField() class Meta: model = Profile fields =... |
[
"NA_Fiora_Mid_Karma(Ratings): pass class NA_Fiora_Mid_Karthus(Ratings): pass class NA_Fiora_Mid_Kassadin(Ratings): pass class NA_Fiora_Mid_Katarina(Ratings): pass class NA_Fiora_Mid_Kayle(Ratings):",
"NA_Fiora_Mid_Akali(Ratings): pass class NA_Fiora_Mid_Alistar(Ratings): pass class NA_Fiora_Mid_Amumu(Ratings): pa... |
[
"ProcessDoc: def __init__(self, path, lemma, stem): self.collection_dic = {} self.doc_info = [] self.lemma",
"{} self.doc_info = [] self.lemma = lemma self.stem = stem self.path = path",
"class ProcessDoc: def __init__(self, path, lemma, stem): self.collection_dic = {} self.doc_info = []",
"= self.load_file(o... |
[
"elif i['emotion']['anger'] > maximum: maximum = i['emotion']['anger'] keywords_sentiments_emotions_buffer['emotion'] = 'anger' keywords_sentiments_emotions.append( keywords_sentiments_emotions_buffer) myJsonDict.update({\"sentiments\":",
"stopwords = set(STOPWORDS) for val in verbs: val = str(val) tokens = val.s... |
[
"import simplejson as json class TestBasic(TestAPNS): def test_construct_service(self): service = self.create_service() service.start() service.stop()",
"is None) self.assertTrue(service._error_greenlet is None) def test_construct_message(self): msg = self.create_message() encoded = str(msg)",
"as json class Te... |
[
"test_select(self): n = 1000 y = pd.Series(np.linspace(0, 100, n)) x = pd.DataFrame({'a': y,",
"100, 100)) b = pd.Series(np.linspace(-4, 4, 100) ** 2) x = pd.DataFrame({'a': y",
"pd.Series(np.random.randint(1, 100, 100)) b = pd.Series(np.linspace(-4, 4, 100)) x = pd.DataFrame({'a': np.cumsum(y), 'b':",
"fpn.l... |
[
"in a string test = \"\" file = open(testname) for line in file.readlines():",
"store the testdata in a string test = \"\" file = open(testname) for",
"result[item[0].decode('utf-8')] = item[1] csvfile.close() # print result # return a directory {character:code} return",
"= \"\" file = open(testname) for line... |
[
"dbc.NavItem(dbc.NavLink( html.Span( \"Linear Regression\", id=\"tooltip-lr\", style={\"cursor\": \"pointer\", \"color\":\"grey\"}, ),disabled=False, href=\"linear_regression\")), dbc.NavItem(dbc.NavLink( html.Span( \"Differential",
"i in available_datasets], # only passing in quant value columns value=available_... |
[
"options={ }, bases=(models.Model,), ), migrations.CreateModel( name='Week', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('date',",
"-*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import",
"dja... |
[
"= False for child in self.children(): child.invalidate(pipeline) pipeline.delete(self.name) if is_root_call: pipeline.execute() def invalidate_on(self,",
"is_root_call = True else: is_root_call = False for child in self.children(): child.invalidate(pipeline) pipeline.delete(self.name)",
"if raw_value is not No... |
[
"resultful import ( unsafe, success, failure, unwrap_failure, Result, NoResult, ) from .conftest import",
"== f\"resultful.Failure({error!r})\" @given(error=st_exceptions()) def test_unsafe(error: BaseException) -> None: with pytest.raises(BaseException) as exception: unsafe(failure(error))",
"None: assert fail... |
[
"label = 1 if label >2 else 0 train_X.append(sentence) train_y.append(label) test_X = []",
">2 else 0 train_X.append(sentence) train_y.append(label) test_X = [] test_y = [] for e",
"= 1 if label >2 else 0 test_X.append(sentence) test_y.append(label) return (train_X,train_y), (test_X, test_y)",
"import pytreeb... |
[
"default=3, metavar='', help='number of input channels') parser.add_argument('--nfilters', type=int, default=64, metavar='', help='number of filters",
"for uniform noise') parser.add_argument('--resolution-high', type=int, default=32, metavar='', help='image resolution height') parser.add_argument('--resolution-w... |
[] |
[
"for c in range(0, 3): print('|', end='') for i in range(0, 3): print(f'{matriz[c][i]:^5}',",
"print() print('-'*30) print(f'A soma dos valores pares é: {par}') print(f'A soma dos valores",
"in range(0, 3): print(f'{matriz[c][i]:^5}', end='|') print() print('-'*30) print(f'A soma dos valores pares é:",
"range... |
[
"utf-8 -*- ''' dict ''' d1 = {'a':1, 'b':2, 'c':3} print(d1) print(d1.keys()) print(d1.values())",
"{'a':1, 'b':2, 'c':3} print(d1) print(d1.keys()) print(d1.values()) print(str(d1)) print(len(d1)) print(d1['a']) d1['a'] = 10 print(d1['a'])",
"print(d1.values()) print(str(d1)) print(len(d1)) print(d1['a']) d1['... |
[
"contactPoint = ModelType(ContactPoint) class ProcuringEntity(Organization): \"\"\"An organization.\"\"\" class Options: roles = RolesFromCsv('ProcuringEntity.csv', relative_to=__file__)",
"as BaseOrganization from openprocurement.tender.cfaselectionua.models.submodels.contactpoint import ContactPoint from schema... |
[
"allocationPool = kwargs['allocationPool'] except KeyError, AttributeError: allocationPool = False try: routeTarget = kwargs['routeTarget']",
"domain=self.domain, tenantName=self.tenantName) def createNetwork(self, **kwargs): _requiredArgs = ['cidr', 'name'] try: cidr = kwargs['cidr']",
"= vnc_api.FloatingIpPoo... |
[
"repository diff Show changes between commits, commit and working tree, etc merge Join",
"everyday) add Add file contents to the index mv Move or rename a",
"help everyday) add Add file contents to the index mv Move or rename",
"'clear') os.system('python refresh.py') exit() elif(command.count('cat ')): comma... |
[
"from pactor.node_parent import AstNode from pactor.node_stack_helper import pop_value, pop class WhenNode(AstNode): def run(self,",
"pactor.node_stack_helper import pop_value, pop class WhenNode(AstNode): def run(self, vm: VM): quote = pop(vm)",
"pop class WhenNode(AstNode): def run(self, vm: VM): quote = pop(... |
[
"in self.weaponSets: for weapon in weaponSet: weapon.cleanup() self.weaponSets = [] self.weaponNPs = {}",
"in self.weaponSets[weaponSet]: if not weapon.active: weapon.triggerPressed(self) def ceaseFiringSet(self, weaponSet): if weaponSet < len(self.weaponSets):",
"self.walking = False self.size = size if collid... |
[
"start_amqp(self): \"\"\"Starts all needed threads: scheduler, controller and AMQP transport IOLOOP. \"\"\" retry_timeout",
"KeyboardInterrupt: self.stop_synapse() except KeyboardInterrupt: self.stop_synapse() except SystemExit: pass except ResourceException as err: self.logger.error(str(err))",
"try: transport... |
[
"%% sns.pairplot(df.loc[df.DeviceId != 3, :], hue=\"DeviceId\", vars=[\"AccMgn_mean\", \"AccMgn_median\"], markers='.') # %% test =",
"# %% print('RandomForestClassifier + SMOTE') accuracies = [] precisions = [] recalls =",
"= True) df = df.loc[(df.DeviceId != 4) & (df.DeviceId != 7), :].reset_index(drop =",
... |
[
"= EnvConfig().get('DEBUG_INTERNAL') _pdb = Pdb() if DEBUG_INTERNAL else _Pdb() def wrapper(): if DEBUG_INTERNAL:",
"_pdb.set_trace(this_frame) return wrapper class _Pdb(Pdb): def do_longlist(self, arg): filename = self.curframe.f_code.co_filename breaklist =",
"not retrieved by `sys._getframe()`, # so that we ... |
[
"StatusProcessing(): success: bool message: str err_stack: str def __init__(self, _success: bool, _message: str,",
"class StatusProcessing(): success: bool message: str err_stack: str def __init__(self, _success: bool, _message:",
"_success: bool, _message: str, _err_stack: str = \"\"): self.success = _success ... |
[
"t*t y = t plt.figure() plt.plot(x,y,'g-') plt.legend(['Path'],loc='best') plt.title('Quadratic Path') plt.show() doty=one dotx=2*t ddoty=0",
"= t plt.figure() plt.plot(x,y,'g-') plt.legend(['Path'],loc='best') plt.title('Quadratic Path') plt.show() doty=one dotx=2*t ddoty=0 ddotx=2*one r",
"yp[0] = 0.0 th[0] =... |
[
"= numpy.zeros(size*LENGTH) print (x) comm.Gather(x_local, x, root=0) #you should notice that only the",
"value for x that #is not \"None\" print (\"process\", rank, \"x:\", x) print",
"numpy.linspace(rank*LENGTH,(rank+1)*LENGTH, LENGTH) print(x_local) if rank == 0: x = numpy.zeros(size*LENGTH) print (x) comm.G... |
[
"h not in d: d[h] = [] d[h].append(anagram) return d if not myList",
"[] map[target].append(v) print('building map ', map[target]) result = [] for value in map.values():",
"{} for v in strs: target = ''.join(sorted(v)) print(target) if target not in",
":rtype List[List[str]] \"\"\" map = {} for v in strs: tar... |
[
"type. One of: 'poisson', 'negbinom', 'powerlaw'. degseq_sort Should degree sequence be sorted by",
"rewiring. SDA_REP Number of independent realizations of adjacency matrices. SIM_PARAMS degseq_type Degree sequence",
"\"\"\"Run simulations for SDC model. Parameters ---------- N_JOBS Number of cores used for",
... |
[
"&& %s' % (self.local_path, command), *args, **kwargs) except Exception as e: with color.for_error():",
"&& git reset --hard origin/master' % target) else: self.ops.local('mkdir -p '+target) self.ops.local('cd '+target+\"",
"self.ops = operations self.api = api self.env = api.env def run(self, command, *args,",... |
[
"= 'User({0}) logged out'.format(request.user.username) self.logger.info(self.logger.to_request('Logout', msg)) # Must override logged username from POST",
"is not logged in def failed_login(self, credentials, **kwargs): request = get_request() username =",
"this context, when looked from the perspective of the... |
[
"a = a, b except IndexError: raise StopCoefficients gamma_sq, err = \\ integrate.quad(self.J,",
"class SpQuadDiscretizedSymmetricBath(BaseDiscretizedSymmetricBath): def __init__(self, J, domain, max_nof_coefficients=100, interval_type='lin', **kwargs): \"\"\" Generates direct discretization",
"of the domain: tr... |
[] |
[
"= IOU_CALCULATORS def build_iou_calculator(cfg, default_args=None): \"\"\"Builder of IoU calculator.\"\"\" return build_from_cfg(cfg, ROTATED_IOU_CALCULATORS, default_args)",
"Copyright (c) OpenMMLab. All rights reserved. from mmcv.utils import build_from_cfg from mmdet.core.bbox.iou_calculators.builder import",... |
[
"__future__ import unicode_literals from django.http import Http404 from django.views.generic.detail import DetailView from .utils",
"self.model, self.request.GET.get('hash')) except DraftError: raise Http404('Snapshot does not exist') return self.__object return super(BaseDraftView,",
"self.__object return sup... |
[
"return anything, modify node in-place instead. \"\"\" while node.next is not None: node.val",
"in-place instead. \"\"\" while node.next is not None: node.val = node.next.val pre =",
"= node node = node.next pre.next = None node1 = ListNode(1) node2 =",
"node1.next = node2 node2.next = node3 solution = Soluti... |
[
"Url2Netloc class TestUrl2Netloc(unittest.TestCase): \"\"\" Tests our internal URL converter. \"\"\" def setUp(self) ->",
"the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in",
"= \"://example.org/\" expected = \"example.org\" self.converter.data_to_conver... |
[
"tell that to the user. If not, print a different appropriate message. \"\"\"",
"print out a different message. 2. Ask the user for two numbers: one",
"odd.\") divisor = int(input(\"Enter a second integer: \")) if number % divisor: print(\"%d",
"Ask the user for two numbers: one number to check (call it num)"... |
[
"<filename>musicrecs/spotify/item/spotify_artist.py from .spotify_item import SpotifyItem class SpotifyArtist(SpotifyItem): \"\"\"Class to hold selected information about",
".spotify_item import SpotifyItem class SpotifyArtist(SpotifyItem): \"\"\"Class to hold selected information about a spotify",
"selected in... |
[
"if n == 0: raise FooError('invalid value: %s' % s) return 10 /",
"# bar('0') # except Exception as e: # print(\"----出错了\") # logging.exception(e) class FooError(ValueError):",
"# def main(): # try: # bar('0') # except Exception as e: #",
"def foo(s): # return 10 / int(s) # def bar(s): # return foo(s)",
"# ... |
[
"Cool assert 'Richter+17' in mwcgm.refs SiII_tbl = mwcgm.abs.ion_tbl((14,2)) assert (not np.any(np.isnan(SiII_tbl['logN']))) assert np.sum(SiII_tbl['flag_N']",
"import print_function, absolute_import, division, unicode_literals # TEST_UNICODE_LITERALS import pytest import numpy as np",
"len(ovii_tbl['sig_logN']... |
[
"= (YELLOW) else: pixels[36] = (OFF) if icon == 'partly-cloudy-day' or 'partly-cloudy-night': pixels[34]",
"time.time() + 22.32 * 1 while time.time() < t_end: n = n +",
"print(text) print(icon) print(baro) print(trend) return trend, baro, icon def barometer(): conditions = getconditions()",
"= data['current_c... |
[
"import Auth class Sxg(Auth): _endpoint1 = \"zones\" _endpoint2 = \"amp/sxg\" _endpoint3 = None",
"from aiocloudflare.commons.auth import Auth class Sxg(Auth): _endpoint1 = \"zones\" _endpoint2 = \"amp/sxg\" _endpoint3",
"aiocloudflare.commons.auth import Auth class Sxg(Auth): _endpoint1 = \"zones\" _endpoint2 ... |
[
"bits[-1] = bits[-1].replace('.fpickle', '') template_names = [ 'docs/%s.html' % '-'.join([b for b in",
"Path from projects.models import Project def document(request, project, url): try: project = Project.objects.get(slug=project)",
"docroot = Path(project.get_pickle_path()) # First look for <bits>/index.fpick... |
[
": str, shift : int) -> str: uncesar_message = '' for alpha in",
"= 0 shift = None fog_num = None fog_pos = None code_message =",
"fog_num, fog_pos, code_message def clear(message : str, fog_num : int, fog_pos : int)",
"2 ROLLBACK = 90 SECURITY = 'access denied\\n' SHIFT = 0 def verify_code(message",
"fog_p... |
[
"rsquared]) self._outp[\"query_latency_table\"] = latency_table.get_string() def _populate_output(self): \"\"\"Populates the output object which is passed",
"def _store_query_latency_table(self): \"\"\"Stores the LaTeX string representing the query latency table on the",
"import spar_python.report_generation.co... |
[
"#reconstruct all components into one signal D_k = components.dot(activations) y_k = librosa.istft(D_k *",
"S, phase = librosa.magphase(D) #NMF decompose to components components, activations = self.decomposeNMF(hpss_y, S,",
"def reconstructFull(self, activations, phase): #reconstruct all components into one si... |
[
"# Q-learning (SARSAMAX) method #best_action = np.argmax(self.Q[next_state]) #Gt = reward + self.gamma *",
"0.9 def epsilon_greedy_probs(self, state, epsilon): ''' Calculation of probabilities accordgin to a epsilon",
"np.ones(self.nA) * epsilon / self.nA best_action = np.argmax(self.Q[state]) probs[best_action... |
[
"meets' assemblies under attendee's organization if self.registration and self.registration.assembly.need_age and self.infos.bed_needs < 1",
"'registration'], condition=models.Q(is_removed=False), name=\"attending_attendee_registration\") ] indexes = [ GinIndex(fields=['infos'], name='attending_infos_gin', ), ] @... |
[
"{}, nickname='UserSubscription', address=address) @property def active(self) -> bool: return self.call_getter('isActive', {'_answer_id': 0}) @property",
"-> bool: return self.call_getter('isActive', {'_answer_id': 0}) @property def auto_renew(self) -> bool: return self.call_getter('isAutoRenew',",
"address=add... |
[
"import socket from geventconnpool import ConnectionPool class MyPool(ConnectionPool): def _new_connection(self): return socket.create_connection((\"www.baidu.com\", 80))",
"gevent import socket from geventconnpool import ConnectionPool class MyPool(ConnectionPool): def _new_connection(self): return socket.create... |
[
"[('output_image', 'in_segm')]), (sel_labels, get_wm, [('out_wm', 'op1')]), (sel_labels, get_gm, [('out_gm', 'op1')]), (get_gm, fill_gm, [('output_image',",
"# MultiplyImages ${DIMENSION} ${EXTRACTION_GM} ${ATROPOS_GM_CLASS_LABEL} ${EXTRACTION_GM} # ImageMath ${DIMENSION} ${EXTRACTION_SEGMENTATION} addtozero ${EX... |
[
"status1=data[\"soap:Envelope\"][\"soap:Body\"][\"RetrieveResponseMsg\"][\"Results\"] status2 = loads(dumps(status1)) except Exception as e: return \"There are no records",
"<a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> </a:ReplyTo> <a:To s:mustUnderstand=\"1\">https://web... |
[
"headers={'How-Many': '1'}) r = resp.json() if len(r) == 0: print('job stream not found')",
"the engine as defined in the TWSz Connector', required=True, metavar=\"<engine_name>\") parser.add_argument('-j','--jsName', help='job stream',",
"{\"inputArrivalTime\": now} # now we can submit the js print \"submit pa... |
[
"norm=norm, filter_size=(1, 1), pad=\"SAME\", name=\"fconv1x1\") g = conv2d(x, num_filters=orig_shp[-1], norm=norm, filter_size=(1, 1), pad=\"SAME\",",
"= conv2d(x, num_filters=orig_shp[-1], norm=norm, filter_size=(1, 1), pad=\"SAME\", name=\"fconv1x1\") g = conv2d(x, num_filters=orig_shp[-1], norm=norm,",
"tf.... |
[
"'msr_paraphrase_testsent' + str(stp) + '.pickle' tscore = src_dir + 'msr_paraphrase_testscore' + str(stp) +",
"nscore_txt = out_dir + 'test_orig_score.pickle' src_dir = base_dir + 'test/' file_list = os.listdir(src_dir)",
"line_processing(a[2])] except IndexError: pass wds = extract_batchfeature_using_senna(al... |
[
"sys import timeit from nemo.parser import NemoParser from mako.template import Template if len(sys.argv)",
"so mako won't render a result return '' def nemo_render(str, debug=False): return NemoParser(debug=debug).parse(str)",
"= 10000 t_mako = timeit.Timer('mako_temp.render()', 'from __main__ import mako_temp... |
[
"from rply import LexingError, ParsingError from lang.lexer import Lexer from lang.parser import Parser",
"lexer_output=False, opt=False): try: tokens = lexer.lex(source) if lexer_output: print(\"LEXER OUTPUT\") for token in",
"lexer_output: print(\"LEXER OUTPUT\") for token in copy.copy(tokens): print(token) p... |
[
"and automatically clears the text widget for you. On the txt file, entries",
"tk.PhotoImage(\"borderImage\", data=borderImageData) focusBorderImage = tk.PhotoImage(\"focusBorderImage\", data=focusBorderImageData) style.element_create(\"RoundedFrame\", \"image\", borderImage, (\"focus\", focusBorderImage), border... |
[
"def run(self, opt, data_loader, writer, epoch=0): total_losses = self.loss_tuple(0, 0, 0, 0) data_length",
"stat(model=self.seg_net, input_size=(3, 256, 256)) self.sparse_l1 = torch.nn.SmoothL1Loss(reduction='none') self.l1 = torch.nn.SmoothL1Loss() self.l2 = torch.nn.MSELoss()",
"batch['num_points'] = batch['... |
[
"<gh_stars>0 from .ngram import ngram from .lda import lda from .tfidf import tfidf"
] |
[
"import logging import os from typing import Literal, Union from ghaudit.cli import cli",
"root = logging.getLogger() root.setLevel(LOGLEVEL) root.addHandler(handler) else: logging.basicConfig(level=LOGLEVEL, format=LOG_FORMAT, style=STYLE) # pylint: disable=no-value-for-parameter cli()",
"typing import Literal... |
[
"for i in range(int(Nx/J)): coupling[i*J:(i+1)*J,i*J:(i+1)*J] = np.ones((J,J)) return mesh,coupling # need to implement",
"np.linspace(0,L-h,Nx) mesh = Mesh(1,topology,geometry) return mesh def make_lattice1d_coupled(Nx,L,J): mesh = make_lattice1d(Nx,L) coupling =",
"Mesh(1,topology,geometry) return mesh def ma... |
[
"os, subprocess from shelljob import proc application = Flask(__name__) @application.route('/provision', methods=['POST', 'GET']) def",
"= str(request.form['username']) usr_pass = str(request.form['password']) if usr_name == 'admin' and usr_pass == '<PASSWORD>':",
"\\ format(contrail_package_version,contrail_pa... |
[
"self.basics) return self.finishWalk() def test_walk_leaf(self): oid = OID(\".1.3.6.1.4.2.1.1\") result = Result() self.session.walk([oid], set_result,",
"version = \"2c\" class TestOID(unittest.TestCase): def test_oid_name(self): oid = OID(\"1.3.6.1.2.1.1.1.0\") self.assertEquals(oid, OID(\"SNMPv2-MIB::sysDescr.... |
[
"if color is None: return self._decode_pixel(self._block(x, y, x, y)) if 0 <= x",
"data = pixel * _BUFFER_SIZE for _ in range(chunks): self.write(None, data) self.write(None, pixel",
"\"https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display.git\" # This is the size of the buffer to be used for",
"the ... |
[
"calc_temps_start(start_date): tobs_stats = session.query(func.min(Measurement.tobs), func.avg(Measurement.tobs), func.max(Measurement.tobs)).\\ filter(Measurement.date >= start_date).all() tobs_stats_all = [] for",
"a dictionary from the row data and append to a list of all_passengers",
"a list of all_passenge... |
[
"# Needed to init the MazeSolver.ALGORITHMS list alg_gen, alg_sol, width, height = -1,",
"\") while solve_anim.lower() not in [\"y\", \"n\"]: solve_anim = input(\"Enable animation for solving?",
"the n° of the algorithm for the solving: \") print() while width not",
"= True if build_anim.lower() == \"y\" else... |
[
"requests import json from datetime import datetime def get_all_products(): url = \"https://api.fmarket.vn/res/products/filter\" data",
"import json from datetime import datetime def get_all_products(): url = \"https://api.fmarket.vn/res/products/filter\" data =",
"datetime import datetime def get_all_products(... |
[
"@params(api='gl', prms=['index', 'v']) def glVertexAttrib1hvNV(index, v): pass @params(api='gl', prms=['index', 'x', 'y']) def glVertexAttrib2hNV(index,",
"ny, nz): pass @params(api='gl', prms=['v']) def glNormal3hvNV(v): pass @params(api='gl', prms=['red', 'green', 'blue']) def",
"@params(api='gl', prms=['tar... |
[
"from sklearn.model_selection import train_test_split # Import train_test_split function from sklearn import metrics #Import",
"y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=1) # 70% training and 30% test",
"= File(file) name_of_image = \"Tree_of_\"+str(os.path.splitext(uploaded_file.name... |
[
"as sp form = cgi.FieldStorage() user_name = form.getvalue('user_name') lv_size = form.getvalue('lv_size') print(user_name) print(lv_size)",
"= cgi.FieldStorage() user_name = form.getvalue('user_name') lv_size = form.getvalue('lv_size') print(user_name) print(lv_size) output=sp.getstatusoutput(\"sudo ansible-play... |
[
"from django.urls import path from .views import DevelopmentLTIView app_name = \"development\" urlpatterns =",
"from .views import DevelopmentLTIView app_name = \"development\" urlpatterns = [ path(\"development/\", DevelopmentLTIView.as_view(), name=\"lti-development-view\"),",
"django.urls import path from .v... |
[
"to (or want to) train any layers of our pre-trained vgg model, so",
"### Total Loss def compute_loss(model, loss_weights, generated_output_activations, gram_style_features, content_features, num_content_layers, num_style_layers): generated_content_activations =",
"data vgg19 = VGG19(weights=None, include_top=F... |
[
"under a 3-clause BSD style license - see LICENSE.rst from .robust_file_opener import _compression_safe_opener",
"# Licensed under a 3-clause BSD style license - see LICENSE.rst from .robust_file_opener",
"Licensed under a 3-clause BSD style license - see LICENSE.rst from .robust_file_opener import"
] |
[
"def test_import_ml(self): \"\"\"Test ml module.\"\"\" import ml self.assertEqual( inspect.getfile(ml), str(Path.cwd().joinpath('src', 'ml', '__init__.py')), )",
"from pathlib import Path class TestImportModule(unittest.TestCase): \"\"\"Module testing.\"\"\" def test_import_ml(self): \"\"\"Test ml module.\"\"\"",... |
[
"plyer import notification def send_desk_message(title, message): notification.notify( title=title, message=message, app_icon=\"circle-48.ico\", timeout=5 ) send_desk_message(\"TITLE\",",
"<filename>Project 8/DeskNotification.py # pip install plyer from plyer import notification def send_desk_message(title, messa... |
[
"int = width self.height: int = height self.bg_colour: str = bg_colour self.font: str",
"fill=self.style_var.get().split(\":\")[1], # 'white', fill='white', font=self.style.font) utils.draw_circle(canvas, self.style.width // 2, self.style.height // 2, self.style.width",
"is to work properly with tkinter. It als... |
[
"SLICE_OCTOMAP_SIZE / 2 - xy[0], np.full(len(xy[0]), lev)]).T * res all.extend(xyz.tolist()) pcd = o3d.geometry.PointCloud()",
"goals)) path = find_path(drivable, start, goals, verbose=False) if path is not None: break",
"color=(0, 0xFF, 0) STATE_FREE = 255 # color=(0xFF, 0xFF, 0xFF) STATE_OCCUPIED = 1",
":pa... |
[
"cmpe = CircuitMPE('permutation-4.vtree', 'permutation-4.sdd') wmc = cmpe.get_tf_ac([[1.0 - ny,ny] for ny in yu])",
"sess.run(accuracy, feed_dict={x: sushi_data.train_data, y_: sushi_data.train_labels}) print \"Validation accuracy: %f\" % sess.run(accuracy, feed_dict={x: sushi_data.valid_data,",
"logits=y)) los... |
[
"handler return decorator def role_or_self_check(): def decorator(func): @wraps(func) async def handler(request, *args, **kwargs):",
"*args, **kwargs): if (request.app.name not in request.args['auth_roles']): return json({\"message\":\"没有权限查看\"},401) else: return await func(request,",
"def role_or_self_check():... |
[
"x.dim() return zeros(*dim, batch_size=batch_size) def ones(*dim, batch_size: int = 1) -> Expression: a",
"device=moire.config.device) def diagonal(x: Expression) -> Expression: (dim0, dim1), batch_size = x.dim() return dy.cmult(x,",
"high: float, batch_size: int = 1) -> Expression: a = np.random.uniform(low=lo... |
[
"# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you",
"writing, software # distributed under the License is distributed on an \"AS IS\"",
"NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version",
"KIND, either express or implied. # See the License for ... |
[
"produto_menos = nome produtovalor = preco resp = str(input('Quer continuar? [S/N]')).upper().strip()[0] if resp",
"= '' print(20*'-') print('{:^20}'.format('<NAME>')) print(20*'-') while True: nome = str(input('Nome do produto: ')).strip()",
"[S/N]')).upper().strip()[0] if resp == 'N': break print(20*'=') prin... |
[
"def backup(self, backup, volume_file): LOG.info('Starting backup...... Creating a new backup for volume:%s.' %",
"volume_file): LOG.info('Starting backup...... Creating a new backup for volume:%s.' % backup['volume_id']) backup_id =",
"Creating a new backup for volume:%s.' % backup['volume_id']) backup_id = ba... |
[
"raise ValueError def normalize_phone_number(phone): phone = phone.replace(\"+\", \"\") phone = phone.replace(\" \", \"\")",
"= phone.replace(\"+\", \"\") phone = phone.replace(\" \", \"\") if len(phone) == 10: phone",
"app.common.conf import PHONE_NUMBER_VALIDATOR def phone_number_valid(phone_number): if phone... |
[
"ai ts=4 sts=4 et sw=4 # Copyright 2016 National Research Foundation (South African",
"ap_name = \"mkat_sim/ap/1\" dev_info = PyTango.DbDevInfo() dev_info.server = \"mkat-tango-AP-DS/test\" dev_info._class = \"MkatAntennaPositioner\" dev_info.name",
"(South African Radio Astronomy Observatory) # BSD license - s... |
[
"= page_soup.find_all('div',class_ = 'update-box') newz = [] for new in news: newz.append([new.strong.text,new.a.text.strip(),new.a['href']]) return",
"BeautifulSoup(page_html,\"html.parser\") news = page_soup.find_all('div',class_ = 'update-box') newz = [] for new in news:",
"uClient.read() uClient.close() pag... |
[
"x = 5 / 3 x = 5 / 0 # capturing the",
"commonly used in object oriented systems. # ValueError: is the token i.e. it",
": {sys.exc_info()[1]}') # else block gets executed only if you don't have any",
"# Copyright 2009-2017 BHG http://bw.org/ # Exceptions are powerful runtime error reporting mechanism",
"def... |
[
"total_size = 0 for path in get_mdsd_csv_cbow_data_output_files_iter(main_path=main_path): data = npload(path, mmap_mode='r') total_size =",
"batch_size): batch = np.stack(batch, axis=0) yield batch def get_mdsd_csv_cbow_data_output_iter(batch_size, main_path=MDSD_MAIN_PATH): iterators = []",
"import bisect_lef... |
[
"= \"python \" + sys.argv[0] + \" [-h | --help] [-a | --app",
"ClientError as e: if e.response[\"Error\"][\"Code\"] == \"InvalidKeyPair.NotFound\": res = ec2.create_key_pair( KeyName=app_name, ) private_key",
"help=\"~/.aws/config.\") argparser.add_argument(\"-r\", \"--region\", type=str, default=\"ap-northeast... |
[
"-> None: return None class NonIntrospectableDeprecated: async def on_introspection( self, _directive_args: Dict[str, Any],",
"None def bake(schema_name, _config): sdl = \"\"\" directive @nonIntrospectable on FIELD_DEFINITION directive @non_introspectable",
"return None class NonIntrospectableDeprecated: async ... |
[
"1.11.3 on 2018-06-13 11:26 from __future__ import unicode_literals from django.db import migrations, models",
"from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('book', '0002_auto_20180613_1914'), ]",
"'0002_auto_20180613_1914'), ] operations = [ migrations.Alter... |
[
"fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=100)), ('parent', models.IntegerField(default=None, null=True)), ], ),",
"serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=100)), ('parent', m... |
[
"\"\"\" Create a new experiment structure based on the information in the msrun_list.",
"else: experiment['run_start_time'] = None experiment['human_run_start_time'] = None experiment['spectra_count'] = msrun_list.info['spectrum_count'] experiment['experimental_state_id'] = None",
"from \"Peak\" WHERE experimen... |
[
"= ver, description = 'High level directory utilities', keywords = ['dir', 'directory', 'workdir',",
"'<EMAIL>', packages = find_packages(), test_suite = 'dirutil.get_tests', url = 'https://github.com/ddolzhenko/dirutil', download_url = 'https://github.com/ddolzhenko/dirutil/archive/v{}.tar.gz'.format(ver),",
"... |
[
"= data[:] random.shuffle(individual) return individual def crossover(parent_1, parent_2): crossover_index = random.randrange(1, len(parent_1)) child_1a",
"= mutate, fitness = fitness, selection = selection) res = optimizer() # print",
"optimizer = ga.get_optimizer(data, population_size = 200, generations = 100... |
[
"state_size self.action_size = action_size self.memory = deque(maxlen=2000) self.gamma = 0.95 # discount future",
"0.995 self.exploration_min = 0.01 self.model = self._build_model() def _build_model(self): model = Sequential() model.add(Dense(24,",
"import deque import random import numpy as np from collections... |
[
"suite for pandas-marc.\"\"\" from pandas_marc import MARCDataFrame def test_instantiate_marcdataframe(dataframe): kwargs = { 'dataframe':",
"value def test_marcdataframe_produces_correct_marc_records(dataframe, records): mdf = MARCDataFrame(dataframe) output = [record.as_marc() for record in",
"replace backsla... |