text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|>#sns.histplot(data=np.clip(MasterData, n_bins[0], n_bins[-1]), bins=n_bins) sns.histplot(MasterData, binwidth=10) plt.ylabel('Helheim') plt.xlabel('Error[m]') print('Modal error= '+str(int(statistics.mode(MasterData)))) print('median error '+str(int(np.median(MasterData)))) print('mean error '+str((np.me...
code_fim
hard
{ "lang": "python", "repo": "PCdurham/SEE_ICE", "path": "/code/Results_Processing/CalvingFront_ErrorHist.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>MasterData3=MasterData[1:] plt.figure() #n_bins=np.asarray(range(0,510,10)) #sns.histplot(data=np.clip(MasterData, n_bins[0], n_bins[-1]), bins=n_bins) sns.histplot(MasterData, binwidth=10) plt.ylabel('Helheim') plt.xlabel('Error[m]') print('Modal error= '+str(int(statistics.mode(MasterData)))) print...
code_fim
medium
{ "lang": "python", "repo": "PCdurham/SEE_ICE", "path": "/code/Results_Processing/CalvingFront_ErrorHist.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: PCdurham/SEE_ICE path: /code/Results_Processing/CalvingFront_ErrorHist.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 17 10:06:36 2021 @author: patrice """ import numpy as np import glob import seaborn as sns import statistics import matplotlib.pyplot as plt import os ...
code_fim
hard
{ "lang": "python", "repo": "PCdurham/SEE_ICE", "path": "/code/Results_Processing/CalvingFront_ErrorHist.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: slantto/slantto.github.io path: /PFILT/neogeo/bin/journal_aggregate_plot.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ This script runs neogeo from an HDF5 formatted dataset """ import pnpnav.utils as pnputils import neogeodb.pytables_db as pdb import neogeo.extent as neoextent import nu...
code_fim
hard
{ "lang": "python", "repo": "slantto/slantto.github.io", "path": "/PFILT/neogeo/bin/journal_aggregate_plot.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>plt.show() fig = plt.figure() grid = ImageGrid(fig, 111, # similar to subplot(111) nrows_ncols = (4, 4), # creates 2x2 grid of axes axes_pad=0.2, # pad between axes in inch. label_mode="L" ) for i in range(16): grid[i].imshow(posterior...
code_fim
hard
{ "lang": "python", "repo": "slantto/slantto.github.io", "path": "/PFILT/neogeo/bin/journal_aggregate_plot.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: formido/browsercontrol path: /w3testrunner/browsers/ie.py from w3testrunner.browsers.browser import BrowserLin, BrowserWin <|fim_suffix|> name = "ie" process_name = "iexplore" executable = "iexplore" directory = "Internet Explorer"<|fim_middle|>class IE(BrowserWin):
code_fim
easy
{ "lang": "python", "repo": "formido/browsercontrol", "path": "/w3testrunner/browsers/ie.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> name = "ie" process_name = "iexplore" executable = "iexplore" directory = "Internet Explorer"<|fim_prefix|># repo: formido/browsercontrol path: /w3testrunner/browsers/ie.py from w3testrunner.browsers.browser import BrowserLin, BrowserWin <|fim_middle|>class IE(BrowserWin):
code_fim
easy
{ "lang": "python", "repo": "formido/browsercontrol", "path": "/w3testrunner/browsers/ie.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> .. math:: VOI(i) = \\sum_{j \\in {0,1}} P(D_i = j) \\left(-\\int p(x \\vert D_i=j) \\log{p(x \\vert D_i=j)}dx\\right) +\\int p(x) \\log{p(x)}dx Takes VOI of a specific branch. """ if probability is None: probability ...
code_fim
hard
{ "lang": "python", "repo": "COHRINT/cops_and_robots", "path": "/src/cops_and_robots/robo_tools/questioner.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: COHRINT/cops_and_robots path: /src/cops_and_robots/robo_tools/questioner.py penalty self.ask_every_n = ask_every_n self.sequence_length = sequence_length self.auto_answer = auto_answer self.minimize_questions = minimize_questions # Set up target order and ...
code_fim
hard
{ "lang": "python", "repo": "COHRINT/cops_and_robots", "path": "/src/cops_and_robots/robo_tools/questioner.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> VOI(i) = \\sum_{j \\in {0,1}} P(D_i = j) \\left(-\\int p(x \\vert D_i=j) \\log{p(x \\vert D_i=j)}dx\\right) +\\int p(x) \\log{p(x)}dx Takes VOI of a specific branch. """ if probability is None: probability = prior.copy() ...
code_fim
hard
{ "lang": "python", "repo": "COHRINT/cops_and_robots", "path": "/src/cops_and_robots/robo_tools/questioner.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>tbyname(hostname) ipbytes = socket.inet_aton(ip) format = "H%dp" % (len(ipbytes) + 1) data = struct.pack(format, int(port), ipbytes) result = sha.new(data).digest() print "0x%08x %08x %08x %08x %08x" % struct.unpack('5I', result)<|fim_prefix|># repo: Zandrr/phonebook.js path: /db-side-instance/bamboo/src...
code_fim
medium
{ "lang": "python", "repo": "Zandrr/phonebook.js", "path": "/db-side-instance/bamboo/src/bamboo/router/host2id.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: Zandrr/phonebook.js path: /db-side-instance/bamboo/src/bamboo/router/host2id.py #!/usr/bin/env python import sys; import sha; import socket; import struct if (len(sys.argv) < 2): print "Usag<|fim_suffix|>nt(port), ipbytes) result = sha.new(data).digest() print "0x%08x %08x %08x %08x %08x" % s...
code_fim
hard
{ "lang": "python", "repo": "Zandrr/phonebook.js", "path": "/db-side-instance/bamboo/src/bamboo/router/host2id.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>nt(port), ipbytes) result = sha.new(data).digest() print "0x%08x %08x %08x %08x %08x" % struct.unpack('5I', result)<|fim_prefix|># repo: Zandrr/phonebook.js path: /db-side-instance/bamboo/src/bamboo/router/host2id.py #!/usr/bin/env python import sys; import sha; import socket; import struct if (len(sys.a...
code_fim
medium
{ "lang": "python", "repo": "Zandrr/phonebook.js", "path": "/db-side-instance/bamboo/src/bamboo/router/host2id.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> class Package: def __init__(self, uuid: str, name: Name, description: Description, keywords: Keywords, author: Author, version: Version, created: Created, deprecated: Deprecated, category: Category): self.uuid = uuid self.name = name self.desc...
code_fim
hard
{ "lang": "python", "repo": "ouabache/librepcb-parts-generator", "path": "/entities/package.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self, uuid: str, name: Name, description: Description): self.uuid = uuid self.name = name self.description = description self.pads = [] # type: List[FootprintPad] self.polygons = [] # type: List[Polygon] self.circles = [] # type: List[Cir...
code_fim
hard
{ "lang": "python", "repo": "ouabache/librepcb-parts-generator", "path": "/entities/package.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ouabache/librepcb-parts-generator path: /entities/package.py from typing import List from common import format_float from .common import ( Align, Author, BoolValue, Category, Circle, Created, Deprecated, Description, EnumValue, FloatValue, Height, Keywords, Layer, Name, Polygon, Positio...
code_fim
hard
{ "lang": "python", "repo": "ouabache/librepcb-parts-generator", "path": "/entities/package.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: KentStateRobotics/Robot_Control path: /control/sockServer.py import asyncio import websockets import json import threading from protocol import field, action, motor, power class sockServer: '''Starts websocket server, listens for connections, and facilitates automatic reading and writeng fro...
code_fim
hard
{ "lang": "python", "repo": "KentStateRobotics/Robot_Control", "path": "/control/sockServer.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def send(self, data): message = json.dumps(data) for user in self.users: asyncio.run_coroutine_threadsafe(user.send(message), self.loop) async def handle_conn(self, conn, Uri): print("URI: " + Uri) user = client(conn, self.recEvent, self) self.u...
code_fim
hard
{ "lang": "python", "repo": "KentStateRobotics/Robot_Control", "path": "/control/sockServer.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> page = Page() page.start(open_browser=False) subprocess.check_call(['awe', 'new', '-o', 'Text: Hello World', '-p', 'props: {key1: value1}']) text1 = page.children[0] assert isinstance(text1, view.Text) assert text1.text == 'Hello World' assert text1.props['key1'] == 'value1' ...
code_fim
hard
{ "lang": "python", "repo": "dankilman/awe", "path": "/tests/test_cli.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> page = Page() text1 = page.new_text() page.start(open_browser=False) output = subprocess.check_output(['awe', '-l', 'ls']) parsed_output = json.loads(output) assert parsed_output[text1.id]['id'] == text1.id output = subprocess.check_output(['awe', '-l', 'get', '-e', text1.id]) ...
code_fim
hard
{ "lang": "python", "repo": "dankilman/awe", "path": "/tests/test_cli.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: dankilman/awe path: /tests/test_cli.py import json import os import subprocess import pytest from awe import Page, view def test_start_sanity(): env = os.environ.copy() env['AWE_OFFLINE'] = '1' subprocess.check_call([ 'awe', 'start', '-t', 'title1', '-w', '...
code_fim
hard
{ "lang": "python", "repo": "dankilman/awe", "path": "/tests/test_cli.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|># The request below returns a list of all evars available in all specified report suites. result = client.request( api="ReportSuite", method="GetEvars", data={ "rsid_list": [ "my_report_suite_id_1", "my_report_suite_id_2", "...", "my_repo...
code_fim
hard
{ "lang": "python", "repo": "steveobd/adobe_analytics", "path": "/examples/other_api_requests.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: steveobd/adobe_analytics path: /examples/other_api_requests.py """ The client class has a request method that allows all sorts of generic API requests to Adobe's v1.4 REST API. <|fim_suffix|># The request below returns a list of all evars available in all specified report suites. result = client...
code_fim
hard
{ "lang": "python", "repo": "steveobd/adobe_analytics", "path": "/examples/other_api_requests.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_Timer_ms(): test = Timer("Timer Testing (ms)") sleep(0.002) test.stop() def test_Timer_with(): with Timer("with Timer block Testing"): sleep(1) sleep(1) def run_all_tests(): test_Timer_object() test_timer_fn_decorator() test_timer_fn_decorator_args...
code_fim
medium
{ "lang": "python", "repo": "nadavo/Timer", "path": "/tests/test_timer.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> test_Timer_object() test_timer_fn_decorator() test_timer_fn_decorator_args() test_Timer_ms() test_Timer_with() if __name__ == "__main__": run_all_tests()<|fim_prefix|># repo: nadavo/Timer path: /tests/test_timer.py from time import sleep from src.syct import Timer, timer import ...
code_fim
hard
{ "lang": "python", "repo": "nadavo/Timer", "path": "/tests/test_timer.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: nadavo/Timer path: /tests/test_timer.py from time import sleep from src.syct import Timer, timer import logging def test_Timer_object(): test = Timer("Timer Testing") sleep(2) test.stop() @timer def test_timer_fn_decorator(): sleep(2) @timer(name="Timer fn Decorator Args Tes...
code_fim
hard
{ "lang": "python", "repo": "nadavo/Timer", "path": "/tests/test_timer.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: tracy-talent/AIPolicy path: /pasaie/pasare/pretrain.py from . import encoder from . import model from . import framework import torch import os import sys import json import numpy as np import logging from ..tokenization.utils import load_vocab import configparser root_url = "https:/...
code_fim
hard
{ "lang": "python", "repo": "tracy-talent/AIPolicy", "path": "/pasaie/pasare/pretrain.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> with open(file_name) as f: return json.load(f) def get_model(model_name, pretrain_path=config['plm']['hfl-chinese-bert-wwm-ext'], root_path=default_root_path): check_root() ckpt = os.path.join(config['path']['re_ckpt'], model_name + '.pth.tar') print(ckpt) datas...
code_fim
hard
{ "lang": "python", "repo": "tracy-talent/AIPolicy", "path": "/pasaie/pasare/pretrain.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> #Call Predict gRPC service result = get_prediction_service(context).Predict(request, 60.0) print("Returning the response for grpc port: %s" % (context.grpc_port)) #Return response jsonObj = MessageToJson(result) return jsonObj, "application/json"<|fim_prefix|># repo: neo-ai/ne...
code_fim
hard
{ "lang": "python", "repo": "neo-ai/neo-ai-dlr", "path": "/container/sample-inf1/inf1_tf_handler.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: neo-ai/neo-ai-dlr path: /container/sample-inf1/inf1_tf_handler.py ''' This file is to be named inference.py when hosting on sagemaker ''' import grpc import gzip import os import io from PIL import Image import numpy as np import tensorflow as tf from tensorflow_serving.apis import predict_pb2, p...
code_fim
medium
{ "lang": "python", "repo": "neo-ai/neo-ai-dlr", "path": "/container/sample-inf1/inf1_tf_handler.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> """Handle request. Args: data (obj): the request data context (Context): an object containing request and configuration details Returns: (bytes, string): data to return to client, (optional) response content type """ ''' stream = os.popen('/opt/aws/neuron/bi...
code_fim
hard
{ "lang": "python", "repo": "neo-ai/neo-ai-dlr", "path": "/container/sample-inf1/inf1_tf_handler.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # delete the Volume on Syndicate. try: rc = observer_core.ensure_volume_absent( volume_name ) except Exception, e: traceback.print_exc() logger.error("Failed to delete volume %s", volume_name ) raise e return rc #------------------------------- def sync_volumeacce...
code_fim
hard
{ "lang": "python", "repo": "syndicate-storage/syndicate", "path": "/python/syndicate/observer/sync.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: syndicate-storage/syndicate path: /python/syndicate/observer/sync.py #!/usr/bin/python """ Copyright 2014 The Trustees of Princeton University Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may ob...
code_fim
hard
{ "lang": "python", "repo": "syndicate-storage/syndicate", "path": "/python/syndicate/observer/sync.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>tleads = {(0,0): t0, # L, up <-- up (1,0): t0, # R, up <-- up (2,1): t0, # L, down <-- down (3,1): t0} # R, down <-- down # lead label, lead spin <-- level spin nleads = 4 # L,up R,up L,down R,down mulst = {0: vbias/2, 1: -...
code_fim
hard
{ "lang": "python", "repo": "gedaskir/qmeq-examples", "path": "/examples/example1c_spinful_single_orbital.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: gedaskir/qmeq-examples path: /examples/example1c_spinful_single_orbital.py # Prerequisites from __future__ import division, print_function import matplotlib.pyplot as plt import numpy as np import qmeq #--------------------------------------------------- def stab_calc(system, bfield, vlst, vgls...
code_fim
hard
{ "lang": "python", "repo": "gedaskir/qmeq-examples", "path": "/examples/example1c_spinful_single_orbital.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('books', '0003_auto_20200311_2152'), ] operations = [ migrations.AlterField( model_name='book', name='deadline_date', field=models.DateTimeField(default=datetime.datetime(2020, 3, 19, 3, 10, 21, 545184), null=True), ...
code_fim
medium
{ "lang": "python", "repo": "kaantecik/yazlab2_p_1", "path": "/app/books/migrations/0004_auto_20200312_0010.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: kaantecik/yazlab2_p_1 path: /app/books/migrations/0004_auto_20200312_0010.py # Generated by Django 3.0.4 on 2020-03-12 00:10 import datetime from django.db import migrations, models class Migration(migrations.Migration): <|fim_suffix|> operations = [ migrations.AlterField( ...
code_fim
medium
{ "lang": "python", "repo": "kaantecik/yazlab2_p_1", "path": "/app/books/migrations/0004_auto_20200312_0010.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: dlont/FourTops2016 path: /MVA/Freyas/root_numpy-4.7.2/lib/python2.7/site-packages/root_numpy/_warnings.py import warnings __all__ = [ 'RootNumpyUnconvertibleWarning', ] <|fim_suffix|>warnings.simplefilter('always', RootNumpyUnconvertibleWarning)<|fim_middle|>class RootNumpyUnconvertibleWa...
code_fim
medium
{ "lang": "python", "repo": "dlont/FourTops2016", "path": "/MVA/Freyas/root_numpy-4.7.2/lib/python2.7/site-packages/root_numpy/_warnings.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>warnings.simplefilter('always', RootNumpyUnconvertibleWarning)<|fim_prefix|># repo: dlont/FourTops2016 path: /MVA/Freyas/root_numpy-4.7.2/lib/python2.7/site-packages/root_numpy/_warnings.py import warnings __all__ = [ 'RootNumpyUnconvertibleWarning', ] <|fim_middle|>class RootNumpyUnconvertibleWa...
code_fim
medium
{ "lang": "python", "repo": "dlont/FourTops2016", "path": "/MVA/Freyas/root_numpy-4.7.2/lib/python2.7/site-packages/root_numpy/_warnings.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: wurstmineberg/alltheitems.wurstmineberg.de path: /alltheitems/__main__.py #!/usr/bin/env python3 """ Wurstmineberg: All The Items """ import sys #sys.path.append('/opt/py') import bottle import contextlib import json import pathlib import re import sys bottle.debug() #try: #import uwsg...
code_fim
hard
{ "lang": "python", "repo": "wurstmineberg/alltheitems.wurstmineberg.de", "path": "/alltheitems/__main__.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """A page with detailed information about the block with the given ID.""" import alltheitems.item_page return alltheitems.item_page.item_page(plugin + ':' + block_id, block=True) @application.route('/block/<plugin>/<block_id>/<damage:int>') def show_block_by_damage(plugin, block_id, damage): ...
code_fim
hard
{ "lang": "python", "repo": "wurstmineberg/alltheitems.wurstmineberg.de", "path": "/alltheitems/__main__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: CS4098/GroupProject path: /src/test/uitest/uitest.py import unittest from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdrive...
code_fim
hard
{ "lang": "python", "repo": "CS4098/GroupProject", "path": "/src/test/uitest/uitest.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def testUI(self): driver = self.driver driver.get("http://localhost/GroupProject/") fileUpload = driver.find_element_by_name("pmlfile") fileUpload.send_keys("src/test/uitest/test.pml") fileUpload.submit() promela = driver.find_element_by_id("promela") ...
code_fim
hard
{ "lang": "python", "repo": "CS4098/GroupProject", "path": "/src/test/uitest/uitest.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: karan23gupta/Summer-Training-Project path: /chander python programs/Emerald's Game.py #https://www.hackerearth.com/challenge/college/efficiency/algorithm/emeralds-game/ x = int(input('')) for i in range(x): <|fim_suffix|> ab=y*j a = map(int,str(ab)) leng =len(a) j=j+1 ...
code_fim
medium
{ "lang": "python", "repo": "karan23gupta/Summer-Training-Project", "path": "/chander python programs/Emerald's Game.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>z]) if set(abc) == set(abc1): flag =0 print ab break else: flag =1<|fim_prefix|># repo: karan23gupta/Summer-Training-Project path: /chander python programs/Emerald's Game.py #https://www.hackerearth.com/challenge/college/efficiency/algorithm/emerald...
code_fim
medium
{ "lang": "python", "repo": "karan23gupta/Summer-Training-Project", "path": "/chander python programs/Emerald's Game.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: simplybusiness/dbt path: /core/dbt/rpc/__init__.py from dbt.rpc.error import ( # noqa dbt_error, server_error, inva<|fim_suffix|>moteCallableResult # noqa from dbt.rpc.task_manager import TaskManager # noqa from dbt.rpc.response_manager import ResponseManager # noqa<|fim_middle|>lid_params...
code_fim
medium
{ "lang": "python", "repo": "simplybusiness/dbt", "path": "/core/dbt/rpc/__init__.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>r # noqa from dbt.rpc.response_manager import ResponseManager # noqa<|fim_prefix|># repo: simplybusiness/dbt path: /core/dbt/rpc/__init__.py from dbt.rpc.error import ( # noqa dbt_error, server_error, inva<|fim_middle|>lid_params, RPCException ) from dbt.rpc.task import RemoteCallable, RemoteCalla...
code_fim
medium
{ "lang": "python", "repo": "simplybusiness/dbt", "path": "/core/dbt/rpc/__init__.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: SiccarPoint/landlab path: /landlab/tests/test_collections.py #! /usr/bin/env python """ Unit tests for landlab.collections """ from nose.tools import assert_equal, assert_true, assert_raises try: from nose.tools import (assert_dict_equal, assert_tuple_equal, assert...
code_fim
hard
{ "lang": "python", "repo": "SiccarPoint/landlab", "path": "/landlab/tests/test_collections.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def set_value(self, name, value): pass def get_value(self, name): return self._vars[name] @ImplementsOrRaise(BmiBase) class Sample2(object): """A sample component.""" __implements__ = (BmiBase, BmiNoGrid, ) _input_var_names = [ 'deposition__rate', ] ...
code_fim
hard
{ "lang": "python", "repo": "SiccarPoint/landlab", "path": "/landlab/tests/test_collections.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> arena = Arena() assert_dict_equal(dict(), arena) arena.instantiate(Sample1, 'one') assert_equal(1, len(arena)) assert_true('one' in arena) assert_true(isinstance(arena['one'], Sample1)) arena.instantiate(Sample2, 'two') assert_equal(2, len(arena)) assert_true('one' in...
code_fim
hard
{ "lang": "python", "repo": "SiccarPoint/landlab", "path": "/landlab/tests/test_collections.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def get(target_name: str) -> Dict[str, str]: config_lines: List[str] = sh.get( "git", "config", "--local", "--list", ).splitlines() prefix = git_config_name(target_name) + GIT_CONFIG_KEY_SEP if target_name in CONFIG.targets: target = CONFIG.targets...
code_fim
hard
{ "lang": "python", "repo": "tribe-health/almond-cloud", "path": "/cli/almond_cloud/lib/targets.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: tribe-health/almond-cloud path: /cli/almond_cloud/lib/targets.py from __future__ import annotations from typing import Any, Callable, Dict, Iterable, List, Optional, Union from subprocess import CalledProcessError from almond_cloud.config import CONFIG from clavier import sh import splatlog as l...
code_fim
hard
{ "lang": "python", "repo": "tribe-health/almond-cloud", "path": "/cli/almond_cloud/lib/targets.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: technology-ebay-de/werkstatt path: /migrations/versions/eb93fb4715f4_.py """Create sketch_pad and code_block tables. Revision ID: eb93fb4715f4 Revises: f8aaa4f49c68 Create Date: 2019-01-08 23:32:53.897516 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgre...
code_fim
medium
{ "lang": "python", "repo": "technology-ebay-de/werkstatt", "path": "/migrations/versions/eb93fb4715f4_.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # ### commands auto generated by Alembic - please adjust! ### op.create_table('sketch_pad', sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False), sa.Column('title', sa.String(length=255), nullable=True), sa.PrimaryKeyConstraint('id') ) op.create_table('code_block', ...
code_fim
medium
{ "lang": "python", "repo": "technology-ebay-de/werkstatt", "path": "/migrations/versions/eb93fb4715f4_.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if hasattr(event, 'eventvalid') and not event.eventvalid(): guiutils.HBEvents.Entry('Ignore event that is no longer valid: {}'.format(repr(event))) return guiutils.HBEvents.Entry('Sched event {}'.format(repr(event))) eventnow = time.time() diff = eventnow - event.TargetTime if abs(diff) > control...
code_fim
medium
{ "lang": "python", "repo": "kevinkahn/softconsole", "path": "/guicore/guievents/schedevent.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: kevinkahn/softconsole path: /guicore/guievents/schedevent.py from guicore.displayscreen import EventDispatch from controlevents import CEvent import guicore.guiutils as guiutils import logsupport import time import controlevents <|fim_suffix|> if hasattr(event, 'eventvalid') and not event.event...
code_fim
medium
{ "lang": "python", "repo": "kevinkahn/softconsole", "path": "/guicore/guievents/schedevent.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: mahajrod/MAVR path: /examples/desaminases/filter_clusters_by_size_and_power.py #!/usr/bin/env python import os from collections import OrderedDict from RouToolPa.Collections.General import TwoLvlDict from Parsers.CCF import CollectionCCF workdir = "/media/mahajrod/d9e6e5ee-1bf7-4dba-934e-3f898d...
code_fim
hard
{ "lang": "python", "repo": "mahajrod/MAVR", "path": "/examples/desaminases/filter_clusters_by_size_and_power.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> os.system("mkdir -p %i/%.2f" % (min_size, min_power)) above_power_clusters, below_power_clusters = above_size_clusters.filter_by_expression("record.description['Power'] >= %f" % min_power) above_power_clusters.write("%i/%.2f/%s_size_%i+_power_%.2f+%s" % (min_size, min_p...
code_fim
hard
{ "lang": "python", "repo": "mahajrod/MAVR", "path": "/examples/desaminases/filter_clusters_by_size_and_power.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: vivanov879/deep-fluids path: /scene/utils/smoke3_mov.py import argparse parser = argparse.ArgumentParser() parser.add_argument("--log_dir", type=str, default='data/smoke3_mov200_f400') parser.add_argument("--num_param", type=int, default=2) parser.add_argument("--path_format", type=str, defaul...
code_fim
hard
{ "lang": "python", "repo": "vivanov879/deep-fluids", "path": "/scene/utils/smoke3_mov.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>parser.add_argument("--resolution_x", type=int, default=48) # 96 parser.add_argument("--resolution_y", type=int, default=72) # 128 parser.add_argument("--resolution_z", type=int, default=48) # 1 parser.add_argument("--buoyancy", type=float, default=-4e-3) parser.add_argument("--bWidth", type=int, default=...
code_fim
hard
{ "lang": "python", "repo": "vivanov879/deep-fluids", "path": "/scene/utils/smoke3_mov.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: rajflume/tf-quant-finance path: /tf_quant_finance/experimental/instruments/rates_common.py # Lint as: python3 # Copyright 2020 Google LLC # # 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 ...
code_fim
hard
{ "lang": "python", "repo": "rajflume/tf-quant-finance", "path": "/tf_quant_finance/experimental/instruments/rates_common.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def get_daycount_fraction(date_start, date_end, basis, dtype): """Return the day count fraction between two dates using the input basis.""" default_values = tf.zeros(date_start.shape, dtype=dtype) basis_as_int = tf.constant([x.value for x in basis], dtype=tf.int16) year_fractions = tf.where( ...
code_fim
hard
{ "lang": "python", "repo": "rajflume/tf-quant-finance", "path": "/tf_quant_finance/experimental/instruments/rates_common.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: MahouShoujoMivutilde/gif.py path: /gif.py #!/usr/bin/python3 from os import path, remove from tempfile import gettempdir from random import random import subprocess import argparse import re DESC = """ Скрипт для создания gif из видео с помощью ffmpeg. Использует генерацию палитры в режиме sta...
code_fim
hard
{ "lang": "python", "repo": "MahouShoujoMivutilde/gif.py", "path": "/gif.py", "mode": "psm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> temp_pal = path.join(gettempdir(), str(random()) + '.png') if args.fps is None: args.fps = get_fps(args.infile) if args.fps > 30: args.fps = 30 gen_pal(args.infile, temp_pal, args.fps, args.height) encode(args.infile, args.outfile, temp_pal, args.fps, args.hei...
code_fim
hard
{ "lang": "python", "repo": "MahouShoujoMivutilde/gif.py", "path": "/gif.py", "mode": "spm", "license": "Unlicense", "source": "the-stack-v2" }
<|fim_suffix|> context = super(ChatView, self).get_context_data(**kwargs) if USE_CACHE is True: store = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB) key = SITE_SLUG+'_rechat' # retrieve cache history data = store.lrange(key, 0, -1) ...
code_fim
medium
{ "lang": "python", "repo": "library-collections/django-rechat", "path": "/rechat/views.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: library-collections/django-rechat path: /rechat/views.py # -*- coding: utf-8 -*- from django.core.urlresolvers import reverse from django.views.generic import FormView from instant.conf import SITE_SLUG from rechat.forms import ChatForm from rechat.producers import process_message from rechat.co...
code_fim
medium
{ "lang": "python", "repo": "library-collections/django-rechat", "path": "/rechat/views.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>class SeasonIssuesView(LoginRequiredMixin, ListView): template_name = 'competitions/seasons/issues.html' context_object_name = 'fixtures' paginate_by = 10 def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) competition = Competition.objects.g...
code_fim
hard
{ "lang": "python", "repo": "ethicaltechcharity/nehl-website", "path": "/fixtures/views/competitions.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ethicaltechcharity/nehl-website path: /fixtures/views/competitions.py from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponseForbidden from django.shortcuts import get_object_or_404 from django.views.generic import DetailView, ListView, FormView, TemplateVie...
code_fim
hard
{ "lang": "python", "repo": "ethicaltechcharity/nehl-website", "path": "/fixtures/views/competitions.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: fredshentu/public_model_based_controller path: /scripts/box3d_trpo/lstm.py """ Author: Dian Chen """ from rllab.core.serializable import Serializable from railrl.core import tf_util from railrl.core.neuralnet import NeuralNetwork from railrl.predictors.perceptron import Perceptron from rllab.misc...
code_fim
easy
{ "lang": "python", "repo": "fredshentu/public_model_based_controller", "path": "/scripts/box3d_trpo/lstm.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self, name_or_scope, input_tensor, input_size, output_size, )<|fim_prefix|># repo: fredshentu/public_model_based_controller path: /scripts/box3d_trpo/lstm.py """ Author: Dian Chen """ from rllab.core.serializable import Serializable from railrl.core im...
code_fim
easy
{ "lang": "python", "repo": "fredshentu/public_model_based_controller", "path": "/scripts/box3d_trpo/lstm.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: youdar/work path: /work/MTRIX/Test_reconstruction_command.py from __future__ import division from misc_scripts.r_factor_calc import * from iotbx.pdb.multimer_reconstruction import multimer import multiprocessing as mp from iotbx import pdb import cPickle as pickle import os ''' Read list of p...
code_fim
medium
{ "lang": "python", "repo": "youdar/work", "path": "/work/MTRIX/Test_reconstruction_command.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>@author: Youval Dar ''' def run(): ''' good_MTRIX_pdb_files, good_BIOMT_pdb_files and structure_factors_files are dictionaries. the keys are pdb record name and the values are the appropriate file full path ''' good_MTRIX_pdb_files = pickle.load(open('dict_good_MTRIX_pdb_files','r')) good_...
code_fim
medium
{ "lang": "python", "repo": "youdar/work", "path": "/work/MTRIX/Test_reconstruction_command.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def run(): ''' good_MTRIX_pdb_files, good_BIOMT_pdb_files and structure_factors_files are dictionaries. the keys are pdb record name and the values are the appropriate file full path ''' good_MTRIX_pdb_files = pickle.load(open('dict_good_MTRIX_pdb_files','r')) good_BIOMT_pdb_files = pickle....
code_fim
medium
{ "lang": "python", "repo": "youdar/work", "path": "/work/MTRIX/Test_reconstruction_command.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: gorhack/webStegFS_project path: /webStegFS/Web_Connection/api_cons.py #!/usr/bin/env python3 """ The `api_cons` module creates an anonymous connection to a given social media file hosting website and provides connection, upload image, and download image parameters. """ from bs4 import Beautiful...
code_fim
hard
{ "lang": "python", "repo": "gorhack/webStegFS_project", "path": "/webStegFS/Web_Connection/api_cons.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """ The downloadImage method retrieves the direct download URL from the download url returned by SendSpace. This method take the download url returned by uploadImage as a parameter. This method returns image as a BytesIO object. """ # check i...
code_fim
hard
{ "lang": "python", "repo": "gorhack/webStegFS_project", "path": "/webStegFS/Web_Connection/api_cons.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: peace098beat/TrackMaster path: /src/TrackMaster/trackmasterapp.py #! coding:utf-8 """ trackmasterapp.py Created by 0160929 on 2016/09/29 16:36 """ import os __version__ = '0.1' import sys from PySide.QtGui import * from PySide.QtCore import * from track_controller import Track...
code_fim
hard
{ "lang": "python", "repo": "peace098beat/TrackMaster", "path": "/src/TrackMaster/trackmasterapp.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def create_track_controller(self, url): tc = TrackController(url) self.scrl_contents_vlayout.insertWidget(0,tc) self.track_controller_s.append((tc)) def main(): app = QApplication(sys.argv) # app.setStyle('plastique') win = TrackMasterApp() win.sho...
code_fim
hard
{ "lang": "python", "repo": "peace098beat/TrackMaster", "path": "/src/TrackMaster/trackmasterapp.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> objs = [str(u.toLocalFile()) for u in event.mimeData().urls()] if len(objs) > 20: raise ImportError for u in objs: ext = os.path.splitext(u)[1] if ext in (".wav",".WAV"): print(u) self.create_track_controlle...
code_fim
hard
{ "lang": "python", "repo": "peace098beat/TrackMaster", "path": "/src/TrackMaster/trackmasterapp.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> res = 0 for i in sorted(zip(weights, values)): if capacity - i[0] >= 0: capacity -= i[0] res += i[1] else: fraction = capacity / i[0] res += i[1] * fraction capacity = int(capacity - (i[0] * fraction)) break return int(res) print(fractional_knapsack2([10, ...
code_fim
medium
{ "lang": "python", "repo": "osama-mohamed/python_projects", "path": "/algorithmes/greedy_fractional_knapsack.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: osama-mohamed/python_projects path: /algorithmes/greedy_fractional_knapsack.py def fractional_knapsack(weights, values, capacity): res, weight_sum = 0, sum(weights) print(f'Over capacity: {capacity}, maximum: {weight_sum}') if capacity > weight_sum else '' for pair in sorted(zip(weights, va...
code_fim
medium
{ "lang": "python", "repo": "osama-mohamed/python_projects", "path": "/algorithmes/greedy_fractional_knapsack.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return a, b, c; # Add two decimal digits passed on the command line. # The sum is returned as digit2 and the carry output is 0 or 1. def add_digits(digit1, digit2): carry = 0 print("\nInput: digit1: " + str(digit1) + " digit2: " + str(digit2)) while digit1 > 0: print("digit1:...
code_fim
hard
{ "lang": "python", "repo": "nikolakn/Modern-Computer-Architecture-and-Organization", "path": "/Chapter 1 - Introduction/Answers to Exercises/Ex__1_single_digit_adder.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: nikolakn/Modern-Computer-Architecture-and-Organization path: /Chapter 1 - Introduction/Answers to Exercises/Ex__1_single_digit_adder.py #!/usr/bin/env python """Answer to chapter 1 exercise 1.""" import sys # Perform one step of the Analytical Engine addition operation # a and b are the digits...
code_fim
hard
{ "lang": "python", "repo": "nikolakn/Modern-Computer-Architecture-and-Organization", "path": "/Chapter 1 - Introduction/Answers to Exercises/Ex__1_single_digit_adder.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> print("Result: digit1: " + str(digit1) + " digit2: " + str(digit2) + " carry: " + str(carry)) return digit2, carry<|fim_prefix|># repo: nikolakn/Modern-Computer-Architecture-and-Organization path: /Chapter 1 - Introduction/Answers to Exercises/Ex__1_single_digit_adder.py #!/usr/bin/env pytho...
code_fim
medium
{ "lang": "python", "repo": "nikolakn/Modern-Computer-Architecture-and-Organization", "path": "/Chapter 1 - Introduction/Answers to Exercises/Ex__1_single_digit_adder.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Baojiazhong/One-Shot-Learning path: /utils.py # #Copyright 2019 Korea University under XAI Project supported by Ministry of Science and ICT, Korea # # #Licensed under the Apache License, Version 2.0 (the "License"); # #you may not use this file except in compliance with the License. # #You m...
code_fim
medium
{ "lang": "python", "repo": "Baojiazhong/One-Shot-Learning", "path": "/utils.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> rand_idx = np.random.permutation(len(dat_all)) trn_dat, val_dat = split_data(dat_all, rand_idx, [0.9,0.1]) trn_lbl, val_lbl = split_data(lbl_all, rand_idx, [0.9,0.1]) sup_dat, qry_dat, tst_lbl= make_k_shot_test(trn_dat, trn_lbl, dat_mci) return (trn_dat, trn_lbl), (val_dat, val_lbl), ...
code_fim
hard
{ "lang": "python", "repo": "Baojiazhong/One-Shot-Learning", "path": "/utils.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: binref/refinery path: /test/units/formats/test_tnetmtm.py erValue(self): unit = self.load(header_filter='User-Agent') user_agent = unit(self.EXAMPLE_COM).decode('utf-8').splitlines() self.assertEqual(user_agent, ['Wget/1.20.3 (msys)']) EXAMPLE_COM = bytes.fromhex( ...
code_fim
hard
{ "lang": "python", "repo": "binref/refinery", "path": "/test/units/formats/test_tnetmtm.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: binref/refinery path: /test/units/formats/test_tnetmtm.py r='User-Agent') user_agent = unit(self.EXAMPLE_COM).decode('utf-8').splitlines() self.assertEqual(user_agent, ['Wget/1.20.3 (msys)']) EXAMPLE_COM = bytes.fromhex( '373930363A343A747970653B343A687474703B373A7665...
code_fim
hard
{ "lang": "python", "repo": "binref/refinery", "path": "/test/units/formats/test_tnetmtm.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> '46414442680A4D517377435159445651514745774A56557A45564D424D474131554543684D4D52476C6E61554E6C636E516' '75357356A4D526B77467759445651514C457842330A643363755A476C6E61574E6C636E5175593239744D53417748675944' '56515144457864456157647051325679644342486247396959577767556D3976644342440A5154416546...
code_fim
hard
{ "lang": "python", "repo": "binref/refinery", "path": "/test/units/formats/test_tnetmtm.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: SitaramRyali/Self_Driving_Car-NanoDegree path: /Project-LaneLines_Finder/Basic_Detector/Practice FIles/image_with_three_channels.py #image_with_three_channels import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np <|fim_suffix|>fig = plt.figure() a = fig.add_su...
code_fim
medium
{ "lang": "python", "repo": "SitaramRyali/Self_Driving_Car-NanoDegree", "path": "/Project-LaneLines_Finder/Basic_Detector/Practice FIles/image_with_three_channels.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> for i in range(3): a = fig.add_subplot(1, 4, i+2) imgplot = plt.imshow(org_img[:,:,i]) a.set_title('{} channel image'.format(channel_data[i])) plt.show()<|fim_prefix|># repo: SitaramRyali/Self_Driving_Car-NanoDegree path: /Project-LaneLines_Finder/Basic_Detector/Practice FIles/image_wit...
code_fim
medium
{ "lang": "python", "repo": "SitaramRyali/Self_Driving_Car-NanoDegree", "path": "/Project-LaneLines_Finder/Basic_Detector/Practice FIles/image_with_three_channels.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: utsurius/django-actionable-messages path: /django_actionable_messages/adaptive_card/inputs.py from typing import List, Union from django_actionable_messages.adaptive_card.mixins import InputMixin, DateTimeMixin from django_actionable_messages.adaptive_card.utils import ChoiceInputStyle, TextInpu...
code_fim
hard
{ "lang": "python", "repo": "utsurius/django-actionable-messages", "path": "/django_actionable_messages/adaptive_card/inputs.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def set_value_off(self, value: str): self._data["valueOff"] = value def set_value_on(self, value: str): self._data["valueOn"] = value def set_wrap(self, value=True): self._data["wrap"] = value class InputChoice(CardElement): def __init__(self, title, value: Unio...
code_fim
hard
{ "lang": "python", "repo": "utsurius/django-actionable-messages", "path": "/django_actionable_messages/adaptive_card/inputs.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: MontoyaAndres/AVMod path: /avmod.py import click from commands import generate as avmod_commands from commands import about <|fim_suffix|> ctx.obj = {} ctx.obj['ip'] = '' ctx.obj['port'] = '' cli.add_command(avmod_commands.all) cli.add_command(about.about)<|fim_middle|>@click.grou...
code_fim
easy
{ "lang": "python", "repo": "MontoyaAndres/AVMod", "path": "/avmod.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> cli.add_command(avmod_commands.all) cli.add_command(about.about)<|fim_prefix|># repo: MontoyaAndres/AVMod path: /avmod.py import click from commands import generate as avmod_commands from commands import about <|fim_middle|>@click.group() @click.pass_context def cli(ctx): ctx.obj = {} ctx.obj...
code_fim
medium
{ "lang": "python", "repo": "MontoyaAndres/AVMod", "path": "/avmod.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> k = np.array(A.sum(axis=0),dtype=float).flatten() return np.mean(k), np.mean(k**2) if __name__=="__main__": NMEAS = 20 B = 10 L = 2 N = B**L k = 16 mus = np.linspace(-1,1,50) generators = ( modular_hierarchical_network_coord_lists, small_world...
code_fim
medium
{ "lang": "python", "repo": "benmaier/sixdegrees", "path": "/sandbox/test_all.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> _k = all_k[ig].mean(axis=1) _k2 = all_k2[ig].mean(axis=1) ax[0].plot(mus, _k,label=g.__name__) ax[1].plot(mus, _k2) ax[0].set_xlabel(r'structural control $\mu$') ax[0].set_ylabel(r'mean degree') ax[1].set_ylabel(r'second moment degree') ax[0].legend() ...
code_fim
hard
{ "lang": "python", "repo": "benmaier/sixdegrees", "path": "/sandbox/test_all.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: benmaier/sixdegrees path: /sandbox/test_all.py import numpy as np from matplotlib import pyplot as pl from sixdegrees import ( small_world_network_coord_lists, original_small_world_network_coord_lists, modular_hierarchical_network_coord_lists, random_geometric...
code_fim
hard
{ "lang": "python", "repo": "benmaier/sixdegrees", "path": "/sandbox/test_all.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: denarced/since path: /since.py #!/usr/bin/env python3 import datetime import re import sys def main(strTime): <|fim_suffix|>if __name__ == '__main__': if len(sys.argv) < 2: print('Usage {0} {{time}}'.format(sys.argv[0])) else: print(main(sys.argv[1]))<|fim_middle|> n...
code_fim
hard
{ "lang": "python", "repo": "denarced/since", "path": "/since.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: denarced/since path: /since.py #!/usr/bin/env python3 import datetime import re import sys <|fim_suffix|>if __name__ == '__main__': if len(sys.argv) < 2: print('Usage {0} {{time}}'.format(sys.argv[0])) else: print(main(sys.argv[1]))<|fim_middle|>def main(strTime): n...
code_fim
hard
{ "lang": "python", "repo": "denarced/since", "path": "/since.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>if __name__ == '__main__': if len(sys.argv) < 2: print('Usage {0} {{time}}'.format(sys.argv[0])) else: print(main(sys.argv[1]))<|fim_prefix|># repo: denarced/since path: /since.py #!/usr/bin/env python3 import datetime import re import sys def main(strTime): <|fim_middle|> n...
code_fim
hard
{ "lang": "python", "repo": "denarced/since", "path": "/since.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }