ngram listlengths 0 82k |
|---|
[
"'python django' result = cap.cap_text(text) self.assertEquals(result, 'Python Django') if __name__",
"class TestCap(unittest.TestCase): def test_single_word(self): text = 'python' result = cap.cap_text(text)",
"'python' result = cap.cap_text(text) self.assertEquals(result, 'Python') def test_multiple_word(self... |
[
"clear_preprocessors(self): self.preprocessors = [] def reset_preprocessors(self): self.preprocessors = list(self.default_preprocessors) def",
"name in self._cache: return self._cache[name] value = self._get_from_source(name, default, source)",
"self._cache[name] = value return value def _get_from_source(self, ... |
[
"np.max(labels)+1 label_image = np.zeros((r,c,l)) for k in range(number_repetitions): for i",
"map labels = np.argmax(P,axis=2) # Segmentation return labels print('Showtime') #",
"# showtime app = insegtannotator.PyQt5.QtWidgets.QApplication([]) ex = insegtannotator.InSegtAnnotator(image, processing_function) a... |
[
"tj.reorder_to_match_other_tetrad(order) return tetrad_pairs def __find_helices(self): helices = [] helix_tetrads =",
"return [Tract(nts) for nts in tracts] def __find_loops(self) -> List[Loop]:",
"suffix='.helix') helix.write(f'#{len(self.analysis.sequence) + 1}\\n') helix.write('i\\tj\\tlength\\tvalue\\n') fo... |
[
"Movement, Trial from . import plots from . import utils",
"from .database import Experiment, Movement, Trial from . import plots",
".database import Experiment, Movement, Trial from . import plots from",
"import Experiment, Movement, Trial from . import plots from .",
"Experiment, Movement, Trial from . im... |
[
"ndvits.rows[-1] # test that we're getting header metadata correctly np.testing.assert_equal(ndvits.site,",
"import Image from pkg_resources import Requirement from pkg_resources import resource_filename",
"\"\"\" import os import numpy as np from PIL import",
"spot check a couple of rows np.testing.assert_eq... |
[
"binary_calib_status = self.PH_BINARY_CALIB_STATUS r = self.read(register) if self.debug: print(\"Binary result",
"not in (\"dry\", \"single\", \"low\", \"mid\", \"high\"): raise Exception( 'missing",
"\"EC\" == self.moduletype: points = {\"dry\": 0x02, \"single\": 0x03, \"low\":",
"if hex(0x01) == hex(mode) ... |
[
"{\"status\": 200, \"value\": error, \"type\": \"application/json\"} self.response = main(request, environ).getResult()",
"logfiles = os.listdir(location) if len(logfiles) == 9: os.remove(logfiles[-1]) logfiles =",
"a.timetuple()[:3]: logtime += str(piece)+'-' logtime = logtime[:-1]+\" \" for piece",
"def log... |
[
"by top-level scripts which are intended to be invoked directly",
"Subpackage containing the modules that implement the command line tools.",
"containing the modules that implement the command line tools. Note",
"from twisted.python.deprecate import deprecatedModuleAttribute deprecatedModuleAttribute( Version... |
[
"def home(): return render_template('home.html') @routes.route('/rds/') def roads(): # Search specific",
"# get the id and name for each record in",
"= conf.db_select(sql)[0][0] page = int(request.values.get('page')) if request.values.get('page') is not None",
"coords in coords_list: points.append(tuple([coor... |
[
"Sarah, Veronica. \"\"\" from django.urls import re_path from .consumers import",
"to activate selected websocket websocket_urlpatterns = [ re_path(r'^ws/chat/(?P<room_name>[^/]+)/$', ChatConsumer), ]",
"import ChatConsumer # Assign pattern to activate selected websocket websocket_urlpatterns",
"ChatConsumer ... |
[
"be combined as an AND condition.') argp.add_argument( '--volume-size', metavar='GB', type=positive_int,",
"= old_volume['VolumeId'] old_az = old_volume['AvailabilityZone'] new_az = self.instance_info['Placement']['AvailabilityZone'] filters =",
"argparse.ArgumentParser( 'ebs-snatcher', description='Automatical... |
[
"== 2 replica0_name = volume[\"replicas\"][0][\"name\"] replica1_name = volume[\"replicas\"][1][\"name\"] data =",
"SIZE) def ha_simple_recovery_test(client, volume_name, size, base_image=\"\"): # NOQA volume =",
"check_volume_data, get_self_host_id, get_volume_endpoint from common import write_volume_random_da... |
[
"Defines the neural network denoted f_{\\theta} in our neural CDE",
"F(z) ''' z = self.linear1(z) z = z.tanh() z =",
"output tensor must be a matrix, # because we need",
"input channels in the data X. :param hidden_channels: the number",
"tensor must be a matrix, # because we need it",
"our neural CDE mod... |
[
"as nd import matplotlib.pyplot as plt from NeuralNetwork import BPnetwork",
"y2] jg = bpn([3, 4, 4, 2]) jg.train(x, y, 0.03,",
"dp(tmp) # ty2 = jg1.cal(tmp)[0] # ty3 = jg2.cal(tmp1) #",
"import hugeScaleLR as hlr from LinearRegression.GradientDescent import gradientDescent as glr",
"jg = bpn([3, 4, 4, 2]) ... |
[
"números e colocar em uma lista, depois disso,mostre: A) Quantos",
"Quantos números foram digitados. B) A Lista de valores, ordenada",
"decrescente são {valores}') if 5 in valores: print('O valor 5",
"A) Quantos números foram digitados. B) A Lista de valores,",
"programa que vai ler vários números e colocar... |
[
"Mashhad zipcode = split[6] # 11111111 hashcode = split[7] #",
"Account/{username}'): fullname = split[1] # <NAME> gender = split[2] #",
"are > 1023) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT))",
"sha3_513 f = open(f'Etc/Users Account/{username}','wb') f.write(f'{fullname... |
[
"-*- # Generated by Django 1.11.5 on 2018-02-20 06:45 from",
"models.BooleanField(default=False)), ], options={ 'verbose_name': 'Presentation Cover', 'verbose_name_plural': 'Presentation Covers', },",
"migrations.RemoveField( model_name='presentation', name='features_cover', ), migrations.DeleteModel( name='Fea... |
[
"cur_G = dattorro.dsp.ui.p_Gain.zone fig = plt.figure() p = fig.add_subplot( 1,",
"cur_Q = dattorro.dsp.ui.p_Q.zone cur_G = dattorro.dsp.ui.p_Gain.zone fig = plt.figure() p",
") for q in Q: dattorro.dsp.ui.p_Q = q out =",
"# plot the frequency response with varying Q ##########################################... |
[
"BaseRunner from .solo import SingleThreadASGIRunner, SingleThreadRunner, SingleThreadWSGIRunner from .threadpool import",
"<gh_stars>100-1000 from .core import BaseRunner from .solo import SingleThreadASGIRunner, SingleThreadRunner,",
"import SingleThreadASGIRunner, SingleThreadRunner, SingleThreadWSGIRunner f... |
[
"Public License (LGPL)', 'Operating System :: OS Independent', 'Natural Language",
"or Lesser General Public License (LGPL)', 'Operating System :: OS",
"from setuptools import setup except ImportError: from distutils.core import setup",
":: Developers', 'License :: OSI Approved :: GNU Library or",
"'Operati... |
[
"ActionTable(FlaskForm): activate = SubmitField('Activate') deactivate = SubmitField('Deactivate') delete = SubmitField('Delete')",
"FlaskForm from . import SubmitField class ActionTable(FlaskForm): activate = SubmitField('Activate')",
". import FlaskForm from . import SubmitField class ActionTable(FlaskForm): ... |
[
"join(css_dest_dir, name + '.css') ], check = True) print(\"[ok]\") elif",
"css_dest_dir): os.makedirs(css_dest_dir, exist_ok=True) for (dirpath, dirnames, filenames) in os.walk(css_source_dir): for",
"f, ext in files_and_extensions if ext == 'svg']: data =",
"if ext in ['.svg']: vectors += [f] if ext in",
... |
[
"of data.txt \"\"\" import sys if __name__ == \"__main__\": with",
"\"\"\" import sys if __name__ == \"__main__\": with open(sys.argv[1],'r',encoding =",
"the second argument in terminal is to be used for",
"in terminal is to be used for line in f:",
"terminal is to be used for line in f: print(line[:-1])",... |
[
"修改邮箱 path('reset_user_email/', views.ResetUserEmailView.as_view(), name='reset_user_email'), # 读取用户消息 path('read_message/', views.ReadMessageView.as_view(), name='read_message'), ]",
"views.UserCenterInformation.as_view(), name='user_center_information'), # 用户学习的课程 path('user_center_my_courses/', views.UserStudy... |
[
"draw.text((col_space, line_pos), line, fill=(0, 0, 0), font=font) line_pos += sz[1]",
"try: image = Image.open(filename).convert('RGBA') new_image = Image.new('RGBA', image.size, (255, 255,",
"break image_group = images[r * col_num + c] for i,",
"images[r * col_num + c] for i, im in enumerate(image_group):",... |
[
"f=False if x<0: f=True y=str(abs(x)) y=y[::-1] x=int(y) if -2147483648<=x and",
"y=str(abs(x)) y=y[::-1] x=int(y) if -2147483648<=x and x<=2147483647: if f==False: return",
"y=y[::-1] x=int(y) if -2147483648<=x and x<=2147483647: if f==False: return x",
"def reverse(self, x: int) -> int: f=False if x<0: f=Tr... |
[
"3: 'SCISSORS'} def cpu_move(): cpu_rand = randint(1, 3) return cpu_rand",
"!= 2 and player_tally != 2: print(\"Round {}...\".format(match)) player =",
"return 'You win!' else: return 'Draw!' def main(): print(\"This game",
"1 player_tally += 1 elif score == 'You lose!': print('You",
"cpu_tally += 1 else: p... |
[
"# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law",
"\"\"\"Invalid configuration values\"\"\" # ConfigurationError class ValidationError(ValueError): \"\"\"JSON Schema validation",
"# ConfigurationError class ValidationError(ValueError): \"\"\"JSON Schema validation error\"\"... |
[
"route_betweenness def route_path_betweenness_from_file(filename, k): ''' Computes route betweenness for paths",
"networkx as nx def route_node_betweenness_from_paths(G, filtered_paths): ''' Computes route betweenness",
"range(0, len(path)-k): kpath = tuple(path[i:i+k+1]) path_to_pair_dict.setdefault(kpath, dic... |
[
"infile = open (\"planets.txt\", \"r\") # Read (skip over) the",
"based on commas giving list P p = s.split (\",\")",
"moons # Open the file try: infile = open (\"planets.txt\",",
"commas giving list P p = s.split (\",\") # If",
"(\",\") # If p[10] < 10 print the planet name,",
"8): # Read a line as strin... |
[
"val = self.conn.sudo(command,password=self.<PASSWORD>,hide=True).stdout.strip() return ('User Deleted: '+username,0) except Exception as",
"/home/\"+dirname+\"/ -g users -s /bin/bash \"+username try: val = self.conn.sudo(command,password=self.rootPass,hide=True).stdout.strip()",
"= \"userdel -f \"+username try... |
[
"lowest_unit=True) @property def value(self): return self._value def plus(self, other): return",
"return self.__sub__(other) def __isub__(self, other): if not isinstance(other, Currency): return",
"binary data with different strencoding: self({}) != other({})\".format( self._strencoding, other._strencoding))",
... |
[
"2): self.dim = dim self.matrixTransf = None def fit_transform(self, X,",
"numpy as np from numpy import linalg as LA class",
"= 0) media_neg = np.mean(negative, axis = 0) cov_pos =",
"sub) self.matrixTransf = np.array(wLDA) print(\"Matriz de transformação\") print(self.matrixTransf) res =",
"= cov_pos + co... |
[
"instance of API api = API() def debug(enable=True, level=1): from",
"lists in chunks if neccessary. \"\"\" def __init__(self, consumer_key, consumer_secret,",
"= level def chunks(l, n): for i in xrange(0, len(l),",
"def api(self): \"Lazy loaded Tweepy API object.\" if not self._api:",
"API wrapper based on... |
[
"= randint(0, 360) lineLen = randint(50, 100) left(angle) forward(lineLen) angle",
"import * from random import * angle = randint(0, 360)",
"<gh_stars>1-10 # Event: LCCS Python Fundamental Skills Workshop # Date:",
"eMail: <EMAIL> # Purpose: Solution to Q5 page 53 from",
"PDST # eMail: <EMAIL> # Purpose: So... |
[
"TODO: with tools in annotate_ws.py def split_scripts(nlu): nlu_t = []",
"nlu.append( t1['question']) nlu_t.append( t1['question_tok']) tbid = t1['table_id'] tb.append(data_tables[tbid]) hds.append(data_tables[tbid]['header']) return",
"None # not used pr_wv_str=None pr_wv_str_wp=None pr_sql_q = generate_sql_q(... |
[
"self.priorities: raise ValueError(\"Message type not defined\") self.buffers[msgType] += data def",
"the LICENSE file for legal information regarding use of this",
"length header in specific place (like Handshake messages). :ivar priorities:",
"self.priorities: raise ValueError(\"Message type already defined... |
[
"a given server address.\"\"\" channel = grpc.secure_channel( address, creds) if",
"%s, ' 'execution_id %s', request.updates, request.execution_id) if request.execution_id != self._execution.id:",
"\"\"\"Updates the `custom_properties` field of Execution object in MLMD.\"\"\" logging.info('Received",
"\"\"\"C... |
[
"np from CPGAN.options import * from CPGAN.train import * warnings.filterwarnings(\"ignore\")",
"torch from CPGAN.data_utils import * import numpy as np from",
"print(' ======== END OPTIONS ========\\n\\n') graphs = train_adj_mats, test_adj_mats, train_attr_vecs,",
"========\\n\\n') graphs = train_adj_mats, t... |
[
"from mavros_msgs.msg import Thrust class Sender(object): def __init__(self): self._pubs =",
"mavros_msgs.msg import Thrust class Sender(object): def __init__(self): self._pubs = {}",
"Thrust class Sender(object): def __init__(self): self._pubs = {} self._pubs['position'] =",
"'/mavros/setpoint_attitude/attit... |
[
"for {seconds} seconds, Current time is {datetime.today().time()}') import random #",
"sleep(seconds) print(f'Wait for {seconds} seconds, Current time is {datetime.today().time()}') import",
"for n in range(3): seconds = random.random() process = multiprocessing.Process(target=print_current_time,",
"import sl... |
[
"loss diff', '\\n', new_loss - new_loss_tf) # f, axarr =",
"0, 0], # [1, 5, 1, 1, 1], # [0,",
"index depth_size = numpy_voxelmap.shape[2] new_depth = np.argmax(numpy_voxelmap, axis=2) new_depth =",
"i, _ in enumerate(images): image, depth, depth_discretized, depth_reconstructed = images[i],",
"# jpg = tf.re... |
[
"@classmethod def from_versioned_targets(cls, versioned_targets): first_target = versioned_targets[0] cache_manager = first_target._cache_manager",
"in this case. ordered_targets = self._order_target_list(targets) # This will be",
"the VersionedTargets that correspond to this dependency's # dependencies, cache"... |
[
"1.1 (the \"License\"); you may not use this file except",
"Original Code is configman # # The Initial Developer of",
"of this file only # under the terms of either",
"Developer of the Original Code is # Mozilla Foundation #",
"be used under the terms of # either the GNU",
"'the a', short_form='a', from_s... |
[
"b = '<PASSWORD>' if a == b: print('Welcome') else: print('Wrong",
"= '<PASSWORD>' if a == b: print('Welcome') else: print('Wrong password!')",
"input() b = '<PASSWORD>' if a == b: print('Welcome') else:",
"= input() b = '<PASSWORD>' if a == b: print('Welcome')",
"a = input() b = '<PASSWORD>' if a == b:",
... |
[
"measurement in progress (press ESC to cancel)' if self.curr_phase ==",
"status def add_warning(self, warn_msg): self.op_warnings.append(warn_msg) def report_status(self): if self.op_status is",
"UvPackMessageCode.ISLANDS_METADATA: if self.islands_metadata_msg is not None: self.raiseUnexpectedOutputError() self... |
[
"pad tokenized input') parser.add_argument('--do_train', action='store_true', help='Train a tokenizer' ) parser.add_argument('--do_test',",
"import BPE from tokenizers.normalizers import Lowercase, NFKC, Sequence from tokenizers.pre_tokenizers",
"candidate files and target configs.') parser.add_argument('--trai... |
[
"'name') self.assertEquals(max_length, 50) self.assertEquals(unique, True) def test_field_url(self): field_label = self.custom_link._meta.get_field('url').verbose_name",
"id') self.assertEquals(max_length, 0) def test_object_presentation(self): expected_presentation = f\"[{self.custom_link.name}]: {self.custom_li... |