text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_prefix|># repo: data-exp-lab/analysis_schema path: /analysis_schema/Previous_Analysis_Schema/stream_frontend.py import time from typing import Any, Dict, List, Optional, Sequence, Set, Tuple, Union from pydantic import BaseModel, Schema, create_model from .data_objects import DataObject from .dataset import Da...
code_fim
hard
{ "lang": "python", "repo": "data-exp-lab/analysis_schema", "path": "/analysis_schema/Previous_Analysis_Schema/stream_frontend.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # helper method def _listContains(self, l, entry): """Helper method to determine if a list contains an entry""" for i in range(0, len(l)): if l[i] == entry: return True return False class CharacterSelectionContext: def GetCharacterI...
code_fim
hard
{ "lang": "python", "repo": "radtek/MultiverseClientServer", "path": "/MultiverseClient/Scripts/CharacterCreation.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: radtek/MultiverseClientServer path: /MultiverseClient/Scripts/CharacterCreation.py # # # The Multiverse Platform is made available under the MIT License. # # Copyright (c) 2012 The Multiverse Foundation # # Permission is hereby granted, free of charge, to any person # obtaining a copy of thi...
code_fim
hard
{ "lang": "python", "repo": "radtek/MultiverseClientServer", "path": "/MultiverseClient/Scripts/CharacterCreation.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def GetCharacterAttribute(self, characterId, attr): """Fetch the value of the given attribute for the given characterId.""" for charEntry in ClientAPI.GetCharacterEntries(): if charEntry.CharacterId == characterId: return charEntry[attr] return None ...
code_fim
hard
{ "lang": "python", "repo": "radtek/MultiverseClientServer", "path": "/MultiverseClient/Scripts/CharacterCreation.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>if PYQT5: from PyQt5.QtDesigner import * elif PYQT6: from PyQt6.QtDesigner import * elif PYSIDE2: raise QtBindingMissingModuleError(name='QtDesigner') elif PYSIDE6: from PySide6.QtDesigner import *<|fim_prefix|># repo: winpython/winpython path: /winpython/_vendor/qtpy/tests/QtDesigner.py ...
code_fim
medium
{ "lang": "python", "repo": "winpython/winpython", "path": "/winpython/_vendor/qtpy/tests/QtDesigner.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: winpython/winpython path: /winpython/_vendor/qtpy/tests/QtDesigner.py # ----------------------------------------------------------------------------- # Copyright © 2014-2015 Colin Duquesnoy # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # -------------------------...
code_fim
medium
{ "lang": "python", "repo": "winpython/winpython", "path": "/winpython/_vendor/qtpy/tests/QtDesigner.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>from . import ( PYQT5, PYQT6, PYSIDE2, PYSIDE6, QtBindingMissingModuleError, ) if PYQT5: from PyQt5.QtDesigner import * elif PYQT6: from PyQt6.QtDesigner import * elif PYSIDE2: raise QtBindingMissingModuleError(name='QtDesigner') elif PYSIDE6: from PySide6.QtDesigner i...
code_fim
medium
{ "lang": "python", "repo": "winpython/winpython", "path": "/winpython/_vendor/qtpy/tests/QtDesigner.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ahuang11/xskillscore path: /xskillscore/tests/test_contingency.py import numpy as np import numpy.testing as npt import pytest import xarray as xr from sklearn.metrics import confusion_matrix from xskillscore import Contingency DIMS = (["time"], ["lon"], ["lat"], "time", ["lon", "lat", "time"])...
code_fim
hard
{ "lang": "python", "repo": "ahuang11/xskillscore", "path": "/xskillscore/tests/test_contingency.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>@pytest.mark.parametrize( "method, expected", [ ("hits", 2), ("misses", 2), ("false_alarms", 1), ("correct_negatives", 2), ("bias_score", 3 / 4), ("hit_rate", 1 / 2), ("false_alarm_ratio", 1 / 3), ("false_alarm_rate", 1 / 3), ...
code_fim
hard
{ "lang": "python", "repo": "ahuang11/xskillscore", "path": "/xskillscore/tests/test_contingency.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>@pytest.fixture def dichotomous_Contingency(): observations = xr.DataArray( np.array(2 * [0] + 2 * [1] + 1 * [0] + 2 * [1]), coords=[("x", np.arange(7))] ) forecasts = xr.DataArray( np.array(2 * [0] + 2 * [0] + 1 * [1] + 2 * [1]), coords=[("x", np.arange(7))] ) category...
code_fim
hard
{ "lang": "python", "repo": "ahuang11/xskillscore", "path": "/xskillscore/tests/test_contingency.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: HelenaNascimento/spyder path: /spyder/plugins/variableexplorer/widgets/tests/test_texteditor.py # -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # """ Tests for texteditor.py """ # Test library imports import pytest # Local impor...
code_fim
medium
{ "lang": "python", "repo": "HelenaNascimento/spyder", "path": "/spyder/plugins/variableexplorer/widgets/tests/test_texteditor.py", "mode": "psm", "license": "LGPL-3.0-or-later", "source": "the-stack-v2" }
<|fim_suffix|> import string dig_its = string.digits translate_digits = string.maketrans(dig_its,len(dig_its)*' ') editor = TextEditor(None) assert not editor.setup_and_check(translate_digits) if __name__ == "__main__": pytest.main()<|fim_prefix|># repo: HelenaNascimento/spyder path: /spyder/p...
code_fim
hard
{ "lang": "python", "repo": "HelenaNascimento/spyder", "path": "/spyder/plugins/variableexplorer/widgets/tests/test_texteditor.py", "mode": "spm", "license": "LGPL-3.0-or-later", "source": "the-stack-v2" }
<|fim_suffix|> tupnomin = input(f'Digite a {unit+1}° palavra: ').lower().strip() tupnom += (tupnomin,) print(tupnom) for palavra in tupnom: print(f'\nNa palavra {palavra.capitalize()} temos ->', end=' ') for letra in palavra: if letra in 'aeiou': print(letra, end=' ')<|fim_prefix|># re...
code_fim
medium
{ "lang": "python", "repo": "Roberto-Mota/CursoemVideo", "path": "/exercicios/ex077.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Roberto-Mota/CursoemVideo path: /exercicios/ex077.py # Desafio 077 -> C. um programa que tenha uma tupla com várias palavras (ñ usar acentos). # Depois disso, você deve mostrar, para cada palavra, quais são as sua vogais tupnom = () print(dir(tupnom)) print('-=-'*5, 'Encontro das V...
code_fim
medium
{ "lang": "python", "repo": "Roberto-Mota/CursoemVideo", "path": "/exercicios/ex077.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>\nNa palavra {palavra.capitalize()} temos ->', end=' ') for letra in palavra: if letra in 'aeiou': print(letra, end=' ')<|fim_prefix|># repo: Roberto-Mota/CursoemVideo path: /exercicios/ex077.py # Desafio 077 -> C. um programa que tenha uma tupla com várias palavras (ñ usar acento...
code_fim
hard
{ "lang": "python", "repo": "Roberto-Mota/CursoemVideo", "path": "/exercicios/ex077.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Enmming/gorden_cralwer path: /gorden_crawler/spiders/kipling.py # -*- coding: utf-8 -*- from scrapy.spiders import Spider from scrapy.selector import Selector from gorden_crawler.items import BaseItem, ImageItem, SkuItem, Color from scrapy import Request from scrapy_redis.spiders import RedisSp...
code_fim
hard
{ "lang": "python", "repo": "Enmming/gorden_cralwer", "path": "/gorden_crawler/spiders/kipling.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> item = response.meta['item'] sel = Selector(response) colorIds = response.meta['colorIds'] colorUrls = response.meta['colorUrls'] image_color_dict = {} for colorId in colorIds: images=[] single_color_imgages = re.findall("[^\.{]*\/zoo...
code_fim
hard
{ "lang": "python", "repo": "Enmming/gorden_cralwer", "path": "/gorden_crawler/spiders/kipling.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: filipagh/kiwi.code.task path: /flight_routes/exporter.py import json import operator import sys from flight_routes.json_models.flight_json_model import FlightJsonModel from flight_routes.json_models.plan_json_model import PlanJsonModel def to_json(list_of_flights, indexed_flights, origin, dest...
code_fim
medium
{ "lang": "python", "repo": "filipagh/kiwi.code.task", "path": "/flight_routes/exporter.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return json.dumps(plans, default=lambda o: o.__dict__, indent=4) def __get_time_string(total_time_in_sec): h = int(total_time_in_sec / 60 / 60) m = int(total_time_in_sec / 60) - h * 60 s = int(total_time_in_sec) - h * 60 * 60 - m * 60 h = __pad_to_len_2(h) m = __pad_to_len_2(m) ...
code_fim
hard
{ "lang": "python", "repo": "filipagh/kiwi.code.task", "path": "/flight_routes/exporter.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> flights.append(flight_json) max_bags = min(max_bags, int(flight.bags_allowed)) total_price += float(flight.base_price) + float(flight.bag_price) * bags plan = PlanJsonModel(flights, max_bags, bags, destination, origin, total_price, ...
code_fim
hard
{ "lang": "python", "repo": "filipagh/kiwi.code.task", "path": "/flight_routes/exporter.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> data_file = os.path.abspath("../data/seq_class_dataset.tsv") train, val, test = pid.split_data(data_file, datatype='sequence', problem_type='classification', num_classes=3) assert (len(train) == 210) and (len(val) == 45) and (len(test) == 45) and (len(train[0...
code_fim
hard
{ "lang": "python", "repo": "idptools/parrot", "path": "/build/lib/parrot/tests/test_parrot.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: idptools/parrot path: /build/lib/parrot/tests/test_parrot.py """ Unit and regression tests for the PARROT package. Note that these tests are by no means comprehensive. For unexplained issues, please reach out on the GitHub page: https://github.com/idptools/parrot/issues """ # Import package, tes...
code_fim
hard
{ "lang": "python", "repo": "idptools/parrot", "path": "/build/lib/parrot/tests/test_parrot.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: phrenault/kindle_weatherdisplay_with-regional-air-quality-data path: /Server/get_uba_airquality.py #!/usr/bin/python3 def get_uba_airquality(state): ############################################################################# # Skript zum Auslesen der UBA Luftqualitätsdaten ...
code_fim
hard
{ "lang": "python", "repo": "phrenault/kindle_weatherdisplay_with-regional-air-quality-data", "path": "/Server/get_uba_airquality.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ############## # Libraries import csv import codecs import io import urllib.request from datetime import datetime, time, timedelta import pymysql #import pprint ########### # Variables stations = ['1372','1129'] # Jackerath, Niederzier as example minus2st = timedelta(hours=-2) # Data are u...
code_fim
hard
{ "lang": "python", "repo": "phrenault/kindle_weatherdisplay_with-regional-air-quality-data", "path": "/Server/get_uba_airquality.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> __slots__ = ('retry_after', 'is_global') def __init__(self, response, message): super().__init__(response, message) self.retry_after = message['retry_after'] / 1000.0 self.is_global = message.get('global', False) class InternalServerError(HTTPException): """Excepti...
code_fim
hard
{ "lang": "python", "repo": "Yandawl/restcord.py", "path": "/restcord/errors.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Yandawl/restcord.py path: /restcord/errors.py # -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2020 Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softwa...
code_fim
hard
{ "lang": "python", "repo": "Yandawl/restcord.py", "path": "/restcord/errors.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> class BadRequest(HTTPException): """Exception that's thrown for when status code 400 occurs.""" pass class Forbidden(HTTPException): """Exception that's thrown for when status code 403 occurs.""" pass class NotFound(HTTPException): """Exception that's thrown for when status cod...
code_fim
hard
{ "lang": "python", "repo": "Yandawl/restcord.py", "path": "/restcord/errors.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: psorus/grapa path: /grapa/mergelayers.py import os from os.path import isfile fold="layers/" fold="layerfiles/" exit() imps=[] clas=[] <|fim_suffix|> for ii in i.keys(): if "import" in ii:continue if len(ii)==0:continue if ii[0]=="#":continue f.write(ii+"\n") for cl ...
code_fim
hard
{ "lang": "python", "repo": "psorus/grapa", "path": "/grapa/mergelayers.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ac1=ac[:ac.find("\nclass ")] ac2=ac[ac.find("\nclass "):] imps.append(ac1) clas.append(ac2) i={} for imp in imps: for lin in imp.split("\n"): if not lin in i.keys():i[lin]=1.0 for ii in i.keys(): if not "import" in ii:continue if len(ii)==0:continue...
code_fim
hard
{ "lang": "python", "repo": "psorus/grapa", "path": "/grapa/mergelayers.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: b1tg/masm_shc path: /demos/knock_test.py import socket import sys import argparse def main(): parser = argparse.ArgumentParser(description="Send to the Crackme") parser.add_argument('--port', dest="port", default="1337", help="Port to conne<|fim_suffix|> print "[+] Response: " + ...
code_fim
hard
{ "lang": "python", "repo": "b1tg/masm_shc", "path": "/demos/knock_test.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> = args.buf try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('127.0.0.1', my_port)) s.send(key) result = s.recv(512) if result is not None: print "[+] Response: " + result s.close() except socket.error: print ...
code_fim
hard
{ "lang": "python", "repo": "b1tg/masm_shc", "path": "/demos/knock_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: OualidBenkarim/BrainStat path: /brainstat/tests/test_SLM.py from sklearn.model_selection import ParameterGrid import numpy as np from brainstat.stats.terms import FixedEffect, MixedEffect from brainstat.stats.SLM import SLM from brainstat.context.utils import read_surface_gz from nilearn.datasets...
code_fim
hard
{ "lang": "python", "repo": "OualidBenkarim/BrainStat", "path": "/brainstat/tests/test_SLM.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> Returns ------- ParameterGrid All pairings of parameters to be run through the SLM class. """ model = [ FixedEffect(1) + FixedEffect(np.random.rand(samples, predictors), names=["y1", "y2", "y3"]) ] Y_idx = [1, 2, 3] contrast = [np.random.rand(sample...
code_fim
hard
{ "lang": "python", "repo": "OualidBenkarim/BrainStat", "path": "/brainstat/tests/test_SLM.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>lit('\n') except: description = 'None' rating = soup.find('span',{'itemprop':'ratingValue'}).text.strip() try: series = soup.find('a',{'class':'greyText'}).text.strip() except: series = 'N/A' pages = soup.find("span", {"itemprop":"numberOfPages"}).text ...
code_fim
hard
{ "lang": "python", "repo": "Immortal000/booksearch", "path": "/main.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Immortal000/booksearch path: /main.py from bs4 import BeautifulSoup import requests while True: links =[] search_query = input() website = requests.get('https://www.goodreads.com/search?q='+search_query).text soup = BeautifulSoup(website,'lxml') for a in soup.find_all('...
code_fim
hard
{ "lang": "python", "repo": "Immortal000/booksearch", "path": "/main.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>/search?searchTerm='+book_title).text soup = BeautifulSoup(website,'lxml') b = soup.find('div',{'class':'price-wrap'}).text.strip().split() book_price = b[0] print(f"Book Title:{book_title}\nBook Series:{series}\nBook Author:{author[2:]}\nBook Rating:{rating}\nLength of the book:{pages...
code_fim
hard
{ "lang": "python", "repo": "Immortal000/booksearch", "path": "/main.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: deborrrrrah/Clustering path: /Metric.py from sklearn.metrics import accuracy_score from copy import deepcopy import numpy as np from itertools import repeat, permutations NumberTypes = ['int32', 'int64', 'float32', 'float64'] ArrayTypes = (np.ndarray) dummy_number = -1 def clustering_accuracy_s...
code_fim
hard
{ "lang": "python", "repo": "deborrrrrah/Clustering", "path": "/Metric.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> max_dict_result = dict(zip(cluster_true, repeat(None))) max_accuracy = dummy_number if (len(cluster_true) > len(cluster_pred)) : permutations_list = [dict(zip(cluster_true, x)) for x in permutations(cluster_pred,len(cluster_pred))] else : permutations_list = [dict(zip(clust...
code_fim
medium
{ "lang": "python", "repo": "deborrrrrah/Clustering", "path": "/Metric.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: LauraForde/FitKit-API path: /providers/couchProvider.py import requests import couchdb ADMIN_USERNAME = 'admin' ADMIN_PASSWORD = 'pass' COUCHDB_URL = 'http://'+ADMIN_USERNAME+':'+ADMIN_PASSWORD+'@localhost:5984/' #COUCHDB_URL = 'http://54.68.14.217:5984/' couch = couchdb.Server(COUCHDB_URL) <|f...
code_fim
hard
{ "lang": "python", "repo": "LauraForde/FitKit-API", "path": "/providers/couchProvider.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def read_user(self, user_id): db = couch['login'] if(user_id in db): user = db[user_id] return user, 200 else: return {"error": "User not found."}, 400<|fim_prefix|># repo: LauraForde/FitKit-API path: /providers/couchProvider.py import reque...
code_fim
medium
{ "lang": "python", "repo": "LauraForde/FitKit-API", "path": "/providers/couchProvider.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> db = couch['login'] if(user_id in db): user = db[user_id] return user, 200 else: return {"error": "User not found."}, 400<|fim_prefix|># repo: LauraForde/FitKit-API path: /providers/couchProvider.py import requests import couchdb ADMIN_USERNAME ...
code_fim
hard
{ "lang": "python", "repo": "LauraForde/FitKit-API", "path": "/providers/couchProvider.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: victorwyee/lungbox path: /tests/test_training_data.py # -*- coding: utf-8 -*- """ Unit Tests for high level training data generation. Usage: python -m unittest tests/test_training_data.py """ import sys import unittest import numpy as np # os.chdir('/projects/lungbox') # os.chdir('..') # ...
code_fim
hard
{ "lang": "python", "repo": "victorwyee/lungbox", "path": "/tests/test_training_data.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_load_mask(self): dataset_train = self.exdata.get_dataset_train() mask_00 = dataset_train.load_mask(0) image_mask_00 = mask_00[0] class_00 = mask_00[1] self.assertEqual(image_mask_00.shape, (1024, 1024, 2)) np.testing.assert_array_equal(class_00,...
code_fim
hard
{ "lang": "python", "repo": "victorwyee/lungbox", "path": "/tests/test_training_data.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> dataset_train = self.exdata.get_dataset_train() # Order should be the retained (when comparing lists) self.assertEqual(dataset_train.patient_ids[0], self.exdata.patient_id_train) self.assertEqual(dataset_train.annotation_dict, self.exdata.annotation_dict) self.asse...
code_fim
hard
{ "lang": "python", "repo": "victorwyee/lungbox", "path": "/tests/test_training_data.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> Returns: train_features: dictionary of feature tensors that can be used for training metadata_features: dictionary of feature tensors that can be used as additional metadata """ train_features, metadata_features = define_feature_layer( feature_co...
code_fim
hard
{ "lang": "python", "repo": "yakkanti/ml4ir", "path": "/python/ml4ir/base/model/scoring/interaction_model.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: yakkanti/ml4ir path: /python/ml4ir/base/model/scoring/interaction_model.py from tensorflow.keras import Input import tensorflow as tf from ml4ir.base.features.feature_config import FeatureConfig from ml4ir.base.features.feature_layer import FeatureLayerMap from ml4ir.base.features.feature_layer ...
code_fim
hard
{ "lang": "python", "repo": "yakkanti/ml4ir", "path": "/python/ml4ir/base/model/scoring/interaction_model.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> self, train_features: Dict[str, tf.Tensor], metadata_features: Dict[str, tf.Tensor] ): """ Transform train_features and metadata_features after the univariate feature_layer fns have been applied. Args: train_features: dictionary of feature tensors t...
code_fim
hard
{ "lang": "python", "repo": "yakkanti/ml4ir", "path": "/python/ml4ir/base/model/scoring/interaction_model.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: bhinz/salt-formula-ceph path: /ceph/files/testinfra/test_health.py import pytest testinfra_hosts = ['salt://I@ceph:mon'] <|fim_suffix|> print(cmd.stdout) assert 'HEALTH_OK' in cmd.stdout<|fim_middle|>@pytest.mark.parametrize('cmd', [ 'ceph health', 'ceph status', 'ceph osd tr...
code_fim
hard
{ "lang": "python", "repo": "bhinz/salt-formula-ceph", "path": "/ceph/files/testinfra/test_health.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> print(cmd.stdout) assert 'HEALTH_OK' in cmd.stdout<|fim_prefix|># repo: bhinz/salt-formula-ceph path: /ceph/files/testinfra/test_health.py import pytest testinfra_hosts = ['salt://I@ceph:mon'] @pytest.mark.parametrize('cmd', [ 'ceph health', 'ceph status', 'ceph osd tree', 'ceph...
code_fim
medium
{ "lang": "python", "repo": "bhinz/salt-formula-ceph", "path": "/ceph/files/testinfra/test_health.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: mnhan32/DIT path: /dit_flow/dit_widget/minsec_to_decimal.py #! /usr/bin/python import re import csv import rill @rill.component @rill.inport('INFILE') @rill.inport('OUTFILE') @rill.outport('OUTFILE_OUT') def minsec_to_decimal(INFILE, OUTFILE, OUTFILE_OUT): """Convert lat/long coordinates f...
code_fim
hard
{ "lang": "python", "repo": "mnhan32/DIT", "path": "/dit_flow/dit_widget/minsec_to_decimal.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # data = io.pull(infile, str) # # out = [] # for coord in data: # # Splits each coordinate pair into degrees, minutes, seconds, and # # hemisphere marker. # coord = ','.join(coord) # coord = coord.upper() # subs = re.split(r'\s*[\xb0"\',]\s*|.(?=[NESW])...
code_fim
hard
{ "lang": "python", "repo": "mnhan32/DIT", "path": "/dit_flow/dit_widget/minsec_to_decimal.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: urvashikhanna/DAMS path: /src/preprocess.py # encoding=utf-8 import argparse from others.logging import init_logger from prepro import json_to_data as data_builder def str2bool(v): if v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f'...
code_fim
hard
{ "lang": "python", "repo": "urvashikhanna/DAMS", "path": "/src/preprocess.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # json_to_data args parser.add_argument('-log_file', default='logs/json_to_data.log') parser.add_argument("-bert_dir", default='bert/bert_base_uncased') parser.add_argument('-min_src_ntokens_per_sent', default=2, type=int) parser.add_argument('-max_src_ntokens_per_sent', default=50, ty...
code_fim
hard
{ "lang": "python", "repo": "urvashikhanna/DAMS", "path": "/src/preprocess.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ethanperez/Snakelet path: /digitalocean/__init__.py from .account import Account from .actions import Action from .domain import Domain from .record import Record from .droplet import Droplet from .image import Image from .key import Key from .region import Region from .size import Size <|fim_su...
code_fim
medium
{ "lang": "python", "repo": "ethanperez/Snakelet", "path": "/digitalocean/__init__.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.account = Account(token) self.action = Action(token) self.domain = Domain(token) self.record = Record(token) self.droplet = Droplet(token) self.image = Image(token) self.key = Key(token) self.region = Region(token) self.size = Size(token)<|fim_prefix|># repo: ethan...
code_fim
medium
{ "lang": "python", "repo": "ethanperez/Snakelet", "path": "/digitalocean/__init__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if -1 < _r < row and -1 < _c < col and (_r, _c) not in visited: visited.add((_r, _c)) if image[_r][_c] == cur_color: image[_r][_c] = newColor que.append((_r, _c)) return None while que: r, ...
code_fim
hard
{ "lang": "python", "repo": "lih627/python-algorithm-templates", "path": "/LeetCodeSolutions/LeetCode_0733.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> while que: r, c = que.pop() helper(r + 1, c) helper(r - 1, c) helper(r, c + 1) helper(r, c - 1) return image<|fim_prefix|># repo: lih627/python-algorithm-templates path: /LeetCodeSolutions/LeetCode_0733.py class Solution: def...
code_fim
hard
{ "lang": "python", "repo": "lih627/python-algorithm-templates", "path": "/LeetCodeSolutions/LeetCode_0733.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: lih627/python-algorithm-templates path: /LeetCodeSolutions/LeetCode_0733.py class Solution: def floodFill(self, image: List[List[int]], sr: int, sc: int, newColor: int) -> List[List[int]]: <|fim_suffix|> if -1 < _r < row and -1 < _c < col and (_r, _c) not in visited: ...
code_fim
hard
{ "lang": "python", "repo": "lih627/python-algorithm-templates", "path": "/LeetCodeSolutions/LeetCode_0733.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: geoffreynyaga/ANGA-UTM path: /flight_plans/migrations/0001_initial.py # -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2018-01-11 08:07 from __future__ import unicode_literals from django.conf import settings import django.contrib.gis.db.models.fields from django.db import migration...
code_fim
hard
{ "lang": "python", "repo": "geoffreynyaga/ANGA-UTM", "path": "/flight_plans/migrations/0001_initial.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>Field(max_length=20)), ('location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='flight_plans.MissionLocation')), ], ), migrations.AddField( model_name='preflight', name='sitesurvey', field=models....
code_fim
hard
{ "lang": "python", "repo": "geoffreynyaga/ANGA-UTM", "path": "/flight_plans/migrations/0001_initial.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('objective', models.CharField(choices=[('TRAIN', 'Training'), ('MAPP', 'Mapping'), ('3DM', '3D Mapping'), ('DELV', 'Delivery'), ('INSP', 'Inspection')...
code_fim
hard
{ "lang": "python", "repo": "geoffreynyaga/ANGA-UTM", "path": "/flight_plans/migrations/0001_initial.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> class MorphologyMeanCenterer(PointTranslater): def __init__(self, morph, PtSrc=None): PtSrc = SVVisitorFactory.Array3AllPoints() if PtSrc == None else PtSrc offset = getMean(PtSrc(morph)) * -1.0 super(MorphologyMeanCenterer, self).__init__(offset) class MorphologyPCARotato...
code_fim
hard
{ "lang": "python", "repo": "unidesigner/morphforge", "path": "/src/morphforge/morphology/ui/morphmaths.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|>class PointTranslater(object): def __init__(self, offset): self.offset = offset def __call__(self, pt): return pt + self.offset class MorphologyMeanCenterer(PointTranslater): def __init__(self, morph, PtSrc=None): PtSrc = SVVisitorFactory.Array3AllPoints() if P...
code_fim
hard
{ "lang": "python", "repo": "unidesigner/morphforge", "path": "/src/morphforge/morphology/ui/morphmaths.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: unidesigner/morphforge path: /src/morphforge/morphology/ui/morphmaths.py #------------------------------------------------------------------------------- # Copyright (c) 2012 Michael Hull. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification,...
code_fim
hard
{ "lang": "python", "repo": "unidesigner/morphforge", "path": "/src/morphforge/morphology/ui/morphmaths.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: Ensembl/tark path: /tark/tark_web/tests/test_sequtils.py """ .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with th...
code_fim
medium
{ "lang": "python", "repo": "Ensembl/tark", "path": "/tark/tark_web/tests/test_sequtils.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>from django.test.testcases import TestCase from tark_web.utils.sequtils import TarkSeqUtils import os class SeqUtilsTest(TestCase): # ./manage.py test tark_web.tests.test_sequtils --settings=tark.settings.test def test_format_fasta(self): sequence = "GATTGCGCCACTGCACTCCAGCCTGGGCGTGCAGAT...
code_fim
hard
{ "lang": "python", "repo": "Ensembl/tark", "path": "/tark/tark_web/tests/test_sequtils.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: rmjarvis/TreeCorr path: /treecorr/kgcorrelation.py rms, # with or without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions, and the disclaimer given in the accom...
code_fim
hard
{ "lang": "python", "repo": "rmjarvis/TreeCorr", "path": "/treecorr/kgcorrelation.py", "mode": "psm", "license": "BSD-2-Clause-Views", "source": "the-stack-v2" }
<|fim_suffix|> self._process_all_cross(cat1, cat2, metric, num_threads, comm, low_mem) if finalize: vark = calculateVarK(cat1, low_mem=low_mem) varg = calculateVarG(cat2, low_mem=low_mem) self.logger.info("vark = %f: sig_k = %f",vark,math.sqrt(vark)) self....
code_fim
hard
{ "lang": "python", "repo": "rmjarvis/TreeCorr", "path": "/treecorr/kgcorrelation.py", "mode": "spm", "license": "BSD-2-Clause-Views", "source": "the-stack-v2" }
<|fim_suffix|> """Clear the data vectors """ self.xi.ravel()[:] = 0 self.xi_im.ravel()[:] = 0 self.meanr.ravel()[:] = 0 self.meanlogr.ravel()[:] = 0 self.weight.ravel()[:] = 0 self.npairs.ravel()[:] = 0 self._varxi = None self._cov = None ...
code_fim
hard
{ "lang": "python", "repo": "rmjarvis/TreeCorr", "path": "/treecorr/kgcorrelation.py", "mode": "spm", "license": "BSD-2-Clause-Views", "source": "the-stack-v2" }
<|fim_prefix|># repo: cheunhong/dynamic-singer path: /target-bigquery/setup.py #!/usr/bin/env python from setuptools import setup setup( name = 'target-bigquery', version = '1.6.0', description = 'Singer.io target for writing data to Google BigQuery<|fim_suffix|>0', 'google-cloud-bigquery>=1.9.0'...
code_fim
hard
{ "lang": "python", "repo": "cheunhong/dynamic-singer", "path": "/target-bigquery/setup.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>0', 'google-cloud-bigquery>=1.9.0', 'oauth2client', ], entry_points = """ [console_scripts] target-bigquery=target_bigquery:main """, )<|fim_prefix|># repo: cheunhong/dynamic-singer path: /target-bigquery/setup.py #!/usr/bin/env python from setuptools im...
code_fim
hard
{ "lang": "python", "repo": "cheunhong/dynamic-singer", "path": "/target-bigquery/setup.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> class TestCase3(TestBincountOp): # empty input def init_test_case(self): self.minlength = 0 self.np_input = np.array([], dtype=np.int64) self.Out = np.bincount(self.np_input, minlength=self.minlength) class TestCase4(TestBincountOp): # with input(INT32) def init_...
code_fim
hard
{ "lang": "python", "repo": "PaddlePaddle/Paddle", "path": "/test/legacy_test/test_bincount_op.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> paddle.disable_static() paddle.seed(2022) self.temp_dir = tempfile.TemporaryDirectory() self.save_path = os.path.join( self.temp_dir.name, 'tensor_minlength_bincount' ) self.place = ( paddle.CUDAPlace(0) if paddle.is_compi...
code_fim
hard
{ "lang": "python", "repo": "PaddlePaddle/Paddle", "path": "/test/legacy_test/test_bincount_op.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: PaddlePaddle/Paddle path: /test/legacy_test/test_bincount_op.py # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # 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 L...
code_fim
hard
{ "lang": "python", "repo": "PaddlePaddle/Paddle", "path": "/test/legacy_test/test_bincount_op.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: VanessaVieiraVV/autocomplete path: /controle.py from palavra import * from lista import Lista ''' Você também deve implementar a classe Controle, que é responsável por fornecer as funcionalidades de carregarDados e find para carregar o arquivo de consultas e ordená-las (OK), e encontrar a lista d...
code_fim
hard
{ "lang": "python", "repo": "VanessaVieiraVV/autocomplete", "path": "/controle.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def __firstIndexOf(self, prefixo): inicio = 0 fim = self.numeroTermos-1 #numeroTermos eh uma variavel gerada em carregarDados(), com a primeira linha do arquivo.txt pos = -1 while inicio <= fim: meio = (inicio+fim)//2 if meio > -1: ...
code_fim
hard
{ "lang": "python", "repo": "VanessaVieiraVV/autocomplete", "path": "/controle.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> lista_de_sugestoes = list() #lista simples onde serao guardadas TODAS as ocorrencias que tem o prefixo em ordem lexicografica indice = self.__firstIndexOf(prefixo) ultimoIndice = self.__lastIndexOf(prefixo) if indice != None and ultimoIndice != None: if indice >...
code_fim
hard
{ "lang": "python", "repo": "VanessaVieiraVV/autocomplete", "path": "/controle.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: MrDLontheway/spark path: /python/pyspark/sql/tests/connect/test_connect_function.py # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. ...
code_fim
hard
{ "lang": "python", "repo": "MrDLontheway/spark", "path": "/python/pyspark/sql/tests/connect/test_connect_function.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> cdf = self.connect.sql(query) sdf = self.spark.sql(query) for c in ["a", "b", "c"]: self.assert_eq( cdf.orderBy(CF.asc(c)).toPandas(), sdf.orderBy(SF.asc(c)).toPandas(), ) self.assert_eq( cdf.order...
code_fim
hard
{ "lang": "python", "repo": "MrDLontheway/spark", "path": "/python/pyspark/sql/tests/connect/test_connect_function.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> _MUMMY.__init__(self) self.name = "MUMMIES" self.specie = 'nouns' self.basic = "mummy" self.jsondata = {}<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/nouns/_mummies.py from xai.brain.wordbase.nouns._mummy import _MUMMY #calss header class _MUMMIES(_MUMMY, ): <|fim_middle|> de...
code_fim
easy
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/nouns/_mummies.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/nouns/_mummies.py from xai.brain.wordbase.nouns._mummy import _MUMMY <|fim_suffix|> _MUMMY.__init__(self) self.name = "MUMMIES" self.specie = 'nouns' self.basic = "mummy" self.jsondata = {}<|fim_middle|>#calss header class _MUMMIES(_MUMMY, ): de...
code_fim
medium
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/nouns/_mummies.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self,): _MUMMY.__init__(self) self.name = "MUMMIES" self.specie = 'nouns' self.basic = "mummy" self.jsondata = {}<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/nouns/_mummies.py from xai.brain.wordbase.nouns._mummy import _MUMMY <|fim_middle|>#calss header class ...
code_fim
easy
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/nouns/_mummies.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> model = Post fields=('title', 'title_tag','body') widgets ={ 'title': forms.TextInput(attrs={'class': 'form-control','placeholder':'Title'}), 'title_tag': forms.TextInput(attrs={'class': 'form-control','placeholder':'Title Tag'}), 'body': forms.T...
code_fim
medium
{ "lang": "python", "repo": "Sergiogd112/notesapp", "path": "/noteapp/notify/forms.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Sergiogd112/notesapp path: /noteapp/notify/forms.py from django import forms from .models import Post class PostForm(forms.ModelForm): class Meta: model = Post fields=('title', 'title_tag','author','body') widgets ={ 'title': forms.TextInput(attrs={'clas...
code_fim
medium
{ "lang": "python", "repo": "Sergiogd112/notesapp", "path": "/noteapp/notify/forms.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if not token: logger.warning(f'skipping { self.target } in { self.name }, no token') return gauges = self.generate_gauges('stats', self.name, self.vrops_entity_name, ['vcenter', 'vccluster', 'datacenter']) if not gauges...
code_fim
hard
{ "lang": "python", "repo": "asotirov0/vrops-exporter", "path": "/collectors/ClusterStatsCollector.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> token = self.get_target_tokens() token = token.setdefault(self.target, None) if not token: logger.warning(f'skipping { self.target } in { self.name }, no token') return gauges = self.generate_gauges('stats', self.name, self.vrops_entity_name, ...
code_fim
hard
{ "lang": "python", "repo": "asotirov0/vrops-exporter", "path": "/collectors/ClusterStatsCollector.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: asotirov0/vrops-exporter path: /collectors/ClusterStatsCollector.py from BaseCollector import BaseCollector from tools.Vrops import Vrops import logging logger = logging.getLogger('vrops-exporter') class ClusterStatsCollector(BaseCollector): def __init__(self): super().__init__() ...
code_fim
hard
{ "lang": "python", "repo": "asotirov0/vrops-exporter", "path": "/collectors/ClusterStatsCollector.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: pombredanne/pykit path: /pykit/adt/tests/test_linkedlist.py # -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import unittest from pykit.adt import LinkableItem, LinkedList class TestADT(unittest.TestCase): def test_linkedlist(self): <|fim_suffix|> ...
code_fim
medium
{ "lang": "python", "repo": "pombredanne/pykit", "path": "/pykit/adt/tests/test_linkedlist.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> l.insert_before(foo, items[2]) l.insert_after(bar, items[2]) l.insert_before(head, items[0]) l.append(five) l.insert_after(tail, five) l.remove(items[4]) expected = ["head", 0, 1, "foo", 2, "bar", 3, 5, "tail"] self.assertEqual(list(l), list...
code_fim
hard
{ "lang": "python", "repo": "pombredanne/pykit", "path": "/pykit/adt/tests/test_linkedlist.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: osteotek/yamr path: /cfg.py from configparser import ConfigParser <|fim_suffix|> print(config_path) config = ConfigParser() config.read(config_path) return dict(config.items("YAMR"))<|fim_middle|>def load(config_path):
code_fim
easy
{ "lang": "python", "repo": "osteotek/yamr", "path": "/cfg.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> print(config_path) config = ConfigParser() config.read(config_path) return dict(config.items("YAMR"))<|fim_prefix|># repo: osteotek/yamr path: /cfg.py from configparser import ConfigParser <|fim_middle|>def load(config_path):
code_fim
easy
{ "lang": "python", "repo": "osteotek/yamr", "path": "/cfg.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> callback = util.make_save_policy_callback("data/") policy.learn(total_timesteps, callback=callback) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--gin_config", default='configs/cartpole_data_collect.gin') args = parser.parse_args() ...
code_fim
hard
{ "lang": "python", "repo": "hyzcn/imitation", "path": "/scripts/data_collect.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hyzcn/imitation path: /scripts/data_collect.py import argparse import gin.tf import imitation.util as util import stable_baselines import tensorflow as tf def make_PPO2(env_name): """ Hyperparameters and a vectorized environment for training a PPO2 expert. """ env = util.make_v...
code_fim
medium
{ "lang": "python", "repo": "hyzcn/imitation", "path": "/scripts/data_collect.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--gin_config", default='configs/cartpole_data_collect.gin') args = parser.parse_args() gin.parse_config_file(args.gin_config) main()<|fim_prefix|># repo: hyzcn/imitation path: /scripts/da...
code_fim
medium
{ "lang": "python", "repo": "hyzcn/imitation", "path": "/scripts/data_collect.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> s = Solution() assert [1, 2, 3, 1] == s.distributeCandies(7, 4) assert [5, 2, 3] == s.distributeCandies(10, 3)<|fim_prefix|># repo: linshaoyong/leetcode path: /python/array/1103_distribute_candies_to_people.py class Solution(object): def distributeCandies(self, candies, num_people): ...
code_fim
hard
{ "lang": "python", "repo": "linshaoyong/leetcode", "path": "/python/array/1103_distribute_candies_to_people.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: linshaoyong/leetcode path: /python/array/1103_distribute_candies_to_people.py class Solution(object): def distributeCandies(self, candies, num_people): """ :type candies: int :type num_people: int :rtype: List[int] """ res = [0] * num_people ...
code_fim
hard
{ "lang": "python", "repo": "linshaoyong/leetcode", "path": "/python/array/1103_distribute_candies_to_people.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: dmicev/Python4ScientificComputing_Fundamentals path: /assignment4_Micev/assignment3_step2_Micev_new.py def wall_calc(layers_in_series,layers_in_paralel,fraction): Materials_library={"glassfiber_90mm":2.52,"stucco_25mm":0.037,"facebrick_100mm":0.075,"wood_25mm":0.22, "woodstud_90mm":0.63,"wood...
code_fim
hard
{ "lang": "python", "repo": "dmicev/Python4ScientificComputing_Fundamentals", "path": "/assignment4_Micev/assignment3_step2_Micev_new.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> material.append(Materials_library[anyLayer]) resistances.append(anyLayer) library=dict(zip(resistances,material)) return library, Rsum, Utot series_materials=["wood_bevel","gypsum_13mm","fiberboard_13mm"] paralel_materials=["glassfiber_90mm","woodstud_90mm"] fraction=0.75 wall...
code_fim
hard
{ "lang": "python", "repo": "dmicev/Python4ScientificComputing_Fundamentals", "path": "/assignment4_Micev/assignment3_step2_Micev_new.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: gregcaporaso/q2-types path: /q2_types/metadata/_format.py # ---------------------------------------------------------------------------- # Copyright (c) 2016-2023, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, d...
code_fim
medium
{ "lang": "python", "repo": "gregcaporaso/q2-types", "path": "/q2_types/metadata/_format.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> plugin.register_formats(ImmutableMetadataFormat, ImmutableMetadataDirectoryFormat)<|fim_prefix|># repo: gregcaporaso/q2-types path: /q2_types/metadata/_format.py # ---------------------------------------------------------------------------- # Copyright (c) 2016-2023, QIIME 2 deve...
code_fim
hard
{ "lang": "python", "repo": "gregcaporaso/q2-types", "path": "/q2_types/metadata/_format.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }