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
26802550
import sys sys.path.append('/afs/ipp/aug/ads-diags/common/python/lib') sys.path.append("/afs/ipp-garching.mpg.de/home/o/osam/workspace/python3_projects/modules_osam") import dd_20190506 as dd # import map_equ_20190429 as equ import matplotlib.pyplot as plt import numpy as np # import importlib # import EQH_Load_osam as...
null
python3_projects/readdata_examples/RRC_NTM_read.py
RRC_NTM_read.py
py
2,357
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
648893301
# wrapper for vizdoom envronment "https://github.com/mwydmuch/ViZDoom" import numpy as np from vizdoom import * from skimage.transform import resize from skimage.color import rgb2gray import itertools as it from os import path RESIZE_H = 120 RESIZE_W = 160 REPEAT = 12 class VizDoomEnv(object): def __...
null
environments/vizdoom_env.py
vizdoom_env.py
py
2,783
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "name" }, { "api_name": "itertools.product", "line_number": 22, "usage_type": "call" }, { "api_name": "skimage.transform.resize", ...
89781550
# _____ __ __ ____ __ # / ___/ ____ _ / /____ / /_ __ __ _____ ____ _ / __ \ ___ _____ ___ ____ _ _____ _____ / /_ # \__ \ / __ `// //_ / / __ \ / / / // ___// __ `/ / /_/ // _ \ / ___// _ \ / __ `// _...
null
opc_ua_server_panda.py
opc_ua_server_panda.py
py
7,212
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 26, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.DE...
286704893
from yt.mods import * import yt yt.enable_parallelism() from yt import YTArray import numpy as np import glob import pickle f = open('../Bhspos_r8.pickle') bhspos = pickle.load(f) f.close() DD = glob.glob('../DD*/*.hierarchy') DD.sort() DD = DD[0:102] allhaloidx = np.loadtxt('../allhalos1.txt') my_storage = {} I ...
null
aas/Paraplots/plot_bhs_parallel.py
plot_bhs_parallel.py
py
834
python
en
code
null
code-starcoder2
76
[ { "api_name": "yt.enable_parallelism", "line_number": 3, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_...
64832453
import numpy as np import networkx as nx import matplotlib.pyplot as plt from Graph import Graph class Weighted_Graph(Graph): def __init__(self, *args): self.edge_list_file = '' self.edge_dict = {} self.edge_set = set() self.vert...
null
Graph Theory/Weighted_Graph.py
Weighted_Graph.py
py
5,060
python
en
code
null
code-starcoder2
76
[ { "api_name": "Graph.Graph", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.loadtxt", "line_number": 103, "usage_type": "call" }, { "api_name": "networkx.read_edgelist", "line_number": 169, "usage_type": "call" }, { "api_name": "networkx.spring_la...
571978724
# -*- coding: utf-8 -*- from django.test import TestCase from django.test.utils import setup_test_environment from django.http import QueryDict from django.contrib.auth.models import User from pub.forms import PaymentForm from pub.models import Department, Management, Category, Item, Project, Payee class FormPaymentF...
null
pub/tests/test_form_payment.py
test_form_payment.py
py
3,204
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "pub.models.Department.objects.create", "line_number": 13, "usage_type": "call" }, { "api_name": "pub.models.Department.objects", "line_number": 13, "usage_type": "attribute" ...
70957016
#imports the modules needed import pygame import os from pygame.locals import* import math import sys #initiates the pygame modue pygame.init() #sets the screen dimensions screenWidth = 740 screenHeight = 600 screen_size = screenWidth,screenHeight #os.environ['SDL_VIDEO_WINDOW_POS'] = "0,0" #,...
null
main.py
main.py
py
16,113
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pygame.displa...
271887338
# dict_format -> ('GJ', (1,Gujarat)), ('8173', (1, '27-A')), ('AN', (1, 'Andaman and Nicobar')) import requests, os, re, datetime, time from selenium import webdriver from bs4 import BeautifulSoup from time import sleep import src.utils as Constants id_list = ["ddlCommodity", "ddlState", "ddlMarket"] file_list = [".....
null
src/data_generator.py
data_generator.py
py
9,879
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.exists", "...
309801597
# coding: utf8 import matplotlib.dates as mdates import matplotlib.pyplot as plt import random as rd import datetime import pyttsx3 import time import os PROBABILITY_RECAP = .14 # about 1/7 PROBABILITY_SHOT = .059 # about 1/17 MAX_SWALLOWS = 5 MAX_WAIT = 4 * 60 HISTORY = [] COLORS_ALL = ['b','g','r','c','m','gol...
null
drink.py
drink.py
py
7,378
python
en
code
null
code-starcoder2
76
[ { "api_name": "platform.system", "line_number": 45, "usage_type": "call" }, { "api_name": "os.system", "line_number": 46, "usage_type": "call" }, { "api_name": "os.system", "line_number": 48, "usage_type": "call" }, { "api_name": "random.sample", "line_number"...
602673723
try: from robot import Robot except ImportError: raise SystemExit('Could not find robot.py. Does it exist?') import unittest class RobotTest(unittest.TestCase): name_re = r'\w{2}\d{3}' def test_has_name(self): self.assertRegexpMatches(Robot().name, self.name_re) def test_name_sticks(self...
null
exercism.io-master/exercism.io-master/assignments/python/robot-name/robot_name_test.py
robot_name_test.py
py
837
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "robot.Robot", "line_number": 12, "usage_type": "call" }, { "api_name": "robot.Robot", "line_number": 15, "usage_type": "call" }, { "api_name": "robot.name", "line_...
158695949
import os import unittest from distutils.version import LooseVersion import numpy as np from scipy.sparse import csr_matrix, issparse import Orange from Orange.data import Table from Orange.data.domain import Domain, StringVariable from orangecontrib.text import preprocess from orangecontrib.text.corpus import Corpu...
null
orangecontrib/text/tests/test_corpus.py
test_corpus.py
py
10,108
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "orangecontrib.text.corpus.Corpus.from_file", "line_number": 19, "usage_type": "call" }, { "api_name": "orangecontrib.text.corpus.Corpus", "line_number": 19, "usage_type": "na...
44502297
import csv import json def get_months(months): if (months.strip() == "All"): months = list(range(1, 13)) else: months = months.split(';') for i in range(len(months)): months[i] = int(months[i]) return months def get_times(times): if (times.strip() == "All"): times = list(range(1, 25)) else: times =...
null
resources/csv_to_json.py
csv_to_json.py
py
1,466
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 38, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 41, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 46, ...
15418890
import os from flask import Flask, render_template, request, jsonify from detect_emotions import detect_emotion app = Flask(__name__) app.config["IMAGE_UPLOADS"] = "" port = int(os.environ.get("PORT", 5300)) @app.route('/') def index(): return render_template('index.html') @app.route('/emotion_recognizer', metho...
null
app.py
app.py
py
742
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "flask.render_template", "...
75176744
from django.shortcuts import render,redirect,get_object_or_404,HttpResponseRedirect from django.contrib.auth.decorators import login_required from .forms import ProjectForm,ReviewForm,CommentForm from .models import Project,Profile,Comments,Review from django.contrib.auth.models import User from django.http import Json...
null
Awwards/projects/views.py
views.py
py
3,608
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Project.objects.order_by", "line_number": 15, "usage_type": "call" }, { "api_name": "models.Project.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "models.Project", "line_number": 15, "usage_type": "name" }, { "api_na...
372561558
# -*- coding:utf-8 -*- import os from datetime import datetime import pytz import requests from bahttext import bahttext from flask import render_template, request, flash, redirect, url_for, send_file, send_from_directory, make_response, \ jsonify from flask_login import current_user, login_required from pandas im...
null
app/receipt_printing/views.py
views.py
py
41,565
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytz.timezone", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 40, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 40, "usage_type": "call" }, { "api_name": "os.environ", "line_numb...
282399888
from envparse import Env # reads a local .env file with the TEST_TOKEN=<user token> # ensure that this file is not commited to github (never ever) env = Env() env.read_envfile() TEST_URL = env('TEST_URL', default='https://kec2api.ke-chain.com') TEST_USERNAME = env('TEST_USERNAME', default='pykechain') # LVL1 TEST_T...
null
tests/utils.py
utils.py
py
527
python
en
code
null
code-starcoder2
76
[ { "api_name": "envparse.Env", "line_number": 6, "usage_type": "call" } ]
24668704
from sklearn.decomposition import PCA import data_import import matplotlib.pyplot as plt data,df = data_import.import_data("~/Dropbox/missense_pred/data/Ben/input_data.HIS.csv",test = 0) X_train = data[0]['X_train'] X_test = data[0]['X_test'] y_train = data[1]['y_train'] y_test = data[1]['y_test'] pca = PCA(n_compon...
null
SAE/pca_plot.py
pca_plot.py
py
839
python
en
code
null
code-starcoder2
76
[ { "api_name": "data_import.import_data", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.decomposition.PCA", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 30, "usage_type": "call" }, { "api_na...
152764680
from collections import defaultdict # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def dfs(self, node): if not node: return cur, pal = self.dict_...
null
LeetCode/1457_PseudoPalindromicPathsInABinaryTree/Solution.py
Solution.py
py
844
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 30, "usage_type": "call" } ]
446575141
import uuid from pathlib import Path from typing import Callable from unittest.mock import patch import pytest from devtools_testutils import AzureRecordedTestCase, is_live from test_utilities.utils import get_arm_id from azure.ai.ml import MLClient from azure.ai.ml.entities._assets import Code @pytest.fixture def ...
null
sdk/ml/azure-ai-ml/tests/code_asset/e2etests/test_code.py
test_code.py
py
2,604
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "attribute" }, { "api_name": "devtools_testutils.AzureRecordedTestCase", "line_number": 24, "usage_type": "name" }, { "api_nam...
498472400
from datetime import datetime, timedelta from provider.utils import get_filtered_fb_post, days_lower import re FB_PAGE = "https://www.facebook.com/pg/amicimieicorvin/posts" FB_ID = "1861078894105248" def getMenu(today): day = today.weekday() try: is_this_week = lambda date: datetime.strptime(date, '%...
null
provider/amici.py
amici.py
py
1,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.strptime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 12, "usage_type": "call" }, { "api_name": "provi...
604408225
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 Snowball Beijing, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
null
shici/store/baidu_crawler.py
baidu_crawler.py
py
2,867
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 52, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 54, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 78, "usage_type": "call" }, { "api_name": "pandas.DataFrame",...
168366822
from __future__ import division import os import re import pathlib import time import datetime import numpy as np import pandas as pd import cv2 import imutils import torch import torch.nn as nn from torch.autograd import Variable from util import load_classes, write_results from darknet import Darknet from preproces...
null
process_all_bob.py
process_all_bob.py
py
12,387
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 28, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 33, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 35, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number":...
520639383
import discord from discord.ext import commands; import asyncio import gaycode #where we store the bots token, so it isn't publicly displayed on github client = discord.Client() supportList = [] #list of discord members signed up to support mixes commandString = '!join !quit (admin !reset !shutdown)' infoString = 'Pe...
null
supporting_bot.py
supporting_bot.py
py
3,938
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.Client", "line_number": 6, "usage_type": "call" }, { "api_name": "discord.utils.find", "line_number": 101, "usage_type": "call" }, { "api_name": "discord.utils", "line_number": 101, "usage_type": "attribute" }, { "api_name": "gaycode.token",...
199919909
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime import requests import sys # args args = sys.argv output_folder = args[1] now = datetime.now().strftime("%Y%m%d_%H%M") output_file = output_folder + "/" + now + ".json" # Request url = "https://fx.click-sec.com/neo/rfl/calendarList" response...
null
CrawlersCron/crawlers/EconomicEvent/get_economic_event.py
get_economic_event.py
py
464
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", ...
651259341
# Starter code for homework 5 # %% # Import the modules we will use import os import numpy as np import pandas as pd import matplotlib.pyplot as plt # %% # Set file location filename = 'streamflow_week5.txt' filepath = os.path.join('data', filename) print(os.getcwd()) print(filepath) filepath = '../data/streamflow_w...
null
Forecast_Submissions/morales_HW5.py
morales_HW5.py
py
3,331
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_table", "line_num...
376358952
from tools.load import LoadMatrix lm=LoadMatrix() data = lm.load_numbers('../data/fm_train_real.dat') parameter_list = [[data, 0.01, 1.0], [data, 0.05, 2.0]] def preprocessor_kernelpca_modular(data, threshold, width): from shogun.Features import RealFeatures from shogun.Preprocessor import KernelPCA from shogun.K...
null
build/shogun_lib/examples/undocumented/python_modular/preprocessor_kernelpca_modular.py
preprocessor_kernelpca_modular.py
py
665
python
en
code
null
code-starcoder2
76
[ { "api_name": "tools.load.LoadMatrix", "line_number": 3, "usage_type": "call" }, { "api_name": "shogun.Features.RealFeatures", "line_number": 13, "usage_type": "call" }, { "api_name": "shogun.Kernel.GaussianKernel", "line_number": 15, "usage_type": "call" }, { "ap...
382387617
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Data binding example ''' from wdom.themes.default import H1, Div, Input class App(Div): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.text = H1(parent=self) self.text.textContent = 'Hello!' self.text...
null
wdom/examples/data_binding.py
data_binding.py
py
936
python
en
code
null
code-starcoder2
76
[ { "api_name": "wdom.themes.default.Div", "line_number": 11, "usage_type": "name" }, { "api_name": "wdom.themes.default.H1", "line_number": 14, "usage_type": "call" }, { "api_name": "wdom.themes.default.Input", "line_number": 16, "usage_type": "call" }, { "api_name...
421615235
class Solution: # @param m: An integer m denotes the size of a backpack # @param A: Given n items with size A[i] # @return: The maximum size def backPack(self, m, A): from itertools import combinations sums = [] for items_count in xrange(1, len(A)+1): sums.extend([sum...
null
backpack.py
backpack.py
py
407
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.combinations", "line_number": 9, "usage_type": "call" } ]
317188640
from datetime import datetime,timedelta from pymongo import MongoClient,errors import pymongo class MongoQueue: OUTSTANDING,PROCESSING,COMPLETE = range(3) def __init__(self,client=None,timeout=300): #self.client = MongoClient("localhost", 27017) if client is None else client self.db = pymongo.MongoClie...
null
mongo_queue_p3.py
mongo_queue_p3.py
py
1,519
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 10, "usage_type": "call" }, { "api_name": "pymongo.errors.DuplicateKeyError", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pymongo.errors", "line_number": 22, "usage_type": "name" }, { "api_name...
465799780
from wordcloud import WordCloud, STOPWORDS import matplotlib.pyplot as plt import pandas as pd df = pd.read_csv(r"tweet_csv/test_pre.csv", encoding ="ISO-8859-1") comments= ' ' stopwords = set(STOPWORDS) #wordcloud visuals for pos_tweets pos_tweets = df[df.pred == 1] pos_string = [] for t in pos_tweets.sentimenttext:...
null
pos_wc.py
pos_wc.py
py
733
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "wordcloud.STOPWORDS", "line_number": 7, "usage_type": "argument" }, { "api_name": "pandas.Series", "line_number": 14, "usage_type": "call" }, { "api_name": "wordcloud.WordClo...
500260365
from __future__ import with_statement import os import errno import six from tempfile import NamedTemporaryFile from plumbum.path import Path, FSUser from plumbum.lib import _setdoc from plumbum.commands import shquote if not six.PY3: bytes = str #@ReservedAssignment class RemotePath(Path): """The class impl...
null
plumbum/remote_path.py
remote_path.py
py
6,176
python
en
code
null
code-starcoder2
76
[ { "api_name": "six.PY3", "line_number": 11, "usage_type": "attribute" }, { "api_name": "plumbum.path.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "plumbum.lib._setdoc", "line_number": 49, "usage_type": "call" }, { "api_name": "plumbum.path.Path"...
260057028
import logging import os import datetime class UserLog: def __init__(self): self.logger = logging.getLogger() self.logger.setLevel(logging.DEBUG) #设置log等级 #输出日志 # consle = logging.StreamHandler() # logger.addHandler(consle) #写入log文件 file_path = os.path.di...
null
web Auto/demos/log/user_log.py
user_log.py
py
1,144
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "lin...
116195281
#!/usr/bin/env python3.6 import os,sys import re import dateutil import argparse import pandas as pd import matplotlib import matplotlib.pyplot as plt import IPython import functools import datetime from collections import defaultdict pd.set_option('display.float_format', '{:.3f}'.format) metrics_df = None ''' Select...
null
scripts/metlab.py
metlab.py
py
12,062
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.set_option", "line_number": 14, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
111676830
#!/usr/bin/python # -*- coding: utf-8 -*- # @Time : 7/25/17 12:41 AM # @Author : Jianpeng Hou # @Email : houjp1992@gmail.com """ Change window size of Conv: [1-10, 11, 13, 15, 20] """ from keras.layers import * from keras.layers.merge import * from keras.models import Model, model_from_json from keras import ...
null
bin/text_cnn/v103/text_cnn.py
text_cnn.py
py
11,841
python
en
code
null
code-starcoder2
76
[ { "api_name": "bin.utils.LogUtil.log", "line_number": 29, "usage_type": "call" }, { "api_name": "bin.utils.LogUtil", "line_number": 29, "usage_type": "name" }, { "api_name": "tensorflow.ConfigProto", "line_number": 32, "usage_type": "call" }, { "api_name": "tensor...
586026730
# -*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User, Group from django.contrib.auth.forms import UserChangeForm from django.forms.widgets import TextInput from captcha.fields import CaptchaField, CaptchaTextInput from eng...
null
www/iskcon/forms.py
forms.py
py
4,402
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 16, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.Group", "line_number": 18, "usage_type": "name" }, { "api_nam...
167076196
# coding: utf-8 from __future__ import unicode_literals import re import itertools class FieldsScore(object): """ 字段级别的precision, recall, f1 只支持单字段计算score """ @classmethod def score(cls, tags_predict, tags_actual): """ :param tags_predict: list of predict tags :param...
null
extract_framework/metrics/fields_score.py
fields_score.py
py
1,624
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.chain", "line_number": 25, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 26, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 33, "usage_type": "call" } ]
108523950
import matplotlib.pyplot as plt plt.figure(1) pos = [1, 2, 3, 4, 5] sales = [203, 136, 113, 83, 68] topgames = ['Minecraft', 'Grand Theft Auto V', 'Tetris (EA)', 'Wii Sports', 'PlayerUnknown\'s BattleGrounds'] plt.bar(pos, sales, color='limegreen') plt.xticks(pos[0:], topgames, fontsize='6') plt.title("Top 5...
null
graph Final.py
graph Final.py
py
457
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 3, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 8, "usage_type": "call" }, { "api_name": "matplot...
383051351
import tensorflow as tf import numpy as np import teacoffeeenv as tce import utils import timeit from abc import ABC, abstractmethod import copy from neural import layers, optimizers # convenience function for stopping parameters since I'll be using this in many places. # Checks if it's time to stop training a networ...
null
simple_goals/neural/neuralnet.py
neuralnet.py
py
25,606
python
en
code
null
code-starcoder2
76
[ { "api_name": "abc.ABC", "line_number": 65, "usage_type": "name" }, { "api_name": "utils.UNIFORM", "line_number": 66, "usage_type": "attribute" }, { "api_name": "tensorflow.sigmoid", "line_number": 66, "usage_type": "attribute" }, { "api_name": "neural.optimizers....
516520383
import ctypes from ctypes import wintypes import logging from .memory import ProcessMemory from .structure import structure from .constant import constant from .process_thread import ProcessThreads from ..kernel32 import kernel32 logger = logging.getLogger('debugger.process') class Process: def __init__(self,...
null
debug/process/process.py
process.py
py
5,659
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "memory.ProcessMemory", "line_number": 21, "usage_type": "call" }, { "api_name": "process_thread.ProcessThreads", "line_number": 23, "usage_type": "call" }, { "api_name": "...
507030538
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. import codecs import os import platform import re import shutil from glob import glob import setuptools from setuptools import Extension from setuptools.command.build_ext import build_ext def clean_html(raw_html): cleanr = re.compile("<....
null
setup.py
setup.py
py
4,166
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 18, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, ...
298279415
""" 3. Массив размером 2m + 1, где m – натуральное число, заполнен случайным образом. Найдите в массиве медиану. Медианой называется элемент ряда, делящий его на две равные части: в одной находятся элементы, которые не меньше медианы, в другой – не больше медианы. Задачу можно решить без сортировки исходного массива. ...
null
Урок 7. Практическое задание сорт/task_3.py
task_3.py
py
2,431
python
en
code
null
code-starcoder2
76
[ { "api_name": "statistics.median", "line_number": 54, "usage_type": "call" } ]
498793368
import glob import json import random import csv import os #import create_features_vgg16 as cf # dictionary to hold features of the images image_feature_map = {} def sample(verticals, output_file, train=True): base_dir = "/home/ubuntu/visualsearch/code/fk-visual-search/data/" meta_dir = os.path....
null
scripts/sampler.py
sampler.py
py
4,629
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
331356450
import utils import pandas as pd train_sample_1 = utils.read_variable('outputs/train_sample_1.pkl') train_sample_0 = utils.read_variable('outputs/train_sample_0.pkl') column_names = utils.read_variable('outputs/column_names.pkl') #% cols_numeric = column_names['numeric'] cols_date = column_names['date'] c...
null
history/1_data_explore.py
1_data_explore.py
py
3,930
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.read_variable", "line_number": 5, "usage_type": "call" }, { "api_name": "utils.read_variable", "line_number": 6, "usage_type": "call" }, { "api_name": "utils.read_variable", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.notnu...
391157692
""" This script runs the application using a development server. It contains the definition of routes and views for the application. """ import asyncio import sys from flask import Flask, request, Response from botbuilder.core import ( BotFrameworkAdapter, BotFrameworkAdapterSettings, TurnContext, ...
null
Python/HelloWorld/app.py
app.py
py
1,531
python
en
code
null
code-starcoder2
76
[ { "api_name": "botbuilder.core.BotFrameworkAdapterSettings", "line_number": 22, "usage_type": "call" }, { "api_name": "botbuilder.core.BotFrameworkAdapter", "line_number": 23, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 25, "usage_type":...
653531348
import logging from datetime import datetime from openpyxl import Workbook from django.http import HttpResponse from django.shortcuts import redirect, reverse from django.views.generic import CreateView, UpdateView, TemplateView from braces.views import StaffuserRequiredMixin from mysite.common import Button, LinkB...
null
public/views/enquiry_views.py
enquiry_views.py
py
3,800
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "django.views.generic.CreateView", "line_number": 24, "usage_type": "name" }, { "api_name": "members.models.Enquiry", "line_number": 25, "usage_type": "name" }, { "api_name...
228914133
#!/usr/bin/env python3 """ New cartopy projection classes and a projection constructor function for generating `~mpl_toolkits.basemap.Basemap` and cartopy `~cartopy.crs.Projection` classes. """ from .utils import _warn_proplot try: # use this for debugging instead of print()! from icecream import ic except ImportE...
null
proplot/projs.py
projs.py
py
24,001
python
en
code
null
code-starcoder2
76
[ { "api_name": "icecream.ic", "line_number": 11, "usage_type": "name" }, { "api_name": "mpl_toolkits.basemap.Basemap", "line_number": 15, "usage_type": "name" }, { "api_name": "cartopy.crs.CRS", "line_number": 22, "usage_type": "name" }, { "api_name": "cartopy.crs....
175420702
import itertools import typing import bblfsh import zss from .bblfsh import uast_eq_node from .bblfsh import uast_iter def _get_children(a: bblfsh.Node) -> typing.List[bblfsh.Node]: return [c for c in a.children] def _get_label(a: bblfsh.Node) -> str: return '%s/%s' % (a.internal_type, a.token) def _label...
null
badcode/treedist.py
treedist.py
py
6,985
python
en
code
null
code-starcoder2
76
[ { "api_name": "bblfsh.Node", "line_number": 11, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "attribute" }, { "api_name": "bblfsh.Node", "line_number": 14, "usage_type": "attribute" }, { "api_name": "bblfsh.Node", ...
118430380
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.utils import translation from django.db import connection class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( '--schema', '-s', action='store', dest='sc...
null
scripts/marketbox-medical-svr/django_server/apps/account/management/commands/create_schema.py
create_schema.py
py
816
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "django.utils.translation.activate", "line_number": 15, "usage_type": "call" }, { "api_name": "django.utils.translation", "line_number": 15, "usage_type": "nam...
242130041
from twisted.internet import reactor from twisted.web import http class MyRequestHandler(http.Request): resource = { '/': '<h1>Home</h1> Home Page', '/about': '<h1>About</h1> all about me' } def process(self): self.setHeader('Content-Type'.encode(), 'text/html'.encode()) ...
null
Chapter4/requesthandler.py
requesthandler.py
py
783
python
en
code
null
code-starcoder2
76
[ { "api_name": "twisted.web.http.Request", "line_number": 5, "usage_type": "attribute" }, { "api_name": "twisted.web.http", "line_number": 5, "usage_type": "name" }, { "api_name": "twisted.web.http.NOT_FOUND", "line_number": 19, "usage_type": "attribute" }, { "api_...
167355683
from django.urls import path from .views import crear_examen, registrar_examen, listar_examen, registra_opcion, formulario, validar_codigo urlpatterns = [ # vista para mostrar el ingreso de los datos para crear el examen path('CrearExamen/', crear_examen, name="crear_examen"), # funcion para registrar ...
null
apps/cuestionario/urls.py
urls.py
py
850
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "views.crear_examen", "line_number": 9, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "views.registra...
405952515
from datetime import datetime from Register.models import * #定时任务:每分钟查,15分钟未付款的订单被自动删除 def crontab_task1(): print("crontab 1") #15分钟未付款 res = ReservationOrder.objects.all() for re in res: #a = datetime.strptime(re.createdTime, "%Y-%m-%d %H:%M:%S.%f") a = re.createdTime b = date...
null
OnlineRegister/Register/cron.py
cron.py
py
1,673
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 37, "usage_type": "call" }, { "api_name": "datetim...
295066883
import os, asyncio from collections import OrderedDict import discord from discord.ext import commands from tinydb import TinyDB from db_guild_interface import fetch from utility import make_simple_embed_t from secret import TOKEN from dev import DEV_MODE intents = discord.Intents.default() intents.members = True b...
null
main.py
main.py
py
1,549
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.Intents.default", "line_number": 13, "usage_type": "call" }, { "api_name": "discord.Intents", "line_number": 13, "usage_type": "attribute" }, { "api_name": "discord.ext.commands.Bot", "line_number": 16, "usage_type": "call" }, { "api_name": ...
177982978
# encoding=utf-8 import re from base64 import decodestring from django.core.files.base import ContentFile from rest_framework.parsers import BaseParser class UriDataParser(BaseParser): """ Plain text parser. """ media_type = 'text/plain' uriExp = re.compile( r"^data:(?P<type>[^;]*);(?P...
null
rolejobs_api/parsers.py
parsers.py
py
781
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.parsers.BaseParser", "line_number": 11, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "django.core.files.base.ContentFile", "line_number": 30, "usage_type": "call" }, { "a...
576559061
from django.urls import path from . import views urlpatterns = [ path('', views.cv_page, name='cv_page'), path('education/', views.education_page, name='education_page'), path('education/new/', views.education_new, name='education_new'), path('education/edit/<int:pk>/', views.education_edit, name='education_edit')...
null
cv/urls.py
urls.py
py
1,683
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
251299960
"""Tests for the strimziregistryoperator.deployments module. """ import yaml from strimziregistryoperator.deployments import ( get_cluster_tls_listener) def test_get_cluster_tls_listener(): manifest = ( 'status:\n' ' conditions:\n' ' - lastTransitionTime: 2019-10-15T21:27:36+0000\n...
null
tests/test_deployments.py
test_deployments.py
py
733
python
en
code
null
code-starcoder2
76
[ { "api_name": "yaml.safe_load", "line_number": 24, "usage_type": "call" }, { "api_name": "strimziregistryoperator.deployments.get_cluster_tls_listener", "line_number": 26, "usage_type": "call" } ]
187324516
#from django.views import ListView from django.http import Http404 from django.views.generic import ListView, DetailView from django.shortcuts import render,get_object_or_404 # from .tables import ProductTable from django_tables2 import RequestConfig from .models import ProductAccessory class ProductDetailAccessoryS...
null
src/ProductAccessory/views.py
views.py
py
2,152
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.DetailView", "line_number": 11, "usage_type": "name" }, { "api_name": "models.ProductAccessory.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.ProductAccessory.objects", "line_number": 12, "usage_type": "a...
123605001
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'carrots_blog.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^$', 'pos...
null
carrots_blog/carrots_blog/urls.py
urls.py
py
474
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 4, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api...
246334689
background_image_filename='sushiplate.jpg' mouse_image_filename="fuji.png" ###制定图像文件名称 import pygame from pygame.locals import * from sys import exit ##导入一些常用的函数和变量 #pygame.init() ##初始化pygame,为使用硬件做准备 pygame.display.set_mode((640,480),0,32) #创建了一个窗口 pygame.display.set_caption('hello, world') ##设置窗口标题 background=pygame....
null
py_example.py
py_example.py
py
1,546
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.display.set_caption", "line_number": 12, "usage_type": "call" }, { "api_name":...
217288326
from src.extractors.txt_extractor import TXTExtractor from os.path import join import luigi, os, json class TXTTransformer(luigi.Task): def requires(self): return TXTExtractor() def run(self): result = [] for file in self.input(): with file.open() as txt_file: ...
null
gestor-de-datos-master/src/transformers/txt_transformer.py
txt_transformer.py
py
1,741
python
en
code
null
code-starcoder2
76
[ { "api_name": "luigi.Task", "line_number": 5, "usage_type": "attribute" }, { "api_name": "src.extractors.txt_extractor.TXTExtractor", "line_number": 8, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 44, "usage_type": "call" }, { "api_name": "os...
285626268
""" Copyright (c) 2016-2020 The scikit-optimize developers. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of cond...
null
entmoot/optimizer/entmoot_minimize.py
entmoot_minimize.py
py
14,729
python
en
code
null
code-starcoder2
76
[ { "api_name": "copy.copy", "line_number": 234, "usage_type": "call" }, { "api_name": "inspect.currentframe", "line_number": 234, "usage_type": "call" }, { "api_name": "inspect.currentframe", "line_number": 235, "usage_type": "call" }, { "api_name": "collections.It...
544243358
import cmath import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation def trapesmetoden(xlist, ylist): I = 0 for i in range(len(xlist)-1): I += (xlist[i+1]-xlist[i])*(ylist[i+1]+ylist[i])/2 return I m = 9.11e-31 dx = 1.0E-10 V0 = 2e-19 E0 = V0 N = 10 hbar = ...
null
s4/kvante-TFY4215/Oblig øv 1/PmellomBarriere.py
PmellomBarriere.py
py
3,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.asarray", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.linalg.eigh", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 46, "usage_type": "attribute" }, { "api_name": "numpy.asarray", ...
179026267
import argparse import os import requests import json import time import library.migrationlogger as migrationlogger import library.localstore as store from library.utils import get_next_url logger = migrationlogger.get_logger(os.path.basename(__file__)) get_labels_url = 'https://api.newrelic.com/v2/labels.json' get_m...
null
fetchlabels.py
fetchlabels.py
py
4,220
python
en
code
null
code-starcoder2
76
[ { "api_name": "library.migrationlogger.get_logger", "line_number": 11, "usage_type": "call" }, { "api_name": "library.migrationlogger", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.basename", "line_number": 11, "usage_type": "call" }, { "api_n...
601015199
import cv2 def takeSnapshot(): videoCaptureObject = cv2.VideoCapture(0) result = True while(result): ret,frame = videoCaptureObject.read() print (ret) cv2.imwrite('newpicture.jpg',frame) result = False videoCaptureObject.release() cv2.destroyAllWindows() takeSnapshot...
null
takeSnapshots.py
takeSnapshots.py
py
323
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_number": 12, "usage_type": "call" } ]
524326813
#!/usr/bin/python # Author: Aaron Daugherty, Stanford University # The following program will pull out any fastq reads matching a provided index within a specified number of mismatches ##### IMPORT MODULES ##### # import necessary for python from __future__ import print_function import os import re import s...
null
ATAC_scripts/matchIndexInFastq.py
matchIndexInFastq.py
py
3,811
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 43, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_...
615099754
from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Date, Text from datetime import datetime from sqlalchemy.orm import sessionmaker from datetime import datetime, timedelta import random engine = create_engine('sqlite:///card.s3...
null
Simple Banking System/task/banking/banking.py
banking.py
py
7,371
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 16, "usage_type": "call" }, {...
290373720
import numpy as np from multiprocessing import cpu_count import sys import os import mandelfortran import imagefortran import time import argparse #This is probably poor form. But now it runs on a computer where I don't have the priviliges to use pip! try: import imageio has_imageio = True except ImportError: from P...
null
multithread_mandel.py
multithread_mandel.py
py
22,165
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 115, "usage_type": "call" }, { "api_name": "numpy.real", "line_number": 116, "usage_type": "call" }, { "api_name": "numpy.imag", "line_number": 117, "usage_type": "call" }, { "api_name": "sys.platform", "...
129728248
import numpy as np import pandas as pd import pickle import lifelines from lifelines import KaplanMeierFitter import matplotlib import matplotlib.pyplot as plt with open('../data/bootout_conv.pkl', 'rb') as f: inputdata_list=pickle.load(f) y_orig = inputdata_list[0] preds_bootfull = inputdata_list[1] inds_inbag = inpu...
null
demo/demo_KMplot.py
demo_KMplot.py
py
1,336
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_numb...
380651797
''' read any file and add the lines at the end of file Ex: read serializer.yml file and add lines ''' import argparse parser = argparse.ArgumentParser() parser.add_argument('--filename',dest="filename", default ="serializer.yml",help="name of the file") lines = ['\n', " "+'remote_user: admin\n'," "+'port: 22\n'," "...
null
plexus/tests/ads-mmtest/lib/utils/add_line.py
add_line.py
py
582
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" } ]
38404304
import numpy as np import pandas as pd import matplotlib as mpl mpl.use('TkAgg') import matplotlib.pyplot as plt from datetime import datetime from lstm import * from ts_algorithms import * #get the df in shape df = pd.read_csv("mawi-96hour.csv") df = df[['Time', 'Traffic (GB)']] df['Time'] = pd.to_datetime(df['Time']...
null
deeplearning/LSTM.py
LSTM.py
py
3,013
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.to_numeric", ...
339609878
''' Measure how consistent data is given a csv, check: shape consistency: for every row, does the row have the same number of columns as the rest of the rows? type consistency: for each row, does the data have the same type as most of the rest of the data (boolean, int, float, text?) value...
null
clean_data.py
clean_data.py
py
5,969
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 74, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 153, "usage_type": "call" }, { "api_name": "sys.argv"...
135271819
from django.shortcuts import render, redirect, get_object_or_404 from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib.auth import login, authenticate from django.db import transaction # Used to generate a ...
null
addrbook/views.py
views.py
py
7,467
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 25, "usage_type": "call" }, { "api_name": "addrbook.models.Entry.objects.filter", "line_number": 28, "usage_type": "call" }, { "api_name": "addrbook.models.Entry.objects", "line_number": 28, "usage_type": "attribute"...
621108476
""" script pareses taxonomer output for processing through DESeq """ import argparse #std python imports import os import sys import re import glob import numpy as np ############### #GLOBALs ############### parser=argparse.ArgumentParser(description="script pareses taxonomer output into experiment count matrix") ...
null
generate_count_matrix.py
generate_count_matrix.py
py
3,901
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 103, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 106, "usage_type": "call" }, { "api_name": "numpy.array", "...
326265070
import gym import gym_gridworld import numpy as np import random import matplotlib.pyplot as plt import statistics # Initialization gamma = 0.9 alpha = 0.05 epsmin = 0.01 decay_rate = 0.995 episodes = 2000 exp = 50 avg_t = [[0 for i in range(episodes)] for j in range(exp)] avg_r = [[0 for i in range(episodes)] for j i...
null
Gridworld/SARSA/SARSA.py
SARSA.py
py
2,719
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.rand", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 24, "usage_type": "attribute" }, { "api_name": "random.randrange", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random.cho...
39719238
import numpy as np import cv2 import time import os from skimage.feature import hog from functions import * import matplotlib.pyplot as plt from scipy.ndimage.measurements import label class FindCar: def __init__(self, clf, scaler, color_space='RGB', spatial_size=(32, 32), hist_bins=32, ...
null
find_car_fast.py
find_car_fast.py
py
8,757
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.resize", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 46, "usage_type": "call" }, { "api_name": "time.time", "line_number": 65, "usage_type": "call" }, { "api_name": "time.time", "line_number": 69, ...
271793643
import pandas as pd import numpy as np import lightgbm as lgb from sklearn.metrics import roc_auc_score from sklearn.model_selection import StratifiedKFold from sklearn.feature_selection import VarianceThreshold from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler,LabelEncoder ...
null
machine_learning/Kesci_Bank/Method1.py
Method1.py
py
9,336
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.re...
253383881
# # Copyright (c) 2019-2020, RTE (https://www.rte-france.com) # See AUTHORS.txt # # This Source Code Form is subject to the terms of the Apache License, version 2.0. # If a copy of the Apache License, version 2.0 was not distributed with this file, # you can obtain one at http://www.apache.org/licenses/LICENSE-2....
null
IEC_LN.py
IEC_LN.py
py
39,233
python
en
code
null
code-starcoder2
76
[ { "api_name": "IEC_PrivateSupport.DynImport", "line_number": 37, "usage_type": "call" }, { "api_name": "IEC61850_XML_Class.IED.AccessPoint.Server.LN", "line_number": 83, "usage_type": "call" }, { "api_name": "IEC61850_XML_Class.IED.AccessPoint", "line_number": 83, "usage_...
346793013
from django.conf.urls import patterns, include, url urlpatterns = patterns('company.views', # Examples: # url(r'^$', 'LancersApp.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^home/$', 'Home'), url(r'^jobs/$', 'Jobs'), )
null
company/urls.py
urls.py
py
298
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 3, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" } ]
429509110
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from odoo.exceptions import Warning from odoo import models, fields, api, _ class LoyaltyGroupActivatePaymentInvoiceLine(models.TransientModel): """ Modal Class for Group Definition """ _name = 'loyalty.group.activate.wizard.line'...
null
loyalty/wizard/group_activation_wiz.py
group_activation_wiz.py
py
4,087
python
en
code
null
code-starcoder2
76
[ { "api_name": "odoo.models.TransientModel", "line_number": 7, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 7, "usage_type": "name" }, { "api_name": "odoo.fields.Many2one", "line_number": 30, "usage_type": "call" }, { "api_name": "odoo.f...
1930723
import pyttsx3 #pip install pyttsx3 import datetime import speech_recognition as sr #pip install SpeechRecognition import wikipedia #if you want wikipedia results pip install wikipedia import webbrowser import os import smtplib import random import requests, json engine= pyttsx3.init('sapi5') #sapi5 is a w...
null
killwish.py
killwish.py
py
7,482
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyttsx3.init", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "speech_reco...
597806005
from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5 import QtCore, QtWidgets from pytube import YouTube from os import listdir from threading import Thread import sys import vlc import random import subprocess class MusicDisplay(QWidget): def __init__(self): super().__init__() s...
null
KorMusic.py
KorMusic.py
py
2,713
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytube.YouTube", "line_number": 43, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 45, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 52, "usage_type": "call" }, { "api_name": "os.listdir", "line...
380118312
""" Instructions: This game starts with updating the board in init(). The dictionary keys represent land position and dictionary values represent land resources, which is a list of: 1. the color of the land 2. plant type 3. how many days are left before the plant is ready to be harvest. This game will ask you to enter ...
null
util.py
util.py
py
17,339
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.OrderedDict", "line_number": 36, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 54, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 216, "usage_type": "call" }, { "api_name": "copy.d...
98229543
import os import subprocess import sys from glob import glob from time import time from datetime import datetime as dt, timedelta import platform if platform.system() == 'Windows': splitter = '\\' else: splitter = '/' base = splitter.join(__file__.split(splitter)[:-2]) if base not in sys.path: sys.path.app...
null
src/processing/regrid_model_data.py
regrid_model_data.py
py
2,770
python
en
code
null
code-starcoder2
76
[ { "api_name": "platform.system", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_num...
316633913
import asyncpg import asyncio import time class database(object): def __init__(self, **kwargs): self.pool = asyncio.get_event_loop().run_until_complete(self.new_connection(**kwargs)) @classmethod async def new_connection(self, **kwargs): return await asyncpg.create_pool(user=kwargs.pop("u...
null
bot/utils/database.py
database.py
py
2,009
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.get_event_loop", "line_number": 8, "usage_type": "call" }, { "api_name": "asyncpg.create_pool", "line_number": 12, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 51, "usage_type": "call" }, { "api_name": "time.perf...
233933019
import ply.yacc as yacc import AST from lex4 import tokens #VERSION 1 #def p_program(p): # '''program : statement # | statement SEMI_COLON program''' # #print(*p) # p[0] = p[1] #VERSION 2 def p_programme_statement(p): '''program : statement''' p[0] = AST.ProgramNode(p[1]) #VERSION 2 def p_program_recursive(p): ...
null
compilation/Projet_PLY/02_TP/parser4.py
parser4.py
py
2,479
python
en
code
null
code-starcoder2
76
[ { "api_name": "AST.ProgramNode", "line_number": 16, "usage_type": "call" }, { "api_name": "AST.ProgramNode", "line_number": 21, "usage_type": "call" }, { "api_name": "AST.TokenNode", "line_number": 36, "usage_type": "call" }, { "api_name": "AST.AssignNode", "l...
8366508
import logging from galaxy import util from galaxy.model import tool_shed_install from galaxy.web import url_for from galaxy.web.framework.helpers import grids, iff from tool_shed.util import repository_util log = logging.getLogger(__name__) def generate_deprecated_repository_img_str(include_mouse_over=False): ...
null
lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
admin_toolshed_grids.py
py
12,725
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "galaxy.web.url_for", "line_number": 17, "usage_type": "call" }, { "api_name": "galaxy.web.url_for", "line_number": 25, "usage_type": "call" }, { "api_name": "galaxy.web.url...
419277077
import requests from bs4 import BeautifulSoup import config from spotipy.oauth2 import SpotifyOAuth import spotipy import datetime API_KEY = config.api_key API_SECRET = config.api_secret def get_date(): date_str = input("Which year do you want to travel to? Type the date in this format YYYY-MM-DD: ") return...
null
main.py
main.py
py
2,061
python
en
code
null
code-starcoder2
76
[ { "api_name": "config.api_key", "line_number": 9, "usage_type": "attribute" }, { "api_name": "config.api_secret", "line_number": 10, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.BeautifulS...
450488468
import re from datetime import datetime from typing import Dict, Iterator from bs4 import Tag from .step import Step class SpeechProvider(Step): """ Extracts all information from a speech tag and provides it as a Python dictionary """ def __init__(self, tag_provider: Iterator[Tag]): self._t...
null
src/steps/speech.py
speech.py
py
1,454
python
en
code
null
code-starcoder2
76
[ { "api_name": "step.Step", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Iterator", "line_number": 15, "usage_type": "name" }, { "api_name": "bs4.Tag", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Iterator", "line_number"...
374654540
from dataclasses import dataclass, field from enum import Enum from typing import ClassVar, Literal from xsdata.formats.dataclass.models.elements import XmlType from ...enum import ElementPrefix, ItemType from .abstract import ItemCommon @dataclass(eq=False) class AuthorCommon(ItemCommon): class Type(Enum): ...
null
mugimugi_client_api_entity/common/item/author.py
author.py
py
879
python
en
code
null
code-starcoder2
76
[ { "api_name": "abstract.ItemCommon", "line_number": 12, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 13, "usage_type": "name" }, { "api_name": "enum.ItemType.AUTHOR", "line_number": 14, "usage_type": "attribute" }, { "api_name": "enum.ItemType...
608670868
import json import requests from django.shortcuts import render from django.contrib.auth.decorators import login_required @login_required def news(request): search = request.GET.get("search") response = requests.get("http://watcha.net/home/news.json?page=1&per=50") news_dict = json.loads(response.text) ...
null
wpsblog/wpsblog/views/news.py
news.py
py
565
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.auth.d...
311930483
import json import urllib.request import urllib.parse from twilio.rest import Client def dispatch_sms(message, number, source, apikey = None, from_v = None, auth_token = None, account_sid = None): if source == "textlocal": data = urllib.parse.urlencode({'apikey': apikey , 'numbers': number,'message' : me...
null
app/sms_util.py
sms_util.py
py
1,052
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.parse.urlencode", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.request.parse", "line_number": 9, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 9, "usage_type": "name" }, { "api_name": "...
160547443
from __future__ import print_function import argparse from os.path import join import cifar_utils as ut def get_args(): """get args from console.""" # get args. parser = argparse.ArgumentParser(description='Parse CIFAR10') parser.add_argument('--data_dir', default='None') # parse args. args ...
null
dl-dataset/code/dataset/cv/cifar/cntk_cifar/install_cifar10.py
install_cifar10.py
py
1,136
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "cifar_utils.loadData", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "cifar_utils...
514322067
#! -*- coding: utf-8 -*- import pandas as pd import numpy as np from keras.datasets import cifar10 unseen_class = [0] def split_dataset(args): xdata, ydata, uc = args index = [] unseen_x = [] unseen_y = [] for i in range(len(ydata)): if(ydata[i] in uc): index.append(i)...
null
data/cifar10_dataset_split.py
cifar10_dataset_split.py
py
928
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.delete", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.delete", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.row_stack", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.datasets.cifar10.load...
523925340
import json import logging import pytest from resources.test_support.helm import ChartDeployment, HelmChart @pytest.fixture(scope="class") def skuid_chart(request, helm_adaptor): chart_values = { 'ingress.enabled': 'true' } request.cls.chart = HelmChart("skuid", helm_adaptor, initial_chart_value...
null
pre-deployment/tests/skuid_chart_test.py
skuid_chart_test.py
py
6,723
python
en
code
null
code-starcoder2
76
[ { "api_name": "resources.test_support.helm.HelmChart", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 19, "usage_type": "call" }, { "api_name": "reso...
400134405
import json if __name__ == "__main__": with open("news_type.json", "r") as f: news_type = json.load(f) with open("news_wc.json", "r") as f: news_wc = json.load(f) wc_global = [{} for i in range(5)] for date in news_wc: for idx in range(len(news_wc[date])): wc =...
null
proj/news_theme.py
news_theme.py
py
1,838
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 55, "usage_type": "call" } ]
407775001
# get a dataframe with the member badge Key and corresponding background field and affiliation import pandas as pd import seaborn as sns import matplotlib.pyplot as plt def run_all(attendees_metadata,members_metadata,tmp_m2ms,time_period): background = pd.DataFrame(columns=['name','badge','background','affil...
null
URMC_CTSI_openbadge_analysis/member_to_member_function.py
member_to_member_function.py
py
8,297
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.concat", "li...
647752249
#! /usr/bin/env python import desir import os import pathlib # make annotated back covers cur_directory = pathlib.Path(os.environ["DESIR"], "exg", "py") script = pathlib.Path(cur_directory, "make-desir-annotated-back-covers.py") os.system(script) # make annotated parts input_directory = pathlib.Path(os.environ["DESI...
null
desir/etc/scr/make-desir-annotated-parts.py
make-desir-annotated-parts.py
py
1,430
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "os.system", "line_number":...
518191474
import re import random from operator import itemgetter import core.module as module import modules.CashmoneyModule as cash def is_int(input): return re.match(r"[-+]?\d+$", input) is not None STATE_IDLE = "idle" STATE_INGAME = "running game" STATE_FINISHED = "finishing game" STATE_COOLDOWN = "cooling down" clas...
null
botv3/modules/BetModule.py
BetModule.py
py
8,038
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.match", "line_number": 9, "usage_type": "call" }, { "api_name": "core.module.strip_name", "line_number": 39, "usage_type": "call" }, { "api_name": "core.module", "line_number": 39, "usage_type": "name" }, { "api_name": "core.module.send_message_n...
193398572
import unittest from utils import encode, decode, create_marker class TestStringMethods(unittest.TestCase): def test_encode_decode(self): teststring = 'DD1234' self.assertEqual(teststring, decode(encode(teststring))) @unittest.skip("fails in travis") def test_markers(self): self....
null
test_utils.py
test_utils.py
py
426
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "utils.decode", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.encode", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.create_marker", ...
385479666
from django import template from lfs.catalog.models import Product from lfs.history.models import UserHistory from django.conf import settings from lfs.catalog.settings import VARIANT register = template.Library() @register.inclusion_tag('lfs/history/last_seen.html', takes_context=True) def get_last_seen_products()...
null
lfs/history/utils.py
utils.py
py
1,570
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 9, "usage_type": "call" }, { "api_name": "django.template", "line_number": 9, "usage_type": "name" }, { "api_name": "lfs.catalog.models.Product.objects.filter", "line_number": 15, "usage_type": "call" }, { "a...
417527864
import cv2 import glob def png_to_bmp(full_dir): for file in glob.glob(full_dir + "*.png"): img = cv2.imread(file) cv2.imwrite(file[:-3] + "bmp", img) def bmp_to_png(full_dir): for file in glob.glob(full_dir + "*.bmp"): img = cv2.imread(file) cv2.imwrite(file[:-3] + "png", img...
null
diplom_test/unused_code/convert_png_and_bmp.py
convert_png_and_bmp.py
py
405
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 7, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 11, ...