text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|> try: table = re.search("<table.*?eventTable.*?</table>", r.text, re.DOTALL).group() except AttributeError: print "unable to parse url %s" % url continue sitesrow = re.search("<tr.*?eventTableHeader.*?</tr>", table, re.DOTALL).group() sites = re.findall('<a.*?title=...
code_fim
hard
{ "lang": "python", "repo": "llimllib/champsleagueviz", "path": "/europa/dl.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: max601/NetLearner path: /autoencoder.py from __future__ import print_function import numpy as np from netlearner.utils import min_max_scale, standard_scale, maybe_npsave from netlearner.autoencoder import Autoencoder import tensorflow as tf <|fim_suffix|>ae_train_dataset = autoencoder.encode_da...
code_fim
hard
{ "lang": "python", "repo": "max601/NetLearner", "path": "/autoencoder.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>ae_train_dataset = autoencoder.encode_dataset(train_dataset) ae_valid_dataset = autoencoder.encode_dataset(valid_dataset) ae_test_dataset = autoencoder.encode_dataset(test_dataset) tr_fn = maybe_npsave('trainset.ae', ae_train_dataset, 0, ae_train_dataset.shape[0], True) va_fn = maybe_...
code_fim
hard
{ "lang": "python", "repo": "max601/NetLearner", "path": "/autoencoder.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>is provided in each text header.""" , 'github': 'https://github.com/acdh-oeaw/delt', 'purpose_de': 'Ziel von DELT ist die Publikation von Forschungsdaten.', 'purpose_en': 'The purpose of DELT is the publication of research data.', 'version': '0.0.1', 'matomo_id': '84', 'matomo_url'...
code_fim
hard
{ "lang": "python", "repo": "acdh-oeaw/delt", "path": "/webpage/metadata.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>, modality etc. The resulting text corpora can then be analysed with tools such as AntWord ® (http://www.laurenceanthony.net/software/antwordprofiler/), WordSmith ® (https://www.lexically.net/wordsmith/) or others. The majority of participants have German as their dominant language and produced these tex...
code_fim
hard
{ "lang": "python", "repo": "acdh-oeaw/delt", "path": "/webpage/metadata.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: acdh-oeaw/delt path: /webpage/metadata.py # this files contains basic metadata about the project. This data will be used # (by default) in the base.html and index.html PROJECT_METADATA = { 'title': 'DELT', 'author': 'Peter Andorfer', 'subtitle': 'Database of English Learner Texts (DE...
code_fim
hard
{ "lang": "python", "repo": "acdh-oeaw/delt", "path": "/webpage/metadata.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: atizo/braindump path: /brainstorming/notifications.py from brainstorming.email_verification import send_email_verification from brainstorming.models import BrainstormingWatcher from django.conf import settings from django.core.mail import send_mail, send_mass_mail from django.core.urlresolvers im...
code_fim
hard
{ "lang": "python", "repo": "atizo/braindump", "path": "/brainstorming/notifications.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> send_email_verification(to=email, subject=subject, callback=url, template='brainstorming/mails/toggle_notification.txt', context={'action': action, 'brain': brainstorming}) return {'sta...
code_fim
hard
{ "lang": "python", "repo": "atizo/braindump", "path": "/brainstorming/notifications.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> unit = self.load() self.assertEqual( 'If you can solve this, try FLARE-ON 8', str(B'Ru blf xzm hloev gsrh, gib UOZIV-LM 8' | unit) )<|fim_prefix|># repo: binref/refinery path: /test/units/encoding/test_atbash.py #!/usr/bin/env python3 # -*- coding: utf-8 -*...
code_fim
easy
{ "lang": "python", "repo": "binref/refinery", "path": "/test/units/encoding/test_atbash.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: binref/refinery path: /test/units/encoding/test_atbash.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- from .. import TestUnitBase class TestAtBash(TestUnitBase): <|fim_suffix|> unit = self.load() self.assertEqual( 'If you can solve this, try FLARE-ON 8', ...
code_fim
easy
{ "lang": "python", "repo": "binref/refinery", "path": "/test/units/encoding/test_atbash.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: artek0chumak/catalyst path: /catalyst/dl/__init__.py # flake8: noqa <|fim_suffix|>from catalyst.dl.callbacks import * from catalyst.dl.experiment import * from catalyst.dl.runner import *<|fim_middle|>from catalyst.core import *
code_fim
easy
{ "lang": "python", "repo": "artek0chumak/catalyst", "path": "/catalyst/dl/__init__.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>from catalyst.dl.callbacks import * from catalyst.dl.experiment import * from catalyst.dl.runner import *<|fim_prefix|># repo: artek0chumak/catalyst path: /catalyst/dl/__init__.py # flake8: noqa <|fim_middle|>from catalyst.core import *
code_fim
easy
{ "lang": "python", "repo": "artek0chumak/catalyst", "path": "/catalyst/dl/__init__.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>Example 3: Input: coins = [1], amount = 0 Output: 0 Example 4: Input: coins = [1], amount = 1 Output: 1 Example 5: Input: coins = [1], amount = 2 Output: 2   Constraints: 1 <= coins.length <= 12 1 <= coins[i] <= 231 - 1 0 <= amount <= 104 """ import collections class Solution: def coinChan...
code_fim
medium
{ "lang": "python", "repo": "franklingu/leetcode-solutions", "path": "/questions/coin-change/Solution.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: franklingu/leetcode-solutions path: /questions/coin-change/Solution.py """ You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by ...
code_fim
medium
{ "lang": "python", "repo": "franklingu/leetcode-solutions", "path": "/questions/coin-change/Solution.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>class Solution: def coinChange(self, coins: List[int], amount: int) -> int: ### method 1: BFS, model it as a graph problem # queue = collections.deque() # queue.append((0, 0)) # visited = set() # while queue: # curr, step = queue.popleft() # ...
code_fim
medium
{ "lang": "python", "repo": "franklingu/leetcode-solutions", "path": "/questions/coin-change/Solution.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hsiboy/seabus path: /seabus/.venv-seabus/lib/python2.7/site-packages/oboeware/djangoware.py """Tracelytics instrumentation for Django Copyright (C) 2011 by Tracelytics, Inc. All rights reserved. """ # django middleware for passing values to oboe __all__ = ("OboeDjangoMiddleware", "install_obo...
code_fim
hard
{ "lang": "python", "repo": "hsiboy/seabus", "path": "/seabus/.venv-seabus/lib/python2.7/site-packages/oboeware/djangoware.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> l = tem_mod.Library() l.simple_tag(oboe_rum_header) l.simple_tag(oboe_rum_footer) tem_mod.libraries['oboe'] = l def on_load_middleware(): """ wrap Django middleware from a list """ # protect middleware wrapping: only a single thread proceeds global load_middleware_lock ...
code_fim
hard
{ "lang": "python", "repo": "hsiboy/seabus", "path": "/seabus/.venv-seabus/lib/python2.7/site-packages/oboeware/djangoware.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if os.getenv('USER') == 'root': # Root use colour overrides host colour BG = Color.USERNAME_ROOT_BG powerline.append(str(user_prompt).rstrip() + '@' + str(host_prompt).lstrip(), FG, BG) add_user_at_host_segment()<|fim_prefix|># repo: dflock/powerline-shell path: /segments/user_a...
code_fim
hard
{ "lang": "python", "repo": "dflock/powerline-shell", "path": "/segments/user_at_host.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> hostname = socket.gethostname() if powerline.args.shell == 'bash': host_prompt = ' \\h ' user_prompt = ' \\u ' elif powerline.args.shell == 'zsh': host_prompt = ' %m ' user_prompt = ' %n ' else: host_prompt = ' %s ' % hostname.split('.')[0] ...
code_fim
medium
{ "lang": "python", "repo": "dflock/powerline-shell", "path": "/segments/user_at_host.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: dflock/powerline-shell path: /segments/user_at_host.py def get_colors_for_hostname(hostname): from binascii import crc32 cmin = 17 # min ANSI color to use cmax = 231 # max ANSI color to use <|fim_suffix|> def add_user_at_host_segment(): import os import socket hos...
code_fim
hard
{ "lang": "python", "repo": "dflock/powerline-shell", "path": "/segments/user_at_host.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> with open(path + '.data', 'rb') as f: while True: try: yield mmdict.deserialise(f) except EOFError: break def iteritems(self): sorted_idx = sorted(self.index.iteritems(), key=operator.itemgetter(1)) ...
code_fim
hard
{ "lang": "python", "repo": "Darnok99/nel", "path": "/nel/model/model.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Darnok99/nel path: /nel/model/model.py ounter, defaultdict from functools32 import lru_cache from .data import Store import itertools import marshal import operator import cPickle as pickle import numpy as np import math import os import logging import mmap log = logging.getLogger() ENC = 'utf...
code_fim
hard
{ "lang": "python", "repo": "Darnok99/nel", "path": "/nel/model/model.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Darnok99/nel path: /nel/model/model.py sr/bin/env python from __future__ import print_function from collections import Counter, defaultdict from functools32 import lru_cache from .data import Store import itertools import marshal import operator import cPickle as pickle import numpy as np import...
code_fim
hard
{ "lang": "python", "repo": "Darnok99/nel", "path": "/nel/model/model.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: brianchiang-tw/leetcode path: /No_0012_Integer to Roman/integer_to_roman.py ''' Description: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 5...
code_fim
hard
{ "lang": "python", "repo": "brianchiang-tw/leetcode", "path": "/No_0012_Integer to Roman/integer_to_roman.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> str_roman += roman_5 elif 8 >= ones >= 6: offset = ones-5 str_roman += ( roman_5 + roman_1*offset ) elif 9 == ones: str_roman += roman_9 ...
code_fim
hard
{ "lang": "python", "repo": "brianchiang-tw/leetcode", "path": "/No_0012_Integer to Roman/integer_to_roman.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: mvantellingen/python-zeep path: /src/zeep/exceptions.py class Error(Exception): def __init__(self, message=""): super(Exception, self).__init__(message) self.message = message def __repr__(self): return "%s(%r)" % (self.__class__.__name__, self.message) class XM...
code_fim
hard
{ "lang": "python", "repo": "mvantellingen/python-zeep", "path": "/src/zeep/exceptions.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>class ValidationError(Error): def __init__(self, *args, **kwargs): self.path = kwargs.pop("path", []) super().__init__(*args, **kwargs) def __str__(self): if self.path: path = ".".join(str(x) for x in self.path) return "%s (%s)" % (self.message, pat...
code_fim
hard
{ "lang": "python", "repo": "mvantellingen/python-zeep", "path": "/src/zeep/exceptions.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> thi = os.path.abspath(os.path.dirname(__file__)) test = os.path.normpath(os.path.join(thi, "..", )) check_pep8(test, fLOG=fLOG, neg_pattern="temp_.*", pylint_ignore=('C0103', 'C1801', 'R1705', 'W0108', 'W0613', 'C0111', 'W0703', ...
code_fim
hard
{ "lang": "python", "repo": "sdpython/manydataapi", "path": "/_unittests/ut_module/test_code_style.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: sdpython/manydataapi path: /_unittests/ut_module/test_code_style.py """ @brief test log(time=0s) """ import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.pycode import check_pep8, ExtTestCase class TestCodeStyle(ExtTestCase): """Test style.""" <|fim_su...
code_fim
hard
{ "lang": "python", "repo": "sdpython/manydataapi", "path": "/_unittests/ut_module/test_code_style.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_style_test(self): thi = os.path.abspath(os.path.dirname(__file__)) test = os.path.normpath(os.path.join(thi, "..", )) check_pep8(test, fLOG=fLOG, neg_pattern="temp_.*", pylint_ignore=('C0103', 'C1801', 'R1705', 'W0108', 'W0613', ...
code_fim
hard
{ "lang": "python", "repo": "sdpython/manydataapi", "path": "/_unittests/ut_module/test_code_style.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """Load model from a saved checkpoint.""" resume_path = str(resume_path) self.logger.info("Loading checkpoint: {} ...".format(resume_path)) checkpoint = torch.load(resume_path) self.start_epoch = checkpoint['epoch'] + 1 # load architecture params from check...
code_fim
hard
{ "lang": "python", "repo": "boschresearch/robertnlp-enhanced-ud-parser", "path": "/src/trainer/trainer.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return epoch_metrics def compute_prf(self, counts_dict): """Compute precision, recall and F-score based on counts (gold, predicted, correct).""" precision = counts_dict["correct"] / counts_dict["predicted"] if counts_dict["predicted"] else 0.0 recall = counts_dict["cor...
code_fim
hard
{ "lang": "python", "repo": "boschresearch/robertnlp-enhanced-ud-parser", "path": "/src/trainer/trainer.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: boschresearch/robertnlp-enhanced-ud-parser path: /src/trainer/trainer.py # This source code is from the PyTorch Template Project (w/ heavy adaptations) # (https://github.com/victoresque/pytorch-template/blob/master/trainer/trainer.py) # Copyright (c) 2018 Victor Huang # This source code is lice...
code_fim
hard
{ "lang": "python", "repo": "boschresearch/robertnlp-enhanced-ud-parser", "path": "/src/trainer/trainer.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> uniform_random = random_ops.random_uniform([], 0, 1.0, seed=seed) mirror = math_ops.less(tf.pack( [1.0, uniform_random, 1.0, 1.0]), 0.5) return tf.reverse(image, mirror) def random_hue(image, max_delta, seed=None): if max_delta > 0.5: raise ValueError('max_delta must be <...
code_fim
hard
{ "lang": "python", "repo": "renmengye/tfplus", "path": "/tfplus/nn/rnd_trans.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> with ops.op_scope([image], name, 'adjust_hue') as name: # Remember original dtype to so we can convert back if needed orig_dtype = image.dtype flt_image = tf.image.convert_image_dtype(image, tf.float32) hsv = gen_image_ops.rgb_to_hsv(flt_image) hue = tf.slice(...
code_fim
hard
{ "lang": "python", "repo": "renmengye/tfplus", "path": "/tfplus/nn/rnd_trans.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: renmengye/tfplus path: /tfplus/nn/rnd_trans.py from graph_builder import GraphBuilder from tensorflow.python.framework import ops from tensorflow.python.ops import clip_ops from tensorflow.python.ops import gen_image_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops impor...
code_fim
hard
{ "lang": "python", "repo": "renmengye/tfplus", "path": "/tfplus/nn/rnd_trans.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: clintkittiesmeow/localizerB path: /localizer/utils/model.py from matplotlib import pyplot as plt from scipy.optimize import curve_fit <|fim_suffix|>ax = plt.gca() ax.plot(range(1080), RESET_RATE) ax.set_xlim([0,1080]) plt.show() print(best_vals)<|fim_middle|> def symmetric_sigmoid(x, a, b, c, d)...
code_fim
hard
{ "lang": "python", "repo": "clintkittiesmeow/localizerB", "path": "/localizer/utils/model.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # 0 20 # 90 7 # 180 5 # 360 4 x = [0,90,180,360] y = [20,10,8,6] best_vals, _ = curve_fit(symmetric_sigmoid, x, y) get_reset_rate = lambda x: symmetric_sigmoid(x, *tuple(best_vals)) RE...
code_fim
medium
{ "lang": "python", "repo": "clintkittiesmeow/localizerB", "path": "/localizer/utils/model.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: JieDiscovery/ChatWhileWatching path: /c2w/protocol/tcp_chat_server.py # -*- coding: utf-8 -*- from twisted.internet.protocol import Protocol import logging import struct import time logging.basicConfig() moduleLogger = logging.getLogger('c2w.protocol.tcp_chat_server_protocol') class c2wTcpChat...
code_fim
hard
{ "lang": "python", "repo": "JieDiscovery/ChatWhileWatching", "path": "/c2w/protocol/tcp_chat_server.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.transport.write(ack) print('test',ack) print('this me') print(typedata,'type of data') if(typedata == 0): print('this is a request of connection to server') ...
code_fim
hard
{ "lang": "python", "repo": "JieDiscovery/ChatWhileWatching", "path": "/c2w/protocol/tcp_chat_server.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> print('show ack in server',ack) self.transport.write(ack) if(len(self.datagram)==16): ack=struct.pack('bhbbh',80,0,1,0,0) print('show ack in server',ack) self.transport.write(ack) if(typedata != 80): ...
code_fim
hard
{ "lang": "python", "repo": "JieDiscovery/ChatWhileWatching", "path": "/c2w/protocol/tcp_chat_server.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # names = ['zhufengjiao', 'zhouzixuan', 'zhouzhou'] # # names.append('zhuzhu') # #<|fim_prefix|># repo: ZhouZiXuan-imb/pythonCourse path: /python_Day10-列表/01-引入列表.py # 名字管理系统 name1 = "zhufengjiao" name2 = "zhouzixuan" name3 = "zhouzhou" # 程序只要运行起来,程序员就不能人为的干预程序的运行,只能让程序本身来自己去修改。 # 使用列表可以解决 # 简单的理解:一个容...
code_fim
hard
{ "lang": "python", "repo": "ZhouZiXuan-imb/pythonCourse", "path": "/python_Day10-列表/01-引入列表.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ZhouZiXuan-imb/pythonCourse path: /python_Day10-列表/01-引入列表.py # 名字管理系统 name1 = "zhufengjiao" name2 = "zhouzixuan" name3 = "zhouzhou" # 程序只要运行起来,程序员就不能人为的干预程序的运行,只能让程序本身来自己去修改。 <|fim_suffix|># 语法: # 变量名 = ["数据1","数据2".........] # 使用 列表名[0]取列表中的第一位 以此类推 # 列表名[可以输入负数] 列表名[-1]可以取到倒数第一个数据 # nums = [...
code_fim
hard
{ "lang": "python", "repo": "ZhouZiXuan-imb/pythonCourse", "path": "/python_Day10-列表/01-引入列表.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|># names = ['zhufengjiao', 'zhouzixuan', 'zhouzhou'] # # names.append('zhuzhu') # #<|fim_prefix|># repo: ZhouZiXuan-imb/pythonCourse path: /python_Day10-列表/01-引入列表.py # 名字管理系统 name1 = "zhufengjiao" name2 = "zhouzixuan" name3 = "zhouzhou" # 程序只要运行起来,程序员就不能人为的干预程序的运行,只能让程序本身来自己去修改。 <|fim_middle|># 使用列表可以解...
code_fim
hard
{ "lang": "python", "repo": "ZhouZiXuan-imb/pythonCourse", "path": "/python_Day10-列表/01-引入列表.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return vals def finish(self, result): ''' Deletes arrays to clean up memory and avoid memory related mistakes ''' # this data can be plotted by enabling persist_mode n = len(self.sweep_par_names) if self._live_plot_enabled(): self._p...
code_fim
hard
{ "lang": "python", "repo": "QudevETH/PycQED_py3", "path": "/pycqed/measurement/measurement_control.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """ :param filtered_sweep: (None or list of bools) indicates which of the acquisition elements will be played by the AWGs (True) and which ones will be skipped (False). Default: None, in which case all acquisition elements will be played. """ ...
code_fim
hard
{ "lang": "python", "repo": "QudevETH/PycQED_py3", "path": "/pycqed/measurement/measurement_control.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: QudevETH/PycQED_py3 path: /pycqed/measurement/measurement_control.py # the subset of acquisitions indicated by the filter is # performed. In this case, the sweep points passed to # the detector function need to be filtered, and the # fil...
code_fim
hard
{ "lang": "python", "repo": "QudevETH/PycQED_py3", "path": "/pycqed/measurement/measurement_control.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>#open the store store.open() #check if H5 has alread the building file keys = store.keys() if '/buildings' in keys: store.remove('buildings') store.put('buildings',building,format = 'table', append = False) else: store.put('buildings',building,format = 'table', append = False) #close the store store...
code_fim
hard
{ "lang": "python", "repo": "BayAreaMetro/petrale", "path": "/utilities/h5 content.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: BayAreaMetro/petrale path: /utilities/h5 content.py # coding: utf-8 # This code take the building.csv file (output of development project script) and put it in the H5 file holder <|fim_suffix|>#open the store store.open() #check if H5 has alread the building file keys = store.keys() if '/bui...
code_fim
hard
{ "lang": "python", "repo": "BayAreaMetro/petrale", "path": "/utilities/h5 content.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: pythonitalia/pycon path: /association-backend/src/internal_api/permissions.py from pythonit_toolkit.api.permissions import IsService as BaseIsService <|fim_suffix|> return BaseIsService( allowed_callers, str(SERVICE_TO_SERVICE_SECRET), "association-backend" )<|fim_middle|>from src...
code_fim
medium
{ "lang": "python", "repo": "pythonitalia/pycon", "path": "/association-backend/src/internal_api/permissions.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def IsService(allowed_callers: list[str]): return BaseIsService( allowed_callers, str(SERVICE_TO_SERVICE_SECRET), "association-backend" )<|fim_prefix|># repo: pythonitalia/pycon path: /association-backend/src/internal_api/permissions.py from pythonit_toolkit.api.permissions import IsServi...
code_fim
medium
{ "lang": "python", "repo": "pythonitalia/pycon", "path": "/association-backend/src/internal_api/permissions.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ryanstwrt/FRIDGe path: /fridge/Assembly/Assembly.py import glob import os import fridge.utilities.utilities as utilities cur_dir = os.path.dirname(__file__) assembly_directory = os.path.join(cur_dir, "../data/assembly") class Assembly(object): """ Holds all information required for mod...
code_fim
hard
{ "lang": "python", "repo": "ryanstwrt/FRIDGe", "path": "/fridge/Assembly/Assembly.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """Updates cell, surface, material, and universe number to create uniqueness.""" self.cellNum += 1 self.surfaceNum += 1 self.materialNum += 1 if universe_test: self.universe += 1 def update_perturbations(self): """Update the variables for an...
code_fim
hard
{ "lang": "python", "repo": "ryanstwrt/FRIDGe", "path": "/fridge/Assembly/Assembly.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """Assign assembly parameters based on the yaml Assembly file.""" self.assemblyType = inputs['Assembly Type'] self.pinsPerAssembly = int(inputs['Pins Per Assembly']) if 'Pins Per Assembly' in inputs else 0 self.assemblyPitch = float(inputs['Assembly Pitch']) self.du...
code_fim
hard
{ "lang": "python", "repo": "ryanstwrt/FRIDGe", "path": "/fridge/Assembly/Assembly.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> field=models.CharField(max_length=10), ), migrations.AlterField( model_name='stock', name='change', field=models.CharField(max_length=10), ), migrations.AlterField( model_name='stock', name='price', ...
code_fim
hard
{ "lang": "python", "repo": "Abeeaad97/FinancialTracker", "path": "/backend/api/migrations/0023_auto_20200505_2300.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Abeeaad97/FinancialTracker path: /backend/api/migrations/0023_auto_20200505_2300.py # Generated by Django 3.0.3 on 2020-05-06 06:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0022_auto_20200315_0019'), ] opera...
code_fim
hard
{ "lang": "python", "repo": "Abeeaad97/FinancialTracker", "path": "/backend/api/migrations/0023_auto_20200505_2300.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: aleksha/ipynb path: /inglessi/Shift-KS-test.py #=============================================================================== canvas.Close() import numpy as np import scipy.stats as stats import statistics as py_stat #=============================================================================...
code_fim
hard
{ "lang": "python", "repo": "aleksha/ipynb", "path": "/inglessi/Shift-KS-test.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>canv.Print("fig_shift.png") #=============================================================================== # Perform Kolmogorov-Smirnov tests for shifted samples # In agreement if p-value > 0.0455 (two-sigma-level) # for ch1 in range(16): for ch2 in range(ch1+1,16): ss = "Test ch" + s...
code_fim
hard
{ "lang": "python", "repo": "aleksha/ipynb", "path": "/inglessi/Shift-KS-test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def play(self, board): valid_moves = self.game.getValidMoves(board, 1) print('\nMoves:', [i for (i, valid) in enumerate(valid_moves) if valid]) while True: move = int(input()) if valid_moves[move]: break else: print('Invalid move') r...
code_fim
easy
{ "lang": "python", "repo": "suetAndTie/alpha234", "path": "/games/connect4/Connect4Players.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> valid_moves = self.game.getValidMoves(board, 1) print('\nMoves:', [i for (i, valid) in enumerate(valid_moves) if valid]) while True: move = int(input()) if valid_moves[move]: break else: print('Invalid move') return move<|fim_prefix|># r...
code_fim
medium
{ "lang": "python", "repo": "suetAndTie/alpha234", "path": "/games/connect4/Connect4Players.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: suetAndTie/alpha234 path: /games/connect4/Connect4Players.py import numpy as np class HumanConnect4Player(): def __init__(self, game): <|fim_suffix|> while True: move = int(input()) if valid_moves[move]: break else: print('Invalid move') re...
code_fim
medium
{ "lang": "python", "repo": "suetAndTie/alpha234", "path": "/games/connect4/Connect4Players.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> newline|'\n' indent|' ' name|'from' name|'pydev' name|'import' name|'pydevd' newline|'\n' dedent|'' name|'except' name|'ImportError' op|':' newline|'\n' indent|' ' name|'import' name|'pydevd' newline|'\n' dedent|'' name|'pydevd' op|'.' name|'settrace' op|'(' name|'host' op|'=' name|'CONF' o...
code_fim
hard
{ "lang": "python", "repo": "bopopescu/nova-token", "path": "/nova/debugger.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: bopopescu/nova-token path: /nova/debugger.py begin_unit comment|'# Copyright 2010 United States Government as represented by the' nl|'\n' comment|'# Administrator of the National Aeronautics and Space Administration.' nl|'\n' comment|'# Copyright 2011 Justin Santa Barbara' nl|'\n' comment|'# All ...
code_fim
hard
{ "lang": "python", "repo": "bopopescu/nova-token", "path": "/nova/debugger.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>import os import sys sys.dont_write_bytecode = True # prevent creation of .pyc files sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) """ Main script of BenchExec for executing a whole benchmark (suite). This script can be called from the command line. For integrating from within Python...
code_fim
hard
{ "lang": "python", "repo": "javapathfinder/benchexec", "path": "/bin/benchexec", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: javapathfinder/benchexec path: /bin/benchexec #!/usr/bin/env python3 """ BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use t...
code_fim
medium
{ "lang": "python", "repo": "javapathfinder/benchexec", "path": "/bin/benchexec", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: z5476t4508/autochem path: /automol/tests/test_graph_reac.py 3: ('C', 1, None), 4: ('F', 0, None), 5: ('F', 0, None), 6: ('O', 1, None)}, {frozenset({0, 1}): (1, None), frozenset({0, 2}): (1, None), frozenset({2, 4}): (1, None), frozenset({3, 5}): (1, ...
code_fim
hard
{ "lang": "python", "repo": "z5476t4508/autochem", "path": "/automol/tests/test_graph_reac.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: z5476t4508/autochem path: /automol/tests/test_graph_reac.py d_cgr = ({0: ('C', 2, None), 1: ('C', 1, None), 2: ('C', 1, None), 3: ('C', 1, None), 4: ('C', 0, None), 5: ('O', 0, None)}, {frozenset({3, 4}): (1, None), frozenset({2, 3}): (1, None), froz...
code_fim
hard
{ "lang": "python", "repo": "z5476t4508/autochem", "path": "/automol/tests/test_graph_reac.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> tras, rct_idxs, prd_idxs = graph.reac.elimination(rct_cgrs, prd_cgrs) assert tras assert rct_idxs assert prd_idxs for tra in tras: print(tra) assert graph.backbone_isomorphic( graph.trans.apply(tra, rct_cgr), prd_cgr) def test__reac__insertion(): """ ...
code_fim
hard
{ "lang": "python", "repo": "z5476t4508/autochem", "path": "/automol/tests/test_graph_reac.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: TedBrookings/euler_python path: /euler007.py #!/usr/bin/python import itertools from primes import genPrimes from number_words import getRankName def euler7(n=10001): <|fim_suffix|> if __name__ == "__main__": euler7()<|fim_middle|> p = next(itertools.islice(genPrimes(), n - 1, n)) print(...
code_fim
medium
{ "lang": "python", "repo": "TedBrookings/euler_python", "path": "/euler007.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>if __name__ == "__main__": euler7()<|fim_prefix|># repo: TedBrookings/euler_python path: /euler007.py #!/usr/bin/python import itertools from primes import genPrimes from number_words import getRankName <|fim_middle|>def euler7(n=10001): p = next(itertools.islice(genPrimes(), n - 1, n)) print('...
code_fim
medium
{ "lang": "python", "repo": "TedBrookings/euler_python", "path": "/euler007.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: vadim-di/tinvest path: /tests/conftest.py import pytest from tinvest.schemas import Empty, Error <|fim_suffix|> return '<TOKEN>' @pytest.fixture() def figi(): return 'BBG0013HGFT4' @pytest.fixture() def broker_account_id(): return 'some_broker_account_id' @pytest.fixture() def...
code_fim
easy
{ "lang": "python", "repo": "vadim-di/tinvest", "path": "/tests/conftest.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return Error( trackingId='tracking_id', payload={}, ) @pytest.fixture() def empty(): return Empty( trackingId='tracking_id', payload={}, )<|fim_prefix|># repo: vadim-di/tinvest path: /tests/conftest.py import pytest from tinvest.schemas import Empty, Err...
code_fim
medium
{ "lang": "python", "repo": "vadim-di/tinvest", "path": "/tests/conftest.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @pytest.fixture() def empty(): return Empty( trackingId='tracking_id', payload={}, )<|fim_prefix|># repo: vadim-di/tinvest path: /tests/conftest.py import pytest from tinvest.schemas import Empty, Error @pytest.fixture() def token(): return '<TOKEN>' <|fim_middle|>@pytes...
code_fim
hard
{ "lang": "python", "repo": "vadim-di/tinvest", "path": "/tests/conftest.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """ self.List=InputList for x in self.List: self.xlApp.ActiveSheet.Cells(x[0]+StartRow,x[1]+StartColumn).Value =str(x[2]) def __del__(self): self.xlApp.ActiveWorkbook.Close(SaveChanges=0) self.xlApp.Quit() del self.xlApp<|fim_prefix|># r...
code_fim
hard
{ "lang": "python", "repo": "betty29/code-1", "path": "/recipes/Python/440617_using_excel_to_debug_python/recipe-440617.py", "mode": "spm", "license": "Python-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: betty29/code-1 path: /recipes/Python/440617_using_excel_to_debug_python/recipe-440617.py from win32com.client import Dispatch class ExcelTable: """ display a data structure in Excel """ def __init__(self): self.xlApp = Dispatch("Excel.Application") self.xlApp.Visib...
code_fim
hard
{ "lang": "python", "repo": "betty29/code-1", "path": "/recipes/Python/440617_using_excel_to_debug_python/recipe-440617.py", "mode": "psm", "license": "Python-2.0", "source": "the-stack-v2" }
<|fim_suffix|> """ Display a Grid of data in excel Input list = List of (row,col,value) to describe your data StartRow,StartColumn - the place where to start to draw you table in excel. """ self.List=InputList for x in self.List: self.xlApp.ActiveSh...
code_fim
medium
{ "lang": "python", "repo": "betty29/code-1", "path": "/recipes/Python/440617_using_excel_to_debug_python/recipe-440617.py", "mode": "spm", "license": "Python-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if utils.is_non_vmware_spec(request_spec): return 0.0 host_shard_aggrs = [aggr for aggr in host_state.aggregates if aggr.name.startswith(self._SHARD_PREFIX)] if not host_shard_aggrs: LOG.warning('%(host_state)s is not in an aggre...
code_fim
hard
{ "lang": "python", "repo": "sapcc/nova", "path": "/nova/scheduler/weights/resize_same_shard.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if len(host_shard_aggrs) > 1: LOG.warning('More than one host aggregates found for ' 'host %(host)s, selecting first.', {'host': host_state.host}) host_shard_aggr = host_shard_aggrs[0] instance_host = request_spec.get_sch...
code_fim
hard
{ "lang": "python", "repo": "sapcc/nova", "path": "/nova/scheduler/weights/resize_same_shard.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: sapcc/nova path: /nova/scheduler/weights/resize_same_shard.py # Copyright (c) 2022 SAP # 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 License at #...
code_fim
hard
{ "lang": "python", "repo": "sapcc/nova", "path": "/nova/scheduler/weights/resize_same_shard.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> return "base" def prepare(self): # cache custom field values if not CustomFields.valueId_to_value_map: for definition in self.card.board.get_custom_field_definitions(): CustomFields.valueId_to_value_map.update(definition.list_options) def extra...
code_fim
medium
{ "lang": "python", "repo": "sahandevs/trello-board-to-csv", "path": "/data_extractors/card_data_extractor/extractors/custom_fields.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: sahandevs/trello-board-to-csv path: /data_extractors/card_data_extractor/extractors/custom_fields.py from typing import Dict from ..base import DataExtractor class CustomFields(DataExtractor): <|fim_suffix|> self.prepare() data = dict() for field in self.card.customField...
code_fim
hard
{ "lang": "python", "repo": "sahandevs/trello-board-to-csv", "path": "/data_extractors/card_data_extractor/extractors/custom_fields.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.prepare() data = dict() for field in self.card.customFields: value = str(field._value).strip() if field._value is not None else "" data[field.name.strip()] = CustomFields.valueId_to_value_map.get(value) or value return data CustomFields.valueI...
code_fim
hard
{ "lang": "python", "repo": "sahandevs/trello-board-to-csv", "path": "/data_extractors/card_data_extractor/extractors/custom_fields.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> print("总提交者:" + str(len(users))) for key in users.keys(): print(key + ":" + str(users.get(key))) """ 使用: python [logfile] 根据svn日志统计有多少提交者 """ if __name__ == '__main__': if (len(sys.argv) > 1): logfile = sys.argv[1] user_count(logfile) else: print("usage: p...
code_fim
hard
{ "lang": "python", "repo": "hnlaomie/python-tools", "path": "/util/svn/usercount.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>""" 使用: python [logfile] 根据svn日志统计有多少提交者 """ if __name__ == '__main__': if (len(sys.argv) > 1): logfile = sys.argv[1] user_count(logfile) else: print("usage: python usercount.py [logfile]")<|fim_prefix|># repo: hnlaomie/python-tools path: /util/svn/usercount.py #!/usr/bin...
code_fim
hard
{ "lang": "python", "repo": "hnlaomie/python-tools", "path": "/util/svn/usercount.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hnlaomie/python-tools path: /util/svn/usercount.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys def user_count(logfile): users = {} hasUser = False with open(logfile, "r") as input: for line in input: if (hasUser == True): data = lin...
code_fim
medium
{ "lang": "python", "repo": "hnlaomie/python-tools", "path": "/util/svn/usercount.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: IntelPython/dpnp path: /dpnp/dpnp_iface_indexing.py ces to access the diagonal of a (4, 4) array: >>> import dpnp as np >>> di = np.diag_indices(4) >>> di (array([0, 1, 2, 3]), array([0, 1, 2, 3])) >>> a = np.arange(16).reshape(4, 4) >>> a array([[ 0, 1, 2, 3], ...
code_fim
hard
{ "lang": "python", "repo": "IntelPython/dpnp", "path": "/dpnp/dpnp_iface_indexing.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|> """ Replaces specified elements of an array with given values. For full documentation refer to :obj:`numpy.put`. Limitations ----------- Input array is supported as :obj:`dpnp.ndarray`. Not supported parameter mode. """ x1_desc = dpnp.get_dpnp_descriptor( x1,...
code_fim
hard
{ "lang": "python", "repo": "IntelPython/dpnp", "path": "/dpnp/dpnp_iface_indexing.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|> return call_origin(numpy.fill_diagonal, x1, val, wrap, dpnp_inplace=True) def indices(dimensions, dtype=int, sparse=False): """ Return an array representing the indices of a grid. For full documentation refer to :obj:`numpy.indices`. Limitations ----------- Parameters ``dty...
code_fim
hard
{ "lang": "python", "repo": "IntelPython/dpnp", "path": "/dpnp/dpnp_iface_indexing.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: bvraghav/standible path: /render/styles/Diffuse.py import logging as lg from . Base import Base class Diffuse(Base) : <|fim_suffix|> super().setup() lg.debug('Configuring Diffuse renderer.')<|fim_middle|>## ==================================================== def setup(self) :
code_fim
medium
{ "lang": "python", "repo": "bvraghav/standible", "path": "/render/styles/Diffuse.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> super().setup() lg.debug('Configuring Diffuse renderer.')<|fim_prefix|># repo: bvraghav/standible path: /render/styles/Diffuse.py import logging as lg from . Base import Base <|fim_middle|>class Diffuse(Base) : ## ==================================================== def setup(self) :
code_fim
medium
{ "lang": "python", "repo": "bvraghav/standible", "path": "/render/styles/Diffuse.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>## ==================================================== def setup(self) : super().setup() lg.debug('Configuring Diffuse renderer.')<|fim_prefix|># repo: bvraghav/standible path: /render/styles/Diffuse.py import logging as lg from . Base import Base <|fim_middle|>class Diffuse(Base) :
code_fim
easy
{ "lang": "python", "repo": "bvraghav/standible", "path": "/render/styles/Diffuse.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: krystiancha/django-smmc path: /smmc/settings.py from django.conf import settings MAGICF<|fim_suffix|>ttings, 'SMMC_RANDOM_ENTRIES_AMOUNT', 10)<|fim_middle|>ILE = getattr(settings, 'SMMC_MAGICFILE', None) RANDOM_ENTRIES_AMOUNT = getattr(se
code_fim
medium
{ "lang": "python", "repo": "krystiancha/django-smmc", "path": "/smmc/settings.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>ttings, 'SMMC_RANDOM_ENTRIES_AMOUNT', 10)<|fim_prefix|># repo: krystiancha/django-smmc path: /smmc/settings.py from django.conf import settings MAGICF<|fim_middle|>ILE = getattr(settings, 'SMMC_MAGICFILE', None) RANDOM_ENTRIES_AMOUNT = getattr(se
code_fim
medium
{ "lang": "python", "repo": "krystiancha/django-smmc", "path": "/smmc/settings.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> None) RANDOM_ENTRIES_AMOUNT = getattr(settings, 'SMMC_RANDOM_ENTRIES_AMOUNT', 10)<|fim_prefix|># repo: krystiancha/django-smmc path: /smmc/settings.py from django.conf import settings MAGICF<|fim_middle|>ILE = getattr(settings, 'SMMC_MAGICFILE',
code_fim
easy
{ "lang": "python", "repo": "krystiancha/django-smmc", "path": "/smmc/settings.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return tuple(get_version_info()['common']) def get_min_client_version(): return tuple(get_version_info()['min_client'])<|fim_prefix|># repo: frans-fuerst/meddle path: /pymeddle_common.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- import json import os def meddle_directory(): if os.path...
code_fim
hard
{ "lang": "python", "repo": "frans-fuerst/meddle", "path": "/pymeddle_common.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: frans-fuerst/meddle path: /pymeddle_common.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- import json import os def meddle_directory(): <|fim_suffix|>def get_version(): return tuple(get_version_info()['common']) def get_min_client_version(): return tuple(get_version_info()['min_clie...
code_fim
hard
{ "lang": "python", "repo": "frans-fuerst/meddle", "path": "/pymeddle_common.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: aldebaran/qibuild path: /doc/tools/gen_cmake_doc.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ Generate Sphinks documentation from a CMake ...
code_fim
hard
{ "lang": "python", "repo": "aldebaran/qibuild", "path": "/doc/tools/gen_cmake_doc.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def parse_example(txt): """ Parse a block of text linked to a function, looking for an example. Return None if not example was found """ res = re.findall(r'\\example\s*:\s*(\w+)', txt, re.DOTALL) if not res: return if len(res) > 1: print("warning: only zero or ...
code_fim
hard
{ "lang": "python", "repo": "aldebaran/qibuild", "path": "/doc/tools/gen_cmake_doc.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> filters = self.get_filter_params() if filters: queryset = self.model.objects.filter(**filters) else: queryset = self.model.objects.all() return queryset<|fim_prefix|># repo: DisMosGit/car_library path: /server/mixins.py from urllib.parse import unqu...
code_fim
hard
{ "lang": "python", "repo": "DisMosGit/car_library", "path": "/server/mixins.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: DisMosGit/car_library path: /server/mixins.py from urllib.parse import unquote from datetime import datetime class ViewRouterMixin(): router_prefix: str = r'' router_basename: str = '' @classmethod def router_path(cls): return { 'prefix': cls.router_prefix, ...
code_fim
hard
{ "lang": "python", "repo": "DisMosGit/car_library", "path": "/server/mixins.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }