ngram
listlengths
0
67.8k
[ "page_count = 0 page_fields[name] = parts[0] page_count += len(name) + len(parts[0]) else: for", "str(input).splitlines(keepends=True) pages = [] page = \"\" count = 0 for line in", "in known_messages.keys(): type = known_messages[message_id][\"type\"] if type in page_handlers.keys(): data = known_messages[mess...
[ "= stdout sys.stderr = stderr return def prompt_response(dialog, response_id): \"\"\" Signal handler for", "scrolled window. \"\"\" message_dialog = gtk.Dialog(parent = parent, buttons = (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) message_dialog.set_default_size(400,", "gtk.HSeparator() main_box.pack_start(separator, ...
[ "dy) in enumerate(NEIGHBORS) if ( 0 <= x + dx < self.width and", "32 BOARD_HEIGHT = 32 CELL_SIZE = 6 CELL_COLOR = 15 WALL_SIZE = 1", "# Calculated N_CELLS = BOARD_WIDTH * BOARD_HEIGHT BLOCK_SIZE = CELL_SIZE + WALL_SIZE *", "neighbors = self._get_neighbors(x, y) if neighbors: d, dx, dy = choice(neighbors) self...
[ "'PasteFromWord', '-','Print','SpellChecker','Scayt'], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat','-','Maximize', 'ShowBlocks', '-',\"CodeSnippet\", 'Subscript',", "False ALLOWED_HOSTS = ['*',] APPEND_SLASH = True # Application definition INSTALLED_APPS = [", "'Replace', '-', 'Sel...
[ "def __str__(self): return f'{self.user.username} Profile' def save(self,*args,**kwargs): super().save() img = Image(self.prof_pic.path) if img.height", "class Profile(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) image = models.ImageField(default='default.jpg', upload_to='profile_pic/')...
[ "data science projects reproducible and shareable. \"\"\" import os import warnings VERSION_BASE =", "so that they don't show up when you are using dvc. warnings.filterwarnings(\"ignore\", message=\"numpy.dtype", "causing # these warnings in some environments. Luckily these warnings are benign and", "import o...
[ "## Local application imports from pkg_dir.config.config import ( creds_file_path as crds_loc, ) from", "db_schema[prop][\"data_type\"] == \"title\"][0] ## Building a the blueprint dictionary for the dataframe (orient=index)", "= db_schema[col][\"data_type\"] ## Set of conditions to determine how the row will b...
[ "super().submit() def make(self): LOGGER.info('make was called') return 'http://issuetracker.example.com/new_issue' def update(self): LOGGER.info('update was called')", "called\", ]) self.assertEqual(result1, result2) return result1 def assertSubmitUpdate(self, issue): with self.assertUnchanged(issue): with self....
[ "= archive.dirname # output: pick one if args.align: # check to make sure", "flag (-s/--samplerate).\") args.samplerate = None # create archive from -r argument archive =", "make sure we're not aligning on the training data if (not args.train) or", "\"--epochs\", type=int, help=\"# of epochs of training per r...
[ "for output files: %s' % FILES_DIR) os.mkdir(FILES_DIR) if not os.path.exists(BUILD_DIR): logging.info('Create folder for", "properties_file: properties = json.load(properties_file) name = properties['name'] legend = properties['legend'] input_file = properties['inputFile']", "problem_name = os.path.basename(pr...
[ "python_requires import conans.tools as tools import os base = python_requires(\"Eigen3ToPython/latest@multi-contact/dev\") class MCRTCDataConan(base.Eigen3ToPythonConan): name", "cmake = self._configure_cmake() cmake.install() tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\")) for f in [\".ca...
[ "old_name='visibleTo', new_name='visible_to', ), migrations.AddField( model_name='post', name='content_type', field=models.CharField(choices=[('1', 'text/plain'), ('2', 'text/markdown'), ('3', 'image/png;base64'), ('4',", "'text/plain'), ('2', 'text/markdown'), ('3', 'image/png;base64'), ('4', 'image/jpeg;base64'...
[ "torch version. It will save the data as module.<xyz> . Handle it if(", "np from torch.autograd import Variable import gzip import yaml from re import split", ") as f: f.write( contents ) def writeJson( fname, data ): with myOpen(", "def readJson( fname ): with myOpen( fname, 'r' ) as f: return json.load(", ...
[ "on text strings you get back from libvips. \"\"\" if _is_PY3 and isinstance(x,", "= x.decode('utf-8') return x class Error(Exception): \"\"\"An error from vips. Attributes: message (str):", "x def _to_string(x): \"\"\"Convert to a unicode string. If x is a byte", "unicode string to a utf-8-encoded byte strin...
[ "= display_string(screen, a_string, output_line) output_line += 2 output_line = display_list_items(screen, a_list, output_line) output_line", "the user selects. \"\"\" # Create a dictionary that contains the items in", "screen.clear() output_line = first_line_num output_line = display_string(screen, a_string, o...
[]
[ "# get selected lines selected_ids = self.get_selected_item_ids() # get data of each id", "self.populate_tree_view_lines() def populate_tree_view_lines(self): all_are_in_exceptions = True for (tr_number, export_timestamp, owner, description, ticket_number, sap_module,", "(\"Owner\", 80) } # TREE VIEW for list d...
[ "= tf.placeholder(tf.float32, shape=(None, 1)) X, Y_, Y_c = opt4_8_generateds.generateds() y = opt4_8_forward.forward(x, REGULARIZER)", "== 0: loss_v = sess.run(loss_total, feed_dict={x:X,y_:Y_}) print(\"After %d steps, loss is: %f\" %(i,", "= tf.Variable(0,trainable=False) learning_rate = tf.train.exponential_...
[ "build_phase(self, phase): self.sqr = vip_sequencer.type_id.create(\"sqr\", self) self.drv = vip_driver.type_id.create(\"drv\", self) self.tx_mon = vip_monitor.type_id.create(\"tx_mon\",", "# fork cocotb.fork(self.drv.suspend()), cocotb.fork(self.tx_mon.suspend()), cocotb.fork(self.rx_mon.suspend()), ]) # join as...
[ "invalid marker ( whitespace at the end). \"\"\" with pytest.raises(ValueError): Transliterator(TEST_MAPPER, '@@LAT@@ ')", "does not get transliterated but markers do get stripped when strip_markers is set", "= Transliterator(TEST_MAPPER, '@@') assert trans.transliterate(u'') == u'' def test_trans_single_no_mar...
[ "CONDITIONS OF ANY KIND, express or implied. See the License for the specific", "this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES", "bucket, solution, version, region): template = get_versioned_template(template_file, bucket, solution, version, region) print(json.dumps(template, ind...
[ "signal_name = signal[:signal.find('[')] ind_start = signal[signal.find('[')+1:signal.find(':')] symb_start = False if ind_start in self.vars:", "in self.vars: ind_end = int(self.vars[ind_end],0) elif ind_end.isdigit(): ind_end = int(ind_end,0) else: #case of", "args.annotation cfo = open(annot_file, \"r+\") cl...
[ "visited_time = datetime.datetime.now() visitors = Visitor.query.all() visited = Visitor.query.filter_by(ip=visitor_ip).first() visit = False if", "else: new_visitor = Visitor(ip=visitor_ip,last_visit=visited_time) db.session.add(new_visitor) db.session.commit() return render_template('index.html',visitors=visito...
[ "int(input(\"Insira a opção: \")) return opcao def carregar_opcoes(opcao): if opcao == 1: imprimir_tela(\"A", "carregar_opcoes(opcao): if opcao == 1: imprimir_tela(\"A opção escolhida foi 'Cadastrar funcionário'\") elif opcao", "escolhida foi 'Editar funcionário'\") elif opcao == 4: imprimir_tela(\"A opção esco...
[ "a + b elif self.value == \"MULT\": return a * b elif self.value", "elif self.value == \"PLUS\": return a + b elif self.value == \"MULT\": return", "a <= b elif self.value == \"EQUALS\": return a == b elif self.value", "elif self.value == \"LESS\": return a < b elif self.value == \"GE\": return", "a == b el...
[ "except requests.exceptions.ConnectionError as e: self.logger.error(\"Connection error: %s\" % e.args) raise e else: try:", "archive): if self.base_dir is not None: command_args = [self.command, 'x', '-aoa', '-bd', '-y',", "limitation the rights to # use, copy, modify, merge, publish, distribute, sublicense, an...
[ "current page next the next page previous the previous page pages number of", "request.GET.get('page', 1) try: page = int(page) object_list = paginator.get_page(page - 1) except (InvalidPage,", "(if paginated) has_next is there a next page? has_previous is there a prev", "from django.template import loader, R...
[ "to a module. Example: >>> net = pax.Lambda(jax.nn.relu) >>> print(net.summary()) x => relu(x)", "parameters by default.\"\"\" def parameters(self): return self.apply_submodules(lambda x: x.parameters()) class StateModule(Module): \"\"\"A PAX", ">>> mlp, _ = MLP([1, 2, 3]) % jnp.ones((1, 1)) >>> print(mlp.summa...
[ "We first try splitting the key as a version 1 key (course-v1:org+course+run) and", "number from data dictionary.\"\"\" course_id = self.extract_course_id(data.get(\"resource_link\")) return split_course_key(course_id)[1] @staticmethod def get_course_run_serializer(data, partial=False):", "import requests from ...
[ "get the url import urllib type, uri = urllib.splittype(uri) if type not in", "ServerProxy = new_server_proxy if __name__ == '__main__': s = ServerProxy('https://greg.mitte.bittorrent.com:7080/') def ping(*a, **kw):", "= (args, kwargs) return self.__send(self.__name, args) # ARG! prevent repr(_Method()) from su...
[ "*args, **kwargs): \"\"\" First attempts to serve the file from the filesystem, then", "def serve(request, name): \"\"\" Retrieves the file from the database. \"\"\" f =", "settings.MEDIA_ROOT try: # First attempt to serve from filesystem. return django_serve(request, name, document_root)", "mimetypes.guess_t...
[ ": :obj:`Dict` Parameters used to define the behaviour of the filter. clean_data :", "np import pandas as pd from abc import ABC class Injector(ABC): \"\"\"Base class", "self._rate > 1: raise ValueError(\"\") def _gen_random(self, seed: int = None): \"\"\"[summary] Args:", "for the injectors of artificial noi...
[ "\"LinkedIn Link (Optional)\") site_link = TextField(\"Personal Site\", [ validators.optional(), validators.URL(message = \"Invalid URL.\")", "RadioField import re phone_regex = \"(\\+\\d+-?)?((\\(?\\d{3}\\)?)|(\\d{3}))-?\\d{3}-?\\d{4}$\" gender_choices = [ (\"\", \"Gender\"), (\"male\", \"Male\"),", "you a beg...
[ "locations, }, }) @app.route('/movie') def movie(): req_title = request.args.get('title', None) if not req_title:", "'%{}%'.format(req_title))) movies = [{'id': index, 'title': l.title} for index, l in enumerate(query)] return", "# coding: utf-8 '''フロントコントローラを提供する ''' from math import ceil import os from flask"...
[ "self.name in ( \"Jungle\", \"Ice\", \"Ocean\"): return DungeonType.REMOVED_MINI elif self.name in ( \"Decrepit", "in ( \"Zombie\", \"Animal\", \"Skeleton\", \"Spider\", \"Silverfish\",): return DungeonType.REMOVED elif self.name in (", "\"Infested Pit\", \"Ice Barrows\", \"Lost Sanctuary\", \"Sand-Swept Tomb\"...
[ "__init__(self, thresh=60, octaves=4): self.thresh = thresh self.octaves = octaves self.descriptor_extractor = pybrisk.create() def", "return pybrisk.detect(self.descriptor_extractor, img, self.thresh, self.octaves) def compute(self, img, keypoints): return pybrisk.compute(self.descriptor_extractor, img, keypoint...
[ "outlet_id < len(self.outlets): self.outlets[outlet_id].state = 1 self._send_outlet_command(outlet_id, self.outlets[outlet_id].state) def turn_off_outlet(self, outlet_id): if outlet_id", "= serial.Serial(ports[0], SERIAL_BAUD_RATE, timeout=SERIAL_TIMEOUT) except IndexError: send_ifttt_log(__name__, 'No serial por...
[ "cores. - Interhelical angle (0-90 degree) ''' # Obtain the helical core vectors...", "np.linalg.norm(core_vec_ref) core_vec_tar_unit = core_vec_tar / np.linalg.norm(core_vec_tar) inter_angle = np.arccos( np.dot(core_vec_ref_unit, core_vec_tar_unit) ) if", "c - b * b # Denominator if de == 0: sc, tc", "= 0, d...
[ "in nums: if num % 2 == 0: count_even += 1 if num", "len(sline) == 9: nums_9_chars.append(num) nums.append(num) count_even = 0 max_num = 0 for num", "<reponame>bartekpacia/informatyka-frycz<gh_stars>1-10 from typing import List with open(\"dane/liczby.txt\") as f: nums: List[int] = []", "line.strip() num = in...
[ "< 2: return n else: return fib(n-1) + fib(n-2) def fib_fast(n): from math", "1: print a, b else: print 0, 1, for i in range(2, n):", "else: print 0, 1, for i in range(2, n): a, b = b,", "0, 1, for i in range(2, n): a, b = b, a +", "i in range(n): print fib_fast(i), def print_fib2(n): fibs = [0, 1] a, b", ...
[ "import ItemCase from src.model.PointMontage import PointMontage from src.model.Robot import Robot from src.model.Tache import", "ItemCase from src.model.PointMontage import PointMontage from src.model.Robot import Robot from src.model.Tache import Tache", "correspondantes # si une étape (assembly point) n'est ...
[ "ex_name = \"Bag of words\" texts = [ \"He loves to walk on", "as p1 import numpy as np verbose = False def green(s): return '\\033[1;32m%s\\033[m'", "np.array([1, 2]) label, theta, theta_0 = 1, np.array([-1, 1]), -1 exp_res = (np.array([0,", "check_tuple( ex_name, p1.pegasos_single_step_update, exp_res, feat...
[ "\"\"\" Mocks file using `NamedTemporaryFile` instance with writed `file_content` inside, where `file_name` ==", "from 0 to 666999 delimited by '\\n'.\", ), ], ) def test_find_maximum_and_minimum(file_content: str,", "(1, 5).\", ), pytest.param( \"1\\n-2\\n3\\n-4\\n5\\n-6\\n7\\n-8\\n9\\n-10\\n11\\n-12\\n\", (-1...
[]
[ "'#0000ff', '#ff00ff', '#990000', '#999900', '#009900', '#009999'] # 各ラベルごとに異なる色でプロット # 同じクラス内のインスタンスが近くに集まり、 # 異なるクラスのインスタンスが離れていれば成功 for", "model) # テストデータをロード _, test = chainer.datasets.get_mnist(ndim=3) test_data, test_label = test._datasets # テストデータを学習した低次元空間(2次元)に写像", "# テストデータをロード _, test = chainer.datas...
[ "else: self._right_color = self._right_color + 1 else: if self._right_color == 0: self._right_color =", "TwoFeetTempoMove.COLORS_ALPHA[self._right_color])) self.tt_gui = TwisterTempoGUI() self.tt_gui.set_left_color(TwoFeetTempoMove.COLORS_ALPHA[self._left_color]) self.tt_gui.set_right_color(TwoFeetTempoMove.COLOR...
[ "to generate statistics from blog posts (number of posts per month, categories and", "Panorama is a Pelican plugin to generate statistics from blog posts (number of", "a Pelican plugin to generate statistics from blog posts (number of posts per", "# -*- coding: utf-8 -*- \"\"\" Panorama is a Pelican plugin to...
[ "is very large for a \" \\ \"transfer time and most likely \"", "= 'transfers' _ID_COLUMNS = ['from_stop_id', 'to_stop_id'] def __init__(self, schedule=None, from_stop_id=None, to_stop_id=None, transfer_type=None, min_transfer_time=None,", "KIND, either express or implied. # See the License for the specific lan...
[ "path('like_post', views.like_post, name='like_post'), path('find_friends',views.find_friends, name='find_friends'), path('profile',views.profile, name='profile'), path('profile_update', views.profile_update, name='profile_update'), path('user/<str:username>', UserPostListView.as_view(), name='user_posts'),", "na...
[ "https://fenicsproject.discourse.group/t/ # any-function-to-determine-if-the-point-is-in-the-mesh/275/3 import dolfin from vtkplotter.dolfin import shapes, plot, printc n =", "n = 4 Px = 0.5 Py = 0.5 mesh = dolfin.UnitSquareMesh(n, n)", "0.5 Py = 0.5 mesh = dolfin.UnitSquareMesh(n, n) bbt = mesh.bounding_box_tr...
[ "main(): key = os.getenv('RASP_KEY') station_from = os.getenv('STATION_FROM') station_to = os.getenv('STATION_TO') date = datetime.date.today().strftime('%Y-%m-%d')", "datetime import os from alice_check_train.main import rasp_to_text from alice_check_train.rasp_api import get_rasp, filter_rasp def", "datetime....
[ "in range(len(queries)): # Recall neighbor_id_from_result = [] for ele in result['responses'][id]['hits']['hits']: neighbor_id_from_result.append(int(ele['_id'])) assert", "= ''' { \"size\": 50, \"query\": {\"knn\": {\"sift_vector\": {\"vector\": [%s],\"k\": 50}}} } '''", "hf.keys(): print(\"A key of hf is %s\"...
[ "image as specified in the # environment options CIBW_MANYLINUX1_*_IMAGE if \"linux\" in sys.platform", "sys # check that we're running in the correct docker image as specified", "def test(tmp_path): if utils.platform != 'linux': pytest.skip('the test is only relevant to the", "as specified in the # environme...
[ "# merge position_id_to_sellids self.position_id_to_sellids = {} for position in valid_positions: pos_id = position[\"id\"]", "self.exist_order_info_list[0] cur_rate = exist_order_info[\"rate\"] if \"rate\" in exist_order_info else None # get current", "True): self.max_total_position_price_base = 0 # total maxi...
[ "r2.off() time.sleep(0.5) r3.on() time.sleep(0.5) r3.off() time.sleep(0.5) r4.on() time.sleep(0.5) r4.off() time.sleep(0.5) r5.on() time.sleep(0.5) r5.off()", "time r1 = Relay(\"RELAY1\") r2 = Relay(\"RELAY2\") r3 = Relay(\"RELAY3\") r4 = Relay(\"RELAY4\")", "= Relay(\"RELAY4\") r5 = Relay(\"RELAY5\") r6 = Rela...
[ "= f\"https://secure.runescape.com/m=avatar-rs/{user_url_name}/chat.png\" runeclan_url = f\"https://runeclan.com/user/{user_url_name}\" clan_banner_url = f\"http://services.runescape.com/m=avatar-rs/l=3/a=869/{user_url_clan}/clanmotif.png\" embed_title = \"RuneClan\" rank_header =", "{rank_emoji['Recruit']} ❯ Cab...
[ "License is distributed on an \"AS IS\" BASIS, WITHOUT # WARRANTIES OR CONDITIONS", "writing, software # distributed under the License is distributed on an \"AS IS\"", "the License. # import json import uuid from datetime import datetime from openstackclient.tests.functional", "' '--local-router-id \"{local_r...
[ "<reponame>Robinson04/StructNoSQL import unittest from typing import Set, Optional, Dict, List from uuid import", "implement pass def test_nested_dict_set_structure(self): # todo: implement pass if __name__ == '__main__': unittest.main()", "= BaseField(field_type=str, required=True) nestedDictDictStructure = Ba...
[ "\"abc\") eq(base64.standard_b64decode(\"\"), \"\") eq(base64.standard_b64decode(\"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE\" \"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT\" \"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\"), \"abcdefghijklmnopqrstuvwxyz\" \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" \"0123456789!@#0^&*();:<>,. []{}\") # Non-by...
[ "np.array(self.yvertices, dtype='float32'), GL_STATIC_DRAW) glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * 4, c_void_p(0)) #setting xline", "self.yvertices = [] self.zvertices = [] for pos in range(len(rotation)): xversor = self.getVersorAtTime(np.array([1,", "model) glUniformMatrix4fv(viewLocation, 1, GL_...
[ "description, ) parser = add_arguments(parser) return parser def add_arguments(parser): parser.add_argument( 'cfps', type=str, help='Path", "def add_arguments(parser): parser.add_argument( 'cfps', type=str, help='Path to a .tsv file containing CFPS parameters", "a .tsv file containing CFPS parameters and featur...
[ "= float(input()) prop_2 = -(x**2) / math.factorial(2) prop_3 = (x**4) / math.factorial(4) prop_4", "cos_x = float(1 + prop_2 + prop_3 + prop_4) print(prop_2) print(prop_3) print(prop_4) print(cos_x)", "-(x**2) / math.factorial(2) prop_3 = (x**4) / math.factorial(4) prop_4 = -(x**6) / math.factorial(6)", "= -...
[ "PythonICATWhereFilter(\"startDate\", \"o.endDate\", \"lt\") test_filter.apply_filter(icat_query) assert icat_query.conditions == {\"startDate\": [\"%s < o.endDate\"]} def test_valid_field(self,", "'5'\"], id=\"less than\"), pytest.param(\"lte\", 5, [\"%s <= '5'\"], id=\"less than or equal\"), pytest.param(\"gt\"...
[ "# name = scrapy.Field() # description = scrapy.Field() # size = scrapy.Field() #", "# size = scrapy.Field() # # import scrapy class StockstarItemLoader(ItemLoader): # 自定义itemloader,用于存储爬虫所抓取的字段内容 default_output_processor", "size = scrapy.Field() # # import scrapy class StockstarItemLoader(ItemLoader): # 自定义ite...
[ "return '%s(name=%r, subcontexts=%s)' % (type(self).__name__, self.name, subcontext_str) def __repr__(self): # Maybe a good", "# This file is open source software distributed according to the terms in", "of the value. blocking_contexts.append(c) # Remove all blocking instances. for c in blocking_contexts:", "...
[ "\"MIT\" __version__ = \"1.0.1\" __maintainer__ = \"<NAME>\" __email__ = \"\" __status__ = \"\"", "simple file to test the line_counter performance in python This is a multiline", "import math #define things def some_function(var_one, var_two, var_three): \"\"\"This is a function that", "function that do thin...
[ "{'categorical', 'input'}: dtype = torch.long return torch.tensor(featurized_data[var_name], dtype=dtype) feature_names = sorted(featurized_data.keys()) data =", "in zip(*batch)], # group by datatype. batch_size=batch_size) def iterator(): for batch in dataloader:", "# Continuous elif isinstance(examples[0], fl...
[ "an integer number = int(input('Enter an integer: ')) # Obtain number of digits", "Calculate and return number of digits def get_num_digits(num): # Convert int to str", "= int(input('Enter an integer: ')) # Obtain number of digits num_digits = get_num_digits(number)", "of digits digits = len(num_str) return d...
[ "return if not ((64 <= w <= 4096) and (64 <= h <=", "UP IN THE END stack.push_async_callback(sticker.delete) if explicit_picture is not None: user_pic = await", "not w or not h: await message.answer(loc.TEXT_AVA_ERR_INVALID, reply_markup=self.menu_kbd()) return if not ((64 <=", "((64 <= w <= 4096) and (64 <= ...
[ "to insert in database self.images_list = dict() self.image_store = list() def request_image_hashes(self): images", "error functionals uploaded_image = cv2.imread(uploaded_image) db_store_image = cv2.imread(db_store_image) uploaded_image = cv2.resize() db_store_image =", "must have the same dimension err = np.s...
[ "str(ctx.author.id) in config: # if not enabled user = config[str(ctx.author.id)] if user[0]: await", "try: if ctx.channel.id not in config['ignore']: config['ignore'].append(ctx.channel.id) await ctx.send(f\"Added {ctx.channel.name} to list of", "self.bot.db['ultraHardcore']['users'][str(ctx.author.id)][0]: aw...
[ "input program.parseInput(key) program.render() curses.doupdate() if __name__ == \"__main__\": background = \"2a2a2a\" text =", "bounds) def main(stdscr): # Setup parser = argparse.ArgumentParser(description='Nearly Headless BinaryNinja.') parser.add_argument('filename', nargs='?', default=\"\")", "= \"\" # Cle...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "is None: data_format = backend.image_data_format() if strides is None: strides = pool_size self.pool_function", "(1,) + self.pool_size + (1,) st...
[ "subprocess as sp # Crop and resize video clip = mpy.VideoFileClip(\"smoke.mp4\") (w, h)", "mpy.VideoFileClip(\"smoke.mp4\") (w, h) = clip.size cropped_clip = vfx.crop(clip, width=(h/128)*64, height=h, x1=w/4*3-100, y1=0).resize((64, 128))", "video clip = mpy.VideoFileClip(\"smoke.mp4\") (w, h) = clip.size crop...
[ "Rolodex application.\"\"\" # Django Imports from django.apps import AppConfig class RolodexConfig(AppConfig): name =", "\"\"\"This contains the configuration of the Rolodex application.\"\"\" # Django Imports from django.apps", "configuration of the Rolodex application.\"\"\" # Django Imports from django.apps ...
[ "django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('boards', '0023_alter_image_type'), ]", "14:42 from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): d...
[ "''' #get rid of the optimizer state ... import torch MODEL_PATH = '/models/model-b2-2.pth'", "the optimizer state ... import torch MODEL_PATH = '/models/model-b2-2.pth' state = torch.load(MODEL_PATH, map_location=lambda", "'/models/model-b2-2.pth' state = torch.load(MODEL_PATH, map_location=lambda storage, loc...
[ "long_description=read('README.md'), license=\"MIT\", keywords=\"git jira release\", url=\"https://www.talentsconnect.com\", include_package_data=True, install_requires=['requests', 'colorama'], entry_points={ 'console_scripts': [\"braumeister =", "bulding, combining JIRA and git\", long_description=read('README....
[ "model_image = model_image.cpu().numpy() warped_model_image = warped_model_image.cpu().numpy() random_product_image = random_product_image.cpu().numpy() random_product_image_warped = random_product_image_warped.cpu().numpy() output_on_random_product", "# inverse normalization of the images along with channel firs...
[ "self.target_transform is not None: target = self.target_transform(target) return img, target, domain_label def __len__(self):", "idxs = np.arange(len(self.all_data)) np.random.shuffle(idxs) train_val_max = 2600 if num_examples > train_val_max: # to", "= self.domain_labels[index] # doing this so that it is cons...
[ "r in sub_result: res.append([new_nums[0]] + r.copy()) new_nums[i], new_nums[0] = new_nums[0], new_nums[i] return res", "range(0, len(new_nums)): if i + 1 < len(new_nums) and new_nums[i] == new_nums[i +", "< len(new_nums) and new_nums[i] == new_nums[i + 1]: continue new_nums[i], new_nums[0] = new_nums[0],", "...
[ "= count +1 conf=SparkConf() conf.setAppName(\"BigData\") sc=SparkContext(conf=conf) ssc=StreamingContext(sc,int(sys.argv[1])) ssc.checkpoint(\"/checkpoint_BIGDATA\") ''' #Selecting a window :", "SparkConf,SparkContext from pyspark.streaming import StreamingContext from pyspark.sql import Row,SQLContext import sy...
[ "'0002_video_text_image_file_content'), ] operations = [ migrations.AlterModelOptions( name='content', options={'ordering': ['order']}, ), migrations.AlterModelOptions( name='module', options={'ordering':", "name='order', field=courses.fields.OrderField(blank=True, default=0), preserve_default=False, ), migration...
[ "for i in range(len(string)): res = res * 10 + (ord(string[i]) - ord('0'))", "Iterate through all characters of # input and update result for i in", "= 0 # Iterate through all characters of # input and update result", "i in range(len(string)): res = res * 10 + (ord(string[i]) - ord('0')) return", "for ASCII...
[ "if the option doesn't exist. \"\"\" if self.config.has_option(section, option): return self.config.get(section, option) else:", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "the config file...
[ "name=None, ns=None ).typecode def __init__( self, name=None, ns=None, **kw ): getAppConfigRequest.__init__( self, name=None,", "response.__class__): raise TypeError(\"%s incorrect response type\" %(response.__class__)) return response def queryStatus(self, request): \"\"\"", "and\\ not issubclass(getAppMetadat...
[ "NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version", "KIND, either express or implied. # See the License for the specific language", "1 else: amax_id += 8 if verbose: print(\"done process layer_{} block_{} activation amax\".format(i,", "Unless required by applicable law o...
[ "= ThreadPool(1) self._pod_to_ep = None def __reduce__(self): return type(self), (self._k8s_config, self._k8s_namespace, self._label_selector) def", "KIND, either express or implied. # See the License for the specific language", "FunctionActor logger = logging.getLogger(__name__) class K8SPodsIPWatcher(object):...
[ "import BertModel class TestBertModel(TestCase): def test_forward(self): # Bert Config vocab_size = 10 sequence_len", "size=(batch, sequence_len)) config= transformers.BertConfig(vocab_size=vocab_size,hidden_size=10, num_hidden_layers=1, num_attention_heads=1,num_labels=num_classes) sut = BertModel(None, None, be...
[ "test_render_dummy_dungeon(self): inpath = os.path.abspath(os.path.dirname(__file__)) inpath = os.path.join(inpath, \"fixtures/dummy_dungeon.json\") with open(inpath, \"r\") as f:", "os.path.join(inpath, \"fixtures/dummy_dungeon.json\") with open(inpath, \"r\") as f: darr = json.load(f)[\"dungeon\"] n_rows = len(...
[ ".consts import API_URL from .utils.credentials import get_env_credential LOG = logging.getLogger(__name__) def validate_gate(): \"\"\"Check", "def validate_gate(): \"\"\"Check Gate connection.\"\"\" try: credentials = get_env_credential() LOG.debug('Found credentials: %s', credentials)", "LOG.info('Gate workin...
[ "operations = [ migrations.CreateModel( name='Form', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('form_id', models.IntegerField()),", "('regex', models.TextField()), ], options={ 'db_table': 'validators', }, ), migrations.AlterUniqueTogether( name='...
[ "INDEX IF NOT EXISTS [website_idx_siteName] ON [website]([siteName]); ''') print 'create website index' self.conn.commit()", "import sys class Sqli(object): conn = '' cursor = '' def __init__(self, dbname):", "show(self): r = self.cursor.fetchall() return r def showone(self): return self.cursor.fetchone() def _...
[ "import torch.nn as nn from FocalLoss import FocalLoss def center_loss(pred,label,num_calss,feature): loss = Centerloss(num_calss,feature)", "\"\"\" easy way to use losses \"\"\" from center_loss import Centerloss import torch.nn", "easy way to use losses \"\"\" from center_loss import Centerloss import torch.n...
[ "real_request = requests.request def fake_request(obj, url, method, **kwargs): if url.startswith('http://127.0.0.1:123'): return fake_result({'a': 1,", "Unless required by applicable law or agreed to in writing, software # distributed", "try # and ensure we're passing _some_ data through to the external REST", ...
[ "token.startswith(\"##\"): labeling_list[idx] = \"[##WordPiece]\" if not tokener_error_flag: self.token_label_and_one_prdicate_out_f.write(\" \".join(labeling_list)+\"\\t\"+predicate+\"\\n\") self.text_f.write(text + \"\\n\") self.token_in_f.write(\"", "sys.path.append(os.path.abspath(os.path.join(os.path.dirname...
[ "Specification. However, by default, empty objects {} get converted to null. We overwrite", "== descriptor.FieldDescriptor.CPPTYPE_MESSAGE) or field.containing_oneof): continue if self.preserving_proto_field_name: name = field.name else: name =", "including_default_value_fields=False, preserving_proto_field_nam...
[]
[ "ret[nm] = val idx = idx + size print \"parsed\", ret return ret", "opid=0): self._isdetecting = flag self._detection[\"opid\"] = opid def startdetection(self, params, opid): if self._detection[\"opid\"]", "(mate.writeblk) print \"mate started\" time.sleep(10) req = Request(None) req.setcommand(\"1\", CmdCode.D...
[ "ignored: \", failedtests - ignoreFailures ) if not ignorefailure: print(\"There are faillures in", "0 ): faileds = getfailedcases() if exit_code != 0 : print(\"exit code:\", exit_code)", "if(exit_code != 0 ): faileds = getfailedcases() if exit_code != 0 : print(\"exit", "= testConfigure[group_name] testlist ...