seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
134923027
import rinobot_plugin as bot import numpy.testing as npt import unittest import shutil import os import sys from mock import patch _dir = os.path.join(os.path.dirname(__file__), 'text-fixtures') class Test(unittest.TestCase): @classmethod def setUpClass(cls): os.mkdir(_dir) @classmethod def...
null
rinobot_plugin/test/test.py
test.py
py
2,683
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "unittest.TestCase", "li...
480520348
from flask import Flask, render_template, request, redirect, jsonify, url_for, flash from sqlalchemy import create_engine, asc from sqlalchemy.orm import sessionmaker from database_setup import Base, Shop, Product, User from flask import session as login_session import random, string from oauth2client.client import flo...
null
project.py
project.py
py
12,354
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 24, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 29, "usage_type": "call" }, { "api_name": "database_setup.Base.m...
382725334
from pygame import transform from pygame.math import Vector2 from pgzero.actor import Actor from steering import SteeringBehaviors from math import cos,sin,degrees,radians class Actor2(Actor): def __init__(self,*args,**kwargs): super().__init__(*args,**kwargs) self._angle = 0.0 self._orig_...
null
steering_behaviors/arrive/actors.py
actors.py
py
3,933
python
en
code
null
code-starcoder2
66
[ { "api_name": "pgzero.actor.Actor", "line_number": 8, "usage_type": "name" }, { "api_name": "pygame.transform.rotate", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 22, "usage_type": "name" }, { "api_name": "pygame.mat...
297511926
import random import numpy as np from numpy.random import choice import argparse import pandas as pd def count_kmers(read, k): """Count kmer occurrences in a given read. Parameters ---------- read : string A single DNA sequence. k : int The value of k for which to count kmers. ...
null
sequence_generator.py
sequence_generator.py
py
3,716
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.choice", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.random", ...
582722550
from discord.ext import commands from command.database.loader import db_loaded class ConfigConfess_DeconfigConfess(commands.Cog): def __init__(self, client): self.client = client @commands.command() @commands.has_permissions(manage_guild=True) async def configconfess(self, ctx): db =...
null
command/database/admin_configconfess_deconfigconfess.py
admin_configconfess_deconfigconfess.py
py
975
python
en
code
null
code-starcoder2
66
[ { "api_name": "discord.ext.commands.Cog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "command.database.loader.db_loaded", "line_number": 13, "usage_type": "call" }, { ...
635889910
#!/usr/bin/python3 """Module for index file""" from flask import jsonify, abort, request, make_response from api.v1.views import app_views from models import storage from models.state import State @app_views.route('/states', methods=['GET'], strict_slashes=False) def get_states(): """States endpoint to retrieve a...
null
api/v1/views/states.py
states.py
py
2,057
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.storage.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.state.State", "line_number": 12, "usage_type": "argument" }, { "api_name": "models.storage", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.jsonif...
513270565
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import csv import multiprocessing as mp from xmlrpc import client as xmlrpclib from scriptconfig import URL, DB, UID, PSW, WORKERS # ==================================== PRIMARY VENDOR ==================================== def update_product_vendor(pid, data_pool, prod...
null
47_1_primary_vendor.py
47_1_primary_vendor.py
py
3,685
python
en
code
null
code-starcoder2
66
[ { "api_name": "xmlrpc.client.ServerProxy", "line_number": 14, "usage_type": "call" }, { "api_name": "scriptconfig.URL", "line_number": 14, "usage_type": "argument" }, { "api_name": "xmlrpc.client", "line_number": 14, "usage_type": "name" }, { "api_name": "scriptco...
317975945
from datetime import timedelta, datetime from typing import List, Optional, Dict from jdatetime import date, time from tsetmc_api.cache import PersistentCache from tsetmc_api.shareholder import SymbolMajorShareholder from tsetmc_api.utils import get_timezone from . import core as day_details_core from .exceptions imp...
null
lib/tsetmc_api/day_details/day_details.py
day_details.py
py
8,992
python
en
code
null
code-starcoder2
66
[ { "api_name": "jdatetime.date", "line_number": 19, "usage_type": "call" }, { "api_name": "tsetmc_api.cache.PersistentCache.exists", "line_number": 39, "usage_type": "call" }, { "api_name": "tsetmc_api.cache.PersistentCache", "line_number": 39, "usage_type": "name" }, ...
429102781
from __future__ import unicode_literals from django.db import models from apirest.utils.constants import Constants from apirest.models.expedientes.resultado import Resultado class Sancion(models.Model): id = models.ForeignKey(Resultado, primary_key=True, db_column='sancion_definitiva_id',unique=True) nroley = ...
null
ejemploAPI/ServiciosParlamentarios/apirest/models/sancion.py
sancion.py
py
697
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 7, "usage_type": "call" }, { "api_name": ...
572118170
#!/usr/bin/env python from __future__ import print_function import argparse import os from six.moves import cPickle from six import text_type import tensorflow as tf from model import Model def sample(args, prime): with open(os.path.join(args.save_dir, 'config.pkl'), 'rb') as f: saved_args = cPickle....
null
sample.py
sample.py
py
1,200
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "six.moves.cPickle.load", "line_number": 18, "usage_type": "call" }, { "api_name": "six.moves.cPickle", ...
586824389
import pip._vendor.requests import json from Parser import jprint, stateDataPrint #This Data comes from Worldometers baseUrl = "https://disease.sh/v3/covid-19/states/" StateAbv= ["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA", "KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","N...
null
Covid-Locator/StateMenu.py
StateMenu.py
py
3,054
python
en
code
null
code-starcoder2
66
[ { "api_name": "pip._vendor.requests._vendor.requests.get", "line_number": 56, "usage_type": "call" }, { "api_name": "pip._vendor.requests._vendor", "line_number": 56, "usage_type": "attribute" }, { "api_name": "pip._vendor.requests", "line_number": 56, "usage_type": "name...
482594905
from flask import ( Blueprint, render_template, request, session, current_app, flash, redirect, url_for, ) from itertools import accumulate import omise from store.cart import Cart, Price import uuid checkout = Blueprint("checkout", __name__, template_folder="templates") @checkout.rou...
null
payment/checkout.py
checkout.py
py
2,356
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 16, "usage_type": "call" }, { "api_name": "store.cart.Cart", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.current_a...
481478060
""" Shipwright -- Builds shared Docker images within a common git repository. Usage: shipwright [options] [DOCKER_HUB_ACCOUNT] [--publish] Options: --help Show all help information -H DOCKER_HOST Override DOCKER_HOST if it's set in the environment. Environment Variables: SW_NAMESPACE : If DO...
null
shipwright/cli.py
cli.py
py
1,994
python
en
code
null
code-starcoder2
66
[ { "api_name": "docopt.docopt", "line_number": 43, "usage_type": "call" }, { "api_name": "shipwright.version.version", "line_number": 43, "usage_type": "name" }, { "api_name": "git.Repo", "line_number": 44, "usage_type": "call" }, { "api_name": "os.getcwd", "li...
328395562
from flask import session from Models.databasemodel import Database import datetime from datetime import date class Customer(object): def __init__(self, name, age, gender, height, weight, occupation, email, password, aim, date, bookings, exercise_log, user_type='customer', _id=None): self.name=nam...
null
Models/usermodel.py
usermodel.py
py
12,987
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.date", "line_number": 18, "usage_type": "name" }, { "api_name": "Models.databasemodel.Database.find_one", "line_number": 27, "usage_type": "call" }, { "api_name": "Models.databasemodel.Database", "line_number": 27, "usage_type": "name" }, { ...
257394351
""" bencode library # bencoding # http://www.bittorrent.org/beps/bep_0003.html """ from functools import singledispatch from collections import OrderedDict from collections.abc import Sequence, Mapping I, L, D, E, C = b'ilde:' def dict_to_list(val): for k,v in val: yield k yield v ...
null
simple tracker/simple_tracker/bencode.py
bencode.py
py
4,222
python
en
code
null
code-starcoder2
66
[ { "api_name": "functools.singledispatch", "line_number": 21, "usage_type": "name" }, { "api_name": "collections.abc.Sequence", "line_number": 52, "usage_type": "argument" }, { "api_name": "collections.OrderedDict", "line_number": 57, "usage_type": "argument" }, { ...
605587357
from django import forms from .models import WorkProgram, OutcomesOfWorkProgram, PrerequisitesOfWorkProgram class WorkProgramOutcomesPrerequisites(forms.ModelForm): class Meta: model = WorkProgram #fields = ('id', 'prerequisites', 'outcomes', 'title') fields = '__all__' class Prerequis...
null
workprogramsapp/forms.py
forms.py
py
495
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 6, "usage_type": "name" }, { "api_name": "models.WorkProgram", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms...
562630355
# port=process.env.PORT || 5000 #IMPORTS import re from bs4 import BeautifulSoup import time import threading import codecs import os #note: praw cannot be imported before loading the book files #LOADING TO DISK titles=[] titles.append(('Harry Potter and the Sorcerer\'s Stone',17)) #book name,number of chapters titl...
null
app.py
app.py
py
7,234
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 28, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 34, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 36, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 44, "usa...
396268694
import sqlite3 import os from sqlite3 import Error from getUKCCredentials import getUKCCredentialsServerVersion from crontab import CronTab from datetime import datetime currDirname = os.path.dirname(__file__) #Make a directory for storing data os.mkdir(os.path.join(currDirname, "/data")) print("Made directory for da...
null
setup.py
setup.py
py
1,355
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number":...
407088405
__author__ = 'Artem Tiumentcev' ''' Problem Statement: https://www.hackerrank.com/challenges/collections-counter ''' from collections import Counter n = input() X = Counter([int(x) for x in input().split()]) amount = 0 for x in range(int(input())): size, money = list(map(int,input().split())) if X[size] != 0: ...
null
python/Collections/collections-counter.py
collections-counter.py
py
374
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" } ]
570764452
env_name = None # Name of the Unity environment binary to launch train_mode = True # Whether to run the environment in training or inference mode import numpy as np import sys import cv2 from mlagents.envs import UnityEnvironment def depth_rgb_to_float(depth_rgb_img): depth_img = depth_rgb_img[:,:,0] * 167772...
null
UnitySDK/Assets/ML-Agents/Examples/SlamWalker/walkerclient.py
walkerclient.py
py
3,623
python
en
code
null
code-starcoder2
66
[ { "api_name": "mlagents.envs.UnityEnvironment", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.uint16", "line_number": 44, "usage_type": "attribute" }, { "api_name": "numpy.zer...
44028969
import datetime import json import logging import re from collections import deque import pymysql import redis import requests import yagmail import urllib3 from scrapy import Selector from urllib3.exceptions import InsecureRequestWarning, ReadTimeoutError from tools.send_mail import mail urllib3.disable_warnings(Ins...
null
SpiderProject/tools/crawl_stock.py
crawl_stock.py
py
6,728
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib3.disable_warnings", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib3.exceptions.InsecureRequestWarning", "line_number": 16, "usage_type": "argument" }, { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, ...
478581269
""" Defines functions that construct various components of a reinforcement learning agent. """ from typing import List, Any from keras.models import Sequential, Model from keras.callbacks import Callback from keras.layers import Dense, Activation, Flatten, Input, Concatenate from keras.optimizers import Adam from rl....
null
agent.py
agent.py
py
5,081
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.layers.Input", "line_number": 30, "usage_type": "call" }, { "api_name": "keras.layers.Input", "line_number": 31, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 33, "usage_type": "call" }, { "api_name": "keras.l...
280889561
import matplotlib.pyplot as plt #x = [1,10,100] #y = [1,10,100] def histogram(list): ''' function histogram takes in a list, returns a histogram of the values in the list, plot has title and axes. ''' bins = int(len(list)/2) plt.hist(list,bins = bins, color = 'maroon') plt.title('histogram data plot')...
null
StatsProject_Table7/graph.py
graph.py
py
2,707
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.hist", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 10, "usage_type": "call" }, { "api_name": "matplo...
435797242
#使用MySQL位函数和运算符进行基于时间的高效SQL盲注 #https://www.freebuf.com/articles/web/188029.html #!/usr/bin/python3 import pymysql,time; PAYLOAD="select if ((ascii((substr((select flag from flag limit 1),%d,1))) >> %d )=%d,benchmark(10000000,sha1('test')), 'false');" DB = pymysql.connect("localhost","miao","pwdpwd","ctf0001" ) TH...
null
sqli.py
sqli.py
py
1,101
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymysql.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 18, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 20, "usage_type": "call" } ]
397498344
#!flask/bin/python import sqlite3 from flask import Flask, jsonify, request, abort from classes import Pulpit app = Flask(__name__) def return_objects_from_table(table): conn = sqlite3.connect('lab') c = conn.cursor() objects = [] for row in c.execute('select * from %s' % table): objects.appe...
null
rest/app.py
app.py
py
1,594
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "classes.Pulpit", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_n...
41216891
# coding: utf-8 # Copyright (c) 2018 一般社団法人 MaruLabo # # 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, including without limitation the rights # to use, copy, modify, mer...
null
tools/test.py
test.py
py
2,356
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.logging.set_verbosity", "line_number": 28, "usage_type": "call" }, { "api_name": "tensorflow.logging", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 31, "usage_type": "call" }, { "api_name...
161384743
import torch import torch.nn as nn import torch.nn.functional as F import config # 定义C-B-L卷积三明治 import numpy as np class Conv2D_BN_Leaky(nn.Module): def __init__(self, inc, outc, kernel=3, strid=1, padding=1): super(Conv2D_BN_Leaky, self).__init__() if kernel == 1 or strid == 2: padding ...
null
yolo/bbase_model.py
bbase_model.py
py
10,212
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
81357352
import label_image import Utils import pymongo import operator import datetime import tkinter as tk from tkinter import filedialog import traceback image_path = "/home/global/Desktop/30Hacks/IMG_4456.JPG" comment = "verry_bad_road" client = pymongo.MongoClient('localhost', 27017) root = tk.Tk() root.withdraw() imag...
null
src/Runner.py
Runner.py
py
3,912
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 13, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 18, "usage_type": "call" }, { "api_name": "tki...
509308918
# -*- coding: utf-8 -*- # from flask import Flask from flask import render_template from flask import request from flask import Response from flask import url_for from flask import redirect from sqlConnecter import myDB from CNSegment import CNSegment import json import wordSim app = Flask(__name__) @app.route("/") d...
null
main.py
main.py
py
2,485
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlConnecter.myDB", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.request.coo...
385181787
import numpy as np import scipy.io import matplotlib.pyplot as plt def plot_scores(accuracy_scores_train, accuracy_scores_test): plt.plot(range(len(accuracy_scores_train)), accuracy_scores_train) plt.plot(range(len(accuracy_scores_test)), accuracy_scores_test) plt.xlabel('epoch') plt.ylabel('accuracy'...
null
utils.py
utils.py
py
2,353
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotl...
503760645
import numpy as np import matplotlib.pyplot as plt import scipy.io from sklearn import svm import re #regular expression for e-mail processing import nltk, nltk.stem.porter def sample_mail(): with open("data/ex6/emailSample1.txt") as f: # The with keyword automatically # closes the file when you are done ...
null
spam_classification_svm.py
spam_classification_svm.py
py
5,890
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 22, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 25, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 28, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 31, "usage_type"...
290012755
import os, json, re import math from CONSTANT import CUR_DIR,ONTO_DIR,TRAIN_DEV_DIR,TEST_DIR class dataset_walker(object): def __init__(self,dataset,labels=False,dataroot=None): #parameters description: # dataset: dstc2_train or dstc2_dev or destc2_test # labels: a boolean variable for d...
null
dataset_walker_dstc2.py
dataset_walker_dstc2.py
py
5,848
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
244680828
from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello from Flask!' from collections import Counter @app.route('/countme/<input_str>') def count_me(input_str): input_counter = Counter(input_str) response = [] for letter, count in input_counter.most_common(): response.a...
null
Hueyling/FlaskApp/flaskapp_simple.py
flaskapp_simple.py
py
391
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 13, "usage_type": "call" } ]
477361037
from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from MFCC_dataset import MFCCDataset, ToTensor import pandas as pd from torch.utils.data import DataLoader import numpy as np if __name__ == "__main__": learning_rate = 0.0001 batch_size = 16 n_feature...
null
functions/random_forest.py
random_forest.py
py
1,564
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "MFCC_dataset.MFCCDataset", "line_number": 23, "usage_type": "call" }, { "api_name": "MFCC_dataset.ToTensor", "line_number": 23, "usage_type": "call" }, { "api_name": "torch....
122560405
"""Energy supply wrapper """ import os from configparser import ConfigParser from subprocess import check_output import numpy as np import psycopg2 import psycopg2.extras from smif.model.sector_model import SectorModel try: from pyinstrument import Profiler # import to enable profiling except ImportError: p...
null
models/energy_supply/energy_supply.py
energy_supply.py
py
41,044
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyinstrument.Profiler", "line_number": 28, "usage_type": "call" }, { "api_name": "smif.model.sector_model.SectorModel", "line_number": 36, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 238, "usage_type": "call" }, { "api_na...
636593290
from urls import URLs from form import FormArgs from config import config from logger import logger from queues import gui_queue, api_queue from functools import partial from dev import deploy import sys import messages import requests import json from time import sleep def api_forever(): while True: comma...
null
shameclient/api.py
api.py
py
3,239
python
en
code
null
code-starcoder2
66
[ { "api_name": "queues.api_queue.get", "line_number": 16, "usage_type": "call" }, { "api_name": "queues.api_queue", "line_number": 16, "usage_type": "name" }, { "api_name": "messages.QUIT", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logger.logge...
265145807
import keyword import re import sys import unicodedata from hy.lex.exceptions import PrematureEndOfInput, LexException # NOQA from hy.models import Expression, Symbol try: from io import StringIO except ImportError: from StringIO import StringIO def hy_parse(source, filename='<string>'): """Parse a Hy ...
null
hy/lex/__init__.py
__init__.py
py
8,581
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 25, "usage_type": "call" }, { "api_name": "hy.models.Expression", "line_number": 26, "usage_type": "call" }, { "api_name": "hy.models.Symbol", "line_number": 26, "usage_type": "call" }, { "api_name": "hy.lex.parser.parser.par...
171890196
# -*- coding: utf-8 -*- """ Created on Sat Apr 17 23:06:11 2021 @author: kalan """ import imutils import os import cv2 import numpy as np #resize all images to 128x128x3 #step 1 #resize to width or height to 128. #then pad remaining area with zeros such that the final size is 128x128 def resize2SquareKeepingAspec...
null
img_dataprep.py
img_dataprep.py
py
1,913
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.resize", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 33...
410559979
import unittest from datetime import datetime from fastapi.testclient import TestClient from tortoise import Tortoise from task_scheduler.app import get_app from task_scheduler.test_utils import start_test_database from .days_of_week import DaysOfWeek app = get_app() class TestCaseDaysOfWeekService(unittest.Isola...
null
packages/task-scheduler/task_scheduler/models/tortoise_models/test_days_of_week.py
test_days_of_week.py
py
1,700
python
en
code
null
code-starcoder2
66
[ { "api_name": "task_scheduler.app.get_app", "line_number": 12, "usage_type": "call" }, { "api_name": "unittest.IsolatedAsyncioTestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "task_scheduler.test_utils.start_test_database", "line_number": 17, "usag...
309567793
from django.http import HttpResponse from .models import TaskList, Task from .task_list_serializer import TaskListSerializer from .task_serializer import TaskSerializer # Create your views here. def task_lists(request): task_lists = TaskList.objects.all() serializer = TaskListSerializer() to_json = serial...
null
todo_back/api/views.py
views.py
py
1,138
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.TaskList.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.TaskList.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.TaskList", "line_number": 9, "usage_type": "name" }, { "api_name": ...
124130652
import jinja2 from babel.dates import format_timedelta from datetime import datetime import flask from pocketbulletin import app, locale as applocale filters = flask.Blueprint('filters', __name__) @jinja2.contextfilter @filters.app_template_filter() def timedeltaformat(ctx, dt, locale=applocale): """ Co...
null
pocketbulletin/blueprints/filters.py
filters.py
py
1,757
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "pocketbulletin.locale", "line_number": 13, "usage_type": "name" }, { "api_name": "babel.dates.format_timedelta", "line_number": 17, "usage_type": "call" }, { "api_name": "dat...
261301471
from io import BytesIO from PIL import Image as PilImage from thumbor.engines import BaseEngine from thumbor.engines.pil import FORMATS try: import cv except ImportError: import cv2.cv as cv PilImage.IGNORE_DECODING_ERRORS = True PilImage.MAXBLOCK = 2 ** 25 class Image: @classmethod def create_from_...
null
remotecv/image.py
image.py
py
2,135
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.IGNORE_DECODING_ERRORS", "line_number": 11, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" }, { "api_name": "PIL.Image.MAXBLOCK", "line_number": 12, "usage_type": "attribute" }, { "api_name"...
151701543
# -*- coding: utf-8 -*- """ Created on Mon Jul 2 12:50:42 2018 @author: htyagi """ ## table exist check import sqlite3 db = sqlite3.connect('INFOSYS') def tableChecker(): try: print('Here1') cursor1 = db.cursor() cursor1.execute('''SELECT name FROM sqlite_master WHERE type...
null
tableChecker.py
tableChecker.py
py
744
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" } ]
625043952
#!/usr/bin/python import logging import ConfigParser import sys import xml.etree.ElementTree as ElementTree from traceback import format_exception from optparse import OptionParser from flrd_request_sender import FLRRequestSender from zpy import ZDbConn __all__ = ['FLRDClient'] class FLRDClient(object): def __i...
null
Python/flrd/flrd_client.py
flrd_client.py
py
4,675
python
en
code
null
code-starcoder2
66
[ { "api_name": "flrd_request_sender.FLRRequestSender", "line_number": 20, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.Element", "line_number": 25, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 25, "usage_type": "name" }, ...
578113316
""" Unit tests for the router class. Please don't add any test that will involve controller or the backend worker, use mock if necessary. """ import asyncio from collections import defaultdict import os import pytest import ray from ray.serve.config import BackendConfig from ray.serve.controller import TrafficPolicy ...
null
python/ray/serve/tests/test_router.py
test_router.py
py
8,762
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.mark", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "ray.init", "line_number": 24, "usage_type": "call" }, { "api_name": "ray.shutdown", "line_nu...
336531867
from nltk.tag import AffixTagger from nltk.corpus import cess_esp from nltk.tag import hmm from nltk.tag import tnt import matplotlib.pyplot as plt import random import math def corpusSimplificado(corpus): newCorpus = [] for frase in corpus: newFrase = [] for palabra in frase: newP...
null
Cuatrimestre 1/LC/Trabajos/practica2.py
practica2.py
py
4,022
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.corpus.cess_esp.tagged_sents", "line_number": 31, "usage_type": "call" }, { "api_name": "nltk.corpus.cess_esp", "line_number": 31, "usage_type": "name" }, { "api_name": "nltk.tag.hmm.HiddenMarkovModelTagger.train", "line_number": 38, "usage_type": "cal...
93744495
import xlrd file=xlrd.open_workbook(r"C:\Users\Administrator.USER-20190305CL\Desktop\readtest.xlsx") data=file.sheet_by_name("Sheet1") row=data.nrows print(row) rowvalue=data.row_values(1,6,6) print(rowvalue) # for i in row: # print(data.col_values(i))
null
secondProject/readExcelTest/excel_test.py
excel_test.py
py
258
python
en
code
null
code-starcoder2
66
[ { "api_name": "xlrd.open_workbook", "line_number": 2, "usage_type": "call" } ]
63207505
from clipmanager import celery_app import time from celery import shared_task import requests import re import urllib.request import datetime from blog.models import HighlightClip, Clip import ffmpeg import os import shutil import traceback import sys import socket import socks @shared_task def sleepy(duration): ...
null
clipmanager/tasks.py
tasks.py
py
4,666
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.sleep", "line_number": 25, "usage_type": "call" }, { "api_name": "celery.shared_task", "line_number": 22, "usage_type": "name" }, { "api_name": "blog.models.HighlightClip.objects.filter", "line_number": 34, "usage_type": "call" }, { "api_name":...
328074819
from django.db import models from django.utils import timezone # Model to store emails from contact form class Email(models.Model): name = models.CharField(max_length=25) email = models.EmailField() subject = models.CharField(max_length=50) message = models.TextField(max_length=5000) ip = models....
null
base/models.py
models.py
py
403
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "...
558380453
# -*- coding: utf-8 -*- """ Created on Thu Mar 25 16:35:23 2021 """ import numpy as np import rdflib from pyowm import OWM g = rdflib.Graph() g.parse("Station_de_Velo.owl") def calcul(city): ville = "'" + city + "'" print(ville) station = g.query( """ SELECT DISTINCT ?station ...
null
sparql_rdf.py
sparql_rdf.py
py
5,883
python
en
code
null
code-starcoder2
66
[ { "api_name": "rdflib.Graph", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 87, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 88, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number":...
609257592
from django.conf.urls import url, include from . import views app_name = 'vksearch' urlpatterns = [ url(r'^search/$', views.get_search_params, name='get_search_params'), url(r'^result/$', views.get_search_result, name='get_search_result'), url(r'^add_filter_1/$', views.add_search_filter, name='add_search...
null
VKInfoSite/vksearch/urls.py
urls.py
py
656
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.c...
301229221
import random from flask import Flask, request, abort, jsonify from flask_cors import CORS from models import setup_db, Question, Category from werkzeug.exceptions import HTTPException QUESTIONS_PER_PAGE = 10 def create_app(test_config=None): # create and configure the app app = Flask(__name__) setup_db(...
null
backend/flaskr/__init__.py
__init__.py
py
8,849
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "models.setup_db", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 14, "usage_type": "call" }, { "api_name": "werkzeug.exceptions.HTTPE...
278476693
import json import time import logging import requests import configparser from functools import wraps from datetime import datetime from requests.exceptions import ConnectionError, Timeout log_name = str(datetime.today().strftime('%d-%m-%Y')) logging.basicConfig(filename=f'{log_name}.log', filemo...
null
utils.py
utils.py
py
10,152
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging...
382328016
# -*- coding: utf-8 -*- """ @version: 1.0 @license: Apache Licence @author: kht,cking616 @contact: cking616@mail.ustc.edu.cn @software: PyCharm Community Edition @file: __main__.py @time: 2018/5/11 9:08 """ import re from collections import defaultdict import os import xlwt xlt_header = ['lot id', 'count', 'receipe...
null
reader.py
reader.py
py
5,803
python
en
code
null
code-starcoder2
66
[ { "api_name": "xlwt.Borders", "line_number": 22, "usage_type": "call" }, { "api_name": "xlwt.Borders", "line_number": 23, "usage_type": "attribute" }, { "api_name": "xlwt.Borders", "line_number": 28, "usage_type": "attribute" }, { "api_name": "xlwt.Borders", "...
77067951
from django import forms from . import models class CreatePersoneFrom(forms.ModelForm): phones = forms.CharField(widget=forms.Textarea(), help_text="separated by new line '\\n'") class Meta: model = models.Persone fields = ( 'name', 'phones' )
null
src/phonebook/forms.py
forms.py
py
302
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "django.f...
618090807
import asyncio from aiotfm.errors import InvalidSocketData class Socket: """A socket class with asyncio.""" def __init__(self, host, port, loop=None): self.loop = loop or asyncio.get_event_loop() self.__socket = asyncio.open_connection(host, port, loop=self.loop) self._reader:asyncio.StreamReader = None se...
null
aiotfm/connection.py
connection.py
py
3,074
python
en
code
null
code-starcoder2
66
[ { "api_name": "asyncio.get_event_loop", "line_number": 8, "usage_type": "call" }, { "api_name": "asyncio.open_connection", "line_number": 10, "usage_type": "call" }, { "api_name": "asyncio.StreamReader", "line_number": 11, "usage_type": "attribute" }, { "api_name"...
246579551
import pvporcupine import struct import pyaudio import assistant.pushtotalk as pushtotalk PROJECT_ID = 'hey-lumi' DEVICE_MODEL_ID = 'hey-lumi-hey-lumi-e75s95' CREDENTIALS_PATH = './credentials.json' MODEL_PATH = './hey_lumi.ppn' handle = pvporcupine.create(keyword_paths=[MODEL_PATH]) pa = pyaudio.PyAudio() audio_str...
null
wakeword.py
wakeword.py
py
1,194
python
en
code
null
code-starcoder2
66
[ { "api_name": "pvporcupine.create", "line_number": 12, "usage_type": "call" }, { "api_name": "pyaudio.PyAudio", "line_number": 13, "usage_type": "call" }, { "api_name": "pyaudio.paInt16", "line_number": 17, "usage_type": "attribute" }, { "api_name": "struct.unpack...
543966088
import asyncio import websockets async def client_requests(): async with websockets.connect("ws://localhost:1234", ping_interval=1000) as socket: FirstIteration = True while True: try: start_message = await socket.recv() if FirstIteration else None if start_message: print(start_message) if Fir...
null
client1.py
client1.py
py
1,013
python
en
code
null
code-starcoder2
66
[ { "api_name": "websockets.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "websockets.connect", "line_number": 31, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 33, "usage_type": "call" } ]
4447190
import requests import program_data from send_sms import send_text ten_hour_log = [] # This code requests json_data from Dark Sky API and assigns 10 hours of sliced data into 'sliced_data' variable. json_data = requests.get(program_data.api_address).json() sliced_data = json_data['hourly']['data'][0:10] # Iterates t...
null
main().py
main().py
py
871
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "program_data.api_address", "line_number": 8, "usage_type": "attribute" }, { "api_name": "program_data.bad_weather_list", "line_number": 16, "usage_type": "attribute" }, { "api_n...
481662982
from collections import defaultdict import matplotlib.pyplot as plt from recordclass import recordclass from src.common import COMMANDS # total_ocs - stores current total occurrences of command # samples - list of samples of total_ocs taken at times of sampling # these are used as y-values on a graph CmdSample = rec...
null
src/dataset_analyzer/stats/cmd_timeline.py
cmd_timeline.py
py
1,754
python
en
code
null
code-starcoder2
66
[ { "api_name": "recordclass.recordclass", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" }, { "api_name": "src.common.COMMANDS", "line_number": 24, "usage_type": "name" }, { "api_name": "ma...
645173275
#!/usr/bin/python # -*- coding: utf-8 -*- """ * Remote Sensing for Damage Assessment * * process_images.py * * Created by Shari Matzner on 11/14/2015. * Copyright © 2016, Battelle Memorial Institute. All rights reserved. * """ from __future__ import print_function import sys, getopt # command line args imp...
null
process_images.py
process_images.py
py
7,986
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.namedWindow", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.WINDOW_AUTOSIZE", "line_number": 22, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", ...
221561169
import requests from connector import Connector from commit import Commit import xml.etree.ElementTree as ET from geogitexception import GeoGitException class GeoGitServerConnector(Connector): ''' A connector that connects to a geogit repo through a geogit-server instance''' def log(self, tip, until = None, s...
null
src/geogitpy/geogitserverconnector.py
geogitserverconnector.py
py
1,393
python
en
code
null
code-starcoder2
66
[ { "api_name": "connector.Connector", "line_number": 7, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "commit.Commit", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "lin...
431381957
import datetime import hashlib import json import scrapy from kingfisher_scrapy.base_spider import BaseSpider class Australia(BaseSpider): name = 'australia' custom_settings = { 'ITEM_PIPELINES': { 'kingfisher_scrapy.pipelines.KingfisherPostPipeline': 400 }, 'HTTPERROR_A...
null
kingfisher_scrapy/spiders/australia.py
australia.py
py
1,986
python
en
code
null
code-starcoder2
66
[ { "api_name": "kingfisher_scrapy.base_spider.BaseSpider", "line_number": 10, "usage_type": "name" }, { "api_name": "scrapy.Request", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 28, "usage_type": "call" }, { "api...
161321039
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('repositorio', '0006_archivo'), ] ...
null
repositorio/migrations/0007_auto_20150920_2347.py
0007_auto_20150920_2347.py
py
721
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
402305438
from django.db import transaction from django.db.models import Q from django.db.models import F import datetime from activity.models import Activity from django.conf import settings from feedback.models import OrgActivityHistory from account.models import Account,AccountHistory,SysAccountHistory,SysAccount,MAP_TRADE_TY...
null
back_python/front/static/front/js/editor/smiley/api/service/activityService.py
activityService.py
py
9,394
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "back.models.JsonResultService", "line_number": 17, "usage_type": "name" }, { "api_name": "sys.exc_info", "line_number": 30, "usage_type": "call" }, { "api_name": "logging....
94105964
import sys from couchdb_layer.mcm_database import database from tools.locker import locker from cachelib import SimpleCache __cache = SimpleCache() __db = database('settings') # Cache timeout in seconds CACHE_TIMEOUT = 30 * 60 def get(label): cached_value = __cache.get(label) if cached_value is not None: ...
null
mcm/tools/settings.py
settings.py
py
1,309
python
en
code
null
code-starcoder2
66
[ { "api_name": "cachelib.SimpleCache", "line_number": 6, "usage_type": "call" }, { "api_name": "couchdb_layer.mcm_database.database", "line_number": 7, "usage_type": "call" }, { "api_name": "tools.locker.locker.lock", "line_number": 16, "usage_type": "call" }, { "a...
339820129
# Udacity - Web Development - Lesson 3 databases - Problem set - basic blog # inspired by http://chris.com/ascii/ and Udacity web development course # Comment: using the jinja2 template. import os import webapp2 import jinja2 from google.appengine.ext import db # Configure Jinja2 template environment template_dir ...
null
apps/lesson-03ps-basic-blog/blog.py
blog.py
py
2,516
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "jinja2.Environment", "l...
514206362
from werkzeug.exceptions import NotFound from microsetta_private_api import localization from microsetta_private_api.repo.base_repo import BaseRepo from microsetta_private_api.model.survey_template import SurveyTemplate, \ SurveyTemplateLinkInfo from microsetta_private_api.model.survey_template_group import \ ...
null
microsetta_private_api/repo/survey_template_repo.py
survey_template_repo.py
py
11,851
python
en
code
null
code-starcoder2
66
[ { "api_name": "microsetta_private_api.repo.base_repo.BaseRepo", "line_number": 19, "usage_type": "name" }, { "api_name": "microsetta_private_api.model.survey_template.SurveyTemplateLinkInfo", "line_number": 23, "usage_type": "call" }, { "api_name": "microsetta_private_api.model.s...
100259818
#!/usr/bin/env python from __future__ import print_function from root_numpy import root2array from sklearn.externals import joblib from sklearn.neighbors import LocalOutlierFactor from matplotlib import ticker import argparse import matplotlib.pyplot as plt import numpy as np import os # parse command line arguments...
null
energy_estimation/nd/fhc/svm/muon/outlier_removal.py
outlier_removal.py
py
2,495
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "root_numpy.root2array", "line_number": 25, "usage_type": "call" }, { "api_name": "root_numpy.root2array", "line_number": 29, "usage_type": "call" }, { "api_name": "n...
293631059
from PyQt5 import QtWidgets, QtPrintSupport, QtGui from PyQt5.QtGui import * from PyQt5.QtWidgets import * import mysql.connector import pandas as pd import datetime import mysql.connector import sys from os import path from PyQt5.uic import loadUiType from numpy.core import double from Clients_Bmis import get_bmis_cat...
null
petapp.py
petapp.py
py
47,433
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.uic.loadUiType", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "name" }, { "api_name": "os.path.dirname", "line...
367738059
from __future__ import division import logging import time from cnc.pulses import PulseGeneratorLinear from cnc.config import * from cnc.coordinates import Coordinates """ This is virtual device class which is very useful for debugging. It checks PulseGenerator with some tests. """ def init(): """ Initializ...
null
cnc/hal_virtual.py
hal_virtual.py
py
3,118
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.info", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 33, "usage_type": "call" }, { "api_name": "cnc.pulses.PulseGeneratorLinea...
606299486
from flask import Flask from flask import render_template,redirect,request import pandas as pd import numpy as np import pickle app=Flask(__name__) model=pickle.load(open('model.pkl','rb')) @app.route("/index") def index(): return render_template("index.html") @app.route("/result", methods = ['POST', 'GET...
null
app.py
app.py
py
1,276
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.method", ...
397205521
from random import choice from random import randint from classes.items import Useable from common import colors, item_use as iu SCROLL_CHAR = '=' SCROLL_COLOR = colors.light_yellow SCROLL_CLASS = Useable use_scrolls_data = { 'scr_tel': { 'name': 'Scroll of Teleport', 'descr': 'A scroll of Telepo...
null
data/item_data/use_scrolls.py
use_scrolls.py
py
1,884
python
en
code
null
code-starcoder2
66
[ { "api_name": "common.colors.light_yellow", "line_number": 8, "usage_type": "attribute" }, { "api_name": "common.colors", "line_number": 8, "usage_type": "name" }, { "api_name": "classes.items.Useable", "line_number": 9, "usage_type": "name" }, { "api_name": "comm...
37068000
#============================================================= # Test bank for ODE integrators: Kepler problem. # # Contains the functions: # get_planetdata : returns basic information about planets # set_odepar : setting global variables for get_dydx() # get_odepar : getting global variables for get...
null
kepler.py
kepler.py
py
12,619
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
25803613
import os from contextlib import contextmanager from atomicwrites import atomic_write as _backend_writer, AtomicWriter class SuffixWriter(AtomicWriter): def get_fileobject(self, suffix="", dir=None, **kwargs): return super().get_fileobject(suffix, dir, **kwargs) @contextmanager def atomic_write(file, m...
null
src/csci_utils/io/atomic_rewrites.py
atomic_rewrites.py
py
716
python
en
code
null
code-starcoder2
66
[ { "api_name": "atomicwrites.AtomicWriter", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.splitext...
77651354
# example.py Code Sample # # Copyright (c) Microsoft and contributors. All rights reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import time import sample_utils import resource_uri_utils import azure.mgmt.net...
null
src/example.py
example.py
py
24,052
python
en
code
null
code-starcoder2
66
[ { "api_name": "haikunator.Haikunator", "line_number": 26, "usage_type": "call" }, { "api_name": "azure.mgmt.netapp.models.NetAppAccount", "line_number": 37, "usage_type": "call" }, { "api_name": "azure.mgmt.netapp.models.CapacityPool", "line_number": 43, "usage_type": "ca...
67721332
import requests import time from datetime import datetime def clean_message(message): dt = datetime.fromtimestamp(message['time']) dt_str = dt.strftime('%H:%M:%S') print(message['name'], dt_str) print(message['text']) print() after = 0.0 while True: data = requests.get('http://127.0.0.1:5000/messages', params={...
null
receiver.py
receiver.py
py
443
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.fromtimestamp", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "time.sle...
654289078
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.models import User from django.http import HttpResponse from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required from django.contrib import messages from django.http import Json...
null
account/views.py
views.py
py
6,283
python
en
code
null
code-starcoder2
66
[ { "api_name": "forms.UserRegistrationForm", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Profile.objects.create", "line_number": 26, "usage_type": "call" }, { "api_name": "models.Profile.objects", "line_number": 26, "usage_type": "attribute" }, { ...
218394217
from stellar_sdk import Server server = Server(horizon_url="https://horizon-testnet.stellar.org") # get a list of transactions that occurred in ledger 1400 transactions = server.transactions().for_ledger(1400).call() print(transactions) # get a list of transactions submitted by a particular account transactions = se...
null
examples/query_horizon.py
query_horizon.py
py
464
python
en
code
null
code-starcoder2
66
[ { "api_name": "stellar_sdk.Server", "line_number": 3, "usage_type": "call" } ]
199935597
import argparse import os #os.environ['CUDA_VISIBLE_DEVICES']='2' import shutil import time import torch import torch.nn as nn import torch.nn.parallel #import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data import torchvision import torchvision.transforms as transforms import torchvision.data...
null
my_eval.py
my_eval.py
py
7,354
python
en
code
null
code-starcoder2
66
[ { "api_name": "torchvision.models.__dict__", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torchvision.models", "line_number": 23, "usage_type": "name" }, { "api_name": "torchvision.models.__dict__", "line_number": 25, "usage_type": "attribute" }, { ...
292602630
#!/usr/bin/python2.7 ''' Martin Kersner, m.kersner@gmail.com 2015/11/30 Ray Zhang, rzh@umich.edu 2019/05/17 Evaluation metrics for image segmentation inspired by paper Fully Convolutional Networks for Semantic Segmentation. ''' import numpy as np import sys, os from scipy import misc as misc from collections impor...
null
grid_sensor/data_kitti_15/eval_segm.py
eval_segm.py
py
9,504
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sum", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.logical_and", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": ...
478442612
import logging from selenium.common.exceptions import TimeoutException from selenium.webdriver import Firefox from selenium.webdriver.firefox.options import Options from bs4 import BeautifulSoup import requests import time from datetime import datetime import os import pandas as pd import json class WebScraper: ...
null
Jiazheng_Xu/PyTorchScraping.py
PyTorchScraping.py
py
9,765
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 32, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 34, "usage_type": "call" }, {...
129644672
# coding=utf8 """ seen.py - Willie Seen Module. Copyright 2008, Sean B. Palmer, inamidst.com Copyright (c) 2012, Elad Alfassa <elad@fedoraproject.org> Licensed under the Eiffel Forum License 2. http://willie.dftba.net """ from __future__ import unicode_literals import time import datetime from willie.tools import g...
null
willie/modules/seen.py
seen.py
py
3,445
python
en
code
null
code-starcoder2
66
[ { "api_name": "willie.config.ConfigurationError", "line_number": 25, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 56, "usage_type": "call" }, { "api_name": "time.gmtime", "line_number": 57, "usage_type": "call" }, { "api_name": "willie.mod...
369898724
import logging from PyQt5 import QtWidgets, QtGui class LogWidget(logging.Handler, QtWidgets.QWidget): def __init__(self, level=logging.DEBUG, fmt='[%(levelname)s] %(asctime)s -- %(name)s -- %(message)s'): logging.Handler.__init__(self) QtWidgets.QWidget.__init__(self) logging.basicConfi...
null
few_photons/gui/log_widget.py
log_widget.py
py
1,223
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.Handler", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 5, "usage_type": "name" }, { "api_name": "loggin...
550853679
from enum import IntEnum, Enum # Order type class order_type(IntEnum): COMPRA = 1 VENDA = 2 class order_type_text(Enum): COMPRA = "buy" VENDA = "sell" # Order status class order_status(IntEnum): OPEN = 2 CANCELED = 3 FILLED = 4 REQUEST_HOST = 'www.mercadobitcoin.net' REQUEST_PATH_TICKER ...
null
Helpers/Constants.py
Constants.py
py
6,697
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.IntEnum", "line_number": 4, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 8, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_number": 13, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_number": 6...
395351804
from django.urls import path from books.views import author_form_test from . import views app_name = "books" urlpatterns = [ path("", views.home, name="home"), # ex: /books/ path("books_list", views.books_list, name="books_list"), path("books", views.books, name="books"), path("books/<int:book_id>...
null
biblioteka/books/urls.py
urls.py
py
610
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
605847290
#!usr/bin/env python3 import time from getpass import getuser from colorama import init from termcolor import colored, cprint from export_subnets import export_subnets from read_subnets import read_subnets from subnetting import subnetting init(autoreset=True) def main(): try: # CSV file input...
null
main.py
main.py
py
1,628
python
en
code
null
code-starcoder2
66
[ { "api_name": "colorama.init", "line_number": 13, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 25, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 32, "usage_type": "call" }, { "api_name": "read_subnets.read_s...
394891423
### # # Embedding space analysis # Support functions # ### import numpy as np import torch from sklearn.metrics.pairwise import cosine_distances def pairwise_dists(embs_file, dists_save_file): """ PERF. NOTE: Takes roughly 2mins on the server and 25% of memory usage (out of 32GB of avai...
null
utils/spatial.py
spatial.py
py
2,139
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.load", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise.cosine_distances", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.save", "line_number": 28, "usage_type": "call" }, { "api_name": "torch...
10160146
import re import random from django.core.files.base import ContentFile from django.core.files.storage import default_storage def list_entries(): """ Returns a list of all names of encyclopedia entries. """ _, filenames = default_storage.listdir("entries") return list(sorted(re.sub(r"\.md$", "", fi...
null
encyclopedia/util.py
util.py
py
1,713
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.files.storage.default_storage.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "django.core.files.storage.default_storage", "line_number": 11, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 12, "usage_type": "ca...
74538509
import urllib.request as request import json src = "https://padax.github.io/taipei-day-trip-resources/taipei-attractions.json" with request.urlopen(src) as res: data = json.load(res) # 取得網站資料 clist = data["result"]["results"] with open("data.txt", "w", encoding="utf-8") as file: for name, longi, latit, picture...
null
API/api.py
api.py
py
527
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.urlopen", "line_number": 4, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 4, "usage_type": "name" }, { "api_name": "json.load", "line_number": 5, "usage_type": "call" } ]
213511698
#coding: UTF-8 from data import data from dataGauss import dataGauss from perceptron import perceptron import matplotlib.patches as mpatches from numpy import * from matplotlib import * from matplotlib import pyplot as plt class main(object): def __init__(self): self.__dataSet = [] for i in range(100): if...
null
main.py
main.py
py
1,811
python
en
code
null
code-starcoder2
66
[ { "api_name": "dataGauss.dataGauss", "line_number": 20, "usage_type": "call" }, { "api_name": "dataGauss.dataGauss", "line_number": 23, "usage_type": "call" }, { "api_name": "perceptron.perceptron", "line_number": 26, "usage_type": "call" }, { "api_name": "data.da...
356526617
from rest_framework import serializers from django_redis import get_redis_connection class RegisterSmsSerializer(serializers.Serializer): text = serializers.CharField(label='图片验证码',max_length=4,min_length=4,required=True) image_code_id = serializers.UUIDField(label='uuid') def validate(self, attrs): ...
null
meiduo04/mall/apps/verifications/serializers.py
serializers.py
py
822
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.Serializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "rest_framework.serializers.CharField", "line_number": 6, "usage_type"...
474607046
import json import flask from ... import util from .... import errors, types def configure(config, bp, trusted_clients, centralauth, state): @bp.route("/v1/judgements", methods=["GET"]) def get_judgements(context): """Get all judgements.""" if 'download_all' in flask.request.values: ...
null
jade/wsgi/routes/v1/judgements.py
judgements.py
py
3,508
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.request", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask.json.jsonify", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.json", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.request",...
554089797
import sqlite3 from pathlib import PurePath from definitions import db_path_dir class DBConnection: """Also we can use that class as context manager""" def __init__(self, db_name): self.db_name = db_name self.db_path = self._get_abs_path_for_db(self.db_name) self.connection = sqlite3....
null
db/connection.py
connection.py
py
2,304
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "pathlib.PurePath", "line_number": 30, "usage_type": "call" }, { "api_name": "definitions.db_path_dir", "line_number": 30, "usage_type": "argument" } ]
81561719
import math import copy import mathutils import time import random from mathutils import kdtree from random import random, seed import numpy as np import datetime import bpy from bpy.props import * import bpy.types import bmesh from mathutils import Vector, Matrix from mathutils.bvhtree import BVHTree bl_info = { "n...
null
blender/addon_experiments/old/modifTools_v01.py
modifTools_v01.py
py
18,479
python
en
code
null
code-starcoder2
66
[ { "api_name": "bpy.context", "line_number": 33, "usage_type": "attribute" }, { "api_name": "bpy.context", "line_number": 38, "usage_type": "attribute" }, { "api_name": "bpy.ops.object.mode_set", "line_number": 40, "usage_type": "call" }, { "api_name": "bpy.ops", ...
557000673
import unittest from typing import List class Solution(unittest.TestCase): def rob(self, nums: List[int]) -> int: """ You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adj...
null
src/main/python/house_robber.py
house_robber.py
py
1,614
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 4, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
607934344
from fixtures.builder import FixtureBuilder import shutil def build(): fixture = FixtureBuilder('TUFTestFixtureAttackRollback')\ .create_target('testtarget.txt')\ .publish(with_client=True) server_dir = fixture._server_dir backup_dir = server_dir + '_backup' shutil.copytree(server_di...
null
fixtures/TUFTestFixtureAttackRollback/__init__.py
__init__.py
py
646
python
en
code
null
code-starcoder2
66
[ { "api_name": "fixtures.builder.FixtureBuilder", "line_number": 7, "usage_type": "call" }, { "api_name": "shutil.copytree", "line_number": 13, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_number": 17, "usage_type": "call" }, { "api_name": "shutil.c...
235120702
# track.py # Developed by Xiaocheng Mesut Yang for CS294-112 Fall 2018 # This file contains all the necessary component to simulate a ractrack import numpy as np import math import utils import cv2 import random import pickle # Python Imaging Library imports from PIL import Image from PIL import ImageDraw import mat...
null
track.py
track.py
py
19,652
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.ftToMm", "line_number": 58, "usage_type": "call" }, { "api_name": "utils.ftToMm", "line_number": 59, "usage_type": "call" }, { "api_name": "utils.ftToMm", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number...
203548113
import cv2 import numpy as np # import necessary libraries def nothing(x): # does nothing pass def sort_p(alist): # functions well, but sbould not be used it = 0 # iteration counter for i in alist: if it + 1 != len(alist): x, y = i.pos q, p = alist[it + 1].pos # assi...
null
test.py
test.py
py
7,990
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.namedWindow", "line_number": 46, "usage_type": "call" }, { "api_name": "cv2.createTrackbar", "line_number": 47, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 48, "usage_type": "call" }, { "api_name": "cv2.getTrackbarPo...
365523714
# polling/views.py from django.shortcuts import render from django.http import Http404 from polling.models import Poll def list_view(request): context = {'polls': Poll.objects.all()} return render(request, 'polling/list.html', context) def detail_view(request, poll_id): try: poll = Poll.objects.get(pk=poll_id) ...
null
mysite/polling/views.py
views.py
py
577
python
en
code
null
code-starcoder2
66
[ { "api_name": "polling.models.Poll.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "polling.models.Poll.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "polling.models.Poll", "line_number": 8, "usage_type": "name" }, { ...