text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_prefix|># repo: nickuntitled/FAN path: /gif_gen.py import imageio import os import os.path import cv2 def create_gif(gif_name, path, duration = 0.3): ''' 生成gif文件,原始图片仅支持png格式 gif_name : 字符串,所生成的 gif 文件名,带 .gif 后缀 path : 需要合成为 gif 的图片所在路径 duration : gif 图像时间间隔 ''' <|fim_suffix|> ...
code_fim
hard
{ "lang": "python", "repo": "nickuntitled/FAN", "path": "/gif_gen.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|> gif_name = 'landmarks.gif' path = './save_pics' #指定文件路径 duration = 0.05 create_gif(gif_name, path, duration) if __name__ == "__main__": main()<|fim_prefix|># repo: nickuntitled/FAN path: /gif_gen.py import imageio import os import os.path import cv2 def create_gif(gif_name, path, ...
code_fim
medium
{ "lang": "python", "repo": "nickuntitled/FAN", "path": "/gif_gen.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|> return def main(): gif_name = 'landmarks.gif' path = './save_pics' #指定文件路径 duration = 0.05 create_gif(gif_name, path, duration) if __name__ == "__main__": main()<|fim_prefix|># repo: nickuntitled/FAN path: /gif_gen.py import imageio import os import os.path import cv2 def cre...
code_fim
hard
{ "lang": "python", "repo": "nickuntitled/FAN", "path": "/gif_gen.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: DanPopa46/neo3-boa path: /boa3_test/tests/compiler_tests/test_multiple_expressions.py from boa3.boa3 import Boa3 from boa3.neo.vm.opcode.Opcode import Opcode from boa3.neo.vm.type.Integer import Integer from boa3.neo.vm.type.String import String from boa3_test.tests.boa_test import BoaTest from b...
code_fim
hard
{ "lang": "python", "repo": "DanPopa46/neo3-boa", "path": "/boa3_test/tests/compiler_tests/test_multiple_expressions.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> path = self.get_contract_path('tuple_test', 'MultipleExpressionsInLine.py') output = Boa3.compile(path) self.assertEqual(expected_output, output) engine = TestEngine() result = self.run_smart_contract(engine, path, 'Main', [1, 2]) self.assertEqual(5, result...
code_fim
hard
{ "lang": "python", "repo": "DanPopa46/neo3-boa", "path": "/boa3_test/tests/compiler_tests/test_multiple_expressions.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> @pytest.mark.parametrize( "ingress_controller", [ pytest.param({"extra_args": ["-enable-prometheus-metrics"]}, id="one-additional-cli-args"), ], indirect=True, ) def test_reload_count_after_start(self, kube_apis, smoke_setup, ingress_controller_prere...
code_fim
hard
{ "lang": "python", "repo": "nginxinc/kubernetes-ingress", "path": "/tests/suite/test_smoke.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if request.config.getoption("--skip-fixture-teardown") == "no": print("Clean up the Smoke Application:") delete_common_app(kube_apis, "simple", test_namespace) delete_items_from_yaml(kube_apis, f"{TEST_DATA}/smoke/{request.param}/smoke-ingress.yaml", test_namesp...
code_fim
hard
{ "lang": "python", "repo": "nginxinc/kubernetes-ingress", "path": "/tests/suite/test_smoke.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: nginxinc/kubernetes-ingress path: /tests/suite/test_smoke.py import os import tempfile import pytest import yaml from settings import TEST_DATA from suite.fixtures.fixtures import PublicEndpoint from suite.utils.custom_assertions import wait_and_assert_status_code from suite.utils.resources_util...
code_fim
hard
{ "lang": "python", "repo": "nginxinc/kubernetes-ingress", "path": "/tests/suite/test_smoke.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: dubrayn/dubrayn.github.io path: /examples/mpi4py/p2p_nonblocking_python_v2.py #!/usr/bin/env python from mpi4py import MPI import time <|fim_suffix|>if rank == 0: time.sleep(0.3) data = 'Hello COMM_WORLD !' req = comm.send(data, dest = 1) elif rank == 1: req = comm.irecv(source = 0) f...
code_fim
easy
{ "lang": "python", "repo": "dubrayn/dubrayn.github.io", "path": "/examples/mpi4py/p2p_nonblocking_python_v2.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>if rank == 0: time.sleep(0.3) data = 'Hello COMM_WORLD !' req = comm.send(data, dest = 1) elif rank == 1: req = comm.irecv(source = 0) flag, data = req.test() while not flag: print("waiting (irecv)") time.sleep(0.1) flag, data = req.test() print("Received '%s'" % (data))<|fim_pre...
code_fim
easy
{ "lang": "python", "repo": "dubrayn/dubrayn.github.io", "path": "/examples/mpi4py/p2p_nonblocking_python_v2.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Natim/723e path: /723e_server/django_723e/models/transactions/tests.py # -*- coding: utf-8 -*- from django.test import TransactionTestCase from django.contrib.auth.models import User from django_723e.models.accounts.models import Account from django_723e.models.currency.models import Currency f...
code_fim
hard
{ "lang": "python", "repo": "Natim/723e", "path": "/723e_server/django_723e/models/transactions/tests.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # self.assertEqual(c2.balance, 20) # self.assertEqual(trans1.reference_value(), 100) c2.delete() trans1 = DebitsCredits.objects.get(pk=trans1.pk) # self.assertEqual(trans1.reference_value(), None) # self.assertEqual(trans1.due_to_change(), 20) c3 ...
code_fim
hard
{ "lang": "python", "repo": "Natim/723e", "path": "/723e_server/django_723e/models/transactions/tests.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """Reverse a URL and make it absolute.""" return absoluteuri.reverse(view_name, args=args, kwargs=kwargs) register.filter(name='absolutize')(absoluteuri.build_absolute_uri) @register.simple_tag(name='absolutize') def absolutize_deprecated_tag(*args, **kwargs): warnings.warn( "{% ab...
code_fim
medium
{ "lang": "python", "repo": "bashu/django-absoluteuri", "path": "/absoluteuri/templatetags/absoluteuri.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: bashu/django-absoluteuri path: /absoluteuri/templatetags/absoluteuri.py from __future__ import absolute_import import warnings from django import template <|fim_suffix|> register.filter(name='absolutize')(absoluteuri.build_absolute_uri) @register.simple_tag(name='absolutize') def absolutize_d...
code_fim
hard
{ "lang": "python", "repo": "bashu/django-absoluteuri", "path": "/absoluteuri/templatetags/absoluteuri.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> @register.simple_tag(name='absolutize') def absolutize_deprecated_tag(*args, **kwargs): warnings.warn( "{% absolutize %} tag is deprecated. Use {{ |absolutize }} filter", DeprecationWarning, ) return absoluteuri.build_absolute_uri(*args, **kwargs)<|fim_prefix|># repo: bashu/dj...
code_fim
medium
{ "lang": "python", "repo": "bashu/django-absoluteuri", "path": "/absoluteuri/templatetags/absoluteuri.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: Mattlk13/lophttpd path: /src/tests/test10.py #!/usr/bin/python import os import sys import errno def usage(): <|fim_suffix|> print(arg, os.strerror(e.errno)) exit(e.errno) def main(): if len(sys.argv) == 1: usage() try: os.mkdir(sys.argv[1], 0755) except Exception as e: if e.errno =...
code_fim
medium
{ "lang": "python", "repo": "Mattlk13/lophttpd", "path": "/src/tests/test10.py", "mode": "psm", "license": "LicenseRef-scancode-warranty-disclaimer", "source": "the-stack-v2" }
<|fim_suffix|> try: os.mkdir(sys.argv[1], 0755) except Exception as e: if e.errno == errno.EEXIST: pass else: die('Failed to create directory.', e) try: os.chdir(sys.argv[1]) for i in range(100000): f = open('file-%s' % i, 'w') f.write('X'*1024) f.close() except Exception as e: die('Faile...
code_fim
medium
{ "lang": "python", "repo": "Mattlk13/lophttpd", "path": "/src/tests/test10.py", "mode": "spm", "license": "LicenseRef-scancode-warranty-disclaimer", "source": "the-stack-v2" }
<|fim_suffix|> @pytest.mark.parametrize("num", [1, 2, 3]) def test_passing(num): print(num) assert True<|fim_prefix|># repo: DataDog/integrations-core path: /teamcity/tests/docker/teamcity_agent/test_sample.py import pytest def test_passed(): assert True def test_failed(): assert 1 == 2 @pytest.m...
code_fim
easy
{ "lang": "python", "repo": "DataDog/integrations-core", "path": "/teamcity/tests/docker/teamcity_agent/test_sample.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> print(num) assert True<|fim_prefix|># repo: DataDog/integrations-core path: /teamcity/tests/docker/teamcity_agent/test_sample.py import pytest def test_passed(): assert True def test_failed(): assert 1 == 2 <|fim_middle|> @pytest.mark.skip(reason="Skip this test") def test_skip_this(...
code_fim
medium
{ "lang": "python", "repo": "DataDog/integrations-core", "path": "/teamcity/tests/docker/teamcity_agent/test_sample.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: DataDog/integrations-core path: /teamcity/tests/docker/teamcity_agent/test_sample.py import pytest def test_passed(): assert True def test_failed(): assert 1 == 2 <|fim_suffix|> print(num) assert True<|fim_middle|> @pytest.mark.skip(reason="Skip this test") def test_skip_this(...
code_fim
medium
{ "lang": "python", "repo": "DataDog/integrations-core", "path": "/teamcity/tests/docker/teamcity_agent/test_sample.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> context = super(ArcView, self).get_context_data(**kwargs) arc = self.get_object() context['issue_list'] = arc.issue_set.all().order_by('series__name', 'number') return context class TeamView(generic.DetailView): model = Team template_name = 'comics/team.html' def get_context_data(self, **kwar...
code_fim
hard
{ "lang": "python", "repo": "issackelly/Tenma", "path": "/comics/views.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: issackelly/Tenma path: /comics/views.py from django.shortcuts import get_object_or_404, render from django.views import generic from django.http import HttpResponseRedirect from .models import Series, Issue, Character, Arc, Team, Publisher, Creator, Settings from .utils.cvscraper import CVScrape...
code_fim
hard
{ "lang": "python", "repo": "issackelly/Tenma", "path": "/comics/views.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.object = form.save() return render(self.request, 'comics/settings.html', {'settings': self.object}) def read(request, issue_id): issue = get_object_or_404(Issue, pk=issue_id) return render(request, 'comics/read.html', {'issue': issue}) def importer(request): cvscraper = CVScraper() cvscrap...
code_fim
hard
{ "lang": "python", "repo": "issackelly/Tenma", "path": "/comics/views.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.25, random_state=0 ) # create estimators lasso = Lasso(fit_intercept=True) # create cv search objects for each estimator cv5 = KFold(n_splits=5, shuffle=True, random_state=0) params = {"alpha": np.logspace(-1, 1.5, 20)} lasso_cv...
code_fim
hard
{ "lang": "python", "repo": "CederGroupHub/sparse-lm", "path": "/examples/plot_one_std.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: CederGroupHub/sparse-lm path: /examples/plot_one_std.py """ ========================================= Hyperparameters selection with 1-std rule ========================================= One-standard-deviation rule is a technique to promote model robustness when cross validation results are noisy...
code_fim
hard
{ "lang": "python", "repo": "CederGroupHub/sparse-lm", "path": "/examples/plot_one_std.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: trepca/scrapy path: /scrapy/commands/list.py from scrapy.command import ScrapyCommand from scrapy.spider import spiders <|fim_suffix|> def run(self, args, opts): print "\n".join(spiders.list())<|fim_middle|>class Command(ScrapyCommand): requires_project = True def short_desc...
code_fim
medium
{ "lang": "python", "repo": "trepca/scrapy", "path": "/scrapy/commands/list.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def run(self, args, opts): print "\n".join(spiders.list())<|fim_prefix|># repo: trepca/scrapy path: /scrapy/commands/list.py from scrapy.command import ScrapyCommand from scrapy.spider import spiders class Command(ScrapyCommand): <|fim_middle|> requires_project = True def short_desc...
code_fim
medium
{ "lang": "python", "repo": "trepca/scrapy", "path": "/scrapy/commands/list.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> first_digit = str(random.randint(0, 9)) second_digit = str(random.randint(0, 9)) if (date_type == "year"): return valid[0:2] + first_digit + second_digit + valid[4:] elif (date_type == "day"): return valid[:8] + first_digit + second_digit else: return None de...
code_fim
hard
{ "lang": "python", "repo": "caramelmelmel/50.003-ESC_g_3_8", "path": "/react-app/src/test/fuzzing/testFuzzInvalidDate.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # This test allows us to check if the staff emails that we expect to fail will actually fail the regex check = False while (check == False): invalid_dates = ["2021/12/31", "2078.01.01", "23-05-2099", "28/10/2043", "19.08.2069"] valid = random.choice(invalid_dates) output = fuzz(valid) che...
code_fim
hard
{ "lang": "python", "repo": "caramelmelmel/50.003-ESC_g_3_8", "path": "/react-app/src/test/fuzzing/testFuzzInvalidDate.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: caramelmelmel/50.003-ESC_g_3_8 path: /react-app/src/test/fuzzing/testFuzzInvalidDate.py import random import string import re # This test allows us to check if the dates that we expect to fail will actually fail the regex def fuzz(valid): # Use various methods to fuzz randomly day_bool ...
code_fim
hard
{ "lang": "python", "repo": "caramelmelmel/50.003-ESC_g_3_8", "path": "/react-app/src/test/fuzzing/testFuzzInvalidDate.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Aareon/Pyto path: /Extensions/Dependencies/tools/iosxcrun.py #!/usr/bin/env python3 import sys import shlex import os import subprocess args = sys.argv del args[0] <|fim_suffix|> if is_just_c_not_cpp and arg.startswith("-std=c++"): continue if arg == "-march=native": co...
code_fim
medium
{ "lang": "python", "repo": "Aareon/Pyto", "path": "/Extensions/Dependencies/tools/iosxcrun.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>for arg in sys.argv: if is_just_c_not_cpp and arg.startswith("-std=c++"): continue if arg == "-march=native": continue elif "MacOSX" in arg or "macosx" in arg: if arg.endswith("MacOSX.sdk"): arg = subprocess.run("xcrun -sdk iphoneos --show-sdk-path".split(...
code_fim
medium
{ "lang": "python", "repo": "Aareon/Pyto", "path": "/Extensions/Dependencies/tools/iosxcrun.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: willrp/willbuyer path: /backend/tests/unit/controller/api/store/gender/test_gender_controller.py import pytest import responses import re from flask import json from copy import deepcopy from json.decoder import JSONDecodeError from requests import ConnectionError from backend.util.request.store...
code_fim
hard
{ "lang": "python", "repo": "willrp/willbuyer", "path": "/backend/tests/unit/controller/api/store/gender/test_gender_controller.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> mocker.patch.object(GenderRequest, method, side_effect=error) make_request = get_request_function(http_method) response = make_request( test_url ) data = json.loads(response.data) ErrorSchema().load(data) assert response.status_code == status_code @pytest.mark.para...
code_fim
hard
{ "lang": "python", "repo": "willrp/willbuyer", "path": "/backend/tests/unit/controller/api/store/gender/test_gender_controller.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """Receive a python logger (logging.Logger) which has been configured by AMsoil.""" logger = logging.getLogger(log_name) if prefix: return PrefixAdapter(logger, prefix) else: return logger class PrefixAdapter(logging.LoggerAdapter): """Internal class for wrapping logg...
code_fim
hard
{ "lang": "python", "repo": "dana-i2cat/felix", "path": "/modules/resource/manager/stitching-entity/src/core/log.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: dana-i2cat/felix path: /modules/resource/manager/stitching-entity/src/core/log.py """ This module provides logging facilities. More specifically, it provides a way to get to a (configured) python logger. Hence the interface of this logger is the same as the python one (so please direct all compla...
code_fim
hard
{ "lang": "python", "repo": "dana-i2cat/felix", "path": "/modules/resource/manager/stitching-entity/src/core/log.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: CasperWA/aiidalab-empa-scanning-probe path: /common.py from aiida.orm import load_node from aiida.orm.querybuilder import QueryBuilder from aiida.orm.calculation.work import WorkCalculation from aiida.orm.calculation.job import JobCalculation path_to_stm_viewer = "scanning_probe/stm/view_stm.ip...
code_fim
hard
{ "lang": "python", "repo": "CasperWA/aiidalab-empa-scanning-probe", "path": "/common.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if "df.npy" not in afm_pp.out.retrieved.get_folder_list(): raise(Exception("df.npy was not retrieved!")) if "df.npy" not in afm_2pp.out.retrieved.get_folder_list(): raise(Exception("df.npy was not retrieved!")) structure = workcalc.inp.structure ...
code_fim
hard
{ "lang": "python", "repo": "CasperWA/aiidalab-empa-scanning-probe", "path": "/common.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: roadsideseb/geldmaschine path: /geldmaschine/scrapers/au/nab.py import os from bs4 import BeautifulSoup from decimal import Decimal as D from ..base import BaseAccountScraper class NabAccountScraper(BaseAccountScraper): scrape_code = 'nab' default_currency = 'AUD' def login(self)...
code_fim
hard
{ "lang": "python", "repo": "roadsideseb/geldmaschine", "path": "/geldmaschine/scrapers/au/nab.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.logger.debug('Retrieving account details') for row in self.browser.find_by_css('ul.account-list li>a'): strings = [ss for ss in BeautifulSoup(row.html).stripped_strings] bsb, acct_number = strings[1].split(' ') amount, typ = strings[-1].split(' ') ...
code_fim
hard
{ "lang": "python", "repo": "roadsideseb/geldmaschine", "path": "/geldmaschine/scrapers/au/nab.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: anatoli-starostin/factRuEval-2016 path: /scripts/dialent/task1/test.py # This module deals with test data representation for the first task ######################################################################################### import os import csv from dialent.config import Config from dia...
code_fim
hard
{ "lang": "python", "repo": "anatoli-starostin/factRuEval-2016", "path": "/scripts/dialent/task1/test.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # set the allowed tags for later self.allowed_tags = set(['org', 'per', 'loc', 'locorg']) self.entities = {} for tag in self.allowed_tags: self.entities[tag] = [] # read the file that should consist of lines like # [TAG]...
code_fim
hard
{ "lang": "python", "repo": "anatoli-starostin/factRuEval-2016", "path": "/scripts/dialent/task1/test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: JTPond/PyPWA path: /tests/data/memory/test_kv.py import os import pytest import PyPWA.data.memory.kv import numpy TEST_KV_DICT_FILE = os.path.join(os.path.dirname(__file__), "test_docs/kv_test_data.txt") TEST_KV_DICT_FILE_2 = os.path.join(os.path.dirname(__file__), "test_docs/kv_test_data2.txt")...
code_fim
medium
{ "lang": "python", "repo": "JTPond/PyPWA", "path": "/tests/data/memory/test_kv.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def test_abstract_methods(): abstract = PyPWA.data.memory.kv.KvInterface() with pytest.raises(NotImplementedError): abstract.parse(TEST_KV_DICT_FILE) with pytest.raises(NotImplementedError): abstract.write(TEST_KV_DICT_FILE_2, {"something": 1}) with pytest.raises(NotImpleme...
code_fim
hard
{ "lang": "python", "repo": "JTPond/PyPWA", "path": "/tests/data/memory/test_kv.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_list_of_booleans(): data = numpy.random.choice([True, False], 50) kv_loader = PyPWA.data.memory.kv.ListOfBooleans() kv_loader.write(TEST_KV_BOOL_FILE, data) loaded = kv_loader.parse(TEST_KV_BOOL_FILE) os.remove(TEST_KV_BOOL_FILE) numpy.testing.assert_array_almost_equal(...
code_fim
hard
{ "lang": "python", "repo": "JTPond/PyPWA", "path": "/tests/data/memory/test_kv.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: yiu-code/Project2.2 path: /kimyiu's kopie/main(kimyiu - Owen)/Pygame_main/Pygame_main/Pause.py import pygame, time, random, basic, Pygame_main from array import array pygame.init basic.screen basic.clock pause = False def paused(): largeText = pygame.font.SysFont(None,300) T...
code_fim
hard
{ "lang": "python", "repo": "yiu-code/Project2.2", "path": "/kimyiu's kopie/main(kimyiu - Owen)/Pygame_main/Pygame_main/Pause.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> global pause pause = False def pause_pressed(): for event in pygame.event.get(): if event.type == pygame.KEYDOWN: if event.key == pygame.K_p: pause = True paused()<|fim_prefix|># repo: yiu-code/Project2.2 path: /kimyiu's kopie/...
code_fim
hard
{ "lang": "python", "repo": "yiu-code/Project2.2", "path": "/kimyiu's kopie/main(kimyiu - Owen)/Pygame_main/Pygame_main/Pause.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> operations = [ migrations.RemoveField( model_name='device', name='platform_version', ), migrations.AlterField( model_name='devicemodel', name='model', field=models.CharField(max_length=1024, unique=True), ), ...
code_fim
medium
{ "lang": "python", "repo": "kamau-edwin/PassiveDataKit-Django", "path": "/migrations/0067_auto_20190820_1503.py", "mode": "spm", "license": "LicenseRef-scancode-warranty-disclaimer", "source": "the-stack-v2" }
<|fim_prefix|># repo: kamau-edwin/PassiveDataKit-Django path: /migrations/0067_auto_20190820_1503.py # pylint: skip-file # -*- coding: utf-8 -*- # Generated by Django 1.11.23 on 2019-08-20 20:03 from __future__ import unicode_literals <|fim_suffix|> dependencies = [ ('passive_data_kit', '0066_auto_2019082...
code_fim
medium
{ "lang": "python", "repo": "kamau-edwin/PassiveDataKit-Django", "path": "/migrations/0067_auto_20190820_1503.py", "mode": "psm", "license": "LicenseRef-scancode-warranty-disclaimer", "source": "the-stack-v2" }
<|fim_suffix|> @classmethod def get_incidents(cls): ''' Returns a geojson feature collection of incidents or None if no data is found. ''' cls.get_geojson(cls.service_url) class Closures_Feed(_CHART): ''' Access road closures XML feed from CHART. ''' service_url ...
code_fim
hard
{ "lang": "python", "repo": "ATran31/chart-tools", "path": "/ChartTools.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ATran31/chart-tools path: /ChartTools.py import urllib.request import urllib.parse import xml.etree.ElementTree as ET class _CHART(object): ''' Private class to hold common methods accross various child classes that represent CHART data feeds. Should not be called externally. ''' ...
code_fim
hard
{ "lang": "python", "repo": "ATran31/chart-tools", "path": "/ChartTools.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ''' Returns a geojson feature collection of RWIS sensors or None if no data is found. Keyword Argument: station_name (optional) -- The name of the station to filter by e.g. 'IS 270 N, North of MD 80' ''' if station_name is None: return cls.get_g...
code_fim
hard
{ "lang": "python", "repo": "ATran31/chart-tools", "path": "/ChartTools.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>#save predictions and r2 scores together model_output = pd.DataFrame([exp_data, predictions_all, predictions_sel]).transpose() model_output.columns = ['exp_data', 'predictions_all_' + str(scores_all), 'predictions_sel_' + str(scores_sel)] model_output.index = tf_data_proc.index model_output.to_csv('Result...
code_fim
hard
{ "lang": "python", "repo": "SysBioChalmers/Hyena", "path": "/Hyena_FeatureSelection.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: SysBioChalmers/Hyena path: /Hyena_FeatureSelection.py # -*- coding: utf-8 -*- """ Script to run the feature selection pipeline using mlxtend Part of the Hyena Toolbox (see https://github.com/SysBioChalmers/Hyena) @author: Christoph S. Börlin; Chalmers University of Technology, Gothenburg Sweden "...
code_fim
hard
{ "lang": "python", "repo": "SysBioChalmers/Hyena", "path": "/Hyena_FeatureSelection.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ctrl_symbols = ["[PAD]","[UNK]","[CLS]","[SEP]","[MASK]"] bert_vocab = ctrl_symbols + bert_vocab bert_vocab += ["[UNUSED_{}]".format(i) for i in range(VOC_SIZE - len(bert_vocab))] print(len(bert_vocab)) VOC_FNAME = inputFile+".vocab" #@param {type:"string"} with open(VOC_FNAME, "w") as fo: ...
code_fim
hard
{ "lang": "python", "repo": "rnajim/QARiB", "path": "/prepare_vocab.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: rnajim/QARiB path: /prepare_vocab.py #!/usr/bin/env python # coding: utf-8 import os import sys import json import nltk import random import logging import tensorflow as tf from glob import glob from tensorflow.keras.utils import Progbar sys.path.append("bert") import sentencepiece as spm import...
code_fim
hard
{ "lang": "python", "repo": "rnajim/QARiB", "path": "/prepare_vocab.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> args = parser.parse_args() inputFile = args.infile vocab_size = int(args.vocab_size) total_lines = count_lines(inputFile) bar = Progbar(total_lines) MODEL_PREFIX = "tokenizer" #@param {type: "string"} VOC_SIZE = vocab_size #@param {type:"integer"} SUBSAMPLE_SIZE = 5600000 #total_lines ...
code_fim
hard
{ "lang": "python", "repo": "rnajim/QARiB", "path": "/prepare_vocab.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: iwcharlton/minecraft-monitor path: /minecraft_monitor/server.py #!/usr/bin/env python import ast import copy import datetime import gzip import json import os import re import signal import subprocess from enum import Enum from flask import request from flask_socketio import emit from log_parser...
code_fim
hard
{ "lang": "python", "repo": "iwcharlton/minecraft-monitor", "path": "/minecraft_monitor/server.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def get_server(self): if self.locked: return None else: return self def refresh_server(self): self.whitelist.parse_whitelist() self.load_properties() self.load_logs() for wl in self.whitelist.whitelist: if wl['name'] not in self.players: self.players[...
code_fim
hard
{ "lang": "python", "repo": "iwcharlton/minecraft-monitor", "path": "/minecraft_monitor/server.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.locked = True # Lazy instantiation of the parser if not self.log_parser: dir_path = os.path.dirname(os.path.realpath(__file__)) config_path = os.path.join(dir_path, 'logparse-config.json') if os.path.exists(config_path): print('loading log parser config...')...
code_fim
hard
{ "lang": "python", "repo": "iwcharlton/minecraft-monitor", "path": "/minecraft_monitor/server.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>ource = name_url.json()[3][0] except: source = "Not found" return source<|fim_prefix|># repo: MathisBurger/SLF-engine path: /data-scraper/wikipedia.py import requests def get_wikipedia_link(name): name_url = requests.get(f"https://de.wikipedia.org/w/api.php?action=opensearch&format=...
code_fim
medium
{ "lang": "python", "repo": "MathisBurger/SLF-engine", "path": "/data-scraper/wikipedia.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: MathisBurger/SLF-engine path: /data-scraper/wikipedia.py import requests def get_wikipedia_link(name): name_url = requests.get(f"https://de.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2" <|fim_suffix|>ource = name_url.json()[3][0] except: ...
code_fim
medium
{ "lang": "python", "repo": "MathisBurger/SLF-engine", "path": "/data-scraper/wikipedia.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Krotonus/luke path: /examples_allennlp/utils/wiki_mention_detector/wiki_link_db.py import click import logging import multiprocessing from contextlib import closing from multiprocessing.pool import Pool import joblib import marisa_trie from tqdm import tqdm from wikipedia2vec.dump_db import Dum...
code_fim
hard
{ "lang": "python", "repo": "Krotonus/luke", "path": "/examples_allennlp/utils/wiki_mention_detector/wiki_link_db.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> joblib.dump( dict(title_trie=self._title_trie, mention_trie=self._mention_trie, data_trie=self._data_trie), out_file ) @staticmethod def build(dump_db, mention_db, out_file, pool_size, chunk_size): title_trie = marisa_trie.Trie(dump_db.titles()) data = ...
code_fim
hard
{ "lang": "python", "repo": "Krotonus/luke", "path": "/examples_allennlp/utils/wiki_mention_detector/wiki_link_db.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> title_trie = marisa_trie.Trie(dump_db.titles()) data = {} with tqdm(total=dump_db.page_size(), mininterval=0.5) as pbar: initargs = (dump_db, mention_db, title_trie) with closing(Pool(pool_size, initializer=WikiLinkDB._initialize_worker, initargs=initargs))...
code_fim
hard
{ "lang": "python", "repo": "Krotonus/luke", "path": "/examples_allennlp/utils/wiki_mention_detector/wiki_link_db.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: nikeftekhar/compas_assembly path: /examples/wall_sequence_equilibrium_rhino.py """Compute the contact forces required for static equilibrium of an assembly. 1. Make an Xfunc of ``compute_interface_forces`` 2. Load an assembly from a JSON file. 3. Make a sub-assembly corresponding to the building...
code_fim
hard
{ "lang": "python", "repo": "nikeftekhar/compas_assembly", "path": "/examples/wall_sequence_equilibrium_rhino.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|># create a sub_assembly for the sequence sub = assembly.subset(sequence) # check if the sub_assembly is supported supports = list(sub.vertices_where({'is_support': True})) if not supports: raise Exception('The sub-assembly has no supports.') # compute the interface forces compute_interface_force...
code_fim
hard
{ "lang": "python", "repo": "nikeftekhar/compas_assembly", "path": "/examples/wall_sequence_equilibrium_rhino.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|># check if the sub_assembly is supported supports = list(sub.vertices_where({'is_support': True})) if not supports: raise Exception('The sub-assembly has no supports.') # compute the interface forces compute_interface_forces(sub, solver='CPLEX', verbose=True) # update the original assembly for u...
code_fim
hard
{ "lang": "python", "repo": "nikeftekhar/compas_assembly", "path": "/examples/wall_sequence_equilibrium_rhino.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> check_backend(backend) from mmseg.models.backbones.unet import BasicConvBlock from mmseg.models.utils import UpConvBlock head = UpConvBlock(BasicConvBlock, 16, 8, 8).eval() dynamic_axes = { 'x': { 0: 'b', 2: 'h', 3: 'w' }, 's...
code_fim
hard
{ "lang": "python", "repo": "open-mmlab/mmdeploy", "path": "/tests/test_codebase/test_mmseg/test_mmseg_models.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: open-mmlab/mmdeploy path: /tests/test_codebase/test_mmseg/test_mmseg_models.py # Copyright (c) OpenMMLab. All rights reserved. import mmengine import pytest import torch from packaging import version from mmdeploy.codebase import import_codebase from mmdeploy.utils import Backend, Codebase, Task...
code_fim
hard
{ "lang": "python", "repo": "open-mmlab/mmdeploy", "path": "/tests/test_codebase/test_mmseg/test_mmseg_models.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> deploy_cfg = mmengine.Config( dict( backend_config=dict(type=backend.value), onnx_config=dict( output_names=['result'], input_shape=(1, 8, 16, 16)), codebase_config=dict(type='mmseg', task='Segmentation'))) feats = torch.randn(1, 8, 16, 1...
code_fim
hard
{ "lang": "python", "repo": "open-mmlab/mmdeploy", "path": "/tests/test_codebase/test_mmseg/test_mmseg_models.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> (h, p) = encoding.encode(None) options = {'path': dir1 + os.path.sep + 'a.txt', 'data': p} sm.storage.put(options) (head, payl) = sm.storage.get(options) decode = encoding.decode(header=head, value=payl) assert decode is None def test_put_get(): options = {'path': dir1 + os.pa...
code_fim
hard
{ "lang": "python", "repo": "kube-HPC/python-wrapper.hkube", "path": "/tests/test_storage_manager_fs.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: kube-HPC/python-wrapper.hkube path: /tests/test_storage_manager_fs.py import os import shutil import pytest from hkube_python_wrapper.storage.storage_manager import StorageManager from hkube_python_wrapper.util.encoding import Encoding from tests.configs import config def ensure_dir(dirName): ...
code_fim
hard
{ "lang": "python", "repo": "kube-HPC/python-wrapper.hkube", "path": "/tests/test_storage_manager_fs.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if rel_indices.shape[0] > 0: for index, k in enumerate(ks): rel_labels = topk_labels[rel_indices, : int(k)].squeeze() recalls[rel_indices, index] = ( torch.div(torch.sum(rel_labels, dim=-1), rel_count) .reshape(len(rel_indices), 1) ...
code_fim
hard
{ "lang": "python", "repo": "rnyak/T4R", "path": "/Source_code/transformers4rec/evaluation/ranking_metrics_torch/precision_recall.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: rnyak/T4R path: /Source_code/transformers4rec/evaluation/ranking_metrics_torch/precision_recall.py import torch from .common import _check_inputs, _create_output_placeholder, _extract_topk def precision_at( ks: torch.Tensor, scores: torch.Tensor, labels: torch.Tensor ) -> torch.Tensor: ...
code_fim
hard
{ "lang": "python", "repo": "rnyak/T4R", "path": "/Source_code/transformers4rec/evaluation/ranking_metrics_torch/precision_recall.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>def _test_at(): scores = torch.arange(0, 1, step=0.1).expand((1, 10)) ks = torch.LongTensor([1, 2, 3, 10]) print("scores:{}".format(scores)) print("ks:{}".format(ks)) print("-" * 10 + "\ntest1") labels = torch.LongTensor([1, 0, 0, 0, 0, 0, 0, 0, 0, 1]).expand((1, 10)) print("l...
code_fim
hard
{ "lang": "python", "repo": "rnyak/T4R", "path": "/Source_code/transformers4rec/evaluation/ranking_metrics_torch/precision_recall.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>tpot = TPOTClassifier(generations=5, warm_start=True, verbosity=2, config_dict='TPOT sparse') pipe = make_pipeline( TfidfVectorizer(stop_words='english', ngram_range=(1, 2), min_df=5), tpot ) pipe.fit(X, y) tpot.export('output/tpot_pipeline.py')<|fim_prefix|># repo: jordanparker6/skle...
code_fim
hard
{ "lang": "python", "repo": "jordanparker6/sklearn-textclassifier", "path": "/train/TPOT_Classification.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: jordanparker6/sklearn-textclassifier path: /train/TPOT_Classification.py from tpot import TPOTClassifier from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.pipeline import make_pipeline import pandas as pd <|fim_suffix|>tpot = TPOTClassifier(generations=5, warm_start=True, ...
code_fim
hard
{ "lang": "python", "repo": "jordanparker6/sklearn-textclassifier", "path": "/train/TPOT_Classification.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>data = pd.read_csv("input/data.csv").dropna() X, y = (data["text"], data["label"]) tpot = TPOTClassifier(generations=5, warm_start=True, verbosity=2, config_dict='TPOT sparse') pipe = make_pipeline( TfidfVectorizer(stop_words='english', ngram_range=(1, 2), min_df=5), tpot ) pipe.fit(X...
code_fim
hard
{ "lang": "python", "repo": "jordanparker6/sklearn-textclassifier", "path": "/train/TPOT_Classification.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: duncanrhamill/cell-map path: /tools/plot_line_iter.py ''' Plots a line iteration from a line step report Enable the "debug_iters" feature to produce reports ''' import matplotlib.pyplot as plt import numpy as np from math import floor, ceil import json import argparse def plot(report): <|fim_s...
code_fim
hard
{ "lang": "python", "repo": "duncanrhamill/cell-map", "path": "/tools/plot_line_iter.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> parser = argparse.ArgumentParser(description='Plots a map JSON file') parser.add_argument('report_path', metavar='P', type=str, nargs=1, help='path to the line_step_report.json file to plot') args = parser.parse_args() with open(args.report_path[0], 'r') as f: report = js...
code_fim
medium
{ "lang": "python", "repo": "duncanrhamill/cell-map", "path": "/tools/plot_line_iter.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ax.set_xticks(np.arange(report[0]['current_map'][0], report[-1]['current_map'][0], 1.0)) ax.set_yticks(np.arange(report[0]['current_map'][1], report[-1]['current_map'][1], -1.0)) ax.xaxis.grid(True) ax.yaxis.grid(True) for i, step in enumerate(report): ax.plot( ste...
code_fim
medium
{ "lang": "python", "repo": "duncanrhamill/cell-map", "path": "/tools/plot_line_iter.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: gurleen-kaur1313/OldBooksell-purchase_website path: /home/admin.py from django.contrib import admin from .models imp<|fim_suffix|>ls here. admin.site.register(books), admin.site.register(Order), admin.site.register(TrackUpdate),<|fim_middle|>ort books,Order,TrackUpdate # Register your mode
code_fim
easy
{ "lang": "python", "repo": "gurleen-kaur1313/OldBooksell-purchase_website", "path": "/home/admin.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>egister(Order), admin.site.register(TrackUpdate),<|fim_prefix|># repo: gurleen-kaur1313/OldBooksell-purchase_website path: /home/admin.py from django.contrib import admin from .models imp<|fim_middle|>ort books,Order,TrackUpdate # Register your models here. admin.site.register(books), admin.site.r
code_fim
medium
{ "lang": "python", "repo": "gurleen-kaur1313/OldBooksell-purchase_website", "path": "/home/admin.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> base_data = get_parquet_test_data("test-data.parquet") reference_signal, target_signal = "A", "B" sources = { reference_signal: {"data": base_data.copy(), "ref_column": "ACCELERATION_Z"}, target_signal: {"data": base_data, "ref_column": "ACCELERATION_Z"}, } extractor = ...
code_fim
hard
{ "lang": "python", "repo": "hpi-dhc/jointly", "path": "/tests/test_shake_extractor.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hpi-dhc/jointly path: /tests/test_shake_extractor.py import pandas as pd import pytest from jointly import ShakeExtractor, Synchronizer, BadWindowException from tests.parquet_reader import get_parquet_test_data <|fim_suffix|> e = ShakeExtractor() with pytest.raises(ValueError): e...
code_fim
medium
{ "lang": "python", "repo": "hpi-dhc/jointly", "path": "/tests/test_shake_extractor.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def world_update(action): global x global pollen percepts = [] reward = 0 if action=="left" and x>-XMAX: if pollen and abs(x-1)<abs(x): percepts.append(("fullbee",1-abs(x-1)/XMAX)) #reward += RPB*(1-abs(x-1)/XMAX)*((1-abs(x-1)/XMAX)>0) if (n...
code_fim
hard
{ "lang": "python", "repo": "alexis-jacq/Mutual_Modelling", "path": "/tools/beehive_game.py", "mode": "spm", "license": "ISC", "source": "the-stack-v2" }
<|fim_prefix|># repo: alexis-jacq/Mutual_Modelling path: /tools/beehive_game.py #!/usr/bin/env python # coding: utf-8 import numpy as np import random from mutualModelling import model import matplotlib.pyplot as plt import copy def create_bee(RT,RF,RPB,RP,RH): bee = model.Model("bee") bee.add_events(["trap"...
code_fim
hard
{ "lang": "python", "repo": "alexis-jacq/Mutual_Modelling", "path": "/tools/beehive_game.py", "mode": "psm", "license": "ISC", "source": "the-stack-v2" }
<|fim_suffix|> return percepts,reward action = "right" for j in range(1): bee = create_bee(RT,RF,RPB,RP,RH) bee2 = create_bee(RT,RF,RPB,RP,RH) for i in range(TMAX): p,r = world_update(action) #if i>2000. and i<2500: # p = None if p: action = bee.update(per...
code_fim
hard
{ "lang": "python", "repo": "alexis-jacq/Mutual_Modelling", "path": "/tools/beehive_game.py", "mode": "spm", "license": "ISC", "source": "the-stack-v2" }
<|fim_suffix|> run_p.add_argument( 'recipe', help='The recipe to execute') run_p.add_argument( 'props', nargs=argparse.REMAINDER, type=parse_prop, help=( 'A list of property pairs; e.g. mastername=chromium.linux ' 'issue=12345. The property value will be decoded as JSON, but if ' ...
code_fim
hard
{ "lang": "python", "repo": "Kryndex/recipes-py", "path": "/recipe_engine/run.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: Kryndex/recipes-py path: /recipe_engine/run.py under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Entry point for running recipes for real (not in testing mode).""" import collections import json import logging import os import sys import traceback from . import ...
code_fim
hard
{ "lang": "python", "repo": "Kryndex/recipes-py", "path": "/recipe_engine/run.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> Returns: A StepData object containing the result of running the step. """ with util.raises((recipe_api.StepFailure, OSError), self._step_runner.stream_engine): step_result = None self._close_through_level(step_config.nest_level) open_step = self._...
code_fim
hard
{ "lang": "python", "repo": "Kryndex/recipes-py", "path": "/recipe_engine/run.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: sagarnikam123/learnNPractice path: /codingBat/python/string1/twoChar.py ####################################################################################################################### # # twoChar # # Given a string and an index, return a string length 2 starting at the given index. ...
code_fim
hard
{ "lang": "python", "repo": "sagarnikam123/learnNPractice", "path": "/codingBat/python/string1/twoChar.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>har("Hello", 5) → "He" # twoChar("Hello", -7) → "He" # twoChar("Hello", 6) → "He" # twoChar("Hello", -1) → "He" # twoChar("yay", 0) → "ya" # #######################################################################################################################<|fim_prefix|># repo: sagarnikam123/le...
code_fim
hard
{ "lang": "python", "repo": "sagarnikam123/learnNPractice", "path": "/codingBat/python/string1/twoChar.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: staugur/passport path: /src/hlm/__init__.py # -*- coding: utf8 -*- # 高层功能封装类 <|fim_suffix|>__all__ = ["UserAppManager", "UserSSOManager", "UserMsgManager", "UserProfileManager"]<|fim_middle|>from ._userapp import UserAppManager from ._usersso import UserSSOManager from ._usermsg import UserMsgMa...
code_fim
medium
{ "lang": "python", "repo": "staugur/passport", "path": "/src/hlm/__init__.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>__all__ = ["UserAppManager", "UserSSOManager", "UserMsgManager", "UserProfileManager"]<|fim_prefix|># repo: staugur/passport path: /src/hlm/__init__.py # -*- coding: utf8 -*- # 高层功能封装类 <|fim_middle|>from ._userapp import UserAppManager from ._usersso import UserSSOManager from ._usermsg import UserMsgMa...
code_fim
medium
{ "lang": "python", "repo": "staugur/passport", "path": "/src/hlm/__init__.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: all-in-one-of/dccpipe path: /pipe/tools/mayatools/utils/utils.py # Interfacing with maya through pymel commands import pymel.core as pm import os import glob import re from PySide2 import QtWidgets from pipe.am import * from pipe.am.environment import Environment from pipe.am.project import Proj...
code_fim
hard
{ "lang": "python", "repo": "all-in-one-of/dccpipe", "path": "/pipe/tools/mayatools/utils/utils.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> return False ''' Helpers for Tagging nodes with flags ''' def tag_node_with_flag(node, flag): if not node_is_tagged_with_flag(node, flag): pm.cmds.lockNode(str(node), l=False) node.addAttr(flag, dv=True, at=bool, h=False, k=True) def untag_node_with_flag(node, flag): if ...
code_fim
hard
{ "lang": "python", "repo": "all-in-one-of/dccpipe", "path": "/pipe/tools/mayatools/utils/utils.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>''' Helper for JSONExporter ''' def get_anchor_points(mesh): verts = mesh.vtx vertpos1 = verts[0].getPosition(space='world') vertpos2 = verts[1].getPosition(space='world') vertpos3 = verts[2].getPosition(space='world') return vertpos1, vertpos2, vertpos3 ''' Helper for JSONEx...
code_fim
hard
{ "lang": "python", "repo": "all-in-one-of/dccpipe", "path": "/pipe/tools/mayatools/utils/utils.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: diamond2nv/GDS2tov30 path: /GDSII_ARef.py Array of structure reference (ARef) Element The ARef element references a cell and repeats it along an array. A cell can be referenced before it is defined. The cells are spaced according the the pitchX, pitchY parameters and the num...
code_fim
hard
{ "lang": "python", "repo": "diamond2nv/GDS2tov30", "path": "/GDSII_ARef.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }