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
507594701
import quandl import pandas as pd import matplotlib.pyplot as plt import numpy as np #from alpha_vantage.timeseries import TimeSeries #import AVdataformatter as tf #import AVapikeys as rkey import seaborn as sns ''' ts = TimeSeries(key=rkey.get_AV_key(), output_format='pandas') aapl, meta_data = ts.get_da...
null
PycharmProjects/Python Scripts/portfolio_optimization_code_along.py
portfolio_optimization_code_along.py
py
4,695
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
503862673
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('catalog', '0001_initial'), ] operations = [ migrations.AlterField( model_name='shoes', name='decript...
null
catalog/migrations/0002_auto_20150529_1738.py
0002_auto_20150529_1738.py
py
644
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
266592845
from db.models import Pub from db.management.loaders.Chado.Pub import ChadoPubManager from db.management.loaders.Chado.Cv import ChadoCvManager from django.core.exceptions import ObjectDoesNotExist import re import sys import logging from Bio import Entrez, Medline # Get an instance of a logger logger = logging.getLog...
null
django_template/local_apps/db/management/loaders/Publication.py
Publication.py
py
5,405
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 32, "usage_type": "call" }, { "api_name": "db.management.loaders.Chado.Cv.ChadoCvManager", "line_number": 34, "usage_type": "call" }, { "api_name...
78536285
#!/usr/bin/env python #Author: Duncan Campbell #January 28, 2015 #Yale University #plot the central quenched fraction #load packages from __future__ import print_function import numpy as np import h5py import matplotlib.pyplot as plt import custom_utilities as cu from custom_utilities.cython_utilities.match2 import m...
null
quenched_fractions/plot_fq_cen.py
plot_fq_cen.py
py
3,734
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "custom_utilities.get_output_path", "line_number": 32, "usage_type": "call" }, { "api_n...
340411180
import matplotlib.pyplot as plt import numpy as np from matplotlib.patches import Ellipse figure(figsize=(8,8)) ax=subplot(aspect='equal') bg = (250, 241, 220) x = Ellipse((1, 1), 2, 2) y = Ellipse((1, 1), 1, 1) ax.add_artist(x) ax.add_artist(y) plt.xlim(-2, 4) plt.ylim(-1, 3) plt.show()
null
Mapa/prueba_elipse.py
prueba_elipse.py
py
320
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.patches.Ellipse", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.patches.Ellipse", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.xlim", "line_number": 19, "usage_type": "call" }, { "api_...
52876434
#%% Diffusion / Impedance Test Script machine = "work" import os if machine == "home": codepath = r"D:\masterthesis\implementations\model_1\code" solutions_path = r"D:\masterthesis\implementations\model_1\solutions" input_files_path = r"D:\masterthesis\implementations\model_1\input_files" elif m...
null
scripts/model1_simulation_script.py
model1_simulation_script.py
py
10,627
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.use", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rc", "line_nu...
287170430
import tweepy # Twitter API Library import sys # Allow Python to interact with more functions import re # Support regular expression (such as white space characters) through libraries import csv # Reading and writing data from CSV files from textblob import TextBlob # Sentiment Analysis import matplotlib.pyplot as plt...
null
twitter.py
twitter.py
py
4,640
python
en
code
null
code-starcoder2
76
[ { "api_name": "tweepy.OAuthHandler", "line_number": 30, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 32, "usage_type": "call" }, { "api_name": "tweepy.Cursor", "line_number": 40, "usage_type": "call" }, { "api_name": "csv.writer", "line_n...
386448989
# -*- coding: utf-8 -*- """ Created on Thu Mar 4 12:29:21 2021 @author: aduell """ #import numpy as np from numpy import pi, linspace, array, exp #import tmm from tmm import inc_tmm, inc_absorp_in_each_layer, inf #import pandas as pd #import tmm_vw as tmm #import matplotlib.pyplot as plt from matplotlib.pyplot impo...
null
tmmPCECalc.py
tmmPCECalc.py
py
20,644
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 42, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 47, "usage_type": "call" }, { "api_name": "wpv.Layer", "line_n...
531070842
#!/usr/bin/env python from setuptools import setup, find_packages def readme(): with open('README.md') as f: return f.read() with open('LICENSE') as f: license = f.read() setup( name='regulus', version='0.4.0', description='Regulus', long_description=readme(), author='Yarden Li...
null
setup.py
setup.py
py
720
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 14, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 24, "usage_type": "call" } ]
63406615
from collections import Counter from itertools import chain import os import pickle from string import digits import time import h5py import numpy as np import pandas as pd from keras.preprocessing import image from keras.models import Model from keras.applications.inception_v3 import preprocess_input from keras.appl...
null
data_handler.py
data_handler.py
py
8,473
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_table", "line_number": 50, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 51, "usage_type": "call" }, { "api_name": "numpy.random.shuffle", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.random", ...
499690168
############################################################################### ## ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary for...
null
vistrails_current/vistrails/db/versions/v0_9_1/persistence/sql/sql_dao.py
sql_dao.py
py
6,156
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date", "line_number": 57, "usage_type": "call" }, { "api_name": "time.strptime", "line_number": 57, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 62, "usage_type": "call" }, { "api_name": "time.strptime", "li...
112349272
from collections import Counter from itertools import product from math import factorial from sys import stdin from typing import Any # MARKDOWN_NORMAL def count_combinations(n: int, r: int) -> int: if r < 0 or r > n: return 0 elif r == n or r == 0: return 1 return factorial(n) // (factori...
null
docs/data/learn/Modeling/input/stats_code/combinatorics/Combinations.py
Combinations.py
py
2,393
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.factorial", "line_number": 14, "usage_type": "call" }, { "api_name": "math.factorial", "line_number": 54, "usage_type": "call" }, { "api_name": "math.factorial", "line_number": 57, "usage_type": "call" }, { "api_name": "itertools.product", ...
78532966
from django.shortcuts import render from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from wagtail.core.models import Page from wagtail.search.models import Query from django.db.models import Q from contentmanager.models import DefaultPage def search(request): # Search search_query = re...
null
contentmanager/views.py
views.py
py
1,135
python
en
code
null
code-starcoder2
76
[ { "api_name": "contentmanager.models.DefaultPage.objects.live", "line_number": 13, "usage_type": "call" }, { "api_name": "contentmanager.models.DefaultPage.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "contentmanager.models.DefaultPage", "line_numbe...
40875472
import atexit import datetime import logging import time from selenium import webdriver from collections import namedtuple from pyvirtualdisplay import Display from controller import PiManager, PS from threading import Thread __author__ = 'Jase' DawnDusk = namedtuple('DawnDusk', ['dawn', 'dusk']) class Server: ...
null
server.py
server.py
py
3,430
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 22, "usage_type": "attribute" }, { "api_name": "logging...
134436298
import os try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # R...
null
pypi_install_script/ritremixerator-0.3.tar/setup.py
setup.py
py
1,317
python
en
code
null
code-starcoder2
76
[ { "api_name": "ez_setup.use_setuptools", "line_number": 6, "usage_type": "call" }, { "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.dirname", ...
1646160
# -*- coding: utf-8 -*- from __future__ import unicode_literals import time, os import errno from random import randint from django.conf import settings from django.db import models from django.template.loader import render_to_string from django.utils import timezone from django.utils.text import slugify from django...
null
medical_record/models.py
models.py
py
8,422
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 35, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 35, "usage_type": "name" }, { "api_name": "django.db.models.TextField", "line_number": 36, "usage_type": "call" }, { "api_name"...
653218050
from doajtest.helpers import DoajTestCase from portality.formcontext import render, formcontext from wtforms import Form, StringField, SelectMultipleField, widgets ################################################################ # Form context for basic test ############################################################...
null
doajtest/unit/test_formrender.py
test_formrender.py
py
6,648
python
en
code
null
code-starcoder2
76
[ { "api_name": "wtforms.Form", "line_number": 9, "usage_type": "name" }, { "api_name": "wtforms.StringField", "line_number": 10, "usage_type": "call" }, { "api_name": "wtforms.StringField", "line_number": 11, "usage_type": "call" }, { "api_name": "portality.formcon...
500172476
import pandas as pd import os import numpy as np import cv2 from urllib.request import urlretrieve import zipfile import time import sys dirnames = [] for dirname in os.getcwd().split('/'): dirnames.append(dirname) if dirname == 'tinyimagenet': break DATA_DIR = "/".join(dirnames+['data']) DOWNLOAD_URL ...
null
dataset.py
dataset.py
py
3,410
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.join", "lin...
531285352
from drender import render from employee.models import Employee, PayRate from django.http import HttpResponseNotAllowed from payem.forms import CalculateForm from django.shortcuts import get_object_or_404 @render('payem/payem.html') def payem(request): employees = Employee.objects.all() form = CalculateForm() ...
null
payem/views.py
views.py
py
1,036
python
en
code
null
code-starcoder2
76
[ { "api_name": "employee.models.Employee.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "employee.models.Employee.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "employee.models.Employee", "line_number": 9, "usage_type": "name...
553482370
from construct import * from eagle_adapters import * from utils import HexLineAdapter from utils import to_bin UNKNOWN = Struct("UNKNOWN", HexLineAdapter(Field("data", 22)), ) ROTATION = Embed(RotationAdapter( BitStruct("rot_flags", BitField("rot_low", 8), Padding(1), BitField("swap",...
null
upconvert/construct/eagle/flrecords.py
flrecords.py
py
12,939
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.HexLineAdapter", "line_number": 8, "usage_type": "call" } ]
247070066
import yaml from appium import webdriver from appium.webdriver.common.mobileby import MobileBy from appium.webdriver.webdriver import WebDriver from appium_po.page.base_page import BasePage from appium_po.page.main_page import MainPage # 进入通讯录 with open("../data/caps.yml",encoding='utf-8') as f: datas = yaml.safe_...
null
appium_po/page/app.py
app.py
py
916
python
en
code
null
code-starcoder2
76
[ { "api_name": "yaml.safe_load", "line_number": 10, "usage_type": "call" }, { "api_name": "appium_po.page.base_page.BasePage", "line_number": 16, "usage_type": "name" }, { "api_name": "appium.webdriver.Remote", "line_number": 19, "usage_type": "call" }, { "api_name...
2165244
import time import unittest from google.appengine.ext import ndb from google.appengine.ext import testbed from main import app from models import User, Ingredient #set up the testing environment once on module load testBed = testbed.Testbed() testBed.activate() testBed.init_datastore_v3_stub() testBed.init_memcache_...
null
main_test.py
main_test.py
py
7,987
python
en
code
null
code-starcoder2
76
[ { "api_name": "google.appengine.ext.testbed.Testbed", "line_number": 11, "usage_type": "call" }, { "api_name": "google.appengine.ext.testbed", "line_number": 11, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "attribute" }, ...
142986501
import numpy as np from sympy import * import base64 from io import BytesIO x = Symbol('x') def quaraticdiagram(function, arr_fig, point, delta): a = arr_fig[0] b = arr_fig[1] c = arr_fig[2] x_diagram_min = point[0] + delta x_diagram_max = point[0] - delta if a > 0: y_diagram_min = point...
null
source/service/math/Solver/FE_Quadratic_Function_Diagram.py
FE_Quadratic_Function_Diagram.py
py
939
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.BytesIO", "line_number": 22, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 25, "usage_type": "call" } ]
277880097
# -*- coding: utf-8 -*- import json import datetime import time from gevent.pywsgi import WSGIServer from geventwebsocket.handler import WebSocketHandler, Client from geventwebsocket.websocket import WebSocket from geventwebsocket import WebSocketError from flask import Flask, request, render_template app = Flask(_...
null
Backend/gevent-websocket-flask/app.py
app.py
py
2,508
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 22, "usage_type": "call" }, { "api_name": "geventwebsocket.websocket.WebSocket", "line_number": 26, "usage_type": "name" }, { "api_name": ...
602066016
##Includes relation-type specific matrix for decoding #Computes negative sampling during trained (not pre-saved as in previous versions) import os.path as osp import torch import torch.nn.functional as F from sklearn.metrics import roc_auc_score from torch_geometric.utils import negative_sampling import os os.envi...
null
graph_embedding/embedding_het_graph_paper_mesh_rel3.py
embedding_het_graph_paper_mesh_rel3.py
py
9,348
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.load", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 34, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "line_...
401685751
# -*- coding:utf-8 _*- """ @author:Administrator @file: alter_color_by_pixel.py @time: 2019/3/12 """ from captcha.image import ImageCaptcha from PIL import Image image = Image.open('../sample/randomimage1.jpg') print('p_mode',image.mode) print(image.getcolors()) pxdata_P = image.load() print('P_load',pxdata_P) im...
null
image_process/alter_color_by_pixel.py
alter_color_by_pixel.py
py
777
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" } ]
390981069
from kivy.lang import Builder from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.garden.graph import MeshLinePlot from kivy.clock import Clock from kivy.uix.widget import Widget from kivy.properties import StringProperty from kivy.properties import ListProperty from threading import Thread imp...
null
glassGUI/glassGUI.py
glassGUI.py
py
5,295
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyaudio.paInt16", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pyaudio.PyAudio", "line_number": 33, "usage_type": "call" }, { "api_name": "audioop.rms", "line_number": 50, "usage_type": "call" }, { "api_name": "kivy.uix.boxlayout.B...
619844203
import docker import util import time class ServiceResourceManager(object): """ Manages docker containers. :param docker.Client client: A docker client object :param str repository: The repository name for the image (registry/name) :param str name: The name of the docker container :param str v...
null
env/lib/python2.7/site-packages/dockhand/service.py
service.py
py
4,874
python
en
code
null
code-starcoder2
76
[ { "api_name": "docker.errors", "line_number": 98, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 110, "usage_type": "call" }, { "api_name": "docker.errors", "line_number": 129, "usage_type": "attribute" }, { "api_name": "util._get_containe...
643653504
# coding=utf-8 # 智城数据抓取 import datetime import re import sys import requests from bs4 import BeautifulSoup from com.parttimejob.db.mysqlclient import MysqlClient def parse(demands, key_word, webtype): # 创建数据库链接客户端 mysql_client = MysqlClient() for demand in demands: try: key_word = d...
null
com/parttimejob/taskcity.py
taskcity.py
py
2,696
python
en
code
null
code-starcoder2
76
[ { "api_name": "com.parttimejob.db.mysqlclient.MysqlClient", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 27, "usage_type": "call" }, { "api_nam...
618513374
"""resource_server URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') ...
null
resource_server/resource_server/urls.py
urls.py
py
2,135
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 18, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 18, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 26, "usage_type": "att...
549302361
import numpy as np import os from sklearn.metrics import average_precision_score from sklearn.metrics import matthews_corrcoef from sklearn.metrics import roc_auc_score import torch from utils.io import write metrics = dict( roc_auc=roc_auc_score, average_precision=average_precision_score, m_corr_coef=mat...
null
DanQ/utils/predictor.py
predictor.py
py
2,845
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.metrics.roc_auc_score", "line_number": 11, "usage_type": "name" }, { "api_name": "sklearn.metrics.average_precision_score", "line_number": 12, "usage_type": "name" }, { "api_name": "sklearn.metrics.matthews_corrcoef", "line_number": 13, "usage_type"...
426550300
import logging as log import time import re import json class AccountNotFound(Exception): pass class AnchorNotFound(Exception): pass class CannotCalculateChanges(Exception): pass class JmapApi: def __init__(self, db): self.db = db self.results = [] self.resultsByTag = {} ...
null
jmap/api.py
api.py
py
15,723
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.error", "line_number": 31, "usage_type": "call" }, { "api_name": "time.monotonic", "line_number": 55, "usage_type": "call" }, { "api_name": "time.monotonic", "line_number": 87, "usage_type": "call" }, { "api_name": "logging.info", "line_...
113945206
import argparse import cPickle import h5py import os import tensorflow as tf from util import log from vlmap import modules parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--data_dir', type=str, default='data/preprocessed/visualgen...
null
vlmap_memft/export_noc_word_weights.py
export_noc_word_weights.py
py
3,442
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { ...
168820094
import pickle import sacred from sacred.observers import MongoObserver from sacred.utils import apply_backspaces_and_linefeeds import torch import random import numpy as np import functools def load_pickle(fname): with open(fname, "rb") as f: return pickle.load(f) def write_pickle(o, fname): with ...
null
racer/utils.py
utils.py
py
2,676
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 28, "usage_type": "call" }, { "api_name": "functools.reduce", "lin...
524512068
import os from bottle import (get, post, redirect, request, route, run, static_file,error,template,jinja2_view) from jinja2 import Template import json import utils # testing with open('./data/143.json') as the_file: data = json.load(the_file) episodes = data['_embedded']['episodes'] # testing ...
null
main.py
main.py
py
1,666
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "bottle.static_file", "line_number": 22, "usage_type": "call" }, { "api_name": "bottle.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bottle.static_file", "line...
631947930
# -*- coding: utf-8 -*- """ Created on Wed May 6 23:07:33 2020 @author: jcantero """ # Regresión polinomica # Cómo importar las librerías import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importar el data set dataset = pd.read_csv('Position_Salaries.csv') x = dataset.iloc[:, 1:2].values y = ...
null
datasets/Part 2 - Regression/Section 6 - Polynomial Regression/polinomial_regression_jcantero.py
polinomial_regression_jcantero.py
py
1,701
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.PolynomialFeatures", "line_number": 27, "usage_type": "call" ...
306880716
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Frederico Ferreira' __version__ = 'v1.0 2016.09.01' from agente.controlo_estrategico import * import sys import traceback import subprocess import psutil import time import sqlite3 SLEEP_TIME = 5 def agent_db_connect(): db_name = r'..\web2py\applicatio...
null
agente_tester.py
agente_tester.py
py
8,324
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "psutil.Process", "line_number": 31, "usage_type": "call" }, { "api_name": "psutil.pids", "line_number": 31, "usage_type": "call" }, { "api_name": "subprocess.Popen", "li...
423774269
import os import pytest from httpie.input import ParseError from utils import TestEnvironment, http, httpbin, HTTP_OK from fixtures import FILE_PATH_ARG, FILE_PATH, FILE_CONTENT class TestMultipartFormDataFileUpload: def test_non_existent_file_raises_parse_error(self): with pytest.raises(ParseError): ...
null
tests/test_uploads.py
test_uploads.py
py
2,065
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytest.raises", "line_number": 12, "usage_type": "call" }, { "api_name": "httpie.input.ParseError", "line_number": 12, "usage_type": "argument" }, { "api_name": "utils.http", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.httpbin", ...
143896280
from pathlib import Path import json from typing import Dict, Any import requests from urllib.parse import urljoin from cachecontrol import CacheControl # type: ignore from .errors import BadRequest def get_data_model() -> Dict: """ Return a dictionary representation of the data model """ root = Path(__file__...
null
covid19_sfbayarea/data/utils.py
utils.py
py
1,741
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 9, "usage_type": "name" }, { "api_name": "cachecontrol.CacheControl", "li...
299898829
import os import glob import tqdm import numpy as np from astropy.io import ascii from itertools import compress import warnings from .path import _GAIA_TOOLS_DATA def read_spec_internal(source_ids, assume_unique, base_path, wavelength_grid): """ internal function to read spectra based on a list of source id...
null
gaia_tools/load/spec.py
spec.py
py
5,036
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_numb...
429842940
#录音学习 import pyaudio import wave import threading from tqdm import tqdm # 定义数据流块 # 要写入的文件名 # WAVE_OUTPUT_FILENAME = "output.wav" # 创建PyAudio对象 class MypyaudioThread(threading.Thread): def __init__(self,mode,wavpath): threading.Thread.__init__(self) self.bRecord = True self.wavpath=wavpath ...
null
ws/study/study_pyqudio/SoundRecord.py
SoundRecord.py
py
3,429
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 12, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 14, "usage_type": "attribute" }, { "api_name": ...
611352678
import mysql.connector from dotenv import load_dotenv import os import json load_dotenv() websiteDB = mysql.connector.connect( host = os.getenv("SERVER_HOST"), port = os.getenv("SERVER_PORT"), user = os.getenv("SERVER_USER"), password = os.getenv("SERVER_PASSWORD"), database = os.getenv("SERVER_DATABAS...
null
data/data.py
data.py
py
1,944
python
en
code
null
code-starcoder2
76
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 8, "usage_type": "attribute" }, { "...
45364931
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
null
python/raydp/context.py
context.py
py
5,130
python
en
code
null
code-starcoder2
76
[ { "api_name": "contextlib.ContextDecorator", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 44, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 45, "usage_type": "name" }, { "api_name": "raydp.utils.pars...
492822478
# -*-coding:utf-8 -*- from django.http import HttpResponse, Http404, HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response from articles.models import Article from TBES.brand.models import Brand from TBES.product.models import Product from TBES.order.models impo...
null
main/views.py
views.py
py
3,751
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render_to_response", "line_number": 12, "usage_type": "call" }, { "api_name": "django.template.RequestContext", "line_number": 13, "usage_type": "call" }, { "api_name": "articles.models.Article.objects.get", "line_number": 19, "usage_type":...
651200148
import torch import torch.nn as nn import torch.nn.functional as F from torch.optim import Adam import numpy as np import gym from gym.spaces import Discrete, Box from collections import deque import random import math import time device = torch.device('cpu') # torch.cuda.set_device(device) def mlp(sizes, activatio...
null
simple_q_imple.py
simple_q_imple.py
py
5,115
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn.ReLU", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.Identity", "lin...
618695914
# Python imports import os import unittest # Project Imports from utils import bq import tests.test_util as test_util from app_identity import PROJECT_ID from cdr_cleaner.cleaning_rules.unit_normalization import UnitNormalization, UNIT_MAPPING_TABLE from common import JINJA_ENV test_query = JINJA_ENV.from_string("""s...
null
tests/integration_tests/data_steward/cdr_cleaner/cleaning_rules/unit_normalization_test.py
unit_normalization_test.py
py
2,262
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.JINJA_ENV.from_string", "line_number": 12, "usage_type": "call" }, { "api_name": "common.JINJA_ENV", "line_number": 12, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "...
193592175
from collections import OrderedDict from functools import partial import itertools import logging import numpy as np import torch from torch.autograd import grad import time from artemis.general.display import sensible_str, deepstr from artemis.general.duck import Duck from artemis.general.nested_structures import s...
null
uoro_demo/torch_utils/training.py
training.py
py
15,303
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.max", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.eq", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 37, "u...
279765483
''' HASSMART Cover v0.5 by Jones 2018-10-14 ''' import time import socket import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from threading import Thread, Event from homeassistant.components.cover import (CoverDevice, DOMAIN, ATTR_POSITION, PLATFORM_SCHEMA) from h...
null
config/custom_components/hassmart/cover.py
cover.py
py
12,282
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "homeassistant.components.cover.PLATFORM_SCHEMA", "line_number": 32, "usage_type": "name" }, { "api_name": "homeassistant.components.cover.PLATFORM_SCHEMA.extend", "line_number": 32, ...
444046722
# -*- coding: utf-8 -*- import re import json import requests from _response import ParserResponse class Parser: """Parser API implementation of Readability""" Name = 'Readability' Version = '1.0.0' Endpoint = 'https://www.readability.com/api/content/v1/parser' def __init__(self, config): """Initialise the p...
null
worker/parser/_readability.py
_readability.py
py
1,001
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 22, "usage_type": "call" }, { "api_name": "_response.ParserResponse", "line_number": 23, "usage_type": "call" }, { "api_name": "re.sub", "line_n...
568895986
import pygame gameDisplay = pygame.display.set_mode((800, 800)) white = (250, 250, 250) green = (0, 255, 0) black = (0, 0, 0) grey = (0, 0, 0) red = (255, 0, 0) lightgray = (100, 100, 100) def createCanvas(): pygame.init() gameDisplay.fill(grey) running = True while running: for eve...
null
Ankles of Joe/Canvas.py
Canvas.py
py
641
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.display.set_mode", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 2, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.event.ge...
554902111
from django.test import TestCase from main import models class TestStatic(TestCase): """Проверка модели статики.""" def setUp(self) -> None: """Подготовка стенда.""" self.google = models.Static.objects.create( link="http:://google.com", description="TestStatic", slug="google" ...
null
main/tests/test_models/test_static.py
test_static.py
py
958
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "main.models.Static.objects.create", "line_number": 11, "usage_type": "call" }, { "api_name": "main.models.Static", "line_number": 11, "usage_type": "attribute" }, { "api...
528968049
from django.conf.urls.defaults import * from django.conf import settings from django.views.generic.simple import direct_to_template # pinax from pinax.apps.account.openid_consumer import PinaxConsumer handler500 = "pinax.views.server_error" from django.contrib import admin admin.autodiscover() from dajaxice.core imp...
null
src/urls.py
urls.py
py
2,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 10, "usage_type": "name" }, { "api_name": "dajaxice.core.dajaxice_autodiscover", "line_number": 13, "usage_type": "call" },...
28523657
from selenium import webdriver from selenium.webdriver.common.keys import Keys from time import sleep from bs4 import BeautifulSoup import pymysql # db에 저장할 함수 # 한번 화면에 담아서 # 팝업창 크롤링할 함수 driver = webdriver.Chrome(executable_path="chromedriver.exe") # home_page open driver.get("http://www.gbis.go.kr/gbis2014/schB...
null
newbus.py
newbus.py
py
1,465
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" }, { "api_name": "time.s...
345896110
import streamlit as st import pandas as pd import numpy as np import plotly.graph_objects as go import plotly.express as px import math import sys import os import requests st.set_page_config(page_title='eWorking Calculator', page_icon="https://raw.githubusercontent.com/Githubaments/Images/main/favicon.ico") st.subh...
null
venv/eWorking.py
eWorking.py
py
3,938
python
en
code
null
code-starcoder2
76
[ { "api_name": "streamlit.set_page_config", "line_number": 12, "usage_type": "call" }, { "api_name": "streamlit.subheader", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.beta_expander", "line_number": 16, "usage_type": "call" }, { "api_name": ...
352156811
''' By Kenneth Liu Date: 12/11/2020 ''' import pytest from other import clear from auth import auth_register from error import AccessError, InputError from channels import channels_create from other import clear from flockr_database_api import DataBase from channel import channel_invite from user import * import glob ...
null
project-backend/src/user_test.py
user_test.py
py
4,494
python
en
code
null
code-starcoder2
76
[ { "api_name": "auth.auth_register", "line_number": 30, "usage_type": "call" }, { "api_name": "auth.auth_register", "line_number": 36, "usage_type": "call" }, { "api_name": "auth.auth_register", "line_number": 42, "usage_type": "call" }, { "api_name": "channels.cha...
581180623
#!/usr/bin/env python # coding:utf-8 from typing import List, Set import sys def diffs(arr: List[int]) -> Set[int]: """ 配列を差分して絶対値を取り返す """ return {abs(v1-v2) for v1, v2 in zip(arr[1:], arr[:-1])} def is_jelly(n: int, arr: List[int]) -> bool: """ 配列がarrのdiffが1..n-1をもれなく重複なく取るか判定する """ ...
null
week1/10038_Jolly_Jumpers/anser.py
anser.py
py
653
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "sys.stdin", "line_number": 19, ...
147723114
import numpy as np import pandas as pd # 1. 데이터 train=np.load('./data/comp1_train.npy') test=np.load('./data/comp1_test.npy') from sklearn.model_selection import train_test_split from keras.layers import Dense, LSTM, Conv2D, MaxPooling2D, Flatten, Input from keras.models import Sequential, Model from sklearn.preproces...
null
data/dacon/comp1/dacon1_12_xgb_feat.py
dacon1_12_xgb_feat.py
py
2,917
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.load", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn....
238499532
#!/usr/bin/env python3 import os import shelve from itertools import repeat from multiprocessing import Pool import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.ticker import FuncFormatter levels = [0.00048828125, 0.0009765625, 0.001953125, 0.00390625, 0...
null
scripts/stats/error_rates_vs_signal_levels.py
error_rates_vs_signal_levels.py
py
4,411
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
79323611
import random import gym import numpy as np from collections import deque from keras.models import Sequential from keras.layers import Dense from keras.optimizers import Adam #from scores.score_logger import ScoreLogger ENV_NAME = "CartPole-v0" GAMMA = 0.95 TAU = 0.001 LEARNING_RATE = 0.001 MEMORY_SIZE = 100000 BAT...
null
DQNCartPole.py
DQNCartPole.py
py
3,157
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 31, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 33, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 35, "usage_type": "call" }, { "api_name": "keras.la...
247541526
import tempfile import warnings from os.path import join import numpy as np from csbdeep.data import RawData, create_patches, no_background_patches from csbdeep.data.transform import anisotropic_distortions from csbdeep.io import load_training_data from csbdeep.io import save_training_data from csbdeep.models import C...
null
dexp/processing/isonet/isonet.py
isonet.py
py
2,812
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "tempfile.gettempdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
535571515
import csv import datetime import os import time import unittest from urllib.parse import urlparse, parse_qs from xml.etree import ElementTree as ET import xlrd from faker import address from faker import company from faker import name from selenium import webdriver from pages.producer_center.login_page import Produc...
null
tests/products/SMOKE_NGP_USPRO_Producer_Create_Binder_PCI_Option.py
SMOKE_NGP_USPRO_Producer_Create_Binder_PCI_Option.py
py
12,513
python
en
code
null
code-starcoder2
76
[ { "api_name": "xlrd.open_workbook", "line_number": 97, "usage_type": "call" }, { "api_name": "utilities.Environments.Environments.Environments.return_environments", "line_number": 140, "usage_type": "call" }, { "api_name": "utilities.Environments.Environments.Environments", "...
618631446
import logging from datetime import datetime from pprint import pprint as pp from click import progressbar from pandas import DataFrame from scout.parse.ensembl import (parse_ensembl_exons, parse_ensembl_exon_request) from scout.build.genes.exon import build_exon LOG = logging.getLogger(__name__) def load_exons(a...
null
scout/load/exon.py
exon.py
py
2,037
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 32, "usage_type": "argument" }, { "api_name": "scout.parse.ensembl.parse_ensembl_exon_request", "line_number": 33, "usage_type": "call" }, { ...
450821212
# The Database that stores the information for all the transaction from collections import deque from flask import jsonify from transaction_entity import TransactionEntity class Database: points_database = {} transactions = deque() total_points = 0 status_code = 200 def __init__(self, arg1=None, ...
null
database.py
database.py
py
3,385
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" }, { "api_name": "transaction_entity.TransactionEntity", "line_number": 34, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 50, "usage_type": "call" } ]
46073679
import random import pygame pygame.init() screen_width = 900 screen_height = 600 # Creating window gameWindow = pygame.display.set_mode((screen_width,screen_height)) # Game Title pygame.display.set_caption("Snakes with Harry") pygame.display.update() # whenever you want to see the change in your window # Colors - RG...
null
tut17.py
tut17.py
py
2,938
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
338591034
import numpy as np from matplotlib import pyplot as plt from Mode import Mode from CurvesSampling import findKvForGivenListOfFrequenciesInMode class Waveform: def __init__(self, omegaPath, kvectPath, samplingFrequencies, numOfCurves, amplitude=1.0): self.modes = [] frequencies = ( np.load(omega...
null
Waveform.py
Waveform.py
py
1,470
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.full", "line_number": 1...
640022077
import commands import json import os import sys import pickle import signal from os.path import abspath as _abspath, join as _join import Interaction,Database,Logger # main Yoda class class Yoda: # constructor def __init__(self, globalWorkingDir, localWorkingDir): self.globalWorkingDir = globalWo...
null
HPC/pandayoda/yodacore/Yoda.py
Yoda.py
py
10,378
python
en
code
null
code-starcoder2
76
[ { "api_name": "Interaction.Receiver", "line_number": 19, "usage_type": "call" }, { "api_name": "Database.Backend", "line_number": 22, "usage_type": "call" }, { "api_name": "Logger.Logger", "line_number": 24, "usage_type": "call" }, { "api_name": "signal.signal", ...
589470055
''' @ Travis Drake (EklipZ) eklipz.io - tdrake0x45 at gmail) July 2019 Generals.io Automated Client - https://github.com/harrischristiansen/generals-bot EklipZ bot - Tries to play generals lol ''' import logging import time import json from ArmyAnalyzer import * from SearchUtils import * from collections import de...
null
BoardAnalyzer.py
BoardAnalyzer.py
py
5,422
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 56...
573976494
import requests def getSidoCode(strSidoName): if type(strSidoName) is not str: print('매게변수로 문자열을 넣으셔야 합니다. : getSidoCode') if type(strSidoName) is int: return strSidoName # 서울특별시 11 # 부산광역시 26 # 대구광역시 27 # 인천광역시 28 # 광주광역시 29 # 대전광역시 30 # 울산광역시 31 # 세종특별자치시 3...
null
test.py
test.py
py
3,399
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 71, "usage_type": "call" } ]
362524783
from numpy import expand_dims from tensorflow.keras.preprocessing.image import load_img, img_to_array, save_img, ImageDataGenerator import matplotlib.pyplot as plt img = load_img('images/1500.jpg') data = img_to_array(img) samples = expand_dims(data, 0) gen = ImageDataGenerator(brightness_range=[0.3, 1.7], ...
null
image_augmentation/unit_augmentation.py
unit_augmentation.py
py
863
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.preprocessing.image.load_img", "line_number": 5, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.image.img_to_array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.expand_dims", "line_number": 7, "usag...
612359563
import arcade window_width=200 window_height=250 window_title="Timer" class Timer(arcade.Window): def __init__(self,window_width,window_height,window_title): super().__init__() arcade.set_background_color(arcade.color.BLACK) self.time=100 def on_draw(self): arcade.start_render...
null
4.Auto timer/main.py
main.py
py
664
python
en
code
null
code-starcoder2
76
[ { "api_name": "arcade.Window", "line_number": 7, "usage_type": "attribute" }, { "api_name": "arcade.set_background_color", "line_number": 10, "usage_type": "call" }, { "api_name": "arcade.color", "line_number": 10, "usage_type": "attribute" }, { "api_name": "arcad...
184935572
import json import secrets import time from flask import jsonify from database import db_pynamodb as db from domains.models.entities.report_templates import ReportTemplate from infrastructures.database.models.report_template_model_pynamodb import ReportTemplateModel from manage import app def create_dat...
null
init_mock_pynamodb.py
init_mock_pynamodb.py
py
2,340
python
en
code
null
code-starcoder2
76
[ { "api_name": "manage.app.app_context", "line_number": 14, "usage_type": "call" }, { "api_name": "manage.app", "line_number": 14, "usage_type": "name" }, { "api_name": "infrastructures.database.models.report_template_model_pynamodb.ReportTemplateModel.delete_table", "line_num...
397799593
import sys import os import re from datetime import datetime from itertools import accumulate import argparse import logging from gitsuperlog import helper from gitsuperlog.defaults import EMPTY_TREE_SHA import git from git.compat import (defenc, PY3) from git.util import (Actor, Iterable, Stats, finalize_process) ...
null
gitsuperlog/main.py
main.py
py
5,124
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "git.Repo", "line_number": 32, "usage_type": "call" }, { "api_name": "gitsuperlog.defaults.EMPTY_TREE_SHA", "line_number": 84, "usage_type": "argument" }, { "api_name...
56776166
import datetime import logging import zlib import aiobotocore import botocore _LOGGER = logging.getLogger(__name__) STATE_NOT_EXISTING = "not_existing" STATE_OK = "ok" STATE_PRECONDITION_FAILED = "precondition_failed" class S3Bucket: def __init__(self, bucket_name, region_name="eu-west-1"): self._bucke...
null
tibber_aws/s3.py
s3.py
py
3,260
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "aiobotocore.get_session", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "call" }, { "api_name": "botocore.e...
191015577
# -*- coding: utf-8 -*- """ Created on Wed Jul 14 09:07:04 2021 @author: Kate.Harrison """ import pandas as pd import numpy as np import matplotlib.pyplot as plt from tkinter.filedialog import askopenfilename # Define constants and options fThresh = 40 #below this value will be set to 0. #stepLen = 45 #Set value t...
null
Python/AthleteFeedback_Agility.py
AthleteFeedback_Agility.py
py
8,971
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 95, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 97, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 106, "usage_type": "call" }, { "api_na...
112559241
from pylab import * import matplotlib as mpl mpl.rcParams['lines.linewidth'] = 1.5 import os import cPickle as pickle def pyload(filepath): with open(filepath, 'rb') as file_: return pickle.load(file_) # TODO: make a plot function that programmatically: # maximizes windows, # figure(figsize=(10,...
null
src/eval_itl_WIP.py
eval_itl_WIP.py
py
9,245
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.rcParams", "line_number": 3, "usage_type": "attribute" }, { "api_name": "cPickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 26, "usage_type": "call" }, { "api_name": "os.listdi...
588208026
# -*- coding: utf-8 -*- from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core import serializers from django.http.response import HttpResponse, Http404, HttpResponseRedirect from django.shortcuts import render from models import Profile from models import Request...
null
apps/task/views.py
views.py
py
3,675
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Profile.objects.first", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Profile.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.Profile", "line_number": 17, "usage_type": "name" }, { "api_name"...
536807464
import os, requests, subprocess, shutil, gzip from pathlib import Path from timeit import default_timer as timer import click import h5py import numpy as np from sklearn.decomposition import TruncatedSVD, PCA from tqdm.std import tqdm def download_file(url: str, file_path: Path): """ Downloads file from `...
null
xrun/data/prepare_sift10m.py
prepare_sift10m.py
py
3,188
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "tqdm.std.tqdm", "line_number": 24, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_numb...
355578914
"""Constructs daily time series of COVID-19 testing data for Myanmar. This module has been tested on tesseract v4.1.1. """ import os import re import requests import datetime import calendar from typing import List, Tuple from io import BytesIO from bs4 import BeautifulSoup import pandas as pd import pdfplumber import...
null
scripts/scripts/testing/automations/incremental/myanmar.py
myanmar.py
py
5,600
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.disable_warnings", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.NA", "line_number": 38, "usage_type": "attribute" }, { "api_name": "pandas.concat...
228459618
#!/bin/python #coding=utf-8 import time, threading, os, urllib2, sys import json from PIL import Image from pymouse import PyMouse reload(sys) sys.setdefaultencoding("utf-8") last_pr = None; cmds = None; def findInList(aid): global last_pr for(key, val) in last_pr: if val["aid"] == aid: return True return Fa...
null
bilibili.py
bilibili.py
py
2,824
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setdefaultencoding", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib2.Request", "line_number": 26, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 27, "usage_type": "call" }, { "api_name": "json.loads", ...
9385392
import sys import os from subprocess import Popen, PIPE, check_output import time import uuid from fabric.api import env, run, cd, get, hide, settings, remote_tunnel, show from fabric.tasks import execute from fabric.decorators import with_settings from datetime import timedelta from os.path import join as pj from jin...
null
mycluster/mycluster.py
mycluster.py
py
16,802
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
166591362
import torch from adabelief_pytorch import AdaBelief from TorchDiffEqPack import odesolve import numpy as np from matplotlib import pyplot as plt from scipy.io import loadmat import os import torch.nn as nn import numpy as np import pandas as pd import torch.nn.functional as F from torch.optim import Adam from scipy im...
null
test_code/multiple_shooting_adjoint/test_multiple_shoot_lotka_sigmoid.py
test_multiple_shoot_lotka_sigmoid.py
py
5,950
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 56, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number...
621827729
# -*- coding: utf-8 -*- """ Created on Wed Apr 25 09:06:37 2018 @author: Administrator """ import pandas as pd from sklearn.utils import shuffle from w2v_model import W2V_MODEL import re import os filtrate = re.compile(u'[^\u4E00-\u9FA50-9a-zA-Z,。,.?!?!::;;]') def load_w2v_file(path): merge_data=[] for file...
null
choose/train_w2v.py
train_w2v.py
py
1,115
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, ...
304568512
import tensorflow as tf import keras import numpy as np import pandas as pd import matplotlib.pyplot as plt import PIL #import danych train_file = open("train.csv", "r") test_file = open("test.csv", "r") column_names = train_file.readline().splitlines()[0].split(",") train_data = pd.read_csv(train_file, names=column...
null
Listki/LeavesNew.py
LeavesNew.py
py
3,555
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.Sequential", "line_number": 52, "usage_type": "call" }, { "api_name": "keras.layers.Dense",...
409860104
import yaml import datetime from datetime import timedelta from dateutil.relativedelta import * from dateutil.rrule import * from dateutil.parser import * # The DAG object; we'll need this to instantiate a DAG from airflow import DAG # Operators; we need this to operate! from airflow.utils.task_group import TaskGroup...
null
airflow/dags/bealign-sliding-windows.py
bealign-sliding-windows.py
py
19,360
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.path", "line_number...
601868665
import os,sys,shutil, json, subprocess, logging, argparse, glob, re from zipfile import ZipFile import xml.etree.ElementTree as ET from xml.etree.ElementTree import ParseError file_path = os.path.abspath(os.path.dirname(__file__)).replace('\\', '/') main_path = os.path.abspath(os.path.join(file_path, '..')).replace('\...
null
mcuxsdk_ci/apps/build_from_package.py
build_from_package.py
py
10,342
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...
351477841
# Importing all the necessary modules import cv2 from keras.datasets import mnist import keras from keras.models import Sequential from keras.layers import Conv2D,Dense,Flatten,MaxPooling2D import matplotlib.pyplot as plot import numpy as np from keras.preprocessing.image import ImageDataGenerator from keras...
null
Digits_Recognition.py
Digits_Recognition.py
py
3,816
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 18, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 18, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" ...
410936453
from prometheus_client import start_http_server, Counter from prometheus_client.parser import text_string_to_metric_families import random import time import logging import sys import requests import logging import sys #logging log = logging.getLogger(__name__) out_hdlr = logging.StreamHandler(sys.stdout) out_hdlr.set...
null
prom_counter.py
prom_counter.py
py
1,569
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.Forma...
359392091
""" byceps.services.ticketing.ticket_user_checkin_service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from ...database import db from ...events.ticketing import TicketCheckedIn from ...typing import PartyID...
null
byceps/services/ticketing/ticket_user_checkin_service.py
ticket_user_checkin_service.py
py
3,594
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.PartyID", "line_number": 32, "usage_type": "name" }, { "api_name": "transfer.models.TicketID", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.UserID", "line_number": 32, "usage_type": "name" }, { "api_name": "user.service.ge...
292280116
import speech_recognition as sr AUDIO_FILE = ("sample.wav") r=sr.Recognition() #initialize the recognizer with sr.AudioFile(AUDIO_FILE) as source: audio=r.record(source) #reads the audio file try: print("audio file contains "+r.recognize_google(audio)) except sr.UnknownValueError : print("Google Speech ...
null
speechToText.py
speechToText.py
py
415
python
en
code
null
code-starcoder2
76
[ { "api_name": "speech_recognition.Recognition", "line_number": 3, "usage_type": "call" }, { "api_name": "speech_recognition.AudioFile", "line_number": 4, "usage_type": "call" }, { "api_name": "speech_recognition.UnknownValueError", "line_number": 9, "usage_type": "attribu...
619610486
import os import re import logging import argparse import h5py import matplotlib import matplotlib.pyplot as plt from numpy import reshape, linspace, amax logging.basicConfig(level=logging.INFO) os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE" # Needed on Supercloud =/ matplotlib.rcParams['figure.dpi'] = 200 plt.sty...
null
plotting/plot_horizontal_slices.py
plot_horizontal_slices.py
py
3,054
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "matplotlib.rcPa...
546416094
from selenium import webdriver from selenium.common.exceptions import NoSuchElementException import os import pandas as pd import pickle from pprint import pprint import re def setup_driver(): chromedriver = "/Users/julianlanger/Dropbox/data/marat_journal/chromedriver" os.environ["webdriver.chrome.driver"] = chrome...
null
scrape_db.py
scrape_db.py
py
4,515
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" }, { "api_name": "s...
569009036
def test_call(): print("Test success") def master_call(): print ("It's master") def new_test_call(): print ("On developer branch.") def branch_changer(): print ("yo") from bokeh.models import Slider, CustomJS from bokeh.layouts import row, column from bokeh.plotting import Figure, output_noteboo...
null
test.py
test.py
py
2,976
python
en
code
null
code-starcoder2
76
[ { "api_name": "bokeh.plotting.output_notebook", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 33, "usage_type": "call" }, { "api_name": "sympy.Symbol", ...
492376443
import os import csv import argparse try: import nmap except ImportError: os.system('pip install -r requirements.txt') print('\nInstalando los paquetes indicados en "requirements.txt"...') print('Ejecuta de nuevo el script.') exit() def nmapRun(gatewayip): #Escaneo de ip de router ...
null
nmapobt.py
nmapobt.py
py
1,763
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.system", "line_number": 7, "usage_type": "call" }, { "api_name": "nmap.PortScanner", "line_number": 15, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 53, "usage_type": "call" } ]
345140504
import collections import pandas as pd import re def culture_report(): #Microbiology culture activity report source = "path/to/file" f = open(source, 'r') subject = f.read() match = re.findall(r'''(?<=icrobiology\sCulture\sActivity\sReport)(.*?)(?=\d\d:\d\d:\d\d\s*M...
null
culture.report.py
culture.report.py
py
5,749
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.findall", "line_number": 14, "usage_type": "call" }, { "api_name": "re.S", "line_number": 14, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 24, "usage_type": "call" }, { "api_name": "re.search", "line_number": 30, ...
50709884
# -*- coding: utf-8 -*- # author: Raychee import teradata import pandas as pd class Teradata(object): """Teradata connection tools use teradata and pandas (for python 3) """ pooling = True config = { "appName": __name__ + '.Teradata', "version": '1.0', "runNumber": "0", ...
null
PyProjectTemplate/scheduler/tools/td_tools.py
td_tools.py
py
7,181
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.isnull", "line_number": 98, "usage_type": "call" }, { "api_name": "pandas.np.isinf", "line_number": 98, "usage_type": "call" }, { "api_name": "pandas.np", "line_number": 98, "usage_type": "attribute" }, { "api_name": "teradata.DatabaseError",...
349498671
from flask import Flask, render_template, request from operacoes import * title = "Calculadora" app = Flask(__name__) @app.route('/') def home(): return render_template("home.html", titulo=title) @app.route('/calcular') def calcular(): num1 = float(request.args["num1"]) num2 = float(request.args["num2...
null
aula10/aula10.py
aula10.py
py
788
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.reques...
562640437
import numpy as np from flask import Flask, request, render_template import pickle app = Flask(__name__) with open('cc_fraud_model.pkl', 'rb') as f: model = pickle.load(f) feature_names = ['Time', 'V1', 'V2', 'V3', 'V4', 'V5', 'V6', 'V7', 'V8', 'V9', 'V10', 'V11', 'V12', 'V13', ...
null
cred_card_fraud_v2/cc_fraud_v2_app.py
cc_fraud_v2_app.py
py
1,078
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 42, "usage_type": "call" }, { "api_name": "flask.request.form.get", ...
53941938
# Use a pretrianed model to continue training, with only water-content loss import argparse import os import numpy as np import math import itertools import sys import rasterio import torchvision.transforms as transforms from torchvision.utils import save_image, make_grid from torch.utils.data import DataLoader from ...
null
bathymetry_training/model2.py
model2.py
py
8,703
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.cuda.is_available", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 42, "usage_type": "attribute" }, { "api_name": "torch.cuda.set_device", "line_number": 43, "usage_type": "call" }, { "api_name": "torch.c...
459910334
import argparse import funcy import itertools import math import numpy as np import random import os import torch from skimage.io import imread from PIL import Image from tqdm import tqdm from torch.autograd import Variable from torch.utils.data import Dataset, DataLoader from torchvision import transforms def set_s...
null
generate_masks.py
generate_masks.py
py
4,632
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.initial_seed", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "random.seed", ...
392987258
import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integrate from Lorenz96_RK4 import Lorenz96 import sys, os # Set the hyperparamters for generating the data # stepsize = dt stepsize = 0.01 # How many time points steps = 1000 # Initial point np.random.seed(123456) y0 = np.random.random(...
null
Testing.py
Testing.py
py
1,334
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.random.random", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random"...