ngram
listlengths
0
67.8k
[ "fact here only does -GT[tgt]*Pred[tgt] Loss[tgt] = torch.mean( -torch.sum(GT[tgt]*Pred[tgt], dim=1)) return Loss class", "edict() Errs = edict() for tgt in tgts: cos_sim = self.cos_sim(Pred[tgt][mask], GT[tgt][mask]) Loss[tgt]", "nn.CosineSimilarity(dim=1).cuda() def compute_loss(self, tgts, Pred, GT): \"\"\" ...
[ "2.)**2)) @registry.register def sphere4(x: np.ndarray) -> float: \"\"\"Even more translated sphere function.\"\"\" return", "i in range(problemDimensions): firstSum += (x[i]-mu1)**2 secondSum += (x[i]-mu2)**2 thirdSum += 1.0 -", "1, and returns len(x) - number of ones.. It also works in the", "with 4 thresho...
[]
[ "check_if_verify(): \"\"\" This function checks if the account has been flagged for manual", "= randint(1, 5) print( \"Sleeping for \" + str(randinteger) + \" seconds due", "if the bot needs to input the shipping information if the user has", "Select from selenium.common.exceptions import NoSuchElementExcepti...
[ "TummyTime) class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id', 'username') class", "= ChildSerializer() class Meta: model = DiaperChange fields = ('child', 'time', 'wet', 'solid',", "Meta: model = User fields = ('id', 'username') class ChildSerializer(serializers.Hyperli...
[ "Quantity, Recipe from .lists import UserList, UserListRecipe from .users import UserIngredient, Profile from", ".lists import UserList, UserListRecipe from .users import UserIngredient, Profile from .comments import Comment", "<filename>api/drinks/models/__init__.py from .activities import Activity from .books...
[ "logger.Logger(execution_id=execution_id, executed_by=executed_by, project_id=project_id, databasename=params['database_logs']['training_logs']['database_name'], collection_name=collection_name, is_log_enabled=is_log_enabled) return logger_obj def get_log_object_for_prediction(collection_name: str, execution_id :",...
[ "overhead in the \"bridge\" protocol used by pyjulia. The idea of using naively", "current index, at time t and after :math:`N_k(t)` pulls of arm k: ..", "there is a lot of overhead in the \"bridge\" protocol used by pyjulia.", "e: print(\"Error: unable to load the 'julia' Python module. Install with 'pip ins...
[ "of correlated events required to allow a particular event through the filter 'max_cluster_size':", "\"\"\"Test of pmd_consumer functionality, with a selection of data.\"\"\" from os.path import join,", "from async_cv.play_file import play_file from async_cv.event_processing.pmd_consumer import pmd_consumer dat...
[ "= \"http://api.sowemail.com:9000\" api_key = os.environ.get('SOWEMAIL_API_KEY') request_headers = { \"Authorization\": 'Bearer {}'.format(api_key) } version", "from SoWeMail\", \"content\": [ { \"type\": \"text/plain\", \"value\": \"Simple email sending example using", "{ \"Authorization\": 'Bearer {}'.format(...
[ "in group['params']: state = optimizer.state[p] if('step' in state and state['step']>=1024): state['step'] = 1000", "np.mean(test_accu) print(accuracy_test) # # In[51]: # #Calculate accuracy of trained model on the", "construct CIFAR-10 dataset. test_dataset = torchvision.datasets.CIFAR10(root='./data/', train=...
[ "if 'payer_bank_branch_name' in d: o.payer_bank_branch_name = d['payer_bank_branch_name'] if 'payer_inst_id' in d: o.payer_inst_id =", "business_scene(self): return self._business_scene @business_scene.setter def business_scene(self, value): self._business_scene = value @property def channel(self):", "if hasatt...
[ "import front.models class Migration(migrations.Migration): dependencies = [ ('front', '0002_images_filename'), ] operations = [", "Generated by Django 2.1.4 on 2019-03-18 22:00 from django.db import migrations, models import", "2019-03-18 22:00 from django.db import migrations, models import front.models class...
[ "loss's scalar and histogram summary :type var: tensorflow.Variable :param var: variable to summary", "mean_summary(var): \"\"\"mean scalar summary :type var: tensorflow.Variable :param var: variable to add summary", "tf.summary.histogram('histogram', var) def max_summary(var): \"\"\"max scalar summary :type va...
[ "datetime armstrong = datetime(1969, 7, 21, 14, 56, 15) armstrong.date() # datetime.date(1969, 7,", "14, 56, 15) armstrong.date() # datetime.date(1969, 7, 21) armstrong.time() # datetime.time(14, 56, 15)", "armstrong.time() # datetime.time(14, 56, 15) armstrong.weekday() # 0 # in US week starts", "56, 15) arm...
[ "import csv def readfile(filepath, fmt='csv'): with open(filepath, 'r') as f: data = csv.reader(f,", "# -*- coding: utf-8 -*- \"\"\"Read polarity. \"\"\" import csv def readfile(filepath, fmt='csv'):", "coding: utf-8 -*- \"\"\"Read polarity. \"\"\" import csv def readfile(filepath, fmt='csv'): with open(filepat...
[ "Jedi, Tests, Questions # Register your models here. admin.site.register(Planet) admin.site.register(Jedi) class TestsInline(admin.StackedInline): model", "admin.site.register(Jedi) class TestsInline(admin.StackedInline): model = Questions extra = 0 @admin.register(Tests) class QuestionsAdmin(admin.ModelAdmin): i...
[ "Solution(object): def nthSuperUglyNumber(self, n, primes): \"\"\" :type n: int :type primes: List[int] :rtype:", "List[int] :rtype: int \"\"\" res = [1] hashmap = {val:0 for val in", "[float('inf')] * len(primes) while len(res) < n: newm = [res[hashmap[p]] * p for", ":type primes: List[int] :rtype: int \"\"\...
[ "- start_time # timeit statement print('Execution time: {0:.4f} sec'.format(elapsed)) # %% plotting section", "attribute why descriptions with why codes from funcWhyID import funcWhyID [df1, whyID, whyIDsum]", "header=0) >>>>>>> Alex1 # filter dataframe zero (raw NHTS2009) to columns listed in", "as pd import...
[ "log: If True, will log the API JSON response. This is optional as", "NotImplementedError(\"Tick range not supported by the Bittrex API.\") async def get_last_values(self, pair: str)", "False elif isinstance(ex, (SyntaxError, NameError)): reason = \"{}: {}\\n{}\".format(type(ex).__name__, ex, ''.join(traceback....
[ "API \"\"\" if not is_team_guid(guid): raise InvalidGuid(\"'{}' is not a valid team GUID.\".format(guid))", ":raise ApiCallFailed: something went wrong while calling API \"\"\" if not is_team_guid(guid): raise", "basketball team :rtype: [dict] :return: a list of dictionaries containing information about team's"...
[]
[ "'src2', 'target': 'targ2'}, ] return render_template('project.html', segments=segments) @app.route('/import/<project_id>') @app.route('/import/<project_id>/<lang>') def import_segments(project_id, lang=None): segments", "{'id': 'first', 'name': 'first project'} ] return render_template('dashboard.html', session=...
[ "db.execute(\"select id, owner, editor, title from posts\") as cursor: async for row in", "web router = web.RouteTableDef() async def fetch_post(db: aiosqlite.Connection, post_id: int) -> Dict[str, Any]:", "title=?, text=? where id =?\", [post[\"title\"], post[\"text\"], post_id], ) await db.commit() raise web....
[ "string: the string representation of the point. ''' def __str__(self): return \"point: \"", "of the pheromones of the list of points. Return: - float: the total", "of points. Return: - list: the the list of points. ''' def get_list_points(self):", "def get_point(self): return self.point ''' Method to get the...
[ "= 0 while True: if self._devid not in TAPDevice._allocated_device_ids: break else: self._devid +=", "#!/usr/bin/env python3 import subprocess from threading import RLock class TAPDevice(object): \"\"\" This class", "TAPDevice(object): \"\"\" This class issues iproute2 commands to add and remove tap devices", ...
[ "True def to_numpy(*tensors: T) -> ARRAYS: params = [param.detach().cpu().numpy() if type(param) is T", "for param in tensors] return params def create_mapper(mask: T) -> T: mapper =", "[1, 2, 3], [4, 5, 6], [5, 7, 6], [0, 1, 5], [0,", "vs alpha = compute_face_areas(triangles)[0] / areas triangles[:, ind] = r...
[ "views as filebrowser_views urlpatterns = [ url(r'^$', filebrowser_views.index, name='filebrowser'), url(r'^api/$', filebrowser_views.api_single_pandaid, name='filebrowser-api-single-pandaid'), url(r'^delete/$',", "static from django.contrib import admin ### #FIXME admin.autodiscover() import views as filebrowser...
[ "sampling (True) or minibatch weighted sampling (False) kwargs: Additional arguments for `BaseLoss`, e.g.", "loss. Bernoulli corresponds to a binary cross entropy (bse), Gaussian corresponds to MSE,", "Shape : (batch_size, n_chan, height, width). latent_dist : tuple of torch.tensor sufficient statistics", "we...
[ "django.test import TestCase from django.urls import reverse from model_mommy import mommy from monitor.models", "path = ( 'monitor.api.serializers.twitter_user_serializers.' 'retrieve_tweets.delay' ) with mock.patch(path, mock.Mock()) as retrieve_tweets: response =", "self.assertEqual(TwitterUser.objects.count...
[ "miss pressure.\") # .format(sid, year)) # statistics temperature valid_temperature = recs.query(\"60 > AVG_TEMP", "__name__ == \"__main__\": # testing code # import sys # print(sys.argv) tool =", "mon_rec = self.calcYear(sid, year, recs) result.append(mon_rec) header = (\"{:>8}{:>6}{:>10}{:>10}{:>10}{:>10}\" \...
[ "import LinearLocator, FormatStrFormatter from UQpy.surrogates import * from UQpy.distributions import Uniform, JointIndependent #", "set of 2D data. .. math:: f(x) = x_1^2 + x_2^2 **Description:** Dimensions:", "import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm f...
[ "if lista[i] >= tempmax: temp = lista[i] -tempmax +1 count += temp lista[i]", "i in range(n): lista.append(int(input())) tempmax = lista[-1] count = 0 for i in", "count = 0 for i in range(n-2,-1,-1): if lista[i] >= tempmax: temp =", "in range(n): lista.append(int(input())) tempmax = lista[-1] count = 0 for i ...
[ "q q = q + h * p vp.append(p) vq.append(q) plt.plot(vq, vp) plt.savefig(\"sym1.png\")", "1.0 p = 0.0 for i in range(1000): p = p - h", "in range(1000): p = p - h * q q = q +", "= 0.0 for i in range(1000): p = p - h * q", "for i in range(1000): p = p - h * q q =", "= 1.0 p = 0.0 for i in range(1000): p = p...
[ "distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", "window[wlen] * data[batch, col * hop_length + wlen] * tir.cos(2 * pi *", "Fourier transform of short overlapping windows of the input. This gives frequency components", "window = [4, 3, 2] [n_fft, hop_length, win_length, normaliz...
[ "from spyder import Spyder from Kite import config import tushare as ts ts.set_token(config.TUSHARE_TOKEN)", "self.db_obj.create_col(self.db, config.COLLECTION_NAME_STOCK_BASIC_INFO) def get_stock_code_info(self): stock_info_a_code_name_df = ak.stock_info_a_code_name() for _id in range(stock_info_a_code_name_df.s...
[ "27), name_func=boundaries.dashed_attr('WARD_EN'), id_func=boundaries.attr('WARD_NUM'), authority='City of Ottawa', source_url='http://ottawa.ca/online_services/opendata/info/wards2010_en.html', licence_url='http://ottawa.ca/online_services/opendata/terms_en.html', data_url='http://ottawa.ca/online_services/opendat...
[ "- [Industrial exhibits.]\"), (False, 'Fifth Avenue - 90th Street, southeast corner'), (False, 'Recreation", "- Miscellaneous - Children.'), (True, 'Manhattan: 59th Street - 6th Avenue'), (True, 'Queens:", "(West) - 5th Avenue'), (True, 'Manhattan: 5th Avenue - 78th Street'), (True, 'Manhattan:", "Sailboat Po...
[ "Author: Darren Date: 26/02/2021 Solving https://adventofcode.com/2015/day/16 500 Sues. Each with different known attributes,", "as a dict. We also have a list of k:v attributes that we", "1 sue_candidates = sue_list.copy() # we need to find any Sue where k:v", "for known_attrib, known_attrib_value in known_a...
[ "your items that you would like to purchase here, hit 0 when you're", "#This while loop represents the scanning input, the cashier will continue to scan", "the total bill, the receipt of the total bill is displayed and the", "that has been scanned based on the UPC of the item that has", "elif item_scanned =...
[ "self.weights = np.random.normal(0, 0.1, no_of_inputs + 1) self.datapoints = datapoints self.plotResult = list()", "+= 1 for inputs, label in zip(training_inputs, labels): prediction = self.predict(inputs) error_rate =", "/ float(len(training_inputs)) * 100.0 return _acc def plot(self): total_data = len(self.da...
[ "self.bot = bot @commands.Cog.listener() async def on_ready(self): print('Logged in as') print(self.bot.user.name) print(self.bot.user.id) print('------')", "__init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print('Logged in as') print(self.bot.user.name)", "import commands ...
[ "<reponame>itdagene-ntnu/itdagene from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies", "django.db import migrations, models class Migration(migrations.Migration): dependencies = [(\"company\", \"0016_auto_20160315_1950\")] operation...
[ "2: parser.error( \"Error: --slowbound should contain 2 \" + \"comma-separated floats\") if args.bazbound", "2.0, -1.0] else: args.weights = [float(val) for val in args.weights.split(',')] if (len(args.weights)) !=", "= UTCDateTime(year+'-'+month+'-'+day) if dateUTC > tstart and dateUTC < tend: # Load meta", ...
[ "= [SIZE] # SIZE == 40 [SIZE] self.y = [SIZE] self.dead = False", "class Apple: def __init__(self, parent_screen): self.image = pygame.image.load(\"resources/The_apple_everyone_want.jpg\").convert() self.parent_screen = parent_screen self.x =", "class Snake: def __init__(self, parent_screen): self.parent_screen...
[ "i, col in enumerate(columns): cdx = (np.max(df[col]) - np.min(df[col]))/(n[i] - 1) cube_df[col] =", "np.sort(n_in)[-cut_idx] mask = (n_in >= thresh) centers['weights'] = n_in/np.sum(n_in[mask]) centers = centers[mask] centers", "re import latbin def lineify(df, n, column): return cubeify(df, [n], [column]) def...
[ "models.constants import RAY from experiments.system_model_v3.configure import configure_experiment from experiments.system_model_v3.run import run_experiment from experiments.utils", "- 1 MONTE_CARLO_RUNS = 1 sweeps = { 'controller_enabled': [True,False], } # Configure", "merge_parameter_sweep from radcad.core...
[ "+= 1 if pointA[1] < pointB[1] else -1 # 0 = x, 1", "in ascending order pointA, pointB = pointB, pointA for i in range(pointA[1], pointB[1]", "# 0 = x, 1 = y grid[target[1]][target[0]] += 1 while target[0] !=", "in range(GRID_SIZE)] for j in range (GRID_SIZE)] for row in data: pointA, pointB", "1 if pointA[...
[ "get_ansible from get_helm import get_helm from get_skaffold import get_skaffold from get_docker import get_docker", "from c_registry import c_registry if __name__ == '__main__': edit_hosts() get_docker() # c_registry() #", "get_helm from get_skaffold import get_skaffold from get_docker import get_docker from g...
[ "Counter @pytest.fixture def weight_names(): return [ \"EventWeight\", # \"MuonWeight\", \"ElectronWeight\", \"JetWeight\", ] @pytest.fixture", "\"JetWeight\", ] @pytest.fixture def counter(weight_names): return Counter(weight_names) def test_init(weight_names, full_wrapped_tree): c = Counter(weight_names)", "a...
[]
[ "sys from flask import Flask, jsonify from flask_cors import CORS from flask_migrate import", "environmenet variables from the passed in configuration file from the instance folder if", "'tests': {'route': tests_controller.testsControllerBlueprint, 'url_prefix': '/tests/'}, } for route in routes: blueprint = ro...
[ "= fiducial.get('Omega_m', None) self._Omega_de = fiducial.get('Omega_de', None) if not config.getboolean('old_growth_func', False): self.xi_growth =", "# Initialize the broadband and check # if we need to add or", "self._tracer2['type'] # Get rescaled Xi coordinates delta_rp = params.get(self._delta_rp_name, 0...
[ "forked.kill('USR2') for i in xrange(10): if forked.poll() is None: time.sleep(1) else: break TS_ASSERT_EQUALS(forked.poll(),", "TS_ASSERT(forked.poll() is None) forked.kill('USR2') for i in xrange(10): if forked.poll() is None: time.sleep(1)", "\"from example_seeds import addition\\nresult = addition.addition(...
[ "self.get(route=route) or {} def get_permissions_all(self): \"\"\" Provide permission information for the current user.", "params[\"startat\"] = startat if(maxResults): params[\"maxResults\"] = maxResults route = f\"rest/api/2/issue/{issueIdOrKey}/changelog\" return self.get(route=route,params=params) or", "= f...
[ "msg): if self.cli: self.logger.warn(msg) else: wx.LogWarning(msg) log = None # type: Logger or", "= hasattr(self, \"show_toolbar_button\") self.show_toolbar_button = True icon_dir = os.path.dirname(os.path.dirname(__file__)) self.icon_file_name = os.path.join(icon_dir, 'icon.png')", "= logging.StreamHandler(sy...
[ "import GuidedBraTSDataset3D # from loss.FALoss3D import FALoss3D import cv2 from loss.TaskFusionLoss import TaskFusionLoss", "of the lossfunc') parser.add_argument('-load_pretrained',type=str,default='',help='load a pretrained model') parser.add_argument('-v', help=\"increase output verbosity\", action=\"store_t...
[ "module contains the class definition for the problem's operating point. problems.py: This module", "that relate to geometry, and the class definitions for different types of geometries.", "stored in DAT files. This package contains the following modules: __init__.py: This module", "folder contains a collecti...
[ "updated_date__year=value.year, updated_date__month=value.month, updated_date__day=value.day, ) class TaskFilter(FilterSet): status = ChoiceFilter(method='completed_custom_filter', choices=STATUS_CHOICES_CUSTOM) class Meta: model", "['status'] def completed_custom_filter(self, queryset, name, value): if value == ...
[ "becomes: ember generate route foobar --pod ''' command = ['ember', cmd_name] + list(args)", "path to the project's Ember app.''' return abspath(join( settings.BASE_DIR, cls.get_setting('EMBER_APP_PATH'))) def notify(self, some_text):", "no setting available.''' return settings.EMBER_TOOLKIT.get(key, DEFAULT_SE...
[ "FieldPanel, StreamFieldPanel from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.core.models import Page from wagtail.api import", "banner image\", ) content = StreamField([ ('ContentBlock', ContentBlock()), ('ImageGalleryBlock', ImageGalleryBlock()), ('CallToActionBlock', CallToActionBlock()...
[ "= None operation = None def __init__(self, num1=None, num2=None, op=None): self.operand1 = float(num1)", "self.local_server.register_instance(class_instance) def register_function(self, function): self.local_server.register_function(function) def run(self): self.local_server.serve_forever() class ClientThread(th...
[ "file.write('#!/usr/bin/perl\\n') file.close() self.assertTrue(sourcehandler.is_wanted_file(self.tmpdir, testfilename)) # Test invalid shebang file = open(os.path.join(self.tmpdir, testfilename), \"w\")", "function.\"\"\" # Test we get False if target is not in the given", "file is in the list, get a list with ...
[ "| PRODUCER | [int][] | *(==)* | Find releases linked to the given", "number. | | LANGUAGES | [str][] | *SOME* | Filter using the language,", "_ConditionProxy( \"date\", operator=Operator.fill_some() ) RELEASED_DATE: t.Final[_ConditionProxy] = _ConditionProxy( \"date\", operator=Operator.fill_all() ) PATCH: t.F...
[ "block of encoded numbers | **Pre:** | len(plain) == 256 | **Post:** |", "encoded number | **Pre:** | plain >= 0 | plain < 256 |", "decoded[i] = decoded[i] ^ self.sBoxes[round].encodeMap[i] ^ seedAtI return decoded def encode(self, plain: bytearray)", "decoded = self.pBox.decode(encoded, pSeed) for i in range...
[ "import apis into api package from admin_api.api.auto_generate_app_token_api import AutoGenerateAppTokenApi from admin_api.api.card_api import CardApi", "into api package from admin_api.api.auto_generate_app_token_api import AutoGenerateAppTokenApi from admin_api.api.card_api import CardApi from admin_api.api.cli...
[ "problems.vrp.problem_vrp import CVRP, SDVRP from problems.op.problem_op import OP from problems.pctsp.problem_pctsp import PCTSPDet, PCTSPStoch", "from problems.tsp.problem_tsp import TSP, TSPEdge from problems.vrp.problem_vrp import CVRP, SDVRP from problems.op.problem_op import", "TSP, TSPEdge from problems....
[ "noqa from .cache import Cache # noqa from .benchmark import Benchmark # noqa", "Cache # noqa from .benchmark import Benchmark # noqa # from .experiments import", "import * # noqa from .cache import Cache # noqa from .benchmark import", "from .cache import Cache # noqa from .benchmark import Benchmark # noqa ...
[ "+= 1 print(arr) if __name__ == \"__main__\": arr = [-1, 2, -3, 4,", "n): j = 0 for i in range(0, n): if (arr[i] < 0):", "arr[i], arr[j] = arr[j], arr[i] j += 1 print(arr) if __name__ == \"__main__\":", "j = 0 for i in range(0, n): if (arr[i] < 0): arr[i],", "2, -3, 4, 5, 6, -7, 8, 9] n = len(arr) rearrange...
[]
[ "elif token in OPERATORS: node[\"val\"] = token node[\"right\"] = {} stack.append(node) node =", "in OPERATORS: node[\"val\"] = token node[\"right\"] = {} stack.append(node) node = node[\"right\"] else:", "node[\"val\"] = int(token) parent = stack.pop() node = parent return tree def evaluate(tree):", "operato...
[ "E , F, G , N 6 cols with float or int 9", "train_data.E.value_counts() #print train_data.corr() le=LabelEncoder() train_data.E = le.fit_transform(train_data.E) print train_data.F.value_counts() print test_data.F.value_counts() # print", "pd.read_csv(\"../data/test.csv\") #print train_data.info() ''' 15 cols : ...
[ "with click.progressbar(keys) as bar: for key in bar: c = 0 for token", "import Pool from shelve import DbfilenameShelf from tokenizer import RegexpTokenizer class AbstractDB(DbfilenameShelf): def", "import defaultdict from contextlib import closing from functools import partial from multiprocessing.pool import...
[ "import render_template def index(): return render_template('index.html') def documentation(): return render_template('documentation.html') def api_landing(): return", "render_template def index(): return render_template('index.html') def documentation(): return render_template('documentation.html') def api_landi...
[ "and profile pic path to users table Revision ID: 0<PASSWORD> Revises: <PASSWORD> Create", "please adjust! ### op.drop_column('users', 'profile_pic_path') op.drop_column('users', 'biodata') # ### end Alembic commands ###", "op.add_column('users', sa.Column('biodata', sa.String(length=255), nullable=True)) op.ad...
[ "setuptools import setup setup( name=\"psycopg2_error_handler\", install_requires=[ \"psycopg-binary >= 3.0\", ], packages=[\"psycopg2_error\"], version='0.0.4', description='Psycopg2", "name=\"psycopg2_error_handler\", install_requires=[ \"psycopg-binary >= 3.0\", ], packages=[\"psycopg2_error\"], version='0.0.4...
[ "models from .validators import validate_file_extension # Create your models here. class NormalProject(models.Model): name", "DocumentNormalMetadataRelation(models.Model): metadata = models.ForeignKey(NormalMetadata, related_name='metadata', on_delete=models.CASCADE) document = models.ForeignKey(Document, related...
[ "st_c = ed_c loss = torch.stack(loss, dim=1) return (loss * m).sum() / data.size()[0]", "0 self.p = np.zeros((counter, maximum_interval(output_info))) self.p_sampling = [] for item in output_info: if", "loss_mean + loss_std loss_info.backward() optimizerG.step() if problem_type: fake = self.generator(noisez) fa...
[ "\"{0:b}\".format(n) zeros = bin.count(\"0\") return pow(2, zeros) if __name__ == \"__main__\": assert sum_xor(5)", "a 1, and an addition would return a 1 as well. For example:", "x = n ^ x Solve: We count the number of zeros that", "which is binary \"1010\", if you add or XOR 1, you would end", "because fo...
[ "import path, include from backend.api.views import bulkUploadFromFile urlpatterns = [ path('bulk_upload/', bulkUploadFromFile) ]", "from django.urls import path, include from backend.api.views import bulkUploadFromFile urlpatterns = [ path('bulk_upload/',", "django.urls import path, include from backend.api.vi...
[ "doesn't it is an ad so we skip it) if entry.find(\"a\", class_=\"comments\") is", "return None def job_logic(): headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux i686; rv:81.0) Gecko/20100101", "gamayun.gamayun_utils import report_error from gamayun.gamayun_utils import run_gamayun_script_logic def parse_singl...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "8667 2108\", \"correo_electronico\": \"<EMAIL>\", \"fax\": \"+506 7242 2789\", \"web\": \"candy.org\", }, follow_redirects=True, )", "b\"dulce\"...
[ "0.5 * dims, delta - dims, delta) return np.sqrt((delta**2).sum(axis=-1)) orbits = np.array([ 1,", "6, 7, 4, 6, 6, 6, 5, 6, 7, 7, 5, 7, 6,", "2, 3, 4, 3, 3, 4, 3, 4, 4, 4, 4, 3, 4,", "2, 2, 2, 3, 4, 3, 3, 4, 3, 4, 4, 4, 4,", "4, 4, 4, 5, 7, 4, 6, 6, 7, 4, 6, 6, 6,", "5, 5, 6, 8, 7, 6, 6, 8, 6, 9, 5, 6, 4,...
[ "[ tvh_genres['NEWS'] ], \"Comedy\": [ tvh_genres['COMEDY'] ], \"Documentary\": [ tvh_genres['DOCUMENTARY'] ], \"Drama\": [", "tvh_genres['DOCUMENTARY'] ], \"Drama\": [ tvh_genres['MOVIE'] ], \"Educational\": [ tvh_genres['EDUCATIONAL'] ], \"Events & Specials\":", "copyright notice and this permission notice sh...
[ "= MyCompleter([file for file in os_test.listdir(f'/home/{getpass.getuser()}') if not file.startswith('.')]) readline.set_completer(completer.complete) readline.parse_and_bind('tab: complete') input(\"Input:", "class MyCompleter: def __init__(self, options): self.options = sorted(options) def complete(self, text,...
[ "столкновения из треугольников. for poly in triangles: for index in poly.vertices: vertext_quad.append(Point3(*obj.data.vertices[index].co)) quad", "показывать полигон столкновения. if obj.hatcher.visibility_collision_polygons: node_path.show() return group.node().getChild(0) def geom_node_create(obj, scene): geo...
[ "from .blueprint import form from .shared.render import render_template_with_title from .shared.routing import route_to_next_form_page from", "ApplyingOnOwnBehalfAnswers.NO.value: prev_path = \"/applying-on-own-behalf\" else: raise ValueError(\"Unexpected ApplyingOnOwnBehalfAnswers value encountered: \" + applyin...
[ ".scnet_bbox_head import SCNetBBoxHead from .rotated import (BBoxHeadRbbox, Shared2FCBBoxHeadRbbox, Shared4Conv1FCBBoxHeadRbbox, ConvFCBBoxHeadRbbox, MHBBoxHeadRbbox) __all__ =", "DoubleConvFCBBoxHead from .sabl_head import SABLHead from .scnet_bbox_head import SCNetBBoxHead from .rotated import (BBoxHeadRbbox,",...
[ "else: return current_data def is_data_needed(st, data): if not data: return True now =", "{j['used_azimuth']:.1f}\" }) traces.append({ 'x': d.index, 'y': d['tangential'], 'name': f\"tangential {j['tangential_azimuth']:.1f}\" }) return {", "= sorted(p, key=itemgetter('date'), reverse=True) link = 'https://hvoin...
[ "label2id = json.loads(open(\"./label2id.json\").read()) id2label = [k for k, v in label2id.items()] def process_one_example_p(tokenizer,", "(input_ids, input_mask, segment_ids) return feature def load_model(model_folder): # We retrieve our checkpoint fullpath", "restore the graph weights sess_ = tf.Session() s...
[ "with --files.\"\"\" # Parser error when both --files and --files-from are specified. self.CheckParserError(['--files',", "# Parser error if results destination dir is a file. filename = '/tmp/dest_dir_file'", "os.path.join(cwd, '.ssh/testing_rsa') self._tester._RunAutotest() self.assertCommandCalled( ['test_th...
[ "pred, args): mask = (GT < args.maxdisp) & (GT >= 0) # print(mask.size(),", "if count == 0: count = 1 return torch.sum(torch.sqrt(torch.pow(GT[mask] - pred[mask], 2) +", "count == 0: count = 1 return torch.sum(torch.sqrt(torch.pow(GT[mask] - pred[mask], 2) + 4)", "= 1 return torch.sum(torch.sqrt(torch.pow(GT[...
[ "import inspect import os def get_datasets_folder(): return os.path.join(get_data_folder(), \"Datasets\") def get_data_folder(): return os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))" ]
[ "@Comment: # ====================================================== import torch def default_collate(batch): elem = batch[0] elem_type = type(elem)", "<NAME> # @Email : # @File : collate.py # @Comment: # ====================================================== import", "# @Time : 20-12-26 下午4:42 # @Author : <NAME...
[ "a == b]) return 0 def solve(data): rows = data.splitlines() return _solve_1(rows), _solve_2(rows)", "in d]) def _solve_2(rows): for i, r in enumerate(rows): for r2 in rows[i:]:", "data.splitlines() return _solve_1(rows), _solve_2(rows) if __name__ == '__main__': from AOC2018 import run_solver run_solver(solve,...
[ "self.lock = lock or asyncio.Lock(loop=self.loop) self.last_request_time = 0 @property def state(self): return self.proto.state", "\"AioHTTPInstagramApi\", ) class AioHTTPInstagramApi: def __init__(self, username, password, state=None, delay=5, proxy=None, loop=None, lock=None):", "loop or asyncio.get_event_loo...
[ "str): context['error'] = error else: raise TypeError('Error message must be a string') return", "= error else: raise TypeError('Error message must be a string') return jinja2.Environment( loader=jinja2.FileSystemLoader(path)", "context={}, error=None, path='templates'): if error: # Error should be a string if ...
[ "from compas.data import Data class Curve(Data): \"\"\"Base class for all curves in this", "compas.data import Data class Curve(Data): \"\"\"Base class for all curves in this package.\"\"\"" ]
[ "= '' marker = '' if self.server.cog_states[i].get_state() == p2db_server.CogState.IDLE: fmt = Fore.GREEN elif", "ui_instance.update_log(r + \"\\n\", Fore.RED) def on_getreg(self, args): ui_instance = UI.instance if len(args) !=", "@ {:#02x} -> {:#02x}\".format(int(args[0], 16), r[1]) + \"\\n\") def on_cog(self...
[ "VidPerSubject = [9,13,7,5,19,5,9,3,13,13,10,12,8,4,3,4,34,3,15,11,2,2,12,7,7,16] IgnoredSamples=['sub09/EP13_02/','sub09/EP02_02f/','sub10/EP13_01/','sub17/EP15_01/', 'sub17/EP15_03/','sub19/EP19_04/','sub24/EP10_03/','sub24/EP07_01/', 'sub24/EP07_04f/','sub24/EP02_07/','sub26/EP15_01/'] listOfIgnoredSamples=[] fo...