text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_prefix|># repo: skojaku/hokusai-plot path: /scripts/point2net.py import pandas as pd import matplotlib.pyplot as plt import numpy as np from scipy import spatial import networkx as nx import sys if __name__ == "__main__": <|fim_suffix|> D = spatial.distance.squareform(spatial.distance.pdist(df)) d ...
code_fim
hard
{ "lang": "python", "repo": "skojaku/hokusai-plot", "path": "/scripts/point2net.py", "mode": "psm", "license": "CC0-1.0", "source": "the-stack-v2" }
<|fim_suffix|> pos = {} r, c = np.nonzero(np.triu(Arand)) for i in range(N): pos[i] = np.array([df.iloc[i, 0], -df.iloc[i, 1]]) for node, (x, y) in pos.items(): G.node[node]["x"] = float(x) G.node[node]["y"] = float(y) nx.write_graphml(G, OUTPUTFILE) #nx.draw_networkx...
code_fim
hard
{ "lang": "python", "repo": "skojaku/hokusai-plot", "path": "/scripts/point2net.py", "mode": "spm", "license": "CC0-1.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: eerimoq/asn1tools path: /tests/files/named_numbers.py EXPECTED = {'Foo': {'extensibility-implied': False, 'imports': {}, 'object-classes': {}, 'object-sets': {}, 'tags': 'AUTOMATIC', 'types': {'A': {'restricted-to': [('min', 'max')], ...
code_fim
hard
{ "lang": "python", "repo": "eerimoq/asn1tools", "path": "/tests/files/named_numbers.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> 'restricted-to': [(-1, 2)], 'type': 'INTEGER'}}, 'values': {'min': {'type': 'INTEGER', 'value': 3}, 'zero': {'type': 'INTEGER', 'value': 0}}}}<|fim_prefix|># repo: eerimoq/asn1tools path: /tests/files/named_numbers.py EXPECTED...
code_fim
hard
{ "lang": "python", "repo": "eerimoq/asn1tools", "path": "/tests/files/named_numbers.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Rorzzer/AI-Python-Game path: /parta.py # Part A # File: parta.py # # TEAM ... import sys import a_massacre import a_moves from watchurback import Board def main(argv): <|fim_suffix|> action = input_file.readline().strip().upper() actions = { 'MOVES': a_moves.on_action, ...
code_fim
hard
{ "lang": "python", "repo": "Rorzzer/AI-Python-Game", "path": "/parta.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def default_action(action: str, board: Board): print('Unknown action command ' + action) print('Just have a look at the board:') board.print_board() if __name__ == "__main__": main(sys.argv[1:])<|fim_prefix|># repo: Rorzzer/AI-Python-Game path: /parta.py # Part A # File: parta.py # # TE...
code_fim
medium
{ "lang": "python", "repo": "Rorzzer/AI-Python-Game", "path": "/parta.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>@client.command(pass_context=True) async def load(ctx, extension): if ctx.message.author.id == '424221454490402816': try: client.load_extension(extension) print("Loaded %s." % (extension)) await client.say("Loaded %s" % (extension)) except Exception as error: print("%s cannot be...
code_fim
hard
{ "lang": "python", "repo": "thewaifuproject/waifubot", "path": "/Chain.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|>extensions = ['misc', 'help', 'music', 'games', 'trivia', 'love'] @client.event async def on_ready(): print("Bot is Kawaii and Ready.") await client.change_presence(game=discord.Game(name="it Cool.")) #FOR TESTING PURPOSES# @client.command(pass_context=True) async def announcement(ctx, *args...
code_fim
medium
{ "lang": "python", "repo": "thewaifuproject/waifubot", "path": "/Chain.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_prefix|># repo: thewaifuproject/waifubot path: /Chain.py import discord from discord.ext.commands import Bot from discord.ext import commands import asyncio import aiohttp from io import BytesIO import random import time import youtube_dl import json TOKEN = open("secret").read() Client = discord...
code_fim
hard
{ "lang": "python", "repo": "thewaifuproject/waifubot", "path": "/Chain.py", "mode": "psm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_prefix|># repo: antocuni/capnpy path: /capnpy/testing/compiler/test_null.py import py import pytest import six from six import b from capnpy.testing.compiler.support import CompilerTest class TestNullPointers(CompilerTest): @py.test.fixture def mod(self): schema = """ @0xbf5147cbbecf40...
code_fim
hard
{ "lang": "python", "repo": "antocuni/capnpy", "path": "/capnpy/testing/compiler/test_null.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @py.test.fixture def mod(self): schema = """ @0xbf5147cbbecf40c1; using Py = import "/capnpy/annotate.capnp"; struct Foo { x :group $Py.nullable { isNull @0 :Bool; value @1 :Int64; } } struct B...
code_fim
hard
{ "lang": "python", "repo": "antocuni/capnpy", "path": "/capnpy/testing/compiler/test_null.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> schema = """ @0xbf5147cbbecf40c1; using Py = import "/capnpy/annotate.capnp"; struct Foo { x :group $Py.nullable { isNull @0 :Bool; value @1 :Int64; } } struct Bar { point :group $Py.nullab...
code_fim
hard
{ "lang": "python", "repo": "antocuni/capnpy", "path": "/capnpy/testing/compiler/test_null.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def main(): euler_num: float = calculate_euler(10) print(f"Euler's number using vectorization {euler_num: .4f}") if __name__ == "__main__": main()<|fim_prefix|># repo: hhandika/stats-from-scratch path: /euler-number/python/simple_euler.py """ Heru Handika 12 September 2020 Euler's number fin...
code_fim
medium
{ "lang": "python", "repo": "hhandika/stats-from-scratch", "path": "/euler-number/python/simple_euler.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hhandika/stats-from-scratch path: /euler-number/python/simple_euler.py """ Heru Handika 12 September 2020 Euler's number finder. Using for loop """ #%% def calculate_factorial(n: int) -> int: if n == 0 or n == 1: return 1 else: return n * calculate_factorial(n-1) <|fim_su...
code_fim
medium
{ "lang": "python", "repo": "hhandika/stats-from-scratch", "path": "/euler-number/python/simple_euler.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # Separate data into instructions and actions text_instructions = [] text_actions = [] IN = True for example in raw_data: new_instruction = ['<SOS>'] new_action = ['<SOS>'] for word in example.split(): if word == '...
code_fim
hard
{ "lang": "python", "repo": "jlrussin/syntactic_attention", "path": "/data.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: jlrussin/syntactic_attention path: /data.py import torch from torch.utils.data import Dataset class ScanDataset(Dataset): def __init__(self, file, vocab=None): self.file = file # Read all data into memory with open(file,'r') as f: raw_data = f.readlines(...
code_fim
hard
{ "lang": "python", "repo": "jlrussin/syntactic_attention", "path": "/data.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def section(data): return "\n".join([row(key, data[key]) for key in sorted(data.keys())]) kw = {k: section(data[k]) for k in ("methods", "data")} print(page.format(**kw))<|fim_prefix|># repo: kbase/narrative path: /kbase-extension/static/kbase/show_icons.py """ Build a simple HTML page showing all ...
code_fim
hard
{ "lang": "python", "repo": "kbase/narrative", "path": "/kbase-extension/static/kbase/show_icons.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> r = '<tr><td style="padding-top: 2em">{}</td>'.format(name) r += '<td class="fa-stack fa-2x" >' color = color_lookup(name) r += '<i class="fa fa-circle fa-stack-2x" style="color: {}"></i>'.format(color) for icon in icons: r += '<i class="fa fa-inverse fa-stack-1x {}"></i>'.form...
code_fim
hard
{ "lang": "python", "repo": "kbase/narrative", "path": "/kbase-extension/static/kbase/show_icons.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: kbase/narrative path: /kbase-extension/static/kbase/show_icons.py """ Build a simple HTML page showing all current icons in icons.json """ import json f = open("icons.json") page = """<html> <head> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.mi...
code_fim
hard
{ "lang": "python", "repo": "kbase/narrative", "path": "/kbase-extension/static/kbase/show_icons.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ranjithpeddi/mimic path: /mimic/test/test_flavors.py """ Tests for :mod:`nova_api` and :mod:`nova_objects` for flavors. """ from __future__ import absolute_import, division, unicode_literals from twisted.trial.unittest import SynchronousTestCase from mimic.test.helpers import json_request, req...
code_fim
hard
{ "lang": "python", "repo": "ranjithpeddi/mimic", "path": "/mimic/test/test_flavors.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def test_get_flavor(self): """ Test to verify :func:`get_flavor` on ``GET /v2.0/<tenant_id>/flavors/<flavor_id>`` """ get_server_flavor = self.get_server_flavor('/flavors/2') self.assertEqual(get_server_flavor['flavor']['id'], '2') def test_get_server_flavo...
code_fim
hard
{ "lang": "python", "repo": "ranjithpeddi/mimic", "path": "/mimic/test/test_flavors.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: adafruit/circuitpython path: /tests/micropython/heap_lock.py # check that heap_lock/heap_unlock work as expected import micropython l = [] l2 = list(range(100)) micropython.heap_lock() micropython.heap_lock() # general allocation on the heap try: print([]) except MemoryError: print("M...
code_fim
hard
{ "lang": "python", "repo": "adafruit/circuitpython", "path": "/tests/micropython/heap_lock.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>micropython.heap_unlock() # check that allocation works after an unlock print([])<|fim_prefix|># repo: adafruit/circuitpython path: /tests/micropython/heap_lock.py # check that heap_lock/heap_unlock work as expected import micropython l = [] l2 = list(range(100)) micropython.heap_lock() micropython.h...
code_fim
hard
{ "lang": "python", "repo": "adafruit/circuitpython", "path": "/tests/micropython/heap_lock.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> b = Button(master, text="Send 1", command=callback) b.pack() mainloop()<|fim_prefix|># repo: plocci/cobalto path: /bluetoothTest/testserial.py #python 3.4 import serial from tkinter import * arduinoSerialPort = serial.Serial("COM4", 9600) <|fim_middle|> master = Tk() arduinoSerialPort.isOpen() def ...
code_fim
medium
{ "lang": "python", "repo": "plocci/cobalto", "path": "/bluetoothTest/testserial.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: plocci/cobalto path: /bluetoothTest/testserial.py #python 3.4 import serial from tkinter import * arduinoSerialPort = serial.Serial("COM4", 9600) master = Tk() arduinoSerialPort.isOpen() <|fim_suffix|>b = Button(master, text="Send 1", command=callback) b.pack() mainloop()<|fim_middle|>def c...
code_fim
medium
{ "lang": "python", "repo": "plocci/cobalto", "path": "/bluetoothTest/testserial.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_all_consumed_recommend(pure_data_small, monkeypatch): _, train_data, eval_data, data_info = pure_data_small set_ranking_labels(train_data) set_ranking_labels(eval_data) model = UserCF(task="ranking", data_info=data_info) model.fit(train_data, neg_sampling=False, verbose=0) ...
code_fim
hard
{ "lang": "python", "repo": "massquantity/LibRecommender", "path": "/tests/models/test_user_cf.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: massquantity/LibRecommender path: /tests/models/test_user_cf.py import numpy as np import pytest from libreco.algorithms import UserCF from tests.utils_data import remove_path, set_ranking_labels from tests.utils_metrics import get_metrics from tests.utils_pred import ptest_preds from tests.util...
code_fim
hard
{ "lang": "python", "repo": "massquantity/LibRecommender", "path": "/tests/models/test_user_cf.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: QuenLo/LeetCode-share path: /283-Move_Zeroes.py class Solution: def moveZeroes(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ <|fim_suffix|>class SolutionII: def moveZeroes(self, nums: List[int]) -> None: """ ...
code_fim
hard
{ "lang": "python", "repo": "QuenLo/LeetCode-share", "path": "/283-Move_Zeroes.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """ Do not return anything, modify nums in-place instead. """ i = 0 for cur in range(len(nums)): if nums[cur]: temp = nums[i], nums[cur] nums[cur], nums[i] = temp i += 1<|fim_prefix|># repo: QuenLo/LeetCod...
code_fim
hard
{ "lang": "python", "repo": "QuenLo/LeetCode-share", "path": "/283-Move_Zeroes.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: qixiuai/BCGHeart path: /mean_hearts/findpeaks3.py import numpy as np def transform_signal_by_energy(signal, window_size=0.3, fs=100): energy = [] window_size = int(window_size*fs) for ind in range(len(signal)-window_size+1): window = signal[ind:ind+window_size] ener...
code_fim
hard
{ "lang": "python", "repo": "qixiuai/BCGHeart", "path": "/mean_hearts/findpeaks3.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if not peaks: return [], [], [], 0 # apply thres max_indicator = max(peaks,key=lambda peak:peak.indicator_value).indicator_value min_indicator = min(peaks,key=lambda peak:peak.indicator_value).indicator_value thres_abs = min_indicator + thres * (max_indicator - min_indicat...
code_fim
hard
{ "lang": "python", "repo": "qixiuai/BCGHeart", "path": "/mean_hearts/findpeaks3.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def main(): nodes = [1, 2, 3, 4, 5, 6, None, None, None, 7] root = generate_B_tree(nodes, 0) postorder_traversal_by_recursion(root) print() postorder_traversal(root) print() if __name__ == '__main__': main()<|fim_prefix|># repo: InnoFang/algo-set path: /Data Structure/Tree/...
code_fim
hard
{ "lang": "python", "repo": "InnoFang/algo-set", "path": "/Data Structure/Tree/Traversal/Post Order/main.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def generate_B_tree(nodes, index): node = None if index < len(nodes) and nodes[index]: node = TreeNode(nodes[index]) node.left = generate_B_tree(nodes, index * 2 + 1) node.right = generate_B_tree(nodes, index * 2 + 2) return node def main(): nodes = [1, 2, 3, 4, ...
code_fim
hard
{ "lang": "python", "repo": "InnoFang/algo-set", "path": "/Data Structure/Tree/Traversal/Post Order/main.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: InnoFang/algo-set path: /Data Structure/Tree/Traversal/Post Order/main.py class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None ''' The binary tree in this example is shown as follow 1 / \ 2 3 / \ / 4 ...
code_fim
hard
{ "lang": "python", "repo": "InnoFang/algo-set", "path": "/Data Structure/Tree/Traversal/Post Order/main.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: meraki-analytics/cassiopeia path: /cassiopeia/data.py }[string] class Position(Enum): top = "TOP" middle = "MIDDLE" jungle = "JUNGLE" bottom = "BOTTOM" utility = "UTILITY" apex = "APEX" none = "NONE" def from_league_naming_scheme(string: str): r...
code_fim
hard
{ "lang": "python", "repo": "meraki-analytics/cassiopeia", "path": "/cassiopeia/data.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return {i: queue for queue, i in QUEUE_IDS.items()}[id] @property def id(self): return QUEUE_IDS[self] QUEUE_IDS = { Queue.custom: 0, # Custom games Queue.deprecated_blind_fives: 2, # Summoner's Rift 5v5 Blind Pick games Deprecated in patch 7.19 in favor of queue...
code_fim
hard
{ "lang": "python", "repo": "meraki-analytics/cassiopeia", "path": "/cassiopeia/data.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: meraki-analytics/cassiopeia path: /cassiopeia/data.py pport, "NONE": Role.none, "SOLO": Role.solo, }[string] class Position(Enum): top = "TOP" middle = "MIDDLE" jungle = "JUNGLE" bottom = "BOTTOM" utility = "UTILITY" apex = "APEX" none...
code_fim
hard
{ "lang": "python", "repo": "meraki-analytics/cassiopeia", "path": "/cassiopeia/data.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> The rule's arguments are validated against this schema: {'type': 'string'} """ if not self._is_valid_cp_format(value): self._error(field, "Invalid cellphone number format.") def _is_valid_cp_format(self, cp_no: str) -> bool: cp_no_list = list(cp_no)...
code_fim
medium
{ "lang": "python", "repo": "develamove/courier-api", "path": "/src/utils/custom_validator.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if cp_no_list[0:4] == ['+', '6', '3', '9'] and len(cp_no_list) == 13: return True return False<|fim_prefix|># repo: develamove/courier-api path: /src/utils/custom_validator.py from cerberus import Validator class CustomValidator(Validator): def _check_with_cp_no_format(...
code_fim
hard
{ "lang": "python", "repo": "develamove/courier-api", "path": "/src/utils/custom_validator.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: develamove/courier-api path: /src/utils/custom_validator.py from cerberus import Validator class CustomValidator(Validator): def _check_with_cp_no_format(self, field, value): """Checks if the cellphone number format is followed (PH cellphone number format) The rule's argume...
code_fim
medium
{ "lang": "python", "repo": "develamove/courier-api", "path": "/src/utils/custom_validator.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: brynhayder/reinforcement_learning_an_introduction path: /code/exercises/ex_5_10/model.py #!/usr/bin/env python """ -------------------------------- project: code created: 06/06/2018 15:59 --------------------------------- This code is not threadsafe, due to the RandomStates being passed around "...
code_fim
hard
{ "lang": "python", "repo": "brynhayder/reinforcement_learning_an_introduction", "path": "/code/exercises/ex_5_10/model.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.new_race() return self def __exit__(self, exc_type, exc_val, exc_tb): pass @staticmethod def _stationary(): return 0, 0 def _noise(self): if self.noise_level is None: return False return self.random_state.binomial(n=1, p=s...
code_fim
hard
{ "lang": "python", "repo": "brynhayder/reinforcement_learning_an_introduction", "path": "/code/exercises/ex_5_10/model.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: tensorflow/graphics path: /tensorflow_graphics/nn/loss/chamfer_distance.py # Copyright 2020 The TensorFlow Authors # # 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": "tensorflow/graphics", "path": "/tensorflow_graphics/nn/loss/chamfer_distance.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> minimum_square_distance_a_to_b = tf.reduce_min( input_tensor=square_distances, axis=-1) minimum_square_distance_b_to_a = tf.reduce_min( input_tensor=square_distances, axis=-2) return ( tf.reduce_mean(input_tensor=minimum_square_distance_a_to_b, axis=-1) + tf.re...
code_fim
hard
{ "lang": "python", "repo": "tensorflow/graphics", "path": "/tensorflow_graphics/nn/loss/chamfer_distance.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: forksbot/byceps path: /byceps/services/board/dbmodels/last_category_view.py """ byceps.services.board.dbmodels.last_category_view ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime...
code_fim
medium
{ "lang": "python", "repo": "forksbot/byceps", "path": "/byceps/services/board/dbmodels/last_category_view.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def __init__( self, user_id: UserID, category_id: CategoryID, occurred_at: datetime ) -> None: self.user_id = user_id self.category_id = category_id self.occurred_at = occurred_at def __repr__(self) -> str: return ReprBuilder(self) \ .add_wi...
code_fim
hard
{ "lang": "python", "repo": "forksbot/byceps", "path": "/byceps/services/board/dbmodels/last_category_view.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> class LastCategoryView(db.Model): """The last time a user looked into specific category.""" __tablename__ = 'board_categories_lastviews' user_id = db.Column(db.Uuid, db.ForeignKey('users.id'), primary_key=True) category_id = db.Column(db.Uuid, db.ForeignKey('board_categories.id'), prima...
code_fim
hard
{ "lang": "python", "repo": "forksbot/byceps", "path": "/byceps/services/board/dbmodels/last_category_view.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: owodunni/questlog path: /backend/questlog/controllers/default_controller.py import connexion import six <|fim_suffix|> :rtype: None """ return "do some magic!"<|fim_middle|>from questlog import util def get_healthcheck(): # noqa: E501 """Server healtcheck Check if the ser...
code_fim
medium
{ "lang": "python", "repo": "owodunni/questlog", "path": "/backend/questlog/controllers/default_controller.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """Server healtcheck Check if the server is operational # noqa: E501 :rtype: None """ return "do some magic!"<|fim_prefix|># repo: owodunni/questlog path: /backend/questlog/controllers/default_controller.py import connexion import six from questlog import util <|fim_middle|>def ...
code_fim
easy
{ "lang": "python", "repo": "owodunni/questlog", "path": "/backend/questlog/controllers/default_controller.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def get_healthcheck(): # noqa: E501 """Server healtcheck Check if the server is operational # noqa: E501 :rtype: None """ return "do some magic!"<|fim_prefix|># repo: owodunni/questlog path: /backend/questlog/controllers/default_controller.py import connexion import six <|fim_mid...
code_fim
easy
{ "lang": "python", "repo": "owodunni/questlog", "path": "/backend/questlog/controllers/default_controller.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: 4rund3v/dailyCode path: /batch1/problem101.py """ Given an even number (greater than 2), return two prime numbers whose sum will be equal to the given number. A solution will always exist. See Goldbach’s conjecture. Example: <|fim_suffix|>If [a, b] is one solution with a <= b, and [c, d] is an...
code_fim
medium
{ "lang": "python", "repo": "4rund3v/dailyCode", "path": "/batch1/problem101.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # prepare the list of prime numbers then find the smallest pair that constitutes the result. num_list = [0]*(value+1) sieve_of_eratosthenes(value, num_list) val = None for i in range(0, value): if num_list[i] and num_list[value-i] : print(' The sum {} : {} + {}'.fo...
code_fim
medium
{ "lang": "python", "repo": "4rund3v/dailyCode", "path": "/batch1/problem101.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: rauladw/nand2tetris path: /project08/VMTranslator.py import sys from pathlib import Path import Parser import CodeWriter class VMTranslator(): def __init__(self) -> None: self.parser = None self.code_writer = None self.input_path_is_dir = None self...
code_fim
hard
{ "lang": "python", "repo": "rauladw/nand2tetris", "path": "/project08/VMTranslator.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> vm_translator = VMTranslator() vm_translator.input_path_is_dir = input_is_dir vm_translator.vm_files_count = len(vm_files) child_path = file_path.joinpath(f'{file_path.stem}') vm_translator.asm_file = child_path for file in vm_files: vm_translator.current_file = f...
code_fim
hard
{ "lang": "python", "repo": "rauladw/nand2tetris", "path": "/project08/VMTranslator.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if not self.has_boostrap: self.write_bootstrap() while self.parser.has_more_commands(): self.parser.advance() if self.parser.command_type() == 'C_ARITHMETIC': self.code_writer.write_arithmetic(self.parser.command()) el...
code_fim
hard
{ "lang": "python", "repo": "rauladw/nand2tetris", "path": "/project08/VMTranslator.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: nastein/Hack-the-North path: /wikinet/json2hdf.py #!/usr/bin/env python3 import json import re import time import os from collections import namedtuple import numpy as np import h5py from tqdm import tqdm filter_title_re = re.compile("(?:Wikipedia:|:?Category:|:?File:|Media:|:?Image:|:?Templ...
code_fim
hard
{ "lang": "python", "repo": "nastein/Hack-the-North", "path": "/wikinet/json2hdf.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> assert len(pages) == len(adjacency_list) print("writing output...") nv = len(adjacency_list) ne = sum(len(row) for row in adjacency_list) IA = np.zeros((nv + 1,), dtype=np.int32) IA[1:] = np.cumsum([len(row) for row in adjacency_list], dtype=np.int32) JA = np.zeros((ne,), dt...
code_fim
hard
{ "lang": "python", "repo": "nastein/Hack-the-North", "path": "/wikinet/json2hdf.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: SKKU-ESLAB/Auto-Compression path: /pruning/detection/Yet-Another-EfficientDet-Pytorch-Convert-ONNX-TVM/efficientnet/utils_extra.py # Author: Zylo117 import math from torch import nn import torch.nn.functional as F class Conv2dStaticSamePadding(nn.Module): """ created by Zylo117 Th...
code_fim
hard
{ "lang": "python", "repo": "SKKU-ESLAB/Auto-Compression", "path": "/pruning/detection/Yet-Another-EfficientDet-Pytorch-Convert-ONNX-TVM/efficientnet/utils_extra.py", "mode": "psm", "license": "LGPL-3.0-only", "source": "the-stack-v2" }
<|fim_suffix|> if isinstance(self.stride, int): self.stride = [self.stride] * 2 elif len(self.stride) == 1: self.stride = [self.stride[0]] * 2 if isinstance(self.kernel_size, int): self.kernel_size = [self.kernel_size] * 2 elif len(self.kernel_size) ==...
code_fim
hard
{ "lang": "python", "repo": "SKKU-ESLAB/Auto-Compression", "path": "/pruning/detection/Yet-Another-EfficientDet-Pytorch-Convert-ONNX-TVM/efficientnet/utils_extra.py", "mode": "spm", "license": "LGPL-3.0-only", "source": "the-stack-v2" }
<|fim_prefix|># repo: dwave/BestRentalHousing path: /BestRentalHousing .py import xlrd import requests import json import xlsxwriter import time API_key = "<自己的高德题图API_key>" tables = [] def get_location(address): """获取经纬度""" url = "https://restapi.amap.com/v3/geocode/geo?address={}&output=js...
code_fim
hard
{ "lang": "python", "repo": "dwave/BestRentalHousing", "path": "/BestRentalHousing .py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> out_table = [] tables = read_excel(); del tables[0] i =0 address1 = "自己的公司地址 越精确越好" address2 = "另一半的公司地址 越精确越好" #所在城市区号 areaCode = "0755" ll1 = get_location(address1) ll2 = get_location(address2) #出发时间 outDoorDate = "2021-08-25" outDoorTime =...
code_fim
hard
{ "lang": "python", "repo": "dwave/BestRentalHousing", "path": "/BestRentalHousing .py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> #按照花费排序 costs2.sort(key = lambda x:x[0]) # print("按照花费排序"+str(costs)) row["另一半最少花费时间"]= float(costs2[0][1]) # row["最少花费"]=str(cost)+"---"+str(costs[0][0]) row["另一半最少花费"]=float(costs2[0][0]) if row["最短时间"] == None or row["最短时间"] == '': ...
code_fim
hard
{ "lang": "python", "repo": "dwave/BestRentalHousing", "path": "/BestRentalHousing .py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>class RugSub: def __init__(self, address): context = zmq.Context() self.socket = context.socket(zmq.SUB) self.socket.connect(address) print("[Info] Connected to: {address}".format(address=address)) def subscribe(self, topic): self.socket.setsockopt(zmq.SUBSCRIBE, topic) ...
code_fim
medium
{ "lang": "python", "repo": "celliott/ruglib", "path": "/app/rugs.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: celliott/ruglib path: /app/rugs.py #!/usr/bin/python import zmq, json, os class RugPub: def __init__(self, address): context = zmq.Context() self.socket = context.socket(zmq.PUB) self.socket.bind(address) print("[Info] Bound to 0MQ: {address}".format(address=address)) ...
code_fim
medium
{ "lang": "python", "repo": "celliott/ruglib", "path": "/app/rugs.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> context = zmq.Context() self.socket = context.socket(zmq.SUB) self.socket.connect(address) print("[Info] Connected to: {address}".format(address=address)) def subscribe(self, topic): self.socket.setsockopt(zmq.SUBSCRIBE, topic) print("[Info] Subscribed to topic: {topic}".f...
code_fim
medium
{ "lang": "python", "repo": "celliott/ruglib", "path": "/app/rugs.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: daisycrego/mercury-telemetry path: /mercury/migrations/0021_auto_20200502_1312.py # Generated by Django 2.2.10 on 2020-05-02 13:12 from django.db import migrations, models <|fim_suffix|> dependencies = [ ("mercury", "0020_auto_20200421_1647"), ] operations = [ migra...
code_fim
easy
{ "lang": "python", "repo": "daisycrego/mercury-telemetry", "path": "/mercury/migrations/0021_auto_20200502_1312.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ("mercury", "0020_auto_20200421_1647"), ] operations = [ migrations.AlterField( model_name="gfconfig", name="gf_token", field=models.CharField(blank=True, max_length=256), ), ]<|fim_prefix|># repo: daisycrego/mer...
code_fim
easy
{ "lang": "python", "repo": "daisycrego/mercury-telemetry", "path": "/mercury/migrations/0021_auto_20200502_1312.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>res = minimize(problem, algorithm, seed=1, verbose=False) print("Best solution found: \nX = %s\nF = %s" % (res.X, res.F))<|fim_prefix|># repo: Peng-YM/pymoo path: /pymoo/usage/misc/usage_initialize_not_evaluated.py import numpy as np from pymoo.algorithms.so...
code_fim
medium
{ "lang": "python", "repo": "Peng-YM/pymoo", "path": "/pymoo/usage/misc/usage_initialize_not_evaluated.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: Peng-YM/pymoo path: /pymoo/usage/misc/usage_initialize_not_evaluated.py import numpy as np from pymoo.algorithms.so_genetic_algorithm import GA from pymoo.factory import get_problem from pymoo.optimize import minimize problem = get_problem("sphere") X = np.random.random((500, problem.n_var)) ...
code_fim
medium
{ "lang": "python", "repo": "Peng-YM/pymoo", "path": "/pymoo/usage/misc/usage_initialize_not_evaluated.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> cmd = op.join(thome, "Trinity.pl") cmd += " --seqType fq --JM 100G --CPU {0}".format(opts.cpus) if paired: cmd += " --left {0} --right {1}".format(reads[0][-1], reads[1][-1]) else: cmd += " --single {0}".format(reads[0][-1]) runfile = "run.sh" write_file(runfile, c...
code_fim
hard
{ "lang": "python", "repo": "yangjl/jcvi", "path": "/assembly/trinity.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: yangjl/jcvi path: /assembly/trinity.py #!/usr/bin/env python # -*- coding: UTF-8 -*- """ Trinity assembly of RNAseq reads. Contains de novo (DN) method and genome-guided (GG) method. DN: http://trinityrnaseq.sourceforge.net/ GG: http://trinityrnaseq.sourceforge.net/genome_guided_trinity.html ""...
code_fim
hard
{ "lang": "python", "repo": "yangjl/jcvi", "path": "/assembly/trinity.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|>def dn(args): """ %prog dn folder Run Trinity-DN on a folder of reads. When paired-end (--paired) mode is on, filenames will be scanned based on whether they contain "_1_" and "_2_". """ p = OptionParser(dn.__doc__) p.add_option("--paired", default=False, action="store_true", ...
code_fim
hard
{ "lang": "python", "repo": "yangjl/jcvi", "path": "/assembly/trinity.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def test_product_stealability_and_explode(self): """ Test product stealability and explosiveness """ prod = Product('Test Product', weight=200, flammability=5.0) stealable = prod.stealability() explodable = prod.explode() self.assertEqual(stealab...
code_fim
hard
{ "lang": "python", "repo": "wel51x/DS-Unit-3-Sprint-1-Software-Engineering", "path": "/acme_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """ Test for legal product names """ adjectives = ['Awesome', 'Shiny', 'Impressive', 'Portable', 'Improved'] nouns = ['Anvil', 'Catapult' 'Disguise' 'Mousetrap', '???'] products = acme_report.generate_products() for prod in range(len(products)): ...
code_fim
hard
{ "lang": "python", "repo": "wel51x/DS-Unit-3-Sprint-1-Software-Engineering", "path": "/acme_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: wel51x/DS-Unit-3-Sprint-1-Software-Engineering path: /acme_test.py """ Unit testing for Acme products and product reporting """ import unittest from acme import Product from acme import BoxingGlove import acme_report class AcmeProductTests(unittest.TestCase): """ Making sure Acme produc...
code_fim
hard
{ "lang": "python", "repo": "wel51x/DS-Unit-3-Sprint-1-Software-Engineering", "path": "/acme_test.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: gugarosa/opytimizer path: /examples/spaces/create_search_space.py from opytimizer.spaces.search import SearchSpace # Define the number of agents and decision variables n_agents = 2 n_variables = 5 <|fim_suffix|># Creates the SearchSpace s = SearchSpace( n_agents=n_agents, n_variables=n_...
code_fim
medium
{ "lang": "python", "repo": "gugarosa/opytimizer", "path": "/examples/spaces/create_search_space.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|># Creates the SearchSpace s = SearchSpace( n_agents=n_agents, n_variables=n_variables, lower_bound=lower_bound, upper_bound=upper_bound, ) # Prints out some properties print(s.n_agents, s.n_variables) print(s.agents, s.best_agent) print(s.best_agent.position)<|fim_prefix|># repo: gugarosa...
code_fim
medium
{ "lang": "python", "repo": "gugarosa/opytimizer", "path": "/examples/spaces/create_search_space.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> filters = [] filters.extend( _get_side_filters( source_config, lambda tu: tu.src_detok, lambda tu: tu.src_tok.tokens[0], self._verbose, ) ) filters.extend( _get_side_filters(...
code_fim
hard
{ "lang": "python", "repo": "OpenNMT/nmt-wizard-docker", "path": "/nmtwizard/preprocess/operators/length_filter.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: OpenNMT/nmt-wizard-docker path: /nmtwizard/preprocess/operators/length_filter.py from nmtwizard.preprocess import prepoperator @prepoperator.register_operator("length_filter") class LengthFilter(prepoperator.Filter): @classmethod def _config_schema(cls): schema = super(LengthFil...
code_fim
hard
{ "lang": "python", "repo": "OpenNMT/nmt-wizard-docker", "path": "/nmtwizard/preprocess/operators/length_filter.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> max_chars = config.get("max_characters") if max_chars is not None: message_max_chars = f"Longer than max chars ({max_chars})" filters.append(lambda tu: (len(chars_fn(tu)) > max_chars, message_max_chars)) max_words = config.get("max_words") if max_words is not None: ...
code_fim
hard
{ "lang": "python", "repo": "OpenNMT/nmt-wizard-docker", "path": "/nmtwizard/preprocess/operators/length_filter.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.speed = 0.0 self.angle = 0.0 self._singleUpdate(self.outPs) super(MovementControl, self).stop() def _listen_for_steering(self, inP, outPs): while True: try: value = inP.recv() self.angle = float(value) ...
code_fim
hard
{ "lang": "python", "repo": "diaconuccalin/BFMC2020.Startup", "path": "/movementControl.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> """Apply the initializing methods and start the threads """ super(MovementControl,self).run() def stop(self): self.speed = 0.0 self.angle = 0.0 self._singleUpdate(self.outPs) super(MovementControl, self).stop() def _listen_for_steering(self...
code_fim
hard
{ "lang": "python", "repo": "diaconuccalin/BFMC2020.Startup", "path": "/movementControl.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: diaconuccalin/BFMC2020.Startup path: /movementControl.py from threading import Thread from src.utils.templates.workerprocess import WorkerProcess class MovementControl(WorkerProcess): # ===================================== INIT ========================================= def __init__(sel...
code_fim
hard
{ "lang": "python", "repo": "diaconuccalin/BFMC2020.Startup", "path": "/movementControl.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def get_logger(self, name): """ Get logger with the specified name. :param name: name of the logger :return: logger """ if not isinstance(name, six.string_types): name = "{}.{}".format(name.__class__.__module__, name.__class__.__name__) ...
code_fim
hard
{ "lang": "python", "repo": "sugarsack/sugar", "path": "/sugar/lib/logger/manager.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> :param name: name of the logger :return: logger """ if not isinstance(name, six.string_types): name = "{}.{}".format(name.__class__.__module__, name.__class__.__name__) return self.logger_store.setdefault(name, Logger(name=name, ...
code_fim
hard
{ "lang": "python", "repo": "sugarsack/sugar", "path": "/sugar/lib/logger/manager.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: sugarsack/sugar path: /sugar/lib/logger/manager.py # coding: utf-8 """ Logger extensions for Twisted. """ import sys import logging from twisted.python import log, util from twisted.python.logfile import LogFile from sugar.utils.objects import Singleton from sugar.lib import six from sugar.lib....
code_fim
hard
{ "lang": "python", "repo": "sugarsack/sugar", "path": "/sugar/lib/logger/manager.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|># setup pitch pitch = Pitch(pitch_type='statsbomb', figsize=(16, 9), layout=(1, 3), line_zorder=2, pitch_color='#22312b', line_color='white', orientation='vertical') # draw fig, ax = pitch.draw() # heatmap specified by (nx, ny) for horizontal pitch bins = [(6, 5), (1, 5), (6, 1)] for i, bin ...
code_fim
medium
{ "lang": "python", "repo": "DymondFormation/mplsoccer", "path": "/examples/plots/plot_heatmap.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: DymondFormation/mplsoccer path: /examples/plots/plot_heatmap.py """ ======= Heatmap ======= This example shows how to plot all pressure events from three matches as a heatmap. """ from mplsoccer.pitch import Pitch from mplsoccer.statsbomb import read_event, EVENT_SLUG import os import pandas as...
code_fim
medium
{ "lang": "python", "repo": "DymondFormation/mplsoccer", "path": "/examples/plots/plot_heatmap.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: AtlantisFox/Green-Point-Challenge path: /leetcode/Trapping_rain_water.py class Solution: # @param {integer[]} height # @return {integer} def trap(self, height): secHeight = 0 left = 0 right = len(height) - 1 area = 0 while (left < right): ...
code_fim
hard
{ "lang": "python", "repo": "AtlantisFox/Green-Point-Challenge", "path": "/leetcode/Trapping_rain_water.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> secHeight = max(height[right], secHeight) area += secHeight - height[right] right -= 1 return area<|fim_prefix|># repo: AtlantisFox/Green-Point-Challenge path: /leetcode/Trapping_rain_water.py class Solution: # @param {integer[]} height # @return {inte...
code_fim
hard
{ "lang": "python", "repo": "AtlantisFox/Green-Point-Challenge", "path": "/leetcode/Trapping_rain_water.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: conversationai/wikidetox path: /experimental/extract_pov_edits/dataflow_main.py 018 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licen...
code_fim
hard
{ "lang": "python", "repo": "conversationai/wikidetox", "path": "/experimental/extract_pov_edits/dataflow_main.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> class WriteDecompressedFile(beam.DoFn): def __init__(self): self.processed_revision_pairs = Metrics.counter(self.__class__, 'processed_revision_pairs') self.errors = Metrics.counter(self.__class__, 'errors') self.revision_skipped = Metrics.counter(self.__class__, 'revision_skipped') ...
code_fim
hard
{ "lang": "python", "repo": "conversationai/wikidetox", "path": "/experimental/extract_pov_edits/dataflow_main.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: conversationai/wikidetox path: /experimental/extract_pov_edits/dataflow_main.py Dataflow Main A dataflow pipeline to ingest the Wikipedia dump from 7zipped xml files to json. To configure with boto: Run gsutil config -e Run with: python dataflow_main.py --setup_file ./setup.py Args: in...
code_fim
hard
{ "lang": "python", "repo": "conversationai/wikidetox", "path": "/experimental/extract_pov_edits/dataflow_main.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: Macatools/macapype path: /macapype/nodes/segment.py import os import nibabel as nb import numpy as np from nipype.interfaces.base import (CommandLine, CommandLineInputSpec, TraitedSpec) from nipype.interfaces.base import traits, File from nipype.interfaces....
code_fim
hard
{ "lang": "python", "repo": "Macatools/macapype", "path": "/macapype/nodes/segment.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> gen_5tt_data = np.stack((gm_data, empty_vol, wm_data, csf_data, empty_vol), axis=-1) gen_5tt_img = nib.Nifti1Image(gen_5tt_data, affine=gm_img.affine, header=gm_img.header) gen_5tt_file = os.path.abspath(fname + "_5tt" + ext) ...
code_fim
hard
{ "lang": "python", "repo": "Macatools/macapype", "path": "/macapype/nodes/segment.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: julstan/judaicalink-labs path: /labs/backend/migrations/0006_auto_20200123_2321.py # Generated by Django 2.2.6 on 2020-01-23 22:21 from django.db import migrations, models class Migration(migrations.Migration): <|fim_suffix|> operations = [ migrations.AddField( model_nam...
code_fim
medium
{ "lang": "python", "repo": "julstan/judaicalink-labs", "path": "/labs/backend/migrations/0006_auto_20200123_2321.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> operations = [ migrations.AddField( model_name='datafile', name='indexed', field=models.BooleanField(default=False), ), migrations.AddField( model_name='dataset', name='indexed', field=models.BooleanField(d...
code_fim
medium
{ "lang": "python", "repo": "julstan/judaicalink-labs", "path": "/labs/backend/migrations/0006_auto_20200123_2321.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> result = super().add_combo(name) if self.nihilism: return result if self.condition("always connect hits"): a_hits = self.hits // 15 if a_hits > 0 and a_hits != self.ahits: self.ahits = a_hits Selfbuff("a1_crit_dmg"...
code_fim
medium
{ "lang": "python", "repo": "imxtrabored/dl", "path": "/adv/laranoa.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: imxtrabored/dl path: /adv/laranoa.py from core.advbase import * class Laranoa(Adv): comment = "no haste buff for teammates" def prerun(self): <|fim_suffix|> def add_combo(self, name="#"): result = super().add_combo(name) if self.nihilism: return result ...
code_fim
medium
{ "lang": "python", "repo": "imxtrabored/dl", "path": "/adv/laranoa.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self, path_to_model): # Load tokenizer and model self.tokenizer = DistilBertTokenizerFast.from_pretrained('distilbert-base-uncased') self.model = DistilBertForSequenceClassification.from_pretrained(path_to_model) self.model.dropout.p = 0 self.model....
code_fim
medium
{ "lang": "python", "repo": "TinaABB/projectpensive", "path": "/civility/classifier/runner.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }