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
375477
# from src import architectures,ramps # import torch.backends.cudnn as cudnn import csv import os import random import time import warnings from datetime import datetime from timeit import default_timer as timer import numpy as np import pandas as pd import torch import torchvision import torchvision.models as models ...
null
make_aid_plabel.py
make_aid_plabel.py
py
5,973
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.seed", "line_number": 30, "usage_type": "call" }, { "api_name": "config.AID.config_AID.DefaultConfigs.seed", "line_number": 30, "usage_type": "attribute" }, { "api_name": "config.AID.config_AID.DefaultConfigs", "line_number": 30, "usage_type": "name"...
8567108
import numpy as np import matplotlib.pyplot as plt ax = plt.subplot(111) t = np.arange(0., 1., 0.02) s = np.cos(2*np.pi*t) + np.random.rand(t.shape[0]) line, = plt.plot(t, s, lw=2) #plt.annotate('Divided line', xy=(0.8, 1), xytext=(0.6, 1.5), # arrowprops=dict(facecolor='black', shrink=0.05), # ...
null
test/plot.py
plot.py
py
364
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.subplot", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.cos", ...
94458976
from flask import Flask, render_template, request, redirect from mysqlconnection import connectToMySQL app = Flask(__name__) @app.route("/") def index(): mysql = connectToMySQL('mydb') # call the function, passing in the name of our db friends = mysql.query_db('SELECT * FROM friends;') # call the query_db funct...
null
20_Flask_plus_MySQL-Quiz/flask_mysql/first_flask_mysql/server.py
server.py
py
1,029
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "mysqlconnection.connectToMySQL", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.r...
450001565
import brian2.numpy_ as np import brian2 as bb from brian2 import ms, second, Hz, mV, pA, nS, pF from collections import defaultdict eqs_exc = '''dv/dt = (g_l*(v_r-v)+Ie+Ii+I)/(C_m) : volt dge/dt = -ge/(tau_exc) : siemens dgi/dt = -gi/(tau_inh) : siemens Ie = ge*(v_e-v) : amp ...
null
scripts/run_simulation_simple.py
run_simulation_simple.py
py
2,850
python
en
code
null
code-starcoder2
66
[ { "api_name": "brian2.nS", "line_number": 20, "usage_type": "name" }, { "api_name": "brian2.nS", "line_number": 21, "usage_type": "name" }, { "api_name": "brian2.nS", "line_number": 22, "usage_type": "name" }, { "api_name": "brian2.pF", "line_number": 22, ...
489782909
from PyQt5 import QtCore, QtGui from PyQt5.QtWidgets import QGridLayout, QHBoxLayout, QFormLayout import pyqtgraph as pg import random import numpy as np import time import serial import serial.tools.list_ports import json import time from MedicalArduino import MedicalArduino # The following lines of code were provi...
null
MainWindow.py
MainWindow.py
py
9,724
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime", "line_number": 39, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 46, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 50, "usage_type": "name" }, { "api_name": "inspect.stack",...
129809204
from kbhitmod import KBHit import socket import sys import select from time import sleep, time from card import GameCard from displayer import displayer from threading import Thread from queue import Queue import argparse # kbhit imports import os from time import sleep # Windows if os.name == 'nt': import msvcrt ...
null
uptodate/player.py
player.py
py
6,126
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.name", "line_number": 16, "usage_type": "attribute" }, { "api_name": "kbhitmod.KBHit", "line_number": 28, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 31, "usage_type": "call" }, { "api_name": "threading.Thread", "line_...
65355873
from django.urls import path from .views import all_products, product_detail, add_product, edit_product, delete_product, like_product urlpatterns = [ path('', all_products, name='products'), path('<int:product_id>/', product_detail, name='product_detail'), path('add/', add_product, name='add_product'), ...
null
products/urls.py
urls.py
py
522
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "views.all_products", "line_number": 6, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.product_d...
483888505
""" Models for loan_app application. """ import secrets import string import decimal from django.utils import timezone from django.db import models from django.db import IntegrityError from django.core.exceptions import ValidationError from clients.models import Client class Base(models.Model): """ Abstract ...
null
loan_app/models.py
models.py
py
9,103
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 15, "usage_type": "name" }, { "api_name": "django.db.models.BooleanField", "line_number": 20, "usage_type": "call" }, { "api_na...
103581896
""" * DMV EXPRESS APPOINTMENT * __author__ = "Mohammed El Amine Idmoussi" * Captcha solver using AI, Buster chrome/firefox extension """ import time from GEOparse import logger from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import e...
null
captcha_solver.py
captcha_solver.py
py
1,368
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 22, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.visibility_of_element_located", "line_number": 23, "usage_type": "call" }, { "api_name": "selenium.webdriver.suppo...
213678540
import matplotlib.pyplot as pyplot year=[2010,2011,2012,2013,2014,2015,2016] rice=[10,30,50,30,40,42,5] pyplot.xlabel("Years") pyplot.ylabel("Rice Production") pyplot.title("Rice Production by Year") pyplot.plot(year,rice) pyplot.show()
null
1/1.py
1.py
py
239
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.xlabel", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylabel", "line_number": 7, "usage_type": "call" }, { "api_name": "matp...
437759480
# -*- coding: utf-8 -*- """ Created on Wed Mar 4 04:47:15 2020 @author: Dotmons """ import pandas as pd from matplotlib import pyplot as plt import sklearn.datasets def get_iris_df(): ds = sklearn.datasets.load_iris() df = pd.DataFrame(ds['data'], columns = ds['feature_names']) code_species_map = di...
null
DataScience/Chapter 5/Chart.py
Chart.py
py
2,392
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.datasets.datasets.load_iris", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.datasets.datasets", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sklearn.datasets", "line_number": 13, "usage_type": "name" }, { ...
6901777
import pytest from awx.main.access import ( RoleAccess, UserAccess, TeamAccess) @pytest.mark.django_db def test_team_access_attach(rando, team, inventory): # rando is admin of the team team.admin_role.members.add(rando) inventory.read_role.members.add(rando) # team has read_role for the i...
null
awx/main/tests/functional/test_rbac_role.py
test_rbac_role.py
py
1,055
python
en
code
null
code-starcoder2
66
[ { "api_name": "awx.main.access.TeamAccess", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 9, "usage_type": "attribute" }, { "api_name": "awx.main.access.UserAccess", "line_number": 25, "usage_type": "call" }, { "api_name": ...
526273095
# QLineEdit single line of text # possible operations: undo redo cut paste drag&drop import sys from PyQt5.QtWidgets import QWidget, QLabel, QLineEdit, QApplication class myWidget(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): ...
null
PyQt5/ch7 - widgets 2/QLineEdit.py
QLineEdit.py
py
883
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLineEdit", "line_number": 15, "usage_type": "call" }, { "api_name"...
336157250
# Copyright 2017 The Sunset Authors. All Rights Reserved. # # 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 # # Unless required by applicable l...
null
sunset/sunset/python/modules/util.py
util.py
py
29,233
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.VariableScope", "line_number": 49, "usage_type": "attribute" }, { "api_name": "six.string_types", "line_number": 51, "usage_type": "attribute" }, { "api_name": "tensorflow.GraphKeys", "line_number": 57, "usage_type": "attribute" }, { "api...
364844246
import torchvision.transforms as T from .RandomErasing import RandomErasing def transforms(cfg, is_train=True): if is_train: transform_list = [T.Resize(cfg.INPUT.SIZE_TRAIN), T.RandomHorizontalFlip(p=cfg.INPUT.HF_PROB), T.Pad(cfg.INPUT.PADDING), ...
null
data_loader/transforms/transforms.py
transforms.py
py
1,083
python
en
code
null
code-starcoder2
66
[ { "api_name": "torchvision.transforms.Resize", "line_number": 7, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 7, "usage_type": "name" }, { "api_name": "torchvision.transforms.RandomHorizontalFlip", "line_number": 8, "usage_type": "call" ...
643130553
import sys from collections import namedtuple from lxml.etree import ElementTree from lxml.etree import ParseError Contact = namedtuple('Contact', 'first last age email') try: tree = ElementTree().parse('results.xml') except ParseError as err: print('Parsing failed: {err}'.format(err=err)) sys.exit(42) ...
null
Optum Tech/student_files/ch08_xml/04_lxml_parsing.py
04_lxml_parsing.py
py
724
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 7, "usage_type": "call" }, { "api_name": "lxml.etree.ElementTree", "line_number": 10, "usage_type": "call" }, { "api_name": "lxml.etree.ParseError", "line_number": 11, "usage_type": "name" }, { "api_name": "sy...
188824985
from requests import get class MeetUpData: def __init__(self): f = open(r"C:\Users\wen kai\Downloads\y4s2\event-advisor\website\DataCollection\token.txt","r") credentials = f.read() f.close() txt_arr = credentials.split("\n") self._token = txt_arr[1] self._url =...
null
website/DataCollection/meetupData.py
meetupData.py
py
1,831
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" } ]
324685390
import sys sys.path.append(r'/home/sebastian/Dropbox/Facultate/BacStats/BAC_2019_statistics') import numpy as np import matplotlib.pyplot as plt import pandas as pd import numpy as np from classes.student import * def box_for_spec(grades, labels): ''' Plotting boxplots for 3 specialisations ''' g...
null
create_stats/boxplots.py
boxplots.py
py
1,182
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", ...
562973208
#from lxml import etree import json import requests import sys import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize import string from gensim.models import TfidfModel from gensim import corpora from sklearn.feature_extraction.text import TfidfVectorizer import pandas as pd from collecti...
null
Final_version/cloud.py
cloud.py
py
5,243
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 38, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 54, "usage_type": "call" }, { "api_name": "nltk.tokenize.word_tokenize", ...
635837645
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 # # Unless required by ...
null
create_pretraining_data.py
create_pretraining_data.py
py
8,068
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.flags", "line_number": 26, "usage_type": "attribute" }, { "api_name": "tokenization.printable_text", "line_number": 70, "usage_type": "call" }, { "api_name": "tokenization.printable_text", "line_number": 76, "usage_type": "call" }, { "api...
552470981
import requests import yaml import re class Citation: def __init__(self, url, instantiate_empty=False): self.url = url self.baseurl = None self.file_url = None self.file_contents = None self.as_yaml = None if not instantiate_empty: self._get_baseurl() ...
null
citationcff/citation.py
citation.py
py
6,268
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 27, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 31, "usage_type": "attribute" }, { "api_name": "re.match", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
236574519
import matplotlib.pyplot as plt import numpy as np import healpy as hp import operator # Read info of 79 sources # # # params string fname Filename # # return void # # Author Van Hiep ## def read_info(fname = '79src_info.txt'): ret = {} ret['src'] = [] ret['yn'] = [] ret['l'] = [] ret['...
null
gas_col_density/all_sky_map.py
all_sky_map.py
py
5,175
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.pi", "line_number": 80, "usage_type": "attribute" }, { "api_name": "healpy.read_map", "line_number": 82, "usage_type": "call" }, { "api_name": "healpy.read_map", "line_number": 83, "usage_type": "call" }, { "api_name": "healpy.read_map", "...
456447599
import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split, TimeSeriesSplit from sklearn.preprocessing import StandardScaler import pandas as pd from sklearn.metrics import mean_absolute_error, mean_squared_error import matplotlib.ticker as plticker import keras import datet...
null
Load_Prediction/Random_Forest/Direct_Multi_Step_Prediction/Compute_Stddevs/Prediction_w_Uncertainty.py
Prediction_w_Uncertainty.py
py
12,324
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 25, "usage_type": "call" }, { "api_name...
182250390
import eosWrap as eos import numpy as np import matplotlib.pyplot as plt from Wrapper import Wrapper, FromEos from scipy import integrate from pylab import pi, sqrt from scipy.interpolate import interp1d from scipy.misc.common import derivative C = eos.KVOR() IC = eos.InterpolatedScalings() wr = Wrapper(C) iwr = Wrapp...
null
Reconstruct/ImproveKVOR.py
ImproveKVOR.py
py
1,873
python
en
code
null
code-starcoder2
66
[ { "api_name": "eosWrap.KVOR", "line_number": 9, "usage_type": "call" }, { "api_name": "eosWrap.InterpolatedScalings", "line_number": 10, "usage_type": "call" }, { "api_name": "Wrapper.Wrapper", "line_number": 12, "usage_type": "call" }, { "api_name": "Wrapper.Wrap...
81432052
import logging import threading import time from persistence import pop_from_queue class ProcessingWorker(object): current_workflow = None current_step = None _exit_event = threading.Event() _worker_thread = None def __init__(self): self.logger = logging.getLogger('spreadsplug.web.worke...
null
spreadsplug/web/worker.py
worker.py
py
1,222
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Event", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 20, "usage_type": "call" }, { "api_name": "persistence.pop_fr...
374146154
''' Created on Apr 19, 2016 @author: pitzer ''' import json import locale import logging import luigi import os from realdeal.email_message import EmailClient from realdeal.luigi.base_task import RealDealBaseTask PROPERTY_TABLE_FIELDS = [ 'address', 'city', 'year_built', 'bedrooms', 'bathrooms', 'buildin...
null
realdeal/luigi/email_deals.py
email_deals.py
py
4,144
python
en
code
null
code-starcoder2
66
[ { "api_name": "locale.setlocale", "line_number": 41, "usage_type": "call" }, { "api_name": "locale.LC_ALL", "line_number": 41, "usage_type": "attribute" }, { "api_name": "realdeal.luigi.base_task.RealDealBaseTask", "line_number": 43, "usage_type": "name" }, { "api...
583831922
from flask import Flask, jsonify, Blueprint, send_from_directory from flask_jwt_extended import JWTManager from api.api import api_bp from database.database import * from api.api import init_swagger app = Flask(__name__) app.register_blueprint(api_bp) #app.config["JWT_SECRET_KEY"] = "I4gc/Yv3P27d/m7Qczbe+JadO+G6cu9D...
null
backend/app/app.py
app.py
py
666
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "api.api.api_bp", "line_number": 10, "usage_type": "argument" }, { "api_name": "flask_jwt_extended.JWTManager", "line_number": 13, "usage_type": "call" }, { "api_name": "api.api.i...
100760889
import csv import requests from lxml import html from geo.models import Location WIKI_DOMAIN = 'https://pl.wikipedia.org' START_URL = '/wiki/Kategoria:Pomniki_historii' class NoLocationsCrawled(Exception): pass def crawl_locations(): locations = [l for l in crawl_locations_page(START_URL)] return locat...
null
geo/crawling.py
crawling.py
py
2,238
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 22, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 22, "usage_type": "name" }, { "api_name": "requests.get", "line_...
487443341
import os import tempfile from testify import teardown, setup, TestCase, run, assert_equal from tests.assertions import assert_call from tests.testingutils import Turtle from tron.api.controller import JobController, ConfigController class JobControllerTestCase(TestCase): @setup def setup_controller(self): ...
null
tests/api/controller_test.py
controller_test.py
py
1,843
python
en
code
null
code-starcoder2
66
[ { "api_name": "testify.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "tests.testingutils.Turtle", "line_number": 12, "usage_type": "call" }, { "api_name": "tests.testingutils.Turtle", "line_number": 13, "usage_type": "call" }, { "api_name": "t...
491180831
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.neighbors import KNeighborsClassifier from sklearn.tree import DecisionTreeClassifier from sklearn.svm import SVC from sklearn.model_selection import train_test_split from sklearn.metric...
null
data/data_analysis/others/KNN.py
KNN.py
py
2,546
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.metrics.accuracy_score", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 52, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 56, "usage_type": "call" }, { ...
98568326
# -*- coding: utf-8 -*- """ Created on Wed Dec 27 20:02:01 2017 @author: Michael """ import cv2 import os, glob OUTPUTBASE = 'E:/300VW_Dataset_2015_12_14/028/' outputfolder = OUTPUTBASE +"/landmarks/" keyframes = "" if (not os.path.isdir(OUTPUTBASE)): print(OUTPUTBASE + " is not a valid directory!") qui...
null
create_frames_from_300vw.py
create_frames_from_300vw.py
py
888
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.exists", "lin...
80592589
# -*- coding: utf-8 -*- """ Created on Sun May 9 10:39:50 2021 @author: Matthieu """ #%% IMPORT import pandas as pd import numpy as np import pywt import matplotlib.pyplot as plt from scipy import signal from sklearn.decomposition import PCA from sklearn.manifold import TSNE from sklearn import svm from behavelet im...
null
matthieu/old/PCA_Wavel_tsne.py
PCA_Wavel_tsne.py
py
2,094
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_pickle", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.decomposition.PCA", "line_number": 30, "usage_type": "call" }, { "api_name": "matplotlib....
35051021
import logging import json import re import math import sys import getopt from urllib.parse import urljoin import requests from bs4 import BeautifulSoup from bs4 import SoupStrainer # #'https://monsterhunter.fandom.com/wiki/MHF2_and_MHFU:_Light_Bowgun_List' #'https://monsterhunter.fandom.com/wiki/wiki/MHF2_and_MHFU:_H...
null
scraper.py
scraper.py
py
17,051
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup"...
349534433
# import modules os and csv import csv from pathlib import Path input_file = Path('Resources','employee_data.csv') new_date=[] First_Name=[] Last_Name=[] new_ssn=[] Emp_Id=[] us_state_abbrev = { 'Alabama': 'AL', 'Alaska': 'AK', 'Arizona': 'AZ', 'Arkansas': 'AR', 'California': 'CA', 'Colorado': ...
null
PyBoss/main.py
main.py
py
3,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 65, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 96, "usage_type": "call" } ]
503900659
# -*- coding: utf-8 -*- """ Created on Tue Oct 6 08:12:54 2020 @author: acer """ from pandas import DataFrame from pandas import Series from pandas import concat import pandas as pd import statistics from pandas import read_csv from pandas import datetime import sklearn.metrics from sklearn.metrics impo...
null
tcc_joao/lstm.py
lstm.py
py
11,951
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 37, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 50, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.Mi...
158581722
import logging from seplis.api.decorators import new_session, auto_session, auto_pipe from seplis.api.connections import database from seplis.api.base.pagination import Pagination from seplis.api.base.description import Description from seplis.api.base.show import Show from seplis.api import exceptions, constants, mode...
null
src/seplis/api/base/episode.py
episode.py
py
14,414
python
en
code
null
code-starcoder2
66
[ { "api_name": "seplis.api.models.Episode", "line_number": 45, "usage_type": "call" }, { "api_name": "seplis.api.models", "line_number": 45, "usage_type": "name" }, { "api_name": "seplis.api.decorators.auto_session", "line_number": 38, "usage_type": "name" }, { "ap...
121607689
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import subprocess import re import os import six import numpy as np import pandas as pd from .region import parse_region from ._process import tsv def atoi(s): return int(s.replace(',', '')) def natsort_key(s, _NS_REGEX=r...
null
bioframe/frameops.py
frameops.py
py
11,954
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 19, "usage_type": "call" }, { "api_name": "re.U", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 2...
146896639
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import confusion_matrix, recall_score, precision_score, f1_score, roc_auc_score, accuracy_score import seaborn as sns import matplotlib.pyplot as plt import numpy as np # df =...
null
pdfs/Projects/NOC/NN_Data/Linear_Regression/linear_regression.py
linear_regression.py
py
2,217
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 29, "usage_type": "call" ...
135585249
import time import numpy as np import math import pybullet as p import pybullet_data as pd useNullSpace = 1 ikSolver = 0 pandaEndEffectorIndex = 7#11 #8 pandaNumDofs = 7 ll = [-7]*pandaNumDofs #upper limits for null space (todo: set them to proper range) ul = [7]*pandaNumDofs #joint ranges for null space (todo: set ...
null
camera_sim/franka/.ipynb_checkpoints/franka_env-checkpoint.py
franka_env-checkpoint.py
py
6,509
python
en
code
null
code-starcoder2
66
[ { "api_name": "pybullet.connect", "line_number": 29, "usage_type": "call" }, { "api_name": "pybullet.GUI", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pybullet.connect", "line_number": 31, "usage_type": "call" }, { "api_name": "pybullet.DIRECT",...
630637426
import logging import os from pprint import pprint import requests from django.conf import settings from django.contrib.sites.models import Site from django.core.management.base import BaseCommand from django.urls import reverse from rest_framework.authtoken.models import Token from todo.core.models import Task logge...
null
todo/core/management/commands/sync-jira.py
sync-jira.py
py
3,349
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 16, "usage_type": "name" }, { "api_name": "django.conf.settings.SITE_ID", "line_number": 20, "usage_type": "attribute" }...
2041884
#!/usr/bin/env python3 ''' SVG loading tool. Requires svgpathtools To install possibly use: pip install git+https://github.com/mathandy/svgpathtools.git Since the pip version does not support rectangles (at this time at least). ''' # Naive SVG loader from importlib import reload import svgpathtools as svg import numpy...
null
py/polygonsoup/svg.py
svg.py
py
7,184
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.arccos", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 34...
282526876
import matplotlib.pyplot as plt # We start by defining some useful variables Wfirst = [] Wsecond = [] Winteresting = [] Wlast = [] fulllist = [] tau = [] temp = [] heattemp = [] magnetization = [] heatcapacity = [] energy = [] # Here we define a function that loads in files to a list def loadfile(filename, data): ...
null
Plots/Ex3-4/Plots.py
Plots.py
py
6,937
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 72, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 72, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 73, "usage_type": "call" }, { "api_name": "mat...
398450028
from pathlib import PurePosixPath from typing import List class PathsPreparer: def prepare(self, databricksRelativePaths: List[PurePosixPath], rootIgnoredPathName: str): def createNotebookPath(databricksRelativePath: PurePosixPath) -> tuple: return (rootIgnoredPathName, ) + databricksRelativeP...
null
src/dbxdeploy/dbc/PathsPreparer.py
PathsPreparer.py
py
718
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "pathlib.PurePosixPath", "line_number": 6, "usage_type": "name" }, { "api_name": "pathlib.PurePosixPath", "line_number": 7, "usage_type": "name" } ]
181614204
#!/usr/bin/env python """ Unit tests for Transformer() =========================== """ import pytest import numpy as np from implicitmf.transform import Transformer from _mock_data import create_user_item_dict def test_transformer_input_dict_error(): """ Check that Transformer raises a TypeError if dict...
null
tests/test_transform.py
test_transform.py
py
1,347
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.raises", "line_number": 20, "usage_type": "call" }, { "api_name": "implicitmf.transform.Transformer", "line_number": 21, "usage_type": "call" }, { "api_name": "_mock_data.create_user_item_dict", "line_number": 28, "usage_type": "call" }, { "a...
150085177
import torch import torch.nn.functional as F def spatial_argmax(logit): """ Compute the soft-argmax of a heatmap :param logit: A tensor of size BS x H x W :return: A tensor of size BS x 2 the soft-argmax in normalized coordinates (-1 .. 1) """ weights = F.softmax(logit.view(logit.size(0), -1),...
null
homework5/homework/planner.py
planner.py
py
3,429
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.functional.softmax", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.stack", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.lin...
643469168
from flask_wtf import Form from wtforms import SelectField, SubmitField, StringField, TextAreaField from wtforms.fields.html5 import EmailField from wtforms.validators import InputRequired, Email from app.models import Tag, Post, User class ChoosePost(Form): choice_id = SelectField( 'posts', choi...
null
app/forms/portal/__init__.py
__init__.py
py
2,448
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_wtf.Form", "line_number": 9, "usage_type": "name" }, { "api_name": "wtforms.SelectField", "line_number": 10, "usage_type": "call" }, { "api_name": "app.models.Post.query.all", "line_number": 12, "usage_type": "call" }, { "api_name": "app.model...
473798831
# @Author: Lorenzo Corneo # @Date: 2016-10-06T09:45:39+02:00 # @Email: lorenzo.corneo@gmail.com # @Last modified by: lorenzocorneo # @Last modified time: 2016-10-28T15:37:48+02:00 #!/usr/bin/python import logging import cluster as cluster_conf SAMPLE_PERIOD_SEC = 10 db_credentials = { 'host': '127.0.0.1',...
null
Phase_2/path_classifier/config.py
config.py
py
3,446
python
en
code
null
code-starcoder2
66
[ { "api_name": "cluster.cluster.iteritems", "line_number": 78, "usage_type": "call" }, { "api_name": "cluster.cluster", "line_number": 78, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 84, "usage_type": "attribute" }, { "api_name": "log...
625579722
import pexpect as px def e2e(name, order, timeout=5): child = px.spawn('./python3 '+name) #child.delaybeforesend = 0 output='' # if order is not empty, if order['expect']: child.expect(order['expect']) if order['send']: child.sendline(order['send']) retcode = child.ex...
null
201_positive_zero_negative/test.py
test.py
py
684
python
en
code
null
code-starcoder2
66
[ { "api_name": "pexpect.spawn", "line_number": 3, "usage_type": "call" }, { "api_name": "pexpect.TIMEOUT", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pexpect.EOF", "line_number": 11, "usage_type": "attribute" } ]
583793990
from __future__ import division import gensim import numpy as np import random import math import unicodedata import itertools from utils import grouper np.random.seed(1234) random.seed(1234) def strip_accents(s): return ''.join(c for c in unicodedata.normalize('NFD', unicode(s, 'utf-8')) if ...
null
data_structure.py
data_structure.py
py
9,320
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "unicodedata.normalize...
131453022
#!/usr/bin/env python3 import opensoundscape as opso from opensoundscape.audio import Audio from opensoundscape.spectrogram import Spectrogram from opensoundscape import ribbit import pytest import numpy as np import pandas as pd @pytest.fixture() def gpt_path(): return "tests/great_plains_toad.wav" def test_ca...
null
tests/test_ribbit.py
test_ribbit.py
py
2,663
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number":...
598863819
from scoreboard import Scoreboard from ball import Ball from turtle import Screen from paddle import Paddle import time screen = Screen() screen.bgcolor('black') screen.setup(800,600) screen.title("Pong") screen.tracer(0) paddle_1 = Paddle((350,0)) paddle_2 = Paddle((-350,0)) ball = Ball() scoreboard = Scoreboard() ...
null
main.py
main.py
py
998
python
en
code
null
code-starcoder2
66
[ { "api_name": "turtle.Screen", "line_number": 7, "usage_type": "call" }, { "api_name": "paddle.Paddle", "line_number": 13, "usage_type": "call" }, { "api_name": "paddle.Paddle", "line_number": 14, "usage_type": "call" }, { "api_name": "ball.Ball", "line_number...
458316696
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.view_index, name='view_index'), url(r'^contact', views.view_contact, name = 'view_contact'), url(r'^(?P<section_name>[a-zA-Z]+)/$', views.view_section, name='view_b'), url(r'^(?P<section_name>[a-zA-Z]+)/(?P<thread_id_...
null
project/imageboard_app/urls.py
urls.py
py
390
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
566478566
from sqlalchemy import create_engine from Spy.Spy import app class MysqlEngine(object): def __init__(self, dbconfig): self.dbconfig = dbconfig self.conns = {} pass def init_db(self): for key, url in self.dbconfig.items(): engine = create_engine(url, pool_recycle=3...
null
Spy/Db/mysql.py
mysql.py
py
749
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.create_engine", "line_number": 14, "usage_type": "call" }, { "api_name": "Spy.Spy.app.config", "line_number": 14, "usage_type": "attribute" }, { "api_name": "Spy.Spy.app", "line_number": 14, "usage_type": "name" } ]
595577997
# -*- coding: utf-8 -*- # @Time : 2018/11/22 15:50 # @Author : panxiaotong # @Description : MIPSG-I/MIPSG-II model, text classification import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' import sys sys.path.append("..") import tensorflow as tf from tensorflow.contrib import rnn from config.config import cf...
null
src/eval/text_classification.py
text_classification.py
py
13,077
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "config.config.cfg.dict_tim...
271471184
import random import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches def plot(ginis,restaurants): # The y values. Cumulative percentage of incomes j = 0 for restaurant in restaurants: y, y_pe = [], [] i = 0 restaurant = sorted(restaurant) fo...
null
working/assignment10/Assignment10_itws/papa_assignment10_2.py
papa_assignment10_2.py
py
2,840
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "matplotlib.p...
129218615
from matplotlib import pyplot as plt from sklearn.model_selection import GridSearchCV, cross_val_score from sklearn.neighbors import KNeighborsClassifier def make_cross_validation(X_train, Y_train, clf, parameters, model_name): ######################################################################################...
null
Cross_Validation.py
Cross_Validation.py
py
1,903
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.model_selection.GridSearchCV", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.model_selection.cross_val_score", "line_number": 29, ...
195576465
from data_treatment import load_data_yf,data_clean,seperate_label,data_seperate,load_data_new,data_transform_new,plot_eda,data_clean,feature_extend from models import rf_mdoel,gbdt_mdoel,xgb_model,cat_boost_model,lgb_model,get_stacking from sklearn.metrics import make_scorer from sklearn.ensemble import RandomForestCl...
null
GM_main_new.py
GM_main_new.py
py
10,261
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 25, "usage_type": "call" }, { "api_name": "data_treatment.load_data_new", "line_number": 28, "usage_type": "call" }, { "api_name": "data_treatment.data_clean", "line_number": 98, "usage_type": "call" }, { "ap...
440892147
import io import os import time import sys import struct import socket import numpy as np import torch as torch from spiketag.fpga import xike_config from torch.multiprocessing import Process, Pipe, SimpleQueue from ..utils.utils import EventEmitter, Timer from ..realtime import Binner class bmi_stream(object): ...
null
spiketag/realtime/BMI.py
BMI.py
py
8,287
python
en
code
null
code-starcoder2
66
[ { "api_name": "struct.unpack", "line_number": 20, "usage_type": "call" }, { "api_name": "spiketag.fpga.xike_config", "line_number": 58, "usage_type": "call" }, { "api_name": "spiketag.fpga.xike_config", "line_number": 61, "usage_type": "call" }, { "api_name": "os....
512985289
# Make the cube of a multiblock dataset pickable and the sphere # unpickable, then reset it. # # Note how the zero index is the entire multiblock, so we have to add 1 # to our indexing to access the right block. # import pyvista as pv dataset = pv.MultiBlock([pv.Cube(), pv.Sphere(center=(0, 0, 1))]) pl = pv.Plotter() a...
null
version/0.37/api/plotting/_autosummary/pyvista-CompositeAttributes-5.py
pyvista-CompositeAttributes-5.py
py
578
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyvista.MultiBlock", "line_number": 8, "usage_type": "call" }, { "api_name": "pyvista.Cube", "line_number": 8, "usage_type": "call" }, { "api_name": "pyvista.Sphere", "line_number": 8, "usage_type": "call" }, { "api_name": "pyvista.Plotter", "li...
68913919
import numpy as np import cv2 # Identify pixels above the threshold # Threshold of RGB > 160 does a nice job of identifying ground pixels only def color_thresh(img, rgb_thresh=(160, 160, 160)): # Create an array of zeros same xy size as img, but single channel color_select = np.zeros_like(img[:,:,0]) # Req...
null
Project 1 Rover Project/perception.py
perception.py
py
8,609
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros_like", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.greater_equal...
12218042
#coding:utf-8 __author__ = '613108' import json import urllib2 #构造小米商品评论get请求,返回json格式数据 for i in range(53): get_url='http://comment.www.xiaomi.com/comment/vlist/goods_id/2011/pagesize/10/pageindex/'+\ str(i+1)+'/comment_grade/0/orderby/1/cnum/0?callback=commentList' result=urllib2.urlopen(get_url...
null
Official_store_project/xiaomi_project/test.py
test.py
py
622
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib2.urlopen", "line_number": 11, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" } ]
207157869
""" LogSumExp reduction ============================== """ #################################################################### # Let's compute the (3000,1) tensor :math:`c` whose entries # :math:`c_i` are given by: # # .. math:: # c_i = \log \left[ \sum_j \exp\left( (p-a_j)^2 \exp(x_i+y_j) \right) \right] # # where...
null
pykeops/pykeops/examples/pytorch/plot_generic_syntax_pytorch_LSE.py
plot_generic_syntax_pytorch_LSE.py
py
6,211
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.float32", "line_number": 43, "usage_type": "attribute" }, { "api_name": "torch.float64", "line_number": 43, "usage_type": "attribute" }, { "api_name": "torch.rand", "line_number": 45, "usage_type": "call" }, { "api_name": "torch.rand", "li...
289015471
from multiprocessing import Queue import inspect import os class Tools: def __init__(self): self.mavlinkThread = None self.vehicle = None self.pulseSender= None self.pulseQueue = Queue() self.setFreqQueue = Queue() self.setGainQueue = Queue() self.logDir = No...
null
Tools.py
Tools.py
py
446
python
en
code
null
code-starcoder2
66
[ { "api_name": "multiprocessing.Queue", "line_number": 10, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", "line_number": 11, "usage_type": "call" }, { "api_name": "multiprocessing.Queue", "line_number": 12, "usage_type": "call" }, { "api_name": "os....
629904535
#-*- coding: utf-8 -*- from trytond.model import ModelView, ModelSQL, fields class Ausencia(ModelSQL, ModelView): "Ausencia" __name__='sigcoop_payroll.ausencia' periodo = fields.Many2One('sigcoop_periodo.periodo', 'Periodo', required = True) ausencias_sabados_domingos = fields.Integer('Ausencias en Sa...
null
ausencia.py
ausencia.py
py
425
python
en
code
null
code-starcoder2
66
[ { "api_name": "trytond.model.ModelSQL", "line_number": 4, "usage_type": "name" }, { "api_name": "trytond.model.ModelView", "line_number": 4, "usage_type": "name" }, { "api_name": "trytond.model.fields.Many2One", "line_number": 8, "usage_type": "call" }, { "api_nam...
604503698
from sanic import Sanic from sanic.response import text app = Sanic(log_config=None) @app.route('/') def index(request): return text('Hi') if __name__ == '__main__': app.run( host='0.0.0.0', port=8000, debug=False, workers=4, )
null
app.py
app.py
py
277
python
en
code
null
code-starcoder2
66
[ { "api_name": "sanic.Sanic", "line_number": 4, "usage_type": "call" }, { "api_name": "sanic.response.text", "line_number": 9, "usage_type": "call" } ]
533463809
import json import dbHandler def deleteHandler(id): #connects to the database todo = dbHandler.dbHandler() #deletes entry from the database todo.deleteEntry(id) def getAllHandler(): #connects to database todo = dbHandler.dbHandler() #reads from database and puts it in a lis...
null
JavaScript_Python_API/assignment3/httpFunctions.py
httpFunctions.py
py
2,686
python
en
code
null
code-starcoder2
66
[ { "api_name": "dbHandler.dbHandler", "line_number": 9, "usage_type": "call" }, { "api_name": "dbHandler.dbHandler", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 25, "usage_type": "call" }, { "api_name": "dbHandler.dbHandler...
55560320
import pandas as pd from sqlalchemy import create_engine # engine=create_engine # from pandasql import * import sqlite3 DATABASE = (r'C:\FINANCE\Python\pyCharm\Projects\OptionOraclePyQt5\database\MyDB.db3') # ALCH_DATABASE = (r"sqlite:///C:\\FINANCE\\Python\\Projects\\OptionOraclePyQt5\\database\\MyDB.db3") import ...
null
database/underlyingDB.py
underlyingDB.py
py
3,747
python
en
code
null
code-starcoder2
66
[ { "api_name": "types.SimpleNamespace", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 36, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 37, "usage_type": "call" }, { "api_name": "pandas.DataFram...
526939333
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import datetime import hashlib import json import logging import re import time import sys import click import pyinotify from elasticsearch import Elasticsearch SYSLOG_REGEX = r'^(?P<date>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}\+\d{2}:\d{2})\s(?P<host>\w+)\s(?P<proc>...
null
modules/hostbase/files/syslog2elastic.py
syslog2elastic.py
py
5,569
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 24, "usage_type": "attribute" }, { "api_name": "logging.getL...
648872655
from flask import Flask, request, render_template, redirect, url_for import sqlite3 import datetime as dt app = Flask(__name__) conn = sqlite3.connect("../database.db", detect_types=sqlite3.PARSE_DECLTYPES) cursor = conn.cursor() cursor.execute(""" CREATE TABLE IF NOT EXISTS stat( id INTEGER PRIMARY KE...
null
server.py
server.py
py
5,996
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.PARSE_DECLTYPES", "line_number": 7, "usage_type": "attribute" }, { "api_name": "flask.render_te...
35583808
from Bio import SeqIO from tkinter import filedialog from tkinter import * import tkinter as tk def dplot(): win = tk.Tk() sv1 = StringVar() sv2 = StringVar() Label(win, text="First FASTA Record").grid(row=0) Label(win, text="Second FASTA record").grid(row=1) e1 = Entry(win, textvariable=sv1) ...
null
functions/dotplot.py
dotplot.py
py
1,955
python
en
code
null
code-starcoder2
66
[ { "api_name": "tkinter.Tk", "line_number": 6, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 19, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 19, "usage_type": "name" }, { "api_name": "tkint...
120160443
from skydcp import finddcp, findsky_border import getf from multiprocessing import Pool, cpu_count from functools import partial import numpy as np import cv2, os, logging, sys, time, pickle import dbg logger = logging.getLogger(__name__) def main_feature(filename, _withsky=False): img = cv2.imread(filename...
null
main_feature.py
main_feature.py
py
6,434
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "dbg.shrink_img", "line_number": 27, "usage_type": "call" }, { "api_name": "skydcp.finddcp", "line...
81082766
from flask import Flask from flask import Flask from flask import json from flask import request from flask import Response from flask import jsonify import requests import json app = Flask(__name__) from clarifai import rest from clarifai.rest import ClarifaiApp from clarifai.rest import Image as ClImag...
null
backend/mnm.py
mnm.py
py
5,617
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "clarifai.rest.ClarifaiApp", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 29, "usage_type": "call" }, { "api_name": "flask.request.arg...
573371138
#!/usr/bin/env python3 import configparser config = configparser.ConfigParser() config.read('config.ini') stub = open('pa.net.stub').read() capacity = config['circuit']['capacity'] inductance = config['circuit']['inductance'] parameters = { 'resolution': config['simulation']['resolution'], 'total_time': config['si...
null
pa.py
pa.py
py
4,070
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 4, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 32, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 32, "usage_type": "attribute" }, { "api_name": "math.exp", "line_...
444776971
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Utilities for svgis''' # This file is part of svgis. # https://github.com/fitnr/svgis # Licensed under the GNU General Public License v3 (GPLv3) license: # http://opensource.org/licenses/GPL-3.0 # Copyright (c) 2015-16, Neil Freeman <contact@fakeisthenewreal.org> from...
null
svgis/utils.py
utils.py
py
1,527
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.floor", "line_number": 54, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 59, "usage_type": "call" }, { "api_name": "itertools.groupby", "line_number": 78, "usage_type": "call" } ]
488024014
import random import logging from importlib import reload # Not needed in Python 2 from typing import Optional import numpy as np import tensorflow as tf import math from functools import partial from transformers import TFTrainingArguments, HfArgumentParser from transformers import AutoConfig, AutoTokenizer from t...
null
AMLPipeline/lis_components/train/train.py
train.py
py
14,688
python
en
code
null
code-starcoder2
66
[ { "api_name": "dataclasses.field", "line_number": 34, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 28, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 53, "usage_type": "call" }, { "api_name": "dataclasses...
357944350
# coding: utf-8 import numpy as np import matplotlib.pyplot as plt class Modem: def __init__(self, M, gray_map = True, bin_input = True, soft_decision = True, bin_output = True): if np.log2(M) != np.round(np.log2(M)): raise ValueError("M should be 2**n, with n=1, 2, 3...") if ...
null
ModulationPy/ModulationPy.py
ModulationPy.py
py
16,297
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.log2", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.round", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.log2", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.log2", "line_number": 45, ...
345660079
# keras imports from keras.models import Model from keras import backend as K from keras.preprocessing import image from keras.layers import Dense, GlobalAveragePooling2D from keras.applications.inception_v3 import InceptionV3 from keras.preprocessing.image import ImageDataGenerator from keras.callbacks import ModelChe...
null
Software/Python/DRIVE/utils/modeler.py
modeler.py
py
1,476
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.applications.ince...
240163453
from __future__ import print_function, absolute_import, division import sys sys.path.append("..") print(sys.path) from numpy import * from variables import * # add variables to be allocated from the list in variables.py solution_step_variables = [ DISPLACEMENT_X, DISPLACEMENT_Y, VELOCITY_X, VELOCITY_...
null
structure_ex/small_structure_test.py
small_structure_test.py
py
2,432
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "gid_io.ReadModelPart", "...
80495478
#! /usr/bin/python # To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. # -*- coding: utf-8 -*- __author__ = "jcarlos" __date__ = "$27-oct-2015 11:30:50$" import sqlite3 try: bd = sqlite3.co...
null
src/conexion.py
conexion.py
py
482
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" } ]
146183556
#let us start with a basic ml app using flask from flask import Flask, render_template,request from flask_cors import cross_origin import numpy as np app = Flask(__name__) #loading the model import pickle model=pickle.load(open(r'App\model.pkl',"rb")) @app.route('/') def home(): return render_template('home.html'...
null
App/app.py
app.py
py
763
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.request.method", ...
380482015
from gemstone.common.testers import BasicTester from peak_core.peak_core import PeakCore from lassen.sim import PE_fc from lassen.asm import add, Mode_t import shutil import tempfile import os import pytest @pytest.fixture(scope="module") def dw_files(): filenames = ["DW_fp_add.v", "DW_fp_mult.v"] dirname = "...
null
tests/test_peak_core/test_pe_stall.py
test_pe_stall.py
py
1,690
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
369210277
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ############## MolFrame Tools ############## *Created on Thu Aug 31, 2017 by A. Pahl* Tools for working with MolFrame dataframes. """ import time import pickle # for b64 encoded mol objects import gzip import sys import base64 as b64 import os.path as op from copy ...
null
mol_frame/mol_frame.py
mol_frame.py
py
25,918
python
en
code
null
code-starcoder2
66
[ { "api_name": "mol_images.b64_mol", "line_number": 31, "usage_type": "name" }, { "api_name": "misc_tools.apl_tools.get_commit", "line_number": 45, "usage_type": "call" }, { "api_name": "misc_tools.apl_tools", "line_number": 45, "usage_type": "name" }, { "api_name"...
453066113
import os from keras.layers import Conv2D, MaxPooling2D from keras.layers import Flatten, Dense, Lambda from keras.models import Sequential, load_model # Tiny model # Total params: 136,937 def build(target_height, target_width, channels, model_h5=None, normalize=True): model = None if model_h5 and os.path.e...
null
Computer/libraries/models/tiny_cnn.py
tiny_cnn.py
py
1,554
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "keras.models.load_model", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.models.Sequ...
8585852
# -*- coding:UTF-8 -*- import atexit import time import logging import os, sys import stomp import pymongo import configparser import os import datetime import send_message conf = configparser.ConfigParser() conf.read('./base.conf') # 文件路径 db_name = conf.get("mongodb", "db_name") # 从base.conf里获取数据名 host = conf.get("...
null
msg_push/mqtest.py
mqtest.py
py
3,305
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 13, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 25, "usage_type": "call" }, { "api_name": "d...
373956681
# Copyright (C) 2008-2009 Open Society Institute # Thomas Moroz: tmoroz@sorosny.org # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License Version 2 as published # by the Free Software Foundation. You may not use, modify or distribu...
null
setup.py
setup.py
py
1,483
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 22, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 35, "usage_type": "call" } ]
307246578
# -*- encoding=utf8 -*- # @Author: import sys import traceback import subprocess import os import configparser import shutil import json import datetime,time import ctypes import logging import platform from Utils.Constant.ConstantVar import ConstantVar # 系统工具类 from Utils.Tool import MyConfigparser from Utils.Tool.Kern...
null
Utils/Tool/SystemTool.py
SystemTool.py
py
8,001
python
en
code
null
code-starcoder2
66
[ { "api_name": "Utils.Tool.Kernel.Kernel", "line_number": 20, "usage_type": "name" }, { "api_name": "Utils.Constant.ConstantVar.ConstantVar.Windows", "line_number": 70, "usage_type": "attribute" }, { "api_name": "Utils.Constant.ConstantVar.ConstantVar", "line_number": 70, ...
127890573
import random import json import locale from flask import Flask, render_template, redirect, url_for, session from flask_wtf import FlaskForm from wtforms import StringField, HiddenField, RadioField from wtforms.fields.html5 import TelField from wtforms.validators import InputRequired, Length, ValidationError def get_t...
null
app.py
app.py
py
7,923
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 19, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 29, ...
134375884
import logging from datetime import datetime from dateutil.relativedelta import relativedelta from core.order.actions.base import ( Action, send_mail, send_template_email, get_admin_order_url, ) # from core.order.actions.user import send_silent_push from core.db.models import ( SUPPORT_NOTIFIED_STA...
null
core/order/actions/support_admin.py
support_admin.py
py
3,808
python
en
code
null
code-starcoder2
66
[ { "api_name": "core.order.actions.base.Action", "line_number": 33, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 36, "usage_type": "call" }, { "api_name": "core.dbmethods.get_wine_expert_for_order", "line_number": 38, "usage_type": "call" }, { ...
45299664
import pymongo import os def connect_db(): """ Establishes a connection that depends on the env and return the database :return: The DB """ # get mongoDB uri depending on the env if os.environ["PATH"].startswith("/home/konstantinos/"): import configparser local_config = configp...
null
db_ops.py
db_ops.py
py
894
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pymongo.Mon...
602151379
# -*- coding: utf-8 -*- # # Copyright 2017 Xiangxiang Telecom Corporation. # @author: Liusha """This is the models of the cdma models. """ from uuid import uuid1 from app import db from app.com.lius.models.base import BaseModel class CdmaCell(BaseModel, db.Model): """information cdma cell mapping class. ...
null
web_root/app/cdma/models.py
models.py
py
3,816
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.com.lius.models.base.BaseModel", "line_number": 13, "usage_type": "name" }, { "api_name": "app.db.Model", "line_number": 13, "usage_type": "attribute" }, { "api_name": "app.db", "line_number": 13, "usage_type": "name" }, { "api_name": "app.db.Co...
2056828
from torch.autograd import Variable import torch import os import numpy as np import matplotlib.pyplot as plt import random from scipy.misc import imread class Face: def __init__(self, fileName): self.data = imread("./resized/" + fileName) self.name = fileName for index in range...
null
GetData.py
GetData.py
py
2,380
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.misc.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 31, "usage_type": "call" }, { "api_name": "random.seed", "line_numb...
641321206
import binascii import copy import datetime import json import logging import os import attrdict import bson import pytest from api.config import persistent_fs_url from api.config import local_fs_url from flywheel_common.storage import parse_storage_url SCITRAN_CORE_DRONE_SECRET = os.environ['SCITRAN_CORE_DRONE_SECR...
null
tests/fixtures/common.py
common.py
py
17,758
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "binascii.hexlify", "line_number": 19, "usage_type": "call" }, { "api_name": "os.urandom", "li...
43249909
#this is a console game copy of http://www.higherlowergame.com/ #import logos and accounts and the clear method from replit import random from art import logo, vs from profiles import accounts from module_clear import clear #import choice to randomly pick an account from random import choice #variable that ho...
null
Higher Lower Game/main.py
main.py
py
2,916
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.choice", "line_number": 22, "usage_type": "call" }, { "api_name": "profiles.accounts", "line_number": 22, "usage_type": "argument" }, { "api_name": "art.logo", "line_number": 32, "usage_type": "argument" }, { "api_name": "art.vs", "line_n...
212690777
# -*- coding: utf-8 -*- from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import HtmlResponse, Request from scrapy.utils.response import get_base_url from urlparse import urljoin from product_spiders.utils import extract_price_eu, extract_price2uk from product_spider...
null
e-commerce/CompetitorMonitor/product_spiders/spiders/eservicesgroup_it/mydigitaland_spider.py
mydigitaland_spider.py
py
2,696
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.spider.BaseSpider", "line_number": 14, "usage_type": "name" }, { "api_name": "scrapy.utils.response.get_base_url", "line_number": 20, "usage_type": "call" }, { "api_name": "scrapy.selector.HtmlXPathSelector", "line_number": 21, "usage_type": "call" ...
351194908
import zmq class ClienteLeitorCB: def __init__(self): self.context = None self.socket = None def conectar(self): #como cliente self.context = zmq.Context() self.socket = self.context.socket(zmq.REQ) self.socket.connect("tcp://localhost:5555") def requisitarLeitura(...
null
Peripheral/Client.py
Client.py
py
728
python
en
code
null
code-starcoder2
66
[ { "api_name": "zmq.Context", "line_number": 9, "usage_type": "call" }, { "api_name": "zmq.REQ", "line_number": 10, "usage_type": "attribute" } ]
254860622
import configparser import logging import sys DEFAULT_CONFIG = ''' [jira_server] url: https://example.local/jira username: test password: test [statuses] # mapping of issue types to allowed statuses all: Backlog,Todo,In Progress [paths] # list of file or folder paths where todos are not searched or validated, relati...
null
src/inspectortodo/config.py
config.py
py
2,161
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 68, "usage_type": "call" } ]
331256346
from glob import glob from os.path import join from pandas import read_csv import codecs import argparse sample_input = """ Density Variance Average Coverage Objects coverage Attributes coverage Conditions coverage Extent Intent Modus 31.23 7899693.28 1286.43 0.48 0.64 0.33 0.14 <ta...
null
fi/eval/noac2eval.py
noac2eval.py
py
3,260
python
en
code
null
code-starcoder2
66
[ { "api_name": "codecs.open", "line_number": 31, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number...
353784066
#Boa:Dialog:frameAbout """ ============================================================================ Title : frameAbout.py Description : Notes : History : Copyright (c) 2012 Bitwise Systems. All rights reserved. This software contains confidential information and trade secrets of Bitwise S...
null
Software/QuickUsbDiagPy/frameAbout.py
frameAbout.py
py
6,251
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 47, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "attribute" }, { "api_name": "os.environ", "line_numb...
129049696
# Copyright 2019 Verily Life Sciences Inc. All Rights Reserved. # # 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 # # Unless required by appli...
null
verily/bigquery_wrapper/bq_test.py
bq_test.py
py
12,130
python
en
code
null
code-starcoder2
66
[ { "api_name": "verily.bigquery_wrapper.bq_shared_tests.BQSharedTests", "line_number": 34, "usage_type": "attribute" }, { "api_name": "verily.bigquery_wrapper.bq_shared_tests", "line_number": 34, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 45, "u...
168464490
#-*- encoding: UTF-8 -*- from lxml import html import requests import time import pandas as pd def sinablog(u='1619925757',p=5): ''' 根据用户id与文章总页数获取新浪博客的标题及链接,e.g. http://blog.sina.com.cn/s/articlelist_1619925757_0_1.html 娱乐工业 http://blog.sina.com.cn/s/blog_608e1afd0102wkw4.html 咸吃萝卜扯扯淡 http...
null
data/smm_metal_price.py
smm_metal_price.py
py
2,865
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 24, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 24, "usage_type": "name" }, { "api_name": "time.sleep", "line_nu...