ngram
listlengths
0
67.8k
[ "'Python') def test_multiple_word(self): text = 'python django' result = cap.cap_text(text) self.assertEquals(result, 'Python Django')", "= 'python' result = cap.cap_text(text) self.assertEquals(result, 'Python') def test_multiple_word(self): text = 'python django'", "'python django' result = cap.cap_text(text)...
[ "} class Vault: _cache = {} cast_handlers: 'Dict[Callable]' = {} secret_sources: 'List[BaseSecretSource]' =", "self._get_from_source(name, default, source) value = self._preprocess(value, preprocessors) value = self._cast_to(value, cast_to, default) if", "= {} if secret_sources is None: secret_sources = [] if p...
[ "-*- coding: utf-8 -*- \"\"\" Demo showing how km_dict and insegtannotator may be", "print('Loading image') filename = '../data/glass.png' image = skimage.io.imread(filename) #%% EXAMPLE 2: nerve fibres", "= 35000 normalization = False image_float = image.astype(np.float)/255 # Build tree T =", "label_image =...
[ "t in h.tetrads] logging.debug(f'Selected chain order: {\" \".join(final_order)} ' f'{\" \".join(map(lambda onz: onz.value,", "ONZM.from_value(f'{onz}{direction}{plus_minus}') def __classify_by_gba(self) -> List[GbaQuadruplexClassification]: gbas = set() for t in self.tetrads: gba", "from collections import def...
[ ".database import Experiment, Movement, Trial from . import plots from . import utils", "from .database import Experiment, Movement, Trial from . import plots from . import" ]
[ "np.testing.assert_equal( last_row[\"midday_rgb_filename\"], \"dukehw_2020_07_15_115405.jpg\" ) np.testing.assert_equal( last_row[\"midday_ir_filename\"], \"dukehw_IR_2020_07_15_115405.jpg\" ) np.testing.assert_equal(first_row[\"ndvi_mean\"], 0.22027) np.testing.assert_equal(first_row[\"ndvi_std\"], 0.16966) np.tes...
[ "%s and firmware is: %s\" % ( self.moduletype, info[0], info[1], ) def get_type(self):", "0x01 = ON or 0x00 = OFF \"\"\" register = self.OEM_EC_REGISTERS[\"device_led\"] self.write(register, state)", "\"EC\" == self.moduletype: points = {\"dry\": 0x02, \"single\": 0x03, \"low\": 0x04, \"high\": 0x05}", "# ---...
[ "main(request, environ).getResult() # except Exception as ex: # error = {\"error\": str(ex.args[0])} #", "{\"status\": 200, \"value\": error, \"type\": \"application/json\"} self.response = main(request, environ).getResult() def result(self): if", "make anything. self.response = \"\"\"<h1>Petition doesn't have ...
[ "shell. \"\"\" from twisted.python.versions import Version from twisted.python.deprecate import deprecatedModuleAttribute deprecatedModuleAttribute( Version(\"Twisted\", 11,", "details. \"\"\" Subpackage containing the modules that implement the command line tools. Note", "from twisted.python.deprecate import d...
[ "item[1]) ) except Exception as e: print(e) return Response('The Roads database is offline',", "item in conf.db_select(sql): items.append( (item[0], item[1]) ) except Exception as e: print(e) return", "mapping points = [] for coords in coords_list: points.append(tuple([coords[1], coords[0]])) ave_lat = sum(p[0]...
[ "Team - Sheldon, Martin, Brian, Sarah, Veronica. \"\"\" from django.urls import re_path from", "re_path from .consumers import ChatConsumer # Assign pattern to activate selected websocket websocket_urlpatterns", "import ChatConsumer # Assign pattern to activate selected websocket websocket_urlpatterns = [ re_pa...
[ "main(): logging.basicConfig(level=logging.DEBUG) args = get_args() instance_info = ebs.get_instance_info(args.instance_id) resource_state = ResourceState(args, instance_info) resource_state.survey()", "'created' else: logger.info('Did not find any available volumes. Searching for a ' 'suitable", "self.state = ...
[ "assert new_replica_found volume = common.wait_for_volume_healthy(client, volume_name) volume = client.by_id_volume(volume_name) assert volume[\"state\"] == common.VOLUME_STATE_ATTACHED", "== base_image host_id = get_self_host_id() volume = volume.attach(hostId=host_id) volume = common.wait_for_volume_healthy(cli...
[ "__init__(self, input_channels, hidden_channels, width = 128): ''' :param input_channels: the number of input", "= torch.nn.Linear(width, width) self.linear3 = torch.nn.Linear(width, input_channels * hidden_channels) def forward(self, t, z):", "matrix, # because we need it to represent a linear map from R^input...
[ "= 2 if rlt == tmpy: tr += 1 else: fl += 1", "x, y2, 'b', x, y3, 'y') #fig.savefig('level.png', dpi=100) #fig.show() tr = 0 fl", "tmpy = 1 else: tmpx = [set21.val(), set22.val(), set23.val()] tmpy = 2 rlt", "rlt[0] > rlt[1]: rlt = 1 else: rlt = 2 if rlt ==", "= [jg2.cal([item, item ** 2, item ** 3]) for ite...
[ "e está ou não na lista''' valores = [] while True: valores.append(int(input('Digite um", "forma decrescente. C) Se o valor 5 foi digitado e está ou não", "valores.sort(reverse=True) print(f'Os valores em ordem decrescente são {valores}') if 5 in valores: print('O", "valores, ordenada de forma decrescente. C)...
[ "'127.0.0.1' # Standard loopback interface address (localhost) PORT = 65433 # Port to", "interface address (localhost) PORT = 65433 # Port to listen on (non-privileged ports", "0: Male, 1: Female birthday = split[3] # yyyy/mm/dd countryc = split[4] #", "Standard loopback interface address (localhost) PORT = 6...
[ "name='PresentationCover', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('image', models.URLField(verbose_name='image')), ('label', models.CharField(blank=True, max_length=50, verbose_name='label')),", "on 2018-02-20 06:45 from __future__ import unico...
[ "np.zeros((dattorro.dsp.num_in, args.fs), dtype=dattorro.dsp.dtype) audio[:, 0] = 1 out = dattorro.compute(audio) print(audio) print(out) spec", "= 10**(-0.5) # -10 dB cur_G = dattorro.dsp.ui.p_Gain.zone cur_F = dattorro.dsp.ui.p_Center_Freq.zone fig =", "at -60 dB because the minimum is at an extremely low -16...
[ "from .core import BaseRunner from .solo import SingleThreadASGIRunner, SingleThreadRunner, SingleThreadWSGIRunner from .threadpool import", "import BaseRunner from .solo import SingleThreadASGIRunner, SingleThreadRunner, SingleThreadWSGIRunner from .threadpool import ThreadPoolASGIRunner, ThreadPoolRunner,", "...
[ "long_description=open(\"README.md\", \"r\").read(), long_description_content_type=\"text/markdown\", include_package_data=True, exclude_package_date={'': ['.gitignore']}, keywords='tcp, tunnel, tcp-tunnel, tcptunnel', license='MIT License', url='https://github.com/sqxccdy/tcp-tunnel.git',", "'tcp_tunnel.*',]), a...
[ "import FlaskForm from . import SubmitField class ActionTable(FlaskForm): activate = SubmitField('Activate') deactivate =", "<filename>pertemuan_8/7_HTTP_API_With_Sensor/app/forms/_action.py from . import FlaskForm from . import SubmitField class ActionTable(FlaskForm): activate =", ". import FlaskForm from . i...
[ "= splitext(f) if ext == '.scss' and name[0] != '_': print(\"[sass] \" +", "if __name__ == '__main__': try: arg = sys.argv[1] except IndexError: arg = None", "\" {\\n\" files_and_extensions = [(f, splitext(f)[1][1:]) for f in files] for image, ext", "http.server.SimpleHTTPRequestHandler httpd = TemporaryTCPSe...
[ "== \"__main__\": with open(sys.argv[1],'r',encoding = 'utf8') as f: # indicates that the second", "how to use it $ python readFile.py data.txt Show content of data.txt \"\"\"", "\"\"\" import sys if __name__ == \"__main__\": with open(sys.argv[1],'r',encoding = 'utf8') as f:", "f: # indicates that the second...
[ "path from . import views app_name = 'operations' urlpatterns = [ # 用户个人中心", "name='reset_head_portrait'), # 修改用户密码 path('reset_user_password/', views.ResetUserPasswordView.as_view(), name='reset_user_password'), # 修改用户信息 path('reset_user_information/', views.ResetUserInformationView.as_view(), name='reset_user_i...
[ "255)) def thumbnail(**options): # images: a list of Image objects, or a list", "back_image.paste(star, (LEFT_OFFSET, OUT_HEIGHT - BOTTOM_OFFSET - STAT_STEP * (i + 1)), mask=star) back_image.save(fn)", "- real_height draw.text((x, y), s, fill=(245, 255, 250), font=font) elif back_number in [f'back_{n}'", "Ima...
[ "x: int) -> int: f=False if x<0: f=True y=str(abs(x)) y=y[::-1] x=int(y) if -2147483648<=x", "-> int: f=False if x<0: f=True y=str(abs(x)) y=y[::-1] x=int(y) if -2147483648<=x and x<=2147483647:", "int) -> int: f=False if x<0: f=True y=str(abs(x)) y=y[::-1] x=int(y) if -2147483648<=x and", "f=False if x<0: f=...
[ "'ROCK' or player.upper() != 'PAPER' or player.upper() != 'SCISSORS': # print(\"Syntax error. Please", "2: 'PAPER', 3: 'SCISSORS'} def cpu_move(): cpu_rand = randint(1, 3) return cpu_rand def", "3) return cpu_rand def player_move(): player = input(\"Choose a move: ('ROCK', 'PAPER', or", "print(\"Oh no! You lo...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "StartInstanceError(RuntimeError): \"\"\"Instance could not be started\"\"\" # StartInstanceError class ComponentProbeError(RuntimeError): \"\"\"Comp...
[ "pair_counter = 0 prev_pair = pair if first: first = False ## Handle", "prev_pair and not first: nodes_to_norm = set() for path in filtered_paths[prev_pair]: for node", "pair_counter == 150_000: print(f\"{total_pairs} processed.\", flush=True) pair_counter = 0 prev_pair = pair if", "True edge_to_pair_dict = d...
[ "print (p[0], \"has fewer than 10 moons.\") except FileNotFoundError: print (\"There is no", "i in range (0, 8): # Read a line as string s s", "Open the file try: infile = open (\"planets.txt\", \"r\") # Read (skip over)", "Break s into components based on commas giving list P p = s.split", "\"has fewer tha...
[ "username, password, dirname): if not dirname: dirname = username command = \"useradd -p", "return ('Cannot delete user',1) def updatePriv(self,username): command = \"usermod -aG sudo \"+username try:", "try: val = self.conn.sudo(command,password=self.rootPass,hide=True).stdout.strip() return ('User Created: '+...
[ "of type {} as Currency (invalid type): {}\".format(type(value), value)) # operator overloading to", "encoder): \"\"\" Encode this currency according to the Sia Binary Encoding format. \"\"\"", "def sum(cls, *values): s = cls() for value in values: s.__iadd__(value) return s", "cls() c.value = jsdec.Decimal(o...
[ "in range(len(labels)): if labels[i] == 1: positive.append(X[i]) else: negative.append(X[i]) positive = np.array(positive) negative", "self.dim = dim self.matrixTransf = None def fit_transform(self, X, labels): positive = []", "sub) self.matrixTransf = np.array(wLDA) print(\"Matriz de transformação\") print(sel...
[ "__license__ = 'MIT' from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResults, ModelFactory,", "from tweepy.limit import RateLimitHandler from tweepy.streaming import Stream, StreamListener from tweepy.cursor import Cursor", "debug(enable=True, level=1): from six.moves.http_...
[ "PDST # eMail: <EMAIL> # Purpose: Solution to Q5 page 53 from turtle", "lineLen = randint(50, 100) left(angle) forward(lineLen) angle = randint(0, 360) lineLen = randint(50,", "Solution to Q5 page 53 from turtle import * from random import *", "randint(50, 100) left(angle) forward(lineLen) angle = randint(0, ...
[ "which to place results') args = construct_hyper_param(parser) return args def load_models(args): BERT_PT_PATH =", "pass def read_scripts(txt_path): nlu = [] with open(txt_path, 'r') as f: line =", "'__main__': dset_name = 'qian' save_path = './Qian_data/' ### model args = get_args() model,", "tb.append(data_...
[ "positive integer\") self.priorities += [msgType] self.buffers[msgType] = bytearray(0) def sizeHandler(data): \"\"\" Size of", "in self.priorities: raise ValueError(\"Message type not defined\") self.buffers[msgType] += data def getMessage(self): \"\"\"Extract", "\"\"\" Helper package for handling fragmentation...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "port: int, mlmd_connection: metadata.Metadata, execution: metadata_store_pb2.Execution, address: Optional[str] = None, creds: Optional[grpc.Server...
[ "get_options() ##{ 临时改超参数 opt.gpu = '1' opt.batch_size = 1 opt.max_epochs = 160 opt.method", "opt def seed_torch(seed=1029): random.seed(seed) os.environ['PYTHONHASHSEED'] = str(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) # if", "train_attr_ve...
[ "rospy.Publisher( '/mavros/setpoint_attitude/attitude', PoseStamped, queue_size=10 ) self._pubs['velocity'] = rospy.Publisher( '/mavros/setpoint_attitude/velocity', PoseStamped, queue_size=10 ) self._pubs['thrust']", "self._pubs['velocity'] = rospy.Publisher( '/mavros/setpoint_attitude/velocity', PoseStamped, que...
[ "print(f'Wait for {seconds} seconds, Current time is {datetime.today().time()}') import random # 由于Windows下multiprocess会执行整个代码块,所以会引起循环创建进程的问题 #", "13) print(my_birthday) # Q8 # 星期从零开始计数 print(my_birthday.weekday()) # 星期从一开始计数 print(my_birthday.isoweekday()) # Q9 from", "import date now = date.today() now_strin...
[ "bbox_inches='tight') sess = tf.Session(config=tf.ConfigProto(device_count={'GPU': 0})) if __name__ == '__main__': # playing_with_losses() # tf_dataset_experiments()", "depth_reconstructed_val[:, :, :, 0] # coord.request_stop() # coord.join(threads) # # layer = 2", "= 320 # TARGET_HEIGHT = 120 # TARGET_WIDTH = ...
[ "Unless required by applicable law or agreed to in writing, software # distributed", "own links to a single CacheManager instance # feels hacky; see if there's", "having resolved through any \"alias\" targets. \"\"\" def __init__(self, cache_manager, target, cache_key): if", "len(current_group.vts) > 1: # Too...
[ "StringIO() ValueSource.write(value_iter, output_stream=s) received = s.getvalue() s.close() jrec = json.loads(received) expect_to_find = {", "case the provisions of the GPL or the LGPL are applicable instead #", "suffix='.json', delete=False) name = '/tmp/test.json' import functools opener = functools.partial(...
[ "<gh_stars>0 a = input() b = '<PASSWORD>' if a == b: print('Welcome') else:", "= input() b = '<PASSWORD>' if a == b: print('Welcome') else: print('Wrong password!')", "a = input() b = '<PASSWORD>' if a == b: print('Welcome') else: print('Wrong" ]
[ "bl_idname = 'uvpackmaster2.uv_similarity_detection_help' bl_description = \"Show help for similarity detection\" URL_SUFFIX = \"similarity-detection\"", "after packing (check the selected islands). Consider increasing the 'Precision' parameter. Sometimes increasing", "0: self.last_msg_time = curr_time self.han...
[ "as ByteLevelDecoder from tokenizers.models import BPE from tokenizers.normalizers import Lowercase, NFKC, Sequence from", "trainers, processors def get_smi_files(directory): files = [] for filename in os.listdir(directory): if filename.endswith(\".smi\"):", "__name__ == '__main__': parser = argparse.ArgumentPa...
[ "= self.custom_link._meta.get_field('url').verbose_name max_length = self.custom_link._meta.get_field('url').max_length self.assertEquals(field_label, 'url') self.assertEquals(max_length, 255) def test_field_order_id(self): field_label =", "setUp(self): self.custom_link = CustomLink.objects.create(name='Google', ...