text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|> def update_pipette_config(self, axis, data): ''' Updates the following configs for a given pipette mount based on the detected pipette type: - homing positions M365.0 - Max Travel M365.1 - endstop debounce M365.2 (NOT for zprobe debounce) - retra...
code_fim
hard
{ "lang": "python", "repo": "fakela/opentrons", "path": "/api/src/opentrons/drivers/smoothie_drivers/__init__.py", "mode": "spm", "license": "LicenseRef-scancode-warranty-disclaimer", "source": "the-stack-v2" }
<|fim_prefix|># repo: fakela/opentrons path: /api/src/opentrons/drivers/smoothie_drivers/__init__.py class SmoothieDriver(object): def __init__(self): pass class VirtualSmoothie(object): def __init__(self): pass class SimulatingDriver: def __init__(self): self._steps_per_mm = ...
code_fim
hard
{ "lang": "python", "repo": "fakela/opentrons", "path": "/api/src/opentrons/drivers/smoothie_drivers/__init__.py", "mode": "psm", "license": "LicenseRef-scancode-warranty-disclaimer", "source": "the-stack-v2" }
<|fim_prefix|># repo: Hovden/tomviz path: /tomviz/python/MisalignImgs_Uniform.py #Misalign (Random-Uniform) a tomography tilt series #for testing and reconsruction development # #developed as part of the tomviz project (www.tomviz.com) def transform_scalars(dataset): from tomviz import utils import n...
code_fim
medium
{ "lang": "python", "repo": "Hovden/tomviz", "path": "/tomviz/python/MisalignImgs_Uniform.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> if data_py is None: #Check if data exists raise RuntimeError("No data array found!") if TILT_AXIS == []: #If tilt axis is not given, find it #Find smallest array dimension, assume it is the tilt angle axis if data_py.ndim == 3: TILT_AXIS = np.argmin( data_p...
code_fim
hard
{ "lang": "python", "repo": "Hovden/tomviz", "path": "/tomviz/python/MisalignImgs_Uniform.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> if TILT_AXIS == []: #If tilt axis is not given, find it #Find smallest array dimension, assume it is the tilt angle axis if data_py.ndim == 3: TILT_AXIS = np.argmin( data_py.shape ) elif data_py.ndim == 2: raise RuntimeError("Data Array is 2 dimensions, it s...
code_fim
hard
{ "lang": "python", "repo": "Hovden/tomviz", "path": "/tomviz/python/MisalignImgs_Uniform.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>gen.add("color_mode", int_t, 0, "Video mode for color camera", 68, 1, 74, edit_method=output_mode_enum) gen.add("depth_mode", int_t, 0, "Video mode for depth camera", 69, 1, 74, edit_method=outp...
code_fim
hard
{ "lang": "python", "repo": "orbbec/ros_astra_camera", "path": "/cfg/Astra.cfg", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: orbbec/ros_astra_camera path: /cfg/Astra.cfg #!/usr/bin/env python PACKAGE = 'astra_camera' from dynamic_reconfigure.parameter_generator_catkin import * gen = ParameterGenerator() # TODO Only offer modes supported by known hardware output_mode_enum = gen.enum([ gen.const("1024_768_5", int...
code_fim
hard
{ "lang": "python", "repo": "orbbec/ros_astra_camera", "path": "/cfg/Astra.cfg", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>gen.add("ir_time_offset", double_t, 0, "ir image time offset in seconds", -0.033, -1.0, 1.0) gen.add("color_time_offset", double_t, 0, "color image time offset in seconds", -0.033, -1.0, 1.0) gen.add("depth_time_offset", double_t, 0, "depth image time offset in seconds", -0.033, -1...
code_fim
hard
{ "lang": "python", "repo": "orbbec/ros_astra_camera", "path": "/cfg/Astra.cfg", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>plt.tight_layout() #Exercise 3 - Save figures plt.savefig("plot_and_scatter.png")<|fim_prefix|># repo: cce-bigdataintro-1160/spring2019 path: /class6-notebook/exercises/matplotlib_1-3.py import matplotlib.pyplot as plt import pandas as pd df = pd.read_csv('../data/boston/housing.data', ...
code_fim
hard
{ "lang": "python", "repo": "cce-bigdataintro-1160/spring2019", "path": "/class6-notebook/exercises/matplotlib_1-3.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: cce-bigdataintro-1160/spring2019 path: /class6-notebook/exercises/matplotlib_1-3.py import matplotlib.pyplot as plt import pandas as pd df = pd.read_csv('../data/boston/housing.data', sep='\s+', header=None) df.columns = ['CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', '...
code_fim
medium
{ "lang": "python", "repo": "cce-bigdataintro-1160/spring2019", "path": "/class6-notebook/exercises/matplotlib_1-3.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> < #count{Z : n(Z) }. %#int(X), X < #count{Z : n(Z) }. c(X1) :- X1 < #count{Z : n(Z) }, X=1+X1. %#int(X), X1 < #count{Z : n(Z) }, +(X, 1, X1). %% end %% """<|fim_prefix|># repo: dave90/Dlv_safe2 path: /Dlv2_safe2/tests/parser/bug.76.test.py input = """ %% start file count.dl %% %#maxint = 5. n(1). n(2...
code_fim
hard
{ "lang": "python", "repo": "dave90/Dlv_safe2", "path": "/Dlv2_safe2/tests/parser/bug.76.test.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: dave90/Dlv_safe2 path: /Dlv2_safe2/tests/parser/bug.76.test.py input = """ %% start file count.dl %% %#maxint = 5. n(1). n(2). n(3). a(X) :- X > 0, X < #count{Z : n(Z) }. %#int(X), X > 0, X < #count{Z : n(Z) }. b(X) :- X <|fim_suffix|>output = """ %% start file count.dl %% %#maxint = 5. n(1). n(2...
code_fim
medium
{ "lang": "python", "repo": "dave90/Dlv_safe2", "path": "/Dlv2_safe2/tests/parser/bug.76.test.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|># Initializing Databases accessdb = AccessModule() acc_peodb = AccPeoModule() peopledb = PeopleModule() peo_curdb = PeoCurModule() curriculumdb = CurriculumModule() # Importing views from views import * # Running the app if __name__ == '__main__': app.run()<|fim_prefix|># repo: GuilhermeVieira/mac03...
code_fim
medium
{ "lang": "python", "repo": "GuilhermeVieira/mac0350-database", "path": "/src/api/app.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: GuilhermeVieira/mac0350-database path: /src/api/app.py from flask import Flask from access_module import AccessModule from acc_peo_module import AccPeoModule from people_module import PeopleModule from peo_cur_module import PeoCurModule from curriculum_module import CurriculumModule # Project Co...
code_fim
medium
{ "lang": "python", "repo": "GuilhermeVieira/mac0350-database", "path": "/src/api/app.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> CW.put_metric_data( Namespace="Turbine", MetricData=[ { "MetricName": "ClusterLoad", "Dimensions": [{"Name": "StackName", "Value": os.environ["StackName"]}], "Timestamp": time, "Value": value, "...
code_fim
hard
{ "lang": "python", "repo": "amizzo87/bernstein-stack", "path": "/functions/load_metric.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: amizzo87/bernstein-stack path: /functions/load_metric.py import datetime import logging import os import boto3 CW = boto3.client("cloudwatch") logging.getLogger().setLevel(os.environ.get("LOGLEVEL", logging.INFO)) def handler(_event, _context): logging.debug("environment variables:\n %s",...
code_fim
hard
{ "lang": "python", "repo": "amizzo87/bernstein-stack", "path": "/functions/load_metric.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if robot.model_type == "MJCF": MJCF_SCALING = robot.mjcf_scaling scaling = [1.0/MJCF_SCALING, 1.0/MJCF_SCALING, 0.6/MJCF_SCALING] else: scaling = [1, 1, 1] magnified = [2, 2, 2] collisionId = p.createCollisionShape(p.GEOM_MESH, fileName...
code_fim
hard
{ "lang": "python", "repo": "sacadena/midlevel-reps", "path": "/gibson/gibson/core/physics/scene_building.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: sacadena/midlevel-reps path: /gibson/gibson/core/physics/scene_building.py import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) os.sys.path.insert(0,parentdir) import pybullet_data from gibson.data.data...
code_fim
hard
{ "lang": "python", "repo": "sacadena/midlevel-reps", "path": "/gibson/gibson/core/physics/scene_building.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hung4564/MMNN path: /markov/M_M_C.py import math class M_M_C(object): def __init__(self, lamda, muy, C): self.lamda = float(lamda) self.muy = float(muy) self.C = int(C) def r(self): return self.lamda/self.muy def Rho(self): return self.r()/s...
code_fim
hard
{ "lang": "python", "repo": "hung4564/MMNN", "path": "/markov/M_M_C.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """Thoi gian doi trung binh""" if not self.isVaild(): pass return self.Lq()/self.lamda def diplay(self): if self.isVaild(): print("Mo hinh M/M/"+str(self.C)) print("rho: " + str(self.Rho())) print("Xac suat tat ca kenh ph...
code_fim
hard
{ "lang": "python", "repo": "hung4564/MMNN", "path": "/markov/M_M_C.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> """test getting all authors""" self.register_user() token = self.login_user() response = self.client.get(self.user_author, format='json', HTTP_AUTHORIZATION='Token ' +token) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_get_specific_autho...
code_fim
medium
{ "lang": "python", "repo": "andela/ah-technocrats", "path": "/authors/apps/profiles/tests/test_view_all_profiles.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> def test_get_specific_authors_profile(self): """test viewing a specific author's profile""" self.register_user() token = self.login_user() response = self.client.get(reverse("profiles:profile", kwargs={ 'username':self.register_data['user']['username'], ...
code_fim
hard
{ "lang": "python", "repo": "andela/ah-technocrats", "path": "/authors/apps/profiles/tests/test_view_all_profiles.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: andela/ah-technocrats path: /authors/apps/profiles/tests/test_view_all_profiles.py from authors.base_file import BaseTestCase from django.urls import reverse from rest_framework import status from ..models import Profile class TestProfile(BaseTestCase): """test the user profile""" def l...
code_fim
medium
{ "lang": "python", "repo": "andela/ah-technocrats", "path": "/authors/apps/profiles/tests/test_view_all_profiles.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: flowroute/flowroute-sdk-v3-python path: /flowroutenumbersandmessaging/models/attributes_28.py # -*- coding: utf-8 -*- """ flowroutenumbersandmessaging.models.attributes_28 This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ) """ class Attributes28(ob...
code_fim
hard
{ "lang": "python", "repo": "flowroute/flowroute-sdk-v3-python", "path": "/flowroutenumbersandmessaging/models/attributes_28.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the ser...
code_fim
hard
{ "lang": "python", "repo": "flowroute/flowroute-sdk-v3-python", "path": "/flowroutenumbersandmessaging/models/attributes_28.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: aashishogale/DataStructurePrograms-Python- path: /com/bridgelabz/utility/linkedlist.py class LinkedList: def __init__(self): self.head = None def addatEnd(self, item): node = Node(item) if (self.isempty()): self.head = node else: ...
code_fim
hard
{ "lang": "python", "repo": "aashishogale/DataStructurePrograms-Python-", "path": "/com/bridgelabz/utility/linkedlist.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> return False def display(self): temp = self.head while (temp != None): print(temp.data) temp=temp.getNext() return def writeToFile(self,filename): with open(filename,"w") as file: temp=self.head while(temp!=...
code_fim
hard
{ "lang": "python", "repo": "aashishogale/DataStructurePrograms-Python-", "path": "/com/bridgelabz/utility/linkedlist.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>@app.route('/oauth2callback') def oauth2callback(): """ The 'flow' has this one place to call back to. We'll enter here more than once as steps in the flow are completed, and need to keep track of how far we've gotten. The first time we'll do the first step, the second time we'll skip the first...
code_fim
hard
{ "lang": "python", "repo": "jeffbayes/399se", "path": "/proj6-Gcal/meetingmaker/oauth.py", "mode": "spm", "license": "Artistic-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: jeffbayes/399se path: /proj6-Gcal/meetingmaker/oauth.py import flask from meetingmaker import app # OAuth2 - Google library implementation for convenience from oauth2client import client import httplib2 # used in oauth2 flow # Google API for services from apiclient import discovery import C...
code_fim
hard
{ "lang": "python", "repo": "jeffbayes/399se", "path": "/proj6-Gcal/meetingmaker/oauth.py", "mode": "psm", "license": "Artistic-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: zxzl/dike path: /dike/webdike/migrations/0011_auto_20171124_0641.py # -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-24 06:41 from __future__ import unicode_literals <|fim_suffix|> class Migration(migrations.Migration): dependencies = [ ('webdike', '0010_step_result')...
code_fim
medium
{ "lang": "python", "repo": "zxzl/dike", "path": "/dike/webdike/migrations/0011_auto_20171124_0641.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> class Migration(migrations.Migration): dependencies = [ ('webdike', '0010_step_result'), ] operations = [ migrations.AlterField( model_name='step', name='parent_step', field=models.ForeignKey(null=True, on_delete=django.db.models.deletion....
code_fim
medium
{ "lang": "python", "repo": "zxzl/dike", "path": "/dike/webdike/migrations/0011_auto_20171124_0641.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if request.method == 'POST': form = UserRegisterForm(request.POST) if form.is_valid(): try: form.save() username = form.cleaned_data.get('username') auth_user = AuthUser.objects.filter(username=username).first() ...
code_fim
hard
{ "lang": "python", "repo": "Abhis33/Fridge-9000---Software-Engg-Project", "path": "/application/Django_refrigerator_project/users/views.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Abhis33/Fridge-9000---Software-Engg-Project path: /application/Django_refrigerator_project/users/views.py from django.shortcuts import render, redirect from django.contrib import messages from django.contrib.auth.decorators import login_required from .forms import UserRegisterForm from .models im...
code_fim
hard
{ "lang": "python", "repo": "Abhis33/Fridge-9000---Software-Engg-Project", "path": "/application/Django_refrigerator_project/users/views.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: doribugi/BOJ path: /14709/14709.py """ 문제: https://www.acmicpc.net/problem/14709 풀이: (1, 3), (4, 3), (1, 4) 가 들어오면 여우 사인 (입력 순서, 쌍의 순서 바뀔 수 있음) 그 외 다른 모든 입력은 여우 사인 아님 """ def check_fox_sign(input_list): if not [1, 3] in input_list and not [3, 1] in input_list: return False ...
code_fim
medium
{ "lang": "python", "repo": "doribugi/BOJ", "path": "/14709/14709.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> if not [1, 3] in input_list and not [3, 1] in input_list: return False elif not [4, 3] in input_list and not [3, 4] in input_list: return False elif not [1, 4] in input_list and not [4, 1] in input_list: return False else: return True nmrLine = int(input()...
code_fim
medium
{ "lang": "python", "repo": "doribugi/BOJ", "path": "/14709/14709.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: jhson989/jhML path: /playground/step3/jhML/core.py import numpy as np import contextlib class Config: enable_backprop = True #contextlib.contextmanager def using_config(name, value): old_value = getattr(Config, name) setattr(Config, name, value) try: yield finally...
code_fim
hard
{ "lang": "python", "repo": "jhson989/jhML", "path": "/playground/step3/jhML/core.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> gx = np.ones_like(self.data) if self.required_grad and retain_grad: self.grad = self.grad + gx if self.creator is None: return funcs = [] seen_set = set() def add_func(f, gy): if f not in seen_set: s...
code_fim
hard
{ "lang": "python", "repo": "jhson989/jhML", "path": "/playground/step3/jhML/core.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: flashlin/pycore path: /video_processing/flac_file.py import librosa def convert_flac_to_wav(flac_filepath, wav_filepath,<|fim_suffix|>epath) waveform = librosa.resample(waveform, sample_rate, resample_rate) librosa.output.write_wav(wav_filepath, waveform, resample_rate)<|fim_middle...
code_fim
medium
{ "lang": "python", "repo": "flashlin/pycore", "path": "/video_processing/flac_file.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>ate) librosa.output.write_wav(wav_filepath, waveform, resample_rate)<|fim_prefix|># repo: flashlin/pycore path: /video_processing/flac_file.py import librosa def convert_flac_to_wav(flac_filepath, wav_filepath, resample_rate=16000): waveform, sample_rate = librosa.load(flac_fil<|fim_middle...
code_fim
medium
{ "lang": "python", "repo": "flashlin/pycore", "path": "/video_processing/flac_file.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>epath) waveform = librosa.resample(waveform, sample_rate, resample_rate) librosa.output.write_wav(wav_filepath, waveform, resample_rate)<|fim_prefix|># repo: flashlin/pycore path: /video_processing/flac_file.py import librosa def convert_flac_to_wav(flac_filepath, wav_filepath,<|fim_middle...
code_fim
medium
{ "lang": "python", "repo": "flashlin/pycore", "path": "/video_processing/flac_file.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.assertEqual(found_words, ["ab", "ac", "bd", "ca", "db"]) def test_find_words_long(self): found_words = self.sol.findWords(board_1, words_1) self.assertEqual(found_words, ['aaaaaaaaaaaaaaaa', 'aaa...
code_fim
hard
{ "lang": "python", "repo": "brigitteunger/katas", "path": "/test_word_search_II.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: brigitteunger/katas path: /test_word_search_II.py import unittest from data_word_search import board_1, words_1 from typing import List, Dict from copy import deepcopy class Trie: def __init__(self) -> None: """ Initialize your data structure here. """ self.c...
code_fim
hard
{ "lang": "python", "repo": "brigitteunger/katas", "path": "/test_word_search_II.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: TTdeveloping/text_classification path: /model/Cnn.py from model.Initialize import * import torch.nn as nn import torch.nn.functional as F class CNN(nn.Module): """ CNN """ def __init__(self, **kwargs): super(CNN, self).__init__() for k in kwargs: ...
code_fim
hard
{ "lang": "python", "repo": "TTdeveloping/text_classification", "path": "/model/Cnn.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if self.pretrained_embed: self.embed.weight.data.copy_(self.pretrained_weight) else: init_embedding(self.embed.weight) self.dropout_embed = nn.Dropout(self.dropout_emb) self.dropout = nn.Dropout(self.dropout) # cnn if self.wide_conv:...
code_fim
hard
{ "lang": "python", "repo": "TTdeveloping/text_classification", "path": "/model/Cnn.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> for conv in self.conv: if self.use_cuda: conv.cuda() in_fea = len(kernel_sizes) * kernel_nums self.linear = nn.Linear(in_features=in_fea, out_features=C, bias=True) init_linear(self.linear) def forward(self, word, sentence_length): "...
code_fim
hard
{ "lang": "python", "repo": "TTdeveloping/text_classification", "path": "/model/Cnn.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: pektin/jam path: /compiler/interpreter/state.py from contextlib import contextmanager class State: self = None stdout = None @classmethod @contextmanager def print(cls, value): <|fim_suffix|> @classmethod @contextmanager def selfScope(cls, self): previous_...
code_fim
medium
{ "lang": "python", "repo": "pektin/jam", "path": "/compiler/interpreter/state.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> yield cls.self = previous_self<|fim_prefix|># repo: pektin/jam path: /compiler/interpreter/state.py from contextlib import contextmanager class State: <|fim_middle|> self = None stdout = None @classmethod @contextmanager def print(cls, value): if cls.stdout i...
code_fim
hard
{ "lang": "python", "repo": "pektin/jam", "path": "/compiler/interpreter/state.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: pombredanne/awspider path: /awspider/resources/admin.py from twisted.python.failure import Failure from twisted.web import server from .base import BaseResource class AdminResource(BaseResource): <|fim_suffix|> def render(self, request): request.setHeader('Content-type', 'text/javasc...
code_fim
medium
{ "lang": "python", "repo": "pombredanne/awspider", "path": "/awspider/resources/admin.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def render(self, request): request.setHeader('Content-type', 'text/javascript; charset=UTF-8') if len(request.postpath) > 0: if request.postpath[0] == "clear_http_cache": d = self.adminserver.clearHTTPCache() d.addCallback(self._successRespon...
code_fim
medium
{ "lang": "python", "repo": "pombredanne/awspider", "path": "/awspider/resources/admin.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.adminserver = adminserver BaseResource.__init__(self) def render(self, request): request.setHeader('Content-type', 'text/javascript; charset=UTF-8') if len(request.postpath) > 0: if request.postpath[0] == "clear_http_cache": d =...
code_fim
medium
{ "lang": "python", "repo": "pombredanne/awspider", "path": "/awspider/resources/admin.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> self.assertTrue(isinstance(self.new_news,News)) if __name__ == '__main__': unittest.main()<|fim_prefix|># repo: BridgitKirika/News-Highlights path: /app/tests/news_test.py import unittest from app.models import News # News = news.News class NewsTest(unittest.TestCase): ''' Test Cl...
code_fim
hard
{ "lang": "python", "repo": "BridgitKirika/News-Highlights", "path": "/app/tests/news_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: BridgitKirika/News-Highlights path: /app/tests/news_test.py import unittest from app.models import News # News = news.News class NewsTest(unittest.TestCase): <|fim_suffix|> def test_instance(self): self.assertTrue(isinstance(self.new_news,News)) if __name__ == '__main__': unitt...
code_fim
hard
{ "lang": "python", "repo": "BridgitKirika/News-Highlights", "path": "/app/tests/news_test.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> ''' Set up method that will run before every Test ''' self.new_news= News('Ex Radio Presenter: We suffered after Rose Kamotho sold Kameme fm' ,'Nairobi Traders in fear over planned evictions','11/28/2020','https://www.kenyans.co.ke/news/index.html','https://www.kenyans.co.k...
code_fim
medium
{ "lang": "python", "repo": "BridgitKirika/News-Highlights", "path": "/app/tests/news_test.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: praneet-away/FarmAID path: /app.py pickle.load(open('UP_Wheat/january.pkl','rb')) february = pickle.load(open('UP_Wheat/february.pkl','rb')) UP_Rice = load_model('UP_Rice') june = pickle.load(open('UP_Rice/june.pkl','rb')) july = pickle.load(open('UP_Rice/july.pkl','rb')) august = pickle.load(...
code_fim
hard
{ "lang": "python", "repo": "praneet-away/FarmAID", "path": "/app.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> @app.route('/hr/rice/', methods=['POST']) def predict_9(): # get data data = request.get_json(force=True) # convert data into dataframe data.update((x, [y]) for x, y in data.items()) data_df = pd.DataFrame.from_dict(data) # predictions result1 = june.predict(data_df) result2 =...
code_fim
hard
{ "lang": "python", "repo": "praneet-away/FarmAID", "path": "/app.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # return data return jsonify(prediction) @app.route('/hr/wheat/', methods=['POST']) def predict_8(): # get data data = request.get_json(force=True) # convert data into dataframe data.update((x, [y]) for x, y in data.items()) data_df = pd.DataFrame.from_dict(data) # predictions ...
code_fim
hard
{ "lang": "python", "repo": "praneet-away/FarmAID", "path": "/app.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: tws0002/pype path: /pype/aport/__init__.py import os import sys from avalon import api as avalon from pyblish import api as pyblish from app import api as app from .. import api t = app.Templates() log = api.Logger.getLogger(__name__, "aport") AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype"...
code_fim
hard
{ "lang": "python", "repo": "tws0002/pype", "path": "/pype/aport/__init__.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> os.chdir(path) print(os.getcwd()) print(os.listdir(path)) try: args = [sys.executable, "-m", "pico.server", # "pipeline", "api" ] app.forward( args, cwd=path ) except Exception as e: ...
code_fim
hard
{ "lang": "python", "repo": "tws0002/pype", "path": "/pype/aport/__init__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Chia-Network/clvm_tools path: /tests/curry_test.py from clvm.operators import KEYWORD_TO_ATOM from clvm_tools.binutils import assemble, disassemble from clvm_tools.curry import curry, uncurry <|fim_suffix|> def test_curry_uncurry(): PLUS = KEYWORD_TO_ATOM["+"][0] f = assemble("(+ 2 5)")...
code_fim
hard
{ "lang": "python", "repo": "Chia-Network/clvm_tools", "path": "/tests/curry_test.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> PLUS = KEYWORD_TO_ATOM["+"][0] f = assemble("(+ 2 5)") args = assemble("(200 30)") actual_disassembly = check_idempotency(f, args) assert actual_disassembly == f"(a (q {PLUS} 2 5) (c (q . 200) (c (q . 30) 1)))" f = assemble("(+ 2 5)") args = assemble("((+ (q . 50) (q . 60)))")...
code_fim
hard
{ "lang": "python", "repo": "Chia-Network/clvm_tools", "path": "/tests/curry_test.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> f = assemble("(+ 2 5)") args = assemble("((+ (q . 50) (q . 60)))") actual_disassembly = check_idempotency(f, args) assert actual_disassembly == f"(a (q {PLUS} 2 5) (c (q {PLUS} (q . 50) (q . 60)) 1))"<|fim_prefix|># repo: Chia-Network/clvm_tools path: /tests/curry_test.py from clvm.operat...
code_fim
hard
{ "lang": "python", "repo": "Chia-Network/clvm_tools", "path": "/tests/curry_test.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: biocore/gneiss path: /gneiss/plot/_regression_plot.py # ---------------------------------------------------------------------------- # Copyright (c) 2016--, gneiss development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distr...
code_fim
hard
{ "lang": "python", "repo": "biocore/gneiss", "path": "/gneiss/plot/_regression_plot.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> # Explained sum of squares ess = model.ess # Summary object _k, _l = model.kfold(), model.lovo() smry = model.summary(_k, _l) _deposit_results(model, output_dir) t = _decorate_tree(tree, ess) p1 = radialplot(t, figsize=(800, 800)) p1.title.text = 'Explained Sum of Squa...
code_fim
hard
{ "lang": "python", "repo": "biocore/gneiss", "path": "/gneiss/plot/_regression_plot.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: githubBingoChen/D4Net path: /resnext/config.py import os pytorch_pretrained_root = '/home/b3-542/Packages/Models/PyT<|fim_suffix|>.path.join(pytorch_pretrained_root, 'ResNet', 'resnet18-5c106cde.pth')<|fim_middle|>orch Pretrained' resnext101_32_path = os.path.join(pytorch_pretrained_root, 'ResNeX...
code_fim
medium
{ "lang": "python", "repo": "githubBingoChen/D4Net", "path": "/resnext/config.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>_root, 'ResNeXt', 'resnext_101_32x4d.pth') pretrained_res18_path = os.path.join(pytorch_pretrained_root, 'ResNet', 'resnet18-5c106cde.pth')<|fim_prefix|># repo: githubBingoChen/D4Net path: /resnext/config.py import os pytorch_pretrained_root = '/home/b3-542/Packages/Models/PyT<|fim_middle|>orch Pretraine...
code_fim
medium
{ "lang": "python", "repo": "githubBingoChen/D4Net", "path": "/resnext/config.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: theambidextrous/Access-approval-management- path: /app/requesttypes/routes.py from flask import Blueprint, jsonify, request,current_app, make_response from app.models import RequestType from app import db import uuid from app.utils import AuthUtil requesttypes = Blueprint('requesttypes', __name_...
code_fim
hard
{ "lang": "python", "repo": "theambidextrous/Access-approval-management-", "path": "/app/requesttypes/routes.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> try: data = request.get_json() gen_id = str(uuid.uuid4()) type = RequestType(type_id=gen_id,type_name=data['type_name']) db.session.add(type) db.session.commit() return jsonify({'status':0, 'created_id':gen_id, 'message':'Created!'}) except Exception...
code_fim
hard
{ "lang": "python", "repo": "theambidextrous/Access-approval-management-", "path": "/app/requesttypes/routes.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('wildlifecompliance', '0407_briefofevidenceotherstatements_legal_case'), ] operations = [ migrations.AlterField( model_name='briefofevidenceotherstatements', name='legal_case', field=models.ForeignKey(on_delete=django.db.mo...
code_fim
medium
{ "lang": "python", "repo": "dbca-wa/wildlifecompliance", "path": "/wildlifecompliance/migrations/0408_auto_20200131_1451.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: dbca-wa/wildlifecompliance path: /wildlifecompliance/migrations/0408_auto_20200131_1451.py # -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2020-01-31 06:51 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(...
code_fim
medium
{ "lang": "python", "repo": "dbca-wa/wildlifecompliance", "path": "/wildlifecompliance/migrations/0408_auto_20200131_1451.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # =============================================================================== # Keras Pattern Classifier, fits Binary Classes to MORGAN2048 fingerprints # =============================================================================== class KlassBinaryMorgan(with_metaclass(ModelMetaClass, KlassSeque...
code_fim
hard
{ "lang": "python", "repo": "kellerberrin/OSM-QSAR", "path": "/OSMKerasFingerprint.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def model_name(self): return "MORGAN > Binary Class (EC50) Classifier" def model_postfix(self): # Must be unique for each model. return "bin_m" def model_description(self): return ("A KERAS (TensorFlow) multi-layer Neural Network class classification model. \n" ...
code_fim
hard
{ "lang": "python", "repo": "kellerberrin/OSM-QSAR", "path": "/OSMKerasFingerprint.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: kellerberrin/OSM-QSAR path: /OSMKerasFingerprint.py # MIT License # # Copyright (c) 2017 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, includi...
code_fim
hard
{ "lang": "python", "repo": "kellerberrin/OSM-QSAR", "path": "/OSMKerasFingerprint.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>n fruits: print('Saya suka ' + fruit)<|fim_prefix|># repo: myarist/Progate path: /Languages/Python/python_study_2/page4/script.py fruits = ['apel', 'pisang', 'jeruk'] # Dapatkan element fruits menggunakan loop f<|fim_middle|>or, dan cetak 'Saya suka ___' for fruit i
code_fim
easy
{ "lang": "python", "repo": "myarist/Progate", "path": "/Languages/Python/python_study_2/page4/script.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: myarist/Progate path: /Languages/Python/python_study_2/page4/script.py fruits = ['apel', 'pisang', 'jeruk'] # D<|fim_suffix|>n fruits: print('Saya suka ' + fruit)<|fim_middle|>apatkan element fruits menggunakan loop for, dan cetak 'Saya suka ___' for fruit i
code_fim
medium
{ "lang": "python", "repo": "myarist/Progate", "path": "/Languages/Python/python_study_2/page4/script.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> team = StringField(required = True) first_name = StringField(required = True) last_name = StringField(required = True) img_slug = StringField(required = True) silly_img_slug = StringField(required = True) description = StringField(default = "", required = False) order = IntFiel...
code_fim
medium
{ "lang": "python", "repo": "hackBCA/hackbcathree", "path": "/application/mod_web/models.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> date = StringField(required = True) time = DateTimeField(required = True) event = StringField(required = True) location = StringField()<|fim_prefix|># repo: hackBCA/hackbcathree path: /application/mod_web/models.py from mongoengine import * class MailingListEntry(Document): email = Stri...
code_fim
hard
{ "lang": "python", "repo": "hackBCA/hackbcathree", "path": "/application/mod_web/models.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hackBCA/hackbcathree path: /application/mod_web/models.py from mongoengine import * class MailingListEntry(Document): email = StringField(max_length = 50, required = True) verified = BooleanField(required = False, default = False) <|fim_suffix|> date = StringField(required = True) time...
code_fim
hard
{ "lang": "python", "repo": "hackBCA/hackbcathree", "path": "/application/mod_web/models.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: suyanzhou626/video_decaptioning path: /models/discriminator.py import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import math import pdb class Discriminator(nn.Module): def __init__(self, opt=None): super(Discriminator, self).__init...
code_fim
hard
{ "lang": "python", "repo": "suyanzhou626/video_decaptioning", "path": "/models/discriminator.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> class Discriminator2D(nn.Module): def __init__(self, opt=None): super(Discriminator2D, self).__init__() self.main = nn.Sequential( # (3+3)x1x128x128 nn.Conv3d(6, 64, kernel_size=(1,4,4), stride=(1,2,2), padding=(0,2,2)), nn.LeakyReLU(0.2, inplace=...
code_fim
hard
{ "lang": "python", "repo": "suyanzhou626/video_decaptioning", "path": "/models/discriminator.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> output = self.main(x) return output.view(-1, 1) class Discriminator2D(nn.Module): def __init__(self, opt=None): super(Discriminator2D, self).__init__() self.main = nn.Sequential( # (3+3)x1x128x128 nn.Conv3d(6, 64, kernel_size=(1,4,4), strid...
code_fim
hard
{ "lang": "python", "repo": "suyanzhou626/video_decaptioning", "path": "/models/discriminator.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: fazlikeles/RACLAB path: /Goruntu Isleme/Examples/ornek22.py #-*-coding: utf-8-*- ###Object Detection And Classification - Paralel Proglamlama### import numpy as np import cv2 from multiprocessing import Process from multiprocessing import Queue def classify_frame(net,inputqueue, outputqueue): ...
code_fim
hard
{ "lang": "python", "repo": "fazlikeles/RACLAB", "path": "/Goruntu Isleme/Examples/ornek22.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> cv2.rectangle(frame,(startx,starty),(endx,endy),colors[idx],2) y=starty - 15 if starty -15 > 15 else starty + 15 cv2.putText(frame,label,(startx, y),cv2.FONT_HERSHEY_SIMPLEX,0.5,colors[idx],2) cv2.imshow("frame",frame) if cv2.waitKey(1) & 0xff == 27: break cam.release() cv2.dest...
code_fim
hard
{ "lang": "python", "repo": "fazlikeles/RACLAB", "path": "/Goruntu Isleme/Examples/ornek22.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>#parelel işlem processi tanımlandı. p=Process(target=classify_frame, args=(net,inputqueue,outputqueue,)) p.daemon=True p.start() cam=cv2.VideoCapture(0) while(1): ret,frame=cam.read() if ret: #frame=cv2.resize(frame,(500,400)) h,w=frame.shape[:2] if inputqueue.empty(): inputqueue.put(frame)...
code_fim
hard
{ "lang": "python", "repo": "fazlikeles/RACLAB", "path": "/Goruntu Isleme/Examples/ornek22.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>''' class Solution(object): def hIndex(self, citations): """ :type citations: List[int] :rtype: int """ count = [0 for i in xrange(len(citations) + 1)] for c in citations: if c >= len(citations): count[-1] += 1 el...
code_fim
medium
{ "lang": "python", "repo": "sugia/leetcode", "path": "/H-Index II.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> ''' class Solution(object): def hIndex(self, citations): """ :type citations: List[int] :rtype: int """ count = [0 for i in xrange(len(citations) + 1)] for c in citations: if c >= len(citations): count[-1] += 1 e...
code_fim
hard
{ "lang": "python", "repo": "sugia/leetcode", "path": "/H-Index II.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: sugia/leetcode path: /H-Index II.py ''' Given an array of citations sorted in ascending order (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According to the definition of h-index on Wikipedia: "A scientist has index h if h of his...
code_fim
hard
{ "lang": "python", "repo": "sugia/leetcode", "path": "/H-Index II.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> cols = ['session_id', 'impressions', 'impr_rank', 'ts_sub_prev', 'abs_impr_rank_sub_lastest_item-impr_rank', 'impr_rank_sub_lastest_item-impr_rank', 'nearest_step_delta', 'prices_div_active_items-session_id_by_prices_median-v2', 'price_rank', 'act_pre1', 'lastest_item-impr_rank', 'impr_rank_sub_impres...
code_fim
hard
{ "lang": "python", "repo": "tuantx7110/pvz_recsys2019", "path": "/src/m2/src/extract_topk_features.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: tuantx7110/pvz_recsys2019 path: /src/m2/src/extract_topk_features.py #!/usr/bin/env python # -*- coding: utf-8 -*- # 基础模块 import os import sys import gc import json import time import functools from datetime import datetime # 数据处理 import numpy as np import pandas as pd # 自定义工具包 sys.path.append...
code_fim
hard
{ "lang": "python", "repo": "tuantx7110/pvz_recsys2019", "path": "/src/m2/src/extract_topk_features.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> print('start time: %s' % datetime.now()) # tr = loader.load_df('../feature/tr_s0_106.ftr') # te = loader.load_df('../feature/te_s0_106.ftr') tr = loader.load_df('../../../feat/m2_tr_s0_106.ftr') te = loader.load_df('../../../feat/m2_te_s0_106.ftr') cols = ['session_id', 'impressio...
code_fim
medium
{ "lang": "python", "repo": "tuantx7110/pvz_recsys2019", "path": "/src/m2/src/extract_topk_features.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # The block above the current one is the one with the higher id child_above = current + grid.cols # the top row of blocks starts with this id topmost = len(grid.children) - grid.cols if child_above > topmost: # We are in the top row, generate new colou...
code_fim
hard
{ "lang": "python", "repo": "ohaz/Colours", "path": "/screens/ingamescreen.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: ohaz/Colours path: /screens/ingamescreen.py from kivy.uix.screenmanager import Screen from kivy.uix.togglebutton import ToggleButton from kivy.uix.popup import Popup from kivy.lang import Builder from kivy.utils import get_color_from_hex from kivy.properties import NumericProperty from screens im...
code_fim
hard
{ "lang": "python", "repo": "ohaz/Colours", "path": "/screens/ingamescreen.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> """ Recursively check the blocks for groups :param current: the block currently visited :return: a list of blocks """ grid = self.ids.grid children = grid.children own_color = children[current].background_color children[current].visit...
code_fim
hard
{ "lang": "python", "repo": "ohaz/Colours", "path": "/screens/ingamescreen.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> """ 查询某段时间的所有论文,用于每周报告。 :param start_timestamp: 开始的时间戳 :param end_timestamp: 结束的时间戳,可选 :return: .Paper 的生成器 """ SQL = "SELECT user_id,title,authors,description,link FROM paper WHERE user_id LIKE '%%{}%%'".format( u_id) cur.execu...
code_fim
hard
{ "lang": "python", "repo": "LibRec-Practical/ideaman-offline", "path": "/ideaman_analyzer/model/paper.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: LibRec-Practical/ideaman-offline path: /ideaman_analyzer/model/paper.py import datetime from ideaman_util.db import * import sys, os sys.path.append("../../") sys.path.extend([os.path.join(root, name) for root, dirs, _ in os.walk("../") for name in dirs]) class Paper: def __init__(self, u...
code_fim
hard
{ "lang": "python", "repo": "LibRec-Practical/ideaman-offline", "path": "/ideaman_analyzer/model/paper.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> SQL = "UPDATE paper SET %s = '%s' WHERE user_id = %s" % (col_name, col_value, user_id) try: cur.execute(SQL) conn.commit() except: conn.rollback() @staticmethod def get_classifier_dataset(): sql = """SELECT ti...
code_fim
hard
{ "lang": "python", "repo": "LibRec-Practical/ideaman-offline", "path": "/ideaman_analyzer/model/paper.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>from .rivalregions import Item, WorkProduction, Building, ConstructionCosts<|fim_prefix|># repo: jan-makarek/rival_regions_calc path: /rival_regions_calc/__init__.py """ # Rival Regions Calc <|fim_middle|>Unofficial calculator for Rival Regions. Easily calculate common known formulas from the game. """...
code_fim
medium
{ "lang": "python", "repo": "jan-makarek/rival_regions_calc", "path": "/rival_regions_calc/__init__.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: jan-makarek/rival_regions_calc path: /rival_regions_calc/__init__.py """ # Rival Regions Calc <|fim_suffix|>from .rivalregions import Item, WorkProduction, Building, ConstructionCosts<|fim_middle|>Unofficial calculator for Rival Regions. Easily calculate common known formulas from the game. """...
code_fim
medium
{ "lang": "python", "repo": "jan-makarek/rival_regions_calc", "path": "/rival_regions_calc/__init__.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: mostafaFechfouch/Data-Reading path: /datareading.py import serial import time import csv import numpy as np import pandas as pd import datetime ser = serial.Serial('COM3',19200) ser.flushInput() i=0 ts = time.gmtime() hours=time.strftime("%H", ts) minutes=time.strftime("%M", ts) seconds=time.st...
code_fim
hard
{ "lang": "python", "repo": "mostafaFechfouch/Data-Reading", "path": "/datareading.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> break i=i+1 with open('data.csv', 'a',newline='') as csvfile: fieldnames = ['time', 'ECG','EMG','HR','RESP'] writer = csv.DictWriter(csvfile, fieldnames=fieldnames) writer.writerow({'time': currenttime, 'ECG': data[0],'EMG':data[1],'HR':data[2],'RESP':data[3]}...
code_fim
hard
{ "lang": "python", "repo": "mostafaFechfouch/Data-Reading", "path": "/datareading.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: eliahrebstock/ansible-role-netatalk path: /molecule/default/tests/test_default.py import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE'] ).get_hosts('all') <|fim_suffix|> def test_line_in_config(...
code_fim
medium
{ "lang": "python", "repo": "eliahrebstock/ansible-role-netatalk", "path": "/molecule/default/tests/test_default.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }