text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|>#this returns a list of actions to convert the source into the target #it uses a buffer, stack, and output #the input is reversed, so call it on [0 1 2 3 4 5] to read the input from left to right def rearrange(source, tar): inp = source[:] target = tar[:] inp.reverse() stack = [] buf ...
code_fim
hard
{ "lang": "python", "repo": "jbuckman/lstm-parser-with-beam-search", "path": "/mtsystem/oracle/no_output/perm_re.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: jbuckman/lstm-parser-with-beam-search path: /mtsystem/oracle/no_output/perm_re.py ''' This can both find the list of actions (rearrange(source, target)) and apply a list of actions to an inpuit array (reorder(source, actions)) Run in python 2.7 ''' def peek(listt): temp = listt.pop() l...
code_fim
hard
{ "lang": "python", "repo": "jbuckman/lstm-parser-with-beam-search", "path": "/mtsystem/oracle/no_output/perm_re.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> inp.reverse() stack = [] buf = inp[:] out = [] seq = [] count = 0 #limit the number of iterations tried #not sure if this is a good idea, as it it isn't too nonlinear while(target != out): #print buf, stack, out #print seq #the current top of ...
code_fim
hard
{ "lang": "python", "repo": "jbuckman/lstm-parser-with-beam-search", "path": "/mtsystem/oracle/no_output/perm_re.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if not has_advanced_index: # step2. Parse values dtype = x.dtype attrs['dtype'] = dtype from .data_feeder import convert_dtype if isinstance(values, (bool, int, float, complex)): values = np.array([values]).astype(convert_dtype(dtype)) if ...
code_fim
hard
{ "lang": "python", "repo": "PaddlePaddle/Paddle", "path": "/python/paddle/fluid/variable_index.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: PaddlePaddle/Paddle path: /python/paddle/fluid/variable_index.py axes.append(dim) starts.append(start) ends.append(end) steps.append(step) dim += 1 if slice_info.indexes: if len(slice_info.indexes) != len(item): raise IndexError( ...
code_fim
hard
{ "lang": "python", "repo": "PaddlePaddle/Paddle", "path": "/python/paddle/fluid/variable_index.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if start is None and end is None and step is None: dim += 1 continue step = 1 if step is None else step if not isinstance(step, Variable) and step == 0: raise ValueError( "When assign a value to a pad...
code_fim
hard
{ "lang": "python", "repo": "PaddlePaddle/Paddle", "path": "/python/paddle/fluid/variable_index.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if normal_idx == 0: combined_samples = vcf_line_in.vcf_line.split('\t')[normal_column] + '\t' + new_tumor_field else: combined_samples = new_tumor_field line_out = '\t'.join(( vcf_line_in.chromosome, str(vcf_line_in.position), vcf_line_in.identifier...
code_fim
hard
{ "lang": "python", "repo": "bioinform/somaticseq", "path": "/somaticseq/utilities/reformat_VCF2SEQC2.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: bioinform/somaticseq path: /somaticseq/utilities/reformat_VCF2SEQC2.py #!/usr/bin/env python3 import sys, argparse, math, gzip, os, re import somaticseq.genomicFileHandler.genomic_file_handlers as genome parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) pa...
code_fim
hard
{ "lang": "python", "repo": "bioinform/somaticseq", "path": "/somaticseq/utilities/reformat_VCF2SEQC2.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: Tyler-Carter/100-Days-of-Code path: /Day 17 - The Quiz Project/main(example).py class User: def __init__(self, user_id, username): self.id = user_id self.username = username self.followers = 0 self.following = 0 <|fim_suffix|> user.followers += 1 ...
code_fim
easy
{ "lang": "python", "repo": "Tyler-Carter/100-Days-of-Code", "path": "/Day 17 - The Quiz Project/main(example).py", "mode": "psm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> user.followers += 1 self.following += 1 user_1 = User("001","angela") user_2 = User("002", "not_angela") user_1.follow(user_2) print(user_1.followers, user_1.following) print(user_2.followers, user_2.following)<|fim_prefix|># repo: Tyler-Carter/100-Days-of-Code path: /Day 17 - The Quiz ...
code_fim
medium
{ "lang": "python", "repo": "Tyler-Carter/100-Days-of-Code", "path": "/Day 17 - The Quiz Project/main(example).py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_prefix|># repo: Pratham82/Python-Programming path: /21. Unit testing/simple_script.py ''' A simple script for printing numbers ''' def func1(): <|fim_suffix|># When we run this program using pylint then we can get our code evaluted. # It will be used when we'll be working with big projects to generate reports #...
code_fim
medium
{ "lang": "python", "repo": "Pratham82/Python-Programming", "path": "/21. Unit testing/simple_script.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|># When we run this program using pylint then we can get our code evaluted. # It will be used when we'll be working with big projects to generate reports # For execution: pylint filename.py<|fim_prefix|># repo: Pratham82/Python-Programming path: /21. Unit testing/simple_script.py ''' A simple script for p...
code_fim
medium
{ "lang": "python", "repo": "Pratham82/Python-Programming", "path": "/21. Unit testing/simple_script.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ''' func1 is simple methdo which shows the number which are entered inside. ''' first_num = 1 second_num = 2 print(first_num) print(second_num) func1() # When we run this program using pylint then we can get our code evaluted. # It will be used when we'll be working with big...
code_fim
easy
{ "lang": "python", "repo": "Pratham82/Python-Programming", "path": "/21. Unit testing/simple_script.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: baduy9x/AlgorithmPractice path: /maximum_subarray_sum.py #!/bin/python3 import math import os import random import re import sys from sortedcollections import SortedSet def binary_search(sorted_set, value): if sorted_set[-1] <= value: return -1 else: start = 0 e...
code_fim
medium
{ "lang": "python", "repo": "baduy9x/AlgorithmPractice", "path": "/maximum_subarray_sum.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> q = int(input()) for q_itr in range(q): nm = input().split() n = int(nm[0]) m = int(nm[1]) a = list(map(int, input().rstrip().split())) result = maximumSum(a, m) fptr.write(str(result) + '\n') fptr.close()<|fim_prefix|># repo: baduy9x/Algo...
code_fim
medium
{ "lang": "python", "repo": "baduy9x/AlgorithmPractice", "path": "/maximum_subarray_sum.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> m = int(nm[1]) a = list(map(int, input().rstrip().split())) result = maximumSum(a, m) fptr.write(str(result) + '\n') fptr.close()<|fim_prefix|># repo: baduy9x/AlgorithmPractice path: /maximum_subarray_sum.py #!/bin/python3 import math import os import random impor...
code_fim
hard
{ "lang": "python", "repo": "baduy9x/AlgorithmPractice", "path": "/maximum_subarray_sum.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>def __PackageSupportBuildPath__(package_path) -> None: ... gen_py: Incomplete<|fim_prefix|># repo: facebook/pyre-check path: /stubs/typeshed/typeshed/stubs/pywin32/win32com/__init__.pyi from _typeshed import Incomplete __gen_path__: str __build_path__: Incomplete <|fim_middle|>def SetupEnvironment() -...
code_fim
easy
{ "lang": "python", "repo": "facebook/pyre-check", "path": "/stubs/typeshed/typeshed/stubs/pywin32/win32com/__init__.pyi", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: facebook/pyre-check path: /stubs/typeshed/typeshed/stubs/pywin32/win32com/__init__.pyi from _typeshed import Incomplete <|fim_suffix|>def __PackageSupportBuildPath__(package_path) -> None: ... gen_py: Incomplete<|fim_middle|>__gen_path__: str __build_path__: Incomplete def SetupEnvironment() -...
code_fim
medium
{ "lang": "python", "repo": "facebook/pyre-check", "path": "/stubs/typeshed/typeshed/stubs/pywin32/win32com/__init__.pyi", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>#for i in range(min_key, max_key + 1): # ascending for i in range(max_key, min_key - 1, -1): # descending if cor.get(i): c = cor[i] else: c = 0 if incor.get(i): ic = incor[i] else: ic = 0 print (i, c, ic) ''' scor = sorted(cor) sincor = sorted(incor) fo...
code_fim
medium
{ "lang": "python", "repo": "langmead-lab/reference_flow-experiments", "path": "/scripts/process_strat_results.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: langmead-lab/reference_flow-experiments path: /scripts/process_strat_results.py cor = {42: 745621, 1: 27285, 40: 55352, 7: 2071, 30: 3386, 39: 12905, 22: 4525, 18: 1712, 6: 19175, 36: 3340, 17: 2066, 38: 6317, 24: 7403, 34: 2378, 27: 6012, 35: 3469, 31: 2753, 37: 6086, 25: 3308, 26: 7963, 12: 267...
code_fim
hard
{ "lang": "python", "repo": "langmead-lab/reference_flow-experiments", "path": "/scripts/process_strat_results.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: bitlucky/erpnext_custom path: /erpnext/hr/utils.py # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext from frappe import _ from frappe.utils import formatdat...
code_fim
hard
{ "lang": "python", "repo": "bitlucky/erpnext_custom", "path": "/erpnext/hr/utils.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def check_frequency_hit(from_date, to_date, frequency): '''Return True if current date matches frequency''' from_dt = get_datetime(from_date) to_dt = get_datetime(to_date) from dateutil import relativedelta rd = relativedelta.relativedelta(to_dt, from_dt) months = rd.months if frequency == "Quarter...
code_fim
hard
{ "lang": "python", "repo": "bitlucky/erpnext_custom", "path": "/erpnext/hr/utils.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def make_eval_transform(args: argparse.Namespace) -> torch.nn.Module: if args.eval_size is None: resize_size = args.crop_size else: resize_size = args.eval_size return StereoMatchingEvalPreset( mean=args.norm_mean, std=args.norm_std, use_grayscale=args...
code_fim
hard
{ "lang": "python", "repo": "pytorch/vision", "path": "/references/depth/stereo/parsing.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>def make_eval_transform(args: argparse.Namespace) -> torch.nn.Module: if args.eval_size is None: resize_size = args.crop_size else: resize_size = args.eval_size return StereoMatchingEvalPreset( mean=args.norm_mean, std=args.norm_std, use_grayscale=args....
code_fim
hard
{ "lang": "python", "repo": "pytorch/vision", "path": "/references/depth/stereo/parsing.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: pytorch/vision path: /references/depth/stereo/parsing.py import argparse from functools import partial import torch from presets import StereoMatchingEvalPreset, StereoMatchingTrainPreset from torchvision.datasets import ( CarlaStereo, CREStereo, ETH3DStereo, FallingThingsStereo...
code_fim
hard
{ "lang": "python", "repo": "pytorch/vision", "path": "/references/depth/stereo/parsing.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: GabrielePisciotta/europe-pubmed-central-dataset path: /config.py start_path = "/mie/temp_data_europepubmed-central-dataset" writing_multiple_csv = True skip_download = False download_workers = 20<|fim_suffix|>load = 1 max_retry = 20 sec_between_retry = 3 folder_articles = 50<|fim_middle|> unzip_t...
code_fim
medium
{ "lang": "python", "repo": "GabrielePisciotta/europe-pubmed-central-dataset", "path": "/config.py", "mode": "psm", "license": "ISC", "source": "the-stack-v2" }
<|fim_suffix|> unzip_threads = 1 process_article_threads = 100 max_file_to_download = 1 max_retry = 20 sec_between_retry = 3 folder_articles = 50<|fim_prefix|># repo: GabrielePisciotta/europe-pubmed-central-dataset path: /config.py start_path = "/mie/temp_data_europepubmed-central-dataset" writin<|fim_middle|>g_multip...
code_fim
medium
{ "lang": "python", "repo": "GabrielePisciotta/europe-pubmed-central-dataset", "path": "/config.py", "mode": "spm", "license": "ISC", "source": "the-stack-v2" }
<|fim_suffix|> value, = struct.unpack('>H', Opcodes.make_addr_regoff(Opcodes.REGINDEX_TH, -42, Opcodes.ADDR_VALTYPE_FLOAT)) self.assertEqual(value, (Opcodes.ADDR_TYPE_REGOFF << 14) | (Opcodes.REGINDEX_TH << 12)| (Opcodes.ADDR_VALTYPE_FLOAT << 11) | (1 << 10) | 42) def test_positive_int_str(self): ...
code_fim
hard
{ "lang": "python", "repo": "ca4ti/dsremap", "path": "/tests/test_opcodes_addr.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> value = Opcodes.make_addr_regoff(Opcodes.REGINDEX_TH, 42, Opcodes.ADDR_VALTYPE_INT) self.assertEqual(Opcodes.make_addr_str(value).str, '[%TH+42]i') def test_negative_int_str(self): value = Opcodes.make_addr_regoff(Opcodes.REGINDEX_TH, -42, Opcodes.ADDR_VALTYPE_INT) sel...
code_fim
hard
{ "lang": "python", "repo": "ca4ti/dsremap", "path": "/tests/test_opcodes_addr.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ca4ti/dsremap path: /tests/test_opcodes_addr.py #!/usr/bin/env python3 import unittest import struct import base from dsrlib.compiler.opcodes import Opcodes class TestRegAddr(unittest.TestCase): def test_reg_addr(self): value, = struct.unpack('>B', Opcodes.make_addr_reg(Opcodes.R...
code_fim
hard
{ "lang": "python", "repo": "ca4ti/dsremap", "path": "/tests/test_opcodes_addr.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: allenhaozhu/doc2hash path: /models/NASH.py import torch import torch.autograd as autograd from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F class decoder(nn.Module): def __init__(self, dataset, vocabSize, latentDim, device, dropoutProb=0.): su...
code_fim
hard
{ "lang": "python", "repo": "allenhaozhu/doc2hash", "path": "/models/NASH.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.encoder = nn.Sequential(nn.Linear(self.vocabSize, self.hidden_dim), nn.ReLU(inplace=True), nn.Linear(self.hidden_dim, self.hidden_dim), nn.ReLU(inplace=True), ...
code_fim
hard
{ "lang": "python", "repo": "allenhaozhu/doc2hash", "path": "/models/NASH.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def get_binary_code(self, train, test): train_zy = [] for xb, yb in train: q = self.encoder(xb.to(self.device)) q_y = q.view(q.size(0), self.latentDim) b = (torch.sign(q_y - 0.5) + 1) / 2 train_zy.append((b, yb)) train_z, train_y ...
code_fim
hard
{ "lang": "python", "repo": "allenhaozhu/doc2hash", "path": "/models/NASH.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ayanakshi/journaldev path: /Python-3/basic_examples/multiple_inheritance.py class A: def __init__(self): super().__init__() self.name = 'John' self.age = 23 <|fim_suffix|> super().__init__() def getName(self): return self.name C1 = C() print(C1.g...
code_fim
hard
{ "lang": "python", "repo": "ayanakshi/journaldev", "path": "/Python-3/basic_examples/multiple_inheritance.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> class B: def __init__(self): super().__init__() self.name = 'Richard' self.id = '32' def getName(self): return self.name class C(A, B): def __init__(self): super().__init__() def getName(self): return self.name C1 = C() print(C1.getNam...
code_fim
easy
{ "lang": "python", "repo": "ayanakshi/journaldev", "path": "/Python-3/basic_examples/multiple_inheritance.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ayonya100/fawkes path: /fawkes/utils/utils.py import json import sys import os import re import csv import itertools import operator import dateutil.parser import hashlib import nltk import jsonschema from datetime import datetime, timedelta nltk.download("stopwords", quiet=True) from nltk.c...
code_fim
hard
{ "lang": "python", "repo": "ayonya100/fawkes", "path": "/fawkes/utils/utils.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def get_sentiment_compound(review): return review.derived_insight.sentiment["compound"] def fetch_channel_config(app_config, channel_type): for review_channel in app_config.review_channels: if review_channel.channel_type == channel_type: return review_channel return None ...
code_fim
hard
{ "lang": "python", "repo": "ayonya100/fawkes", "path": "/fawkes/utils/utils.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def name_number(number_str): number_len = len(number_str) number_literal = '' for i in range(number_len): position = number_len - i if position % 3 == 0: if number_str[i] == '0': # number_literal += numbers.get(3).get(0) + ' ' pass ...
code_fim
medium
{ "lang": "python", "repo": "AguSandoval/number2word", "path": "/number_to_string.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: AguSandoval/number2word path: /number_to_string.py units = {0: '', 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine'} decimals = {0: '', 1: 'teen', 2: 'twenty', 3: 'thirty', 4: 'forty', 5: 'fifty', 6: 'sixty', 7: 'seventy', 8: 'eighty', ...
code_fim
hard
{ "lang": "python", "repo": "AguSandoval/number2word", "path": "/number_to_string.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: MridulS/REMARK path: /REMARKs/CGMPortfolio/Code/Python/Appendix/MertonSamuelson.py # -*- coding: utf-8 -*- """ Created on Sun Nov 17 09:31:45 2019 @author: Matt """ import HARK.ConsumptionSaving.ConsPortfolioModel as cpm import matplotlib.pyplot as plt import numpy as np from copy import copy ...
code_fim
hard
{ "lang": "python", "repo": "MridulS/REMARK", "path": "/REMARKs/CGMPortfolio/Code/Python/Appendix/MertonSamuelson.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>agent = cpm.PortfolioConsumerType(**dict_portfolio) agent.solve() # %% aMin = 0 # Minimum ratio of assets to income to plot aMax = 1e5 # Maximum ratio of assets to income to plot aPts = 1000 # Number of points to plot # Campbell-Viceira (2002) approximation to optimal portfolio share in Merton-Samu...
code_fim
hard
{ "lang": "python", "repo": "MridulS/REMARK", "path": "/REMARKs/CGMPortfolio/Code/Python/Appendix/MertonSamuelson.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: ROAD2018/observations path: /tests/r/test_income.py from __future__ import absolute_import from __future__ import division from __future__ import print_function <|fim_suffix|> def test_income(): """Test module income.py by downloading income.csv and testing shape of extracted data has 44...
code_fim
medium
{ "lang": "python", "repo": "ROAD2018/observations", "path": "/tests/r/test_income.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> """Test module income.py by downloading income.csv and testing shape of extracted data has 44 rows and 4 columns """ test_path = tempfile.mkdtemp() x_train, metadata = income(test_path) try: assert x_train.shape == (44, 4) except: shutil.rmtree(test_path) raise()<|fim_prefix|...
code_fim
medium
{ "lang": "python", "repo": "ROAD2018/observations", "path": "/tests/r/test_income.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: qinqin65/QuickFinance path: /QuickFinance/quick/urls.py from django.conf.urls import url from . import views urlpatterns = [ url(r'login', views.login, name='login'), url(r'logout', views.logout, name='logout'), url(r'register', views.register, name='re<|fim_suffix|>'financePreviewDa...
code_fim
hard
{ "lang": "python", "repo": "qinqin65/QuickFinance", "path": "/QuickFinance/quick/urls.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>'financePreviewData', views.financePreviewData, name='financePreviewData'), url(r'addAccountBook', views.addAccountBook, name='addAccountBook'), url(r'addAccount', views.addAccount, name='addAccount'), ]<|fim_prefix|># repo: qinqin65/QuickFinance path: /QuickFinance/quick/urls.py from django.conf...
code_fim
hard
{ "lang": "python", "repo": "qinqin65/QuickFinance", "path": "/QuickFinance/quick/urls.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>ySelectStore, name='currencySelectStore'), url(r'accountTypeSelectStore', views.accountTypeSelectStore, name='accountTypeSelectStore'), url(r'accounting', views.accounting, name='accounting'), url(r'financePreviewData', views.financePreviewData, name='financePreviewData'), url(r'addAccount...
code_fim
hard
{ "lang": "python", "repo": "qinqin65/QuickFinance", "path": "/QuickFinance/quick/urls.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> self.basic = ['disburse']<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/otherforms/_disburses.py #calss header class _DISBURSES(): <|fim_middle|> def __init__(self,): self.name = "DISBURSES" self.definitions = disburse self.parents = [] self.childen = [] self.properties = [...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/otherforms/_disburses.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/otherforms/_disburses.py #calss header class _DISBURSES(): <|fim_suffix|> self.basic = ['disburse']<|fim_middle|> def __init__(self,): self.name = "DISBURSES" self.definitions = disburse self.parents = [] self.childen = [] self.properties = [...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/otherforms/_disburses.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def applyTo(self, trade, av): trade.giveKingsheadTeleportToken() def getDescriptionText(self): return PLocalizer.KingsHeadTeleportRewardDesc class MainStoryReward(QuestReward): def applyTo(self, trade, av): if not av.checkQuestRewardFlag(PiratesGlobals.Q...
code_fim
hard
{ "lang": "python", "repo": "C0MPU73R/pirates-online-classic", "path": "/pirates/quest/QuestReward.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def applyTo(self, trade, av): trade.giveWandTraining() trade.giveStack(InventoryType.WandWeaponL1, 1) def getDescriptionText(self): return PLocalizer.StaffRewardDesc class TeleportTotemReward(QuestReward): def applyTo(self, trade, av): trade.giveT...
code_fim
hard
{ "lang": "python", "repo": "C0MPU73R/pirates-online-classic", "path": "/pirates/quest/QuestReward.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: C0MPU73R/pirates-online-classic path: /pirates/quest/QuestReward.py calizer.LootGoldDouble % goldAmt return text def setGoldFactor(self, multiplier): global GOLDFACTOR_HOLIDAY GOLDFACTOR_HOLIDAY = multiplier class PlayingCardReward(QuestReward): def...
code_fim
hard
{ "lang": "python", "repo": "C0MPU73R/pirates-online-classic", "path": "/pirates/quest/QuestReward.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: ssattids/NN_project path: /roads_cars.py import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.autograd import Variable from torch.utils.data import DataLoader import torchvision.transforms as transforms from PIL import Image import numpy a...
code_fim
hard
{ "lang": "python", "repo": "ssattids/NN_project", "path": "/roads_cars.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> outputs = fcn_model(inputs) loss = criterion(outputs, labels) loss.backward() optimizer.step() if iter % 10 == 0: print("epoch{}, iter{}, loss: {}".format(epoch, iter, loss.item())) print("Finish epoch {}, time e...
code_fim
hard
{ "lang": "python", "repo": "ssattids/NN_project", "path": "/roads_cars.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: microsoft/playwright-python path: /tests/sync/test_locator_get_by.py # Copyright (c) Microsoft Corporation. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
code_fim
hard
{ "lang": "python", "repo": "microsoft/playwright-python", "path": "/tests/sync/test_locator_get_by.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>def test_get_by_alt_text(page: Page) -> None: page.set_content( """<div> <input alt="Hello"> <input alt="Hello World"> </div>""" ) expect(page.get_by_alt_text("hello")).to_have_count(2) expect(page.main_frame.get_by_alt_text("hello")).to_have_count(2) expect(page.loc...
code_fim
hard
{ "lang": "python", "repo": "microsoft/playwright-python", "path": "/tests/sync/test_locator_get_by.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def test_get_by_label(page: Page) -> None: page.set_content( "<div><label for=target>Name</label><input id=target type=text></div>" ) expect(page.get_by_label("Name")).to_have_count(1) expect(page.main_frame.get_by_label("Name")).to_have_count(1) expect(page.locator("div").ge...
code_fim
hard
{ "lang": "python", "repo": "microsoft/playwright-python", "path": "/tests/sync/test_locator_get_by.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>def edge_dropout(adj, dropout): adj = adj - sp.dia_matrix((adj.diagonal()[np.newaxis, :], [0]), shape=adj.shape) adj.eliminate_zeros() assert np.diag(adj.todense()).sum() == 0 adj_triu = sp.triu(adj) adj_tuple = sparse_to_tuple(adj_triu) edges = adj_tuple[0] num_val = int(np....
code_fim
hard
{ "lang": "python", "repo": "aaronzweig/graphite_super", "path": "/gae/gae/preprocessing.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: aaronzweig/graphite_super path: /gae/gae/preprocessing.py import numpy as np import scipy.sparse as sp import networkx as nx def preprocess_features(features): """Row-normalize feature matrix and convert to tuple representation""" rowsum = np.array(features.sum(1)) r_inv = np.power(r...
code_fim
hard
{ "lang": "python", "repo": "aaronzweig/graphite_super", "path": "/gae/gae/preprocessing.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: dana-i2cat/felix path: /optin_manager/src/python/openflow/optin_manager/opts/admin.py # admin file for flowspace - to be used in debuging from models import * from django.contrib import admin <|fim_suffix|>admin.site.register(AdminFlowSpace) admin.site.register(UserFlowSpace)<|fim_middle|>admin....
code_fim
medium
{ "lang": "python", "repo": "dana-i2cat/felix", "path": "/optin_manager/src/python/openflow/optin_manager/opts/admin.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>admin.site.register(AdminFlowSpace) admin.site.register(UserFlowSpace)<|fim_prefix|># repo: dana-i2cat/felix path: /optin_manager/src/python/openflow/optin_manager/opts/admin.py # admin file for flowspace - to be used in debuging from models import * from django.contrib import admin admin.site.register(...
code_fim
medium
{ "lang": "python", "repo": "dana-i2cat/felix", "path": "/optin_manager/src/python/openflow/optin_manager/opts/admin.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/otherforms/_endured.py #calss header class _ENDURED(): <|fim_suffix|> self.basic = ['endure']<|fim_middle|> def __init__(self,): self.name = "ENDURED" self.definitions = endure self.parents = [] self.childen = [] self.properties = [] self.js...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/otherforms/_endured.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/otherforms/_endured.py #calss header class _ENDURED(): def __init__(self,): self.name = "ENDURED" self.definitions = endure <|fim_suffix|> self.basic = ['endure']<|fim_middle|> self.parents = [] self.childen = [] self.properties = [] self.j...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/otherforms/_endured.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.basic = ['endure']<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/otherforms/_endured.py #calss header class _ENDURED(): <|fim_middle|> def __init__(self,): self.name = "ENDURED" self.definitions = endure self.parents = [] self.childen = [] self.properties = [] self.js...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/otherforms/_endured.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> amp = not args.disable_gpu and not args.disable_amp device = get_device(not args.disable_gpu) # data if args.dataset == 'animeface': dataset = AnimeFaceXDoG(args.image_size, args.min_year) elif args.dataset == 'danbooru': dataset = DanbooruPortraitXDoG(args.image_size,...
code_fim
hard
{ "lang": "python", "repo": "WN1695173791/animeface", "path": "/implementations/SCFT/utils.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: WN1695173791/animeface path: /implementations/SCFT/utils.py import functools import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.cuda.amp import autocast, GradScaler from torchvision.utils import save_image from torch.utils.data import rando...
code_fim
hard
{ "lang": "python", "repo": "WN1695173791/animeface", "path": "/implementations/SCFT/utils.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if args.max_iters < 0: args.max_iters = len(dataset) * args.default_epochs # model G = Generator( args.image_size, args.sketch_channels, args.ref_channels, args.bottom_width, args.enc_channels, args.layer_per_resl, args.num_res_blocks, not args.disable_sn, not ...
code_fim
hard
{ "lang": "python", "repo": "WN1695173791/animeface", "path": "/implementations/SCFT/utils.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>from rqt_science.plugin import SciencePlugin from rqt_gui.main import Main plugin = 'rqt_science' main = Main(filename=plugin) sys.exit(main.main(standalone=plugin))<|fim_prefix|># repo: MacRover/Rover path: /ROS_WS/src/rqt_science/scripts/rqt_science #!/usr/bin/env python <|fim_middle|>import sys
code_fim
easy
{ "lang": "python", "repo": "MacRover/Rover", "path": "/ROS_WS/src/rqt_science/scripts/rqt_science", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: MacRover/Rover path: /ROS_WS/src/rqt_science/scripts/rqt_science #!/usr/bin/env python import sys <|fim_suffix|>plugin = 'rqt_science' main = Main(filename=plugin) sys.exit(main.main(standalone=plugin))<|fim_middle|>from rqt_science.plugin import SciencePlugin from rqt_gui.main import Main
code_fim
medium
{ "lang": "python", "repo": "MacRover/Rover", "path": "/ROS_WS/src/rqt_science/scripts/rqt_science", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> height_new = min((float(ori_size)/imsize) * bbox_tmp[3], 1.0) if y_new + height_new > 0.999: height_new = 1.0 - y_new - 0.001 if flip_img: x_new = 1.0-x_new-width_new bbox_scaled[idx] = [x_new, y_new,...
code_fim
hard
{ "lang": "python", "repo": "ducis28/multiple-objects-gan", "path": "/code/coco/stackgan/miscc/datasets.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ducis28/multiple-objects-gan path: /code/coco/stackgan/miscc/datasets.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import torch.utils.data as data import PIL import os import os.path impor...
code_fim
hard
{ "lang": "python", "repo": "ducis28/multiple-objects-gan", "path": "/code/coco/stackgan/miscc/datasets.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> voters = Vote.objects.all() blancs = 0 candidates = {} for voter in voters: choices = voter.choices.split(",") if choices == [""]: blancs += 1 for choice in choices: if choice == "": choice = "**blank**" candidate...
code_fim
hard
{ "lang": "python", "repo": "dragonleman/django-example", "path": "/src/election/views.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: dragonleman/django-example path: /src/election/views.py from django.http import HttpResponse from django.template import loader from config.settings.base import BASE_DIR from election.models import Election, Vote def create_election(request): if request.GET and 'title' in request.GET: ...
code_fim
medium
{ "lang": "python", "repo": "dragonleman/django-example", "path": "/src/election/views.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> context = { "votes": voters, "blancs": blancs, "candidates": dict(sorted(candidates.items(), key=lambda item: item[1], reverse=True)), "election": Election.objects.all().first() } template = loader.get_template('results.html') return HttpResponse(template.r...
code_fim
hard
{ "lang": "python", "repo": "dragonleman/django-example", "path": "/src/election/views.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @weight(1) @timeout_decorator.timeout(5.0) def test_diagram_context(self): diagram = self.notebook_locals["diagram"] double_integrator = self.notebook_locals["double_integrator"] actuator_model = self.notebook_locals["actuator_model"] context = self.notebook_loc...
code_fim
hard
{ "lang": "python", "repo": "RussTedrake/underactuated", "path": "/underactuated/exercises/lqr/test_drake_diagrams.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: RussTedrake/underactuated path: /underactuated/exercises/lqr/test_drake_diagrams.py import unittest import numpy as np import timeout_decorator from gradescope_utils.autograder_utils.decorators import weight from pydrake.all import AffineSystem, Diagram, System class TestDrakeDiagrams(unittest...
code_fim
hard
{ "lang": "python", "repo": "RussTedrake/underactuated", "path": "/underactuated/exercises/lqr/test_drake_diagrams.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> Args: file_format: See https://pillow.readthedocs.io/en/3.1.x/handbook/image-file-formats.html color_space: One of "L", "RGB", or "CMYK". "L" means greyscale. width: The width, in pixels of the image. height: The width, in pixels of the image. Returns: ...
code_fim
hard
{ "lang": "python", "repo": "admdev8/vws-python-mock", "path": "/tests/mock_vws/utils/__init__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> Returns: An image file in the given format and color space. """ image_buffer = io.BytesIO() image = Image.new(color_space, (width, height)) # If this assertion ever fails, see # https://github.com/VWS-Python/vws-test-fixtures for what to do. assert color_space != 'L' ...
code_fim
hard
{ "lang": "python", "repo": "admdev8/vws-python-mock", "path": "/tests/mock_vws/utils/__init__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: admdev8/vws-python-mock path: /tests/mock_vws/utils/__init__.py """ Utilities for tests. """ import io import random import requests from PIL import Image from mock_vws._constants import ResultCodes class Endpoint: """ Details of endpoints to be called in tests. """ prepared...
code_fim
hard
{ "lang": "python", "repo": "admdev8/vws-python-mock", "path": "/tests/mock_vws/utils/__init__.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: mgaborit/pyven path: /source/pyven/reporting/content/success.py from pyven.reporting.content.status import Status from pyven.reporting.style import Style import pyven.constants class Success(Status): <|fim_suffix|> super(Success, self).__init__(pyven.constants.STATUS[0]) self.status_style = ...
code_fim
easy
{ "lang": "python", "repo": "mgaborit/pyven", "path": "/source/pyven/reporting/content/success.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> super(Success, self).__init__(pyven.constants.STATUS[0]) self.status_style = Style.get().status['success']<|fim_prefix|># repo: mgaborit/pyven path: /source/pyven/reporting/content/success.py from pyven.reporting.content.status import Status from pyven.reporting.style import Style import pyven.consta...
code_fim
easy
{ "lang": "python", "repo": "mgaborit/pyven", "path": "/source/pyven/reporting/content/success.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: astropy/astropy-benchmarks path: /benchmarks/modeling/fitting.py import warnings import numpy as np from astropy.io import ascii from astropy import units as u from astropy.utils.data import get_pkg_data_filename from astropy.modeling import models, fitting fit_LevMarLSQFitter = fitting.LevMar...
code_fim
hard
{ "lang": "python", "repo": "astropy/astropy-benchmarks", "path": "/benchmarks/modeling/fitting.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>def time_Polynomial2D_LinearLSQFitter(): warnings.filterwarnings('error') try: z = z_base + np.random.normal(0., 0.2, z_base.shape) t = fit_LinearLSQFitter(Polynomial2D, x_grid, y_grid, z) except Warning: pass def time_Chebyshev1D_LevMarLSQFitter(): warnings.filte...
code_fim
hard
{ "lang": "python", "repo": "astropy/astropy-benchmarks", "path": "/benchmarks/modeling/fitting.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> warnings.filterwarnings('error') try: z = z_base + np.random.normal(0., 0.2, z_base.shape) t = fit_LinearLSQFitter(Chebyshev2D, x_grid, y_grid, z) except Warning: pass def time_combined_gauss_1d_LevMarLSQFitter(): warnings.filterwarnings('error') try: ...
code_fim
hard
{ "lang": "python", "repo": "astropy/astropy-benchmarks", "path": "/benchmarks/modeling/fitting.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>import nltk.corpus print(os.listdir(nltk.data.find("corpora"))) nltk.corpus.gutenberg.fileids() milton=nltk.corpus.gutenberg.words('milton-paradise.txt') AI="""machine learning is a part of artificial intelligence. machine learning is widely used. Artificial intelligence is incomplete without mac...
code_fim
hard
{ "lang": "python", "repo": "Soumitra-Mandal/ML-and-pyfiles", "path": "/nlp.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Soumitra-Mandal/ML-and-pyfiles path: /nlp.py import nltk import textblob from textblob import TextBlob data=TextBlob("Hello Everyone!hope you are enjoying the day.") data.translate(to="es") data.translate(to="bn") data=TextBlob("The orange is a bad fruit") data.sentiment data=TextBl...
code_fim
hard
{ "lang": "python", "repo": "Soumitra-Mandal/ML-and-pyfiles", "path": "/nlp.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @pytest.fixture def mock_icon_score_class_loader(self, mocker): mocker.patch.object(IconScoreClassLoader, "_load_package_json") mocker.patch.object(IconScoreClassLoader, "_get_package_info") return IconScoreClassLoader @pytest.fixture def mock_importlib(self, mocke...
code_fim
hard
{ "lang": "python", "repo": "icon-project/icon-service", "path": "/tests/unit_test/score_loader/test_icon_score_class_loader.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # mock mock_utils.get_score_deploy_path.return_value = deploy_path mock_utils.get_package_name_by_address_and_tx_hash.return_value = package_name package_json = { self.VERSION: mock.ANY, self.MAIN_FILE: main_file, self.MAIN_SCORE: main_s...
code_fim
hard
{ "lang": "python", "repo": "icon-project/icon-service", "path": "/tests/unit_test/score_loader/test_icon_score_class_loader.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: icon-project/icon-service path: /tests/unit_test/score_loader/test_icon_score_class_loader.py # -*- coding: utf-8 -*- # Copyright 2018 ICON Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ...
code_fim
hard
{ "lang": "python", "repo": "icon-project/icon-service", "path": "/tests/unit_test/score_loader/test_icon_score_class_loader.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def forward(self, x, label=None): return {"features": x, "logits": None}<|fim_prefix|># repo: chenyeren/PaddleClas path: /ppcls/arch/gears/identity_head.py from paddle import nn <|fim_middle|>class IdentityHead(nn.Layer): def __init__(self): super(IdentityHead, self).__init__() ...
code_fim
medium
{ "lang": "python", "repo": "chenyeren/PaddleClas", "path": "/ppcls/arch/gears/identity_head.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self): super(IdentityHead, self).__init__() def forward(self, x, label=None): return {"features": x, "logits": None}<|fim_prefix|># repo: chenyeren/PaddleClas path: /ppcls/arch/gears/identity_head.py from paddle import nn <|fim_middle|> class IdentityHead(nn.Layer):...
code_fim
easy
{ "lang": "python", "repo": "chenyeren/PaddleClas", "path": "/ppcls/arch/gears/identity_head.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: chenyeren/PaddleClas path: /ppcls/arch/gears/identity_head.py from paddle import nn <|fim_suffix|> return {"features": x, "logits": None}<|fim_middle|> class IdentityHead(nn.Layer): def __init__(self): super(IdentityHead, self).__init__() def forward(self, x, label=None):...
code_fim
medium
{ "lang": "python", "repo": "chenyeren/PaddleClas", "path": "/ppcls/arch/gears/identity_head.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if i % 1024 == 0: ind += 1 f = open(fn, 'r') content = f.read() f.close() def run(work_dir, n, contentsize): print contentsize content = gen_content(contentsize) start = time.time() gen_file(work_dir, n, content) read_file(work_dir, n) en...
code_fim
medium
{ "lang": "python", "repo": "linpawslitap/mds_scaling", "path": "/traces/genfile.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: linpawslitap/mds_scaling path: /traces/genfile.py #!/usr/bin/python ######################################################################### # Author: Kai Ren # Created Time: 2011-10-30 22:23:36 # File Name: ./genfile.py # Description: ###########################################################...
code_fim
hard
{ "lang": "python", "repo": "linpawslitap/mds_scaling", "path": "/traces/genfile.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> print contentsize content = gen_content(contentsize) start = time.time() gen_file(work_dir, n, content) read_file(work_dir, n) end = time.time() print end - start if __name__ == '__main__': run("/mnt/share/test", 1024 * 1024, int(sys.argv[1]))<|fim_prefix|># repo: linpawsl...
code_fim
hard
{ "lang": "python", "repo": "linpawslitap/mds_scaling", "path": "/traces/genfile.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: Jerakin/FakemonPackages path: /tools/publisher.py import argparse import zipfile import json import shutil from pathlib import Path __version__ = "0.1" class IncompletePackage(Exception): pass def options(): parser = argparse.ArgumentParser(description='Commandline tool to publish Fa...
code_fim
hard
{ "lang": "python", "repo": "Jerakin/FakemonPackages", "path": "/tools/publisher.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def print_help(): print("Usage: publisher <command> [<args>]\n") print("The commands are:") print(" add Add the package to the index") print(" peek NotImplementedError") print("See `publisher <command> --help` for information on a specific command.") def main(): _op...
code_fim
hard
{ "lang": "python", "repo": "Jerakin/FakemonPackages", "path": "/tools/publisher.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> print("See `publisher <command> --help` for information on a specific command.") def main(): _options = options() if _options.command == "add": package_index = Path(_options.package_index) if _options.package_index else Path(__file__).absolute().parent.parent add(Path(_option...
code_fim
hard
{ "lang": "python", "repo": "Jerakin/FakemonPackages", "path": "/tools/publisher.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> for pair in pairs_to_test: self.assertTupleEqual(pair[0], convert_row_to_nd_slices(pair[1], dimensions)) def main(): unittest.main() if __name__ == '__main__': main()<|fim_prefix|># repo: radujica/data-analysis-pipelines path: /weld/netCDF4_weld/tests/test_utils.py import ...
code_fim
hard
{ "lang": "python", "repo": "radujica/data-analysis-pipelines", "path": "/weld/netCDF4_weld/tests/test_utils.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: radujica/data-analysis-pipelines path: /weld/netCDF4_weld/tests/test_utils.py import unittest from netCDF4_weld.utils import convert_row_to_nd_slices class UtilsTests(unittest.TestCase): def test_convert_to_nd_slices(self): <|fim_suffix|> for pair in pairs_to_test: self....
code_fim
hard
{ "lang": "python", "repo": "radujica/data-analysis-pipelines", "path": "/weld/netCDF4_weld/tests/test_utils.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> my_c=cgs.speed_of_light def test_c(self): """ is the factor 100 between meter and centimeter correct? """ self.failIf(cgs.speed_of_light/mks.speed_of_light!=100) def test_default(self): self.failIf(cgs.speed_of_light/pygsl.const.speed_of_light!=100...
code_fim
medium
{ "lang": "python", "repo": "juhnowski/FishingRod", "path": "/production/pygsl-0.9.5/tests/const_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }