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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
260342698 |
from flask import render_template, redirect, url_for, request, flash, Blueprint, \
send_file, current_app
import zipfile
import pandas as pd
import base64
from io import BytesIO
import os
from flaskr.auth.blueprint import require_access
from flaskr.database.importprocessor import ImportProcessor
from flaskr.datab... | null | flaskr/blueprint.py | blueprint.py | py | 8,178 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flaskr.auth.blueprint.require_access",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "flaskr.auth.blueprint.require_access",
"line_number": 29,
"usage_type": "call"
},
... |
614294340 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import scipy
from mlreco.utils.dbscan import dbscan_types, dbscan_points
import torch
def contains(meta, point, point_type="3d"):
"""
Decides whether a point is contained in the box ... | null | mlreco/utils/ppn.py | ppn.py | py | 17,489 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.power",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "larcv.larcv.kShapeLEScatter",
"line_number": 135,
"usage_type": "attribute"
},
{
"api_name": "larcv.larcv",
"line_number": 135,
"usage_type": "name"
},
{
"api_name": "larcv.larc... |
501969342 | # Practice program from Automate the Borting Stuff chapter 6
# Didn't ready past the outline of steps 1-3 before writing my first draft of code.
# Had to read example code to correct issues with pyperclip.copy and pyperclip.paste
# and correct the issue with only updating the variable i instead of the actual
# input_li... | null | original_code/bullet_point_adder_v2.py | bullet_point_adder_v2.py | py | 930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyperclip.paste",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyperclip.copy",
"line_number": 19,
"usage_type": "call"
}
] |
182961507 | from AbstractTask import AbstractTask
import configparser
import threading
from collections import deque
from Utils.TimeStampValue import TimeStampValue
import re
class Accumulater(AbstractTask):
def __init__(self):
self.valuesMap = {}
self.tupleWindowsSize = 0
self.counter = 0
con... | null | main/cofee_edge_service/edge_user_data/tasks_library/RiotbenchTasks/aggregate/Accumulater.py | Accumulater.py | py | 1,880 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "AbstractTask.AbstractTask",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "con... |
415170854 | import pytest
import subprocess
@pytest.mark.parametrize('sep', ['-', '+'])
def test_list_keybinds(hlwm, sep):
# single key, 1-word command:
hlwm.call(f'keybind x quit')
# 2 modifiers, 3-word command:
hlwm.call(f'keybind Mod1{sep}Shift{sep}a resize left +5')
keybinds = hlwm.call('list_keybinds')
... | null | tests/test_keybind.py | test_keybind.py | py | 5,094 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest... |
117130430 | import flask
import pickle
import pandas as pd
# Use pickle to load in the pre-trained model.
with open(f'model/30june_lr_model.pickle', 'rb') as f:
model = pickle.load(f)
app = flask.Flask(__name__, template_folder='templates')
@app.route('/', methods=['GET','POST'])
def main():
if flask.reque... | null | app.py | app.py | py | 3,111 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.render_template",
... |
68959207 | import os
import urllib
import webapp2
import jinja2
from apiclient.discovery import build
from optparse import OptionParser
import json
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'])
REGISTRATION_INSTRUCTIONS = """
... | null | python_appengine/topics/main.py | main.py | py | 3,550 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jinja2.Environment",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
114361487 | import os
import gc
import torch
import argparse
import librosa
import matplotlib
matplotlib.use('Agg')
import numpy as np
from collections import Counter
import torch.nn.functional as F
from torch.autograd import Variable
import torch.optim as optim
import torch.backends.cudnn as cudnn
from torch.utils.data import Dat... | null | run.py | run.py | py | 7,422 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_avai... |
211161423 | import os
import argparse
import json
import warnings
import numpy as np
import torch
from data import fr, loss
from data.source_number import aic_arr, sorte_arr, mdl_arr
import util
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
matplotlib.rcParams['font.family'] = 'se... | null | evaluate_bias.py | evaluate_bias.py | py | 4,508 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams.update",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "ma... |
593886100 | import Courses
from bs4 import BeautifulSoup
from itertools import combinations
from operator import methodcaller
# link = 'http://sis.rutgers.edu/soc/#courses?subject=198&semester=92019&campus=NB&level=U'
# page = requests.get(link)
# soup = BeautifulSoup(page.content, 'html.parser')
def addCoursesFromFile(fname, co... | null | CoursePlanner.py | CoursePlanner.py | py | 5,138 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Courses.schedule",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "Courses.courseSection",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "Courses.cour... |
613202895 | # -*- coding: utf-8 -*-
import scrapy
from douban_movie.items import MovieItem
import logging
class AwesomeMovieSpider(scrapy.Spider):
name = 'awesome-movie'
allowed_domains = ['movie.douban.com']
start_urls=['https://movie.douban.com/top250?start=0&filter=']
# start_urls = ('https://movie.douban.com/... | null | crawl/douban_movie/douban_movie/spiders/awesome_movie.py | awesome_movie.py | py | 1,976 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "douban_movie.items.MovieItem",
"line_number": 24,
"usage_type": "call"
}
] |
414815006 | import sqlite3
# creamos conexion
conexion = sqlite3.connect('pacientes.sqlite3')
# creamos un cursor
cursor = conexion.cursor()
print(type(cursor))
# creamos una tabla
cursor.execute(
'CREATE TABLE if not exists pacientes(id integer PRIMARY KEY, nombre text, apellido text, edad integer, diabetico text)')
# cer... | null | src/examples/crearTablaDB.py | crearTablaDB.py | py | 368 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
}
] |
328905144 | import pygame
class Label:
def __init__(self, context, text, x, y, fontsize, color, centered=True, justify=None):
x *= context.xscale
y *= context.yscale
fontsize = int(fontsize * context.xscale)
self.context = context
self.text = text
self.color = color
self... | null | gui/label.py | label.py | py | 1,035 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.font.Font",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.surface.Surface",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.surfa... |
300645088 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey, DATETIME, UniqueConstraint
import datetime
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
user_chat_id = Column(Integer, primary_key=True)
user_name = Column(String(20)... | null | models.py | models.py | py | 5,315 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 11,
"usage_type": "argument"
},
{
... |
98712714 | #!/usr/bin/env python3
import random, time
import tweepy
def prefix():
choice = ""
if (random.random() > 0.3):
prefix = ["mushy","Poundland\u2122 Own Brand","deep fried","delicious","toasted","frozen","microwaved","roasted"]
choice = " " + random.choice(prefix)
if (random.random() > 0.5):... | null | shittyfoodbot.py | shittyfoodbot.py | py | 4,177 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.random",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_nu... |
633616552 | from sqlalchemy import Column, Integer, String
from app.models.base import Base
class Url(Base):
"""docstring for Url"""
id = Column(Integer, primary_key=True)
url = Column(String(255))
def __init__(self, url):
self.url = url | null | app/models/url.py | url.py | py | 235 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "app.models.base.Base",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy... |
168707392 | import gym
import numpy as np
import pylab as pl
import math
import timeit
import numpy.linalg as LA
from scipy.stats import norm
# Authors: Dr. Sarah Marzen, Ryan Cullen
def MDPparams():
env = gym.make('FrozenLake-v0')
S = env.observation_space.n
A = env.action_space.n
trans_p = {}
r = np.zeros... | null | Frozen Lake/RLtest.py | RLtest.py | py | 5,668 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_num... |
421950947 | #Apply and test the svm
from sklearn import svm
import os
import numpy as np
import matplotlib.pyplot as plt
def accuracy_svm (data_set1 , data_set2 , cc , gg):
accuracy = []
l = len(data_set1)
if l != len (data_set2):
print ("error")
print (l)
print (len(data_set2))
for i in range (0,5):
fatigue_train1... | null | Codes/SVM-related/svm_test_filtered.py | svm_test_filtered.py | py | 4,894 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.concatenate",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.concatena... |
521929756 | import collections
import requests
import logging
import json
from enum import IntEnum
from typing import List
from Netio.exceptions import CommunicationError, AuthError
class Device(object):
"""
Template device with simple api. Provide _get_ouputs and _set_state functions
"""
_write_access = False
... | null | Netio/Device.py | Device.py | py | 4,695 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.IntEnum",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "collections.namedtuple",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "Netio.exceptions.Auth... |
360251107 | import collections
import lsst.pex.config as pexConf
from . import algorithmsLib
@pexConf.wrap(algorithmsLib.AlgorithmControl)
class AlgorithmConfig(pexConf.Config):
pass
@pexConf.wrap(algorithmsLib.CentroidControl)
class CentroidConfig(AlgorithmConfig):
pass
@pexConf.wrap(algorithmsLib.ShapeControl)
class ... | null | python/lsst/meas/algorithms/algorithmRegistry.py | algorithmRegistry.py | py | 9,001 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lsst.pex.config.Config",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "lsst.pex.config",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "lsst.pex.config.wrap",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "lsst.pe... |
646468387 |
import scipy.io
import numpy as np
import sklearn.utils as sku
import sklearn.preprocessing as prep
def data():
base = scipy.io.loadmat('base_ready_data.mat')['base']
left = scipy.io.loadmat('left_ready_data.mat')['left']
right = scipy.io.loadmat('right_ready_data.mat')['right']
dataShape = base.shape... | null | data_method.py | data_method.py | py | 2,114 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "scipy.io.io.loadmat",
... |
532852753 | import os
from train_manager import TrainManager
from training import Training
import tensorflow as tf
import gin
def main(unused_args):
TEST_TYPES = ["ADD_ONE_ONE_TIME",
"ADD_FIVE_ONE_TIME",
"ADD_FIVE_TWO_TIMES",
"ADD_ONE_FIVE_TIMES",
"ADD_... | null | main.py | main.py | py | 1,307 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gin.parse_config_file",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "train_manager.TrainManager",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "training.Training",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tr... |
220288686 | import sys
from contextlib import closing
import numpy as np
from six import StringIO, b
import pandas as pd
import gym
import gym.envs.toy_text;
import random
from gym import utils
from gym.envs.toy_text import discrete
from collections import deque
import keras
from keras.models import Sequential
... | null | LunarLander/LunarLander-Batch.py | LunarLander-Batch.py | py | 7,080 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "keras.in... |
139101046 | #!/usr/bin/env python
import os
import json
import csv
import matplotlib.pylab as plt
years = {}
f = open('dblp.csv','r')
if __name__ == '__main__':
reader = csv.reader(f, delimiter=',')
for row in reader:
if not row[0] in years:
years.update({ row[0] : 1 })
else:
years[row[0]]+=1
#remove 2... | null | aminer.org/plot.py | plot.py | py | 441 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab.plot",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "matplotlib.pylab.sh... |
429261693 | #!/usr/bin/env python
# encoding: utf-8
from __future__ import absolute_import, unicode_literals
from . import Entry
from . import Journal
import os
import re
from datetime import datetime
import time
import plistlib
import pytz
import uuid
import tzlocal
import base64
from xml.parsers.expat import ExpatError
class ... | null | jrnl/DayOneJournal.py | DayOneJournal.py | py | 7,911 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xml.parsers.expat.ExpatError",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "plistlib.InvalidFileException",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_... |
522950403 | import tweepy
API_KEY = 'wwaWaDEBBLVAeCo1AIIbTNlFr'
API_SECRET_KEY = 'Ys1IQIw5wYlo8sLYnjPmaPSee4szzvUhgmqWyFHD0KZnh26Y4r'
ACCESS_TOKEN = '1349379498-iumUTG4rtRTEzfedO2DQ3jox6rqFWz2bGu7pryr'
ACCESS_TOKEN_SECRET = 'Q5EOqWcej0QjfKagZDZF0Z7zjGePGiyvLeSdUtKg8UKzb'
def OAuth():
try:
auth = tweepy.OAuthHandler... | null | my_tweet_bot.py | my_tweet_bot.py | py | 629 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 19,
"usage_type": "call"
}
] |
445278780 | #!/usr/bin/env python3
import subprocess
from re import match
from termcolor import cprint
from nubia import command, argument
from connectors.aws import AWSConnector
from config import CykConfig
@command(name_or_function="aws")
class AWS:
"""
AWS commands
"""
def __init__(self) -> None:
self... | null | cyk/commands/aws.py | aws.py | py | 5,744 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "config.CykConfig.get_aws_regions",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "config.CykConfig",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "config.CykConfig.get_aws_ssh_users",
"line_number": 18,
"usage_type": "call"
},
{
... |
451197332 | from selenium import selenium
import vars
import unittest
import search_page
class verify_tiki_wiki_markup_in_search_results(unittest.TestCase):
def setUp(self):
self.selenium = selenium(
vars.ConnectionParameters.server,
vars.ConnectionParameters.port,
vars.ConnectionParameters.... | null | test_verify_tiki_wiki_markup_in_search_results.py | test_verify_tiki_wiki_markup_in_search_results.py | py | 2,401 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "selenium.selenium",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "vars.ConnectionParameters",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name":... |
115617686 | import os
import numpy as np
from argparse import ArgumentParser
from typing import Dict, List, Optional, Tuple, Any
from models.adaptive_model import AdaptiveModel
from dataset.dataset import DataSeries, Dataset
from dataset.dataset_factory import get_dataset
from utils.hyperparameters import HyperParameters
from uti... | null | src/threshold_optimization/optimize_thresholds.py | optimize_thresholds.py | py | 6,176 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "utils.constants.METADATA_PA... |
242523037 | import os
from flask import Flask, redirect, url_for, request, render_template
import flask
from pymongo import MongoClient
import acp_times
import arrow
app = Flask(__name__)
client = MongoClient("db", 27017)
db = client.tododb
@app.route('/')
def todo():
return render_template('calc.html')
@app.route('/clear'... | null | proj-7-final/DockerRestAPI/DockerMongo/app.py | app.py | py | 2,868 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.redirect",... |
503301070 | import unittest
import numpy as np
import pytest
from astropy.wcs import WCS
from ndcube import utils
from ndcube.tests import helpers
ht_with_celestial = {
'CTYPE4': 'HPLN-TAN', 'CUNIT4': 'deg', 'CDELT4': 1, 'CRPIX4': 0, 'CRVAL4': 0, 'NAXIS4': 1,
'CNAME4': 'redundant axis', 'CROTA4': 0,
'CTYPE3': 'HPLT... | null | ndcube/tests/test_utils_wcs.py | test_utils_wcs.py | py | 2,955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "astropy.wcs.WCS",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "astropy.wcs.WCS",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "ndcube.utils.wcs._all_slice",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "ndcube.ut... |
108051127 | import requests
import bs4
import os
import csv
import json
class Telemetr_parser(object):
def __init__(self, category: str, base_url: str):
self.base_url = base_url
self.params = {}
self.session = requests.Session()
self.headers = {
'accept': '*/*',
'user-a... | null | main.py | main.py | py | 5,636 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.Session",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path.exists",... |
639904096 | import pigpio
import time
from datetime import datetime
from nrf24 import *
import struct
from os import environ as env
from configparser import ConfigParser
if __name__ == "__main__":
#
# Example sending date/time information using NRF24.
#
print("Python NRF24 date/time sender.")
# Create NRF... | null | test/sndr-time.py | sndr-time.py | py | 1,224 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.monotonic",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "dat... |
401160064 | from utils.helper import Setup, Commons
from source import Book
from requests import get
from bs4 import BeautifulSoup
from queue import Queue
import re
import time
import warnings
class AnalysePipe:
def __init__(self, search_pipe):
self.searchPipe = search_pipe
self.url = Commons.URL_BOOK_REVIEW... | null | source/analyse_pipe.py | analyse_pipe.py | py | 1,802 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.helper.Commons.URL_BOOK_REVIEW",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "utils.helper.Commons",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "utils.helper.Setup.get_goodread_dev_key",
"line_number": 16,
"usage_type":... |
563966427 | pi = False
import requests, re, html, pickle
from bs4 import BeautifulSoup
def form_link(year, page_number) :
return 'https://www.fifacm.com/'+str(year)+'/players?page='+str(page_number)
def scrape(link) :
page = requests.get(link)
soup = html.unescape(str(BeautifulSoup(page.content, 'html.parse... | null | get_all_transfer_combinations.py | get_all_transfer_combinations.py | py | 2,999 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "html.unescape",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_n... |
585635410 | import numpy as np
import matplotlib.pyplot as plt
"""
Computational Intelligence TU - Graz
Assignment 2: Neural networks
Part 2: Classification with neural networks
This file contains functions for plotting.
"""
__author__ = 'bellec,subramoney'
IMAGE_DIM = (32, 30)
def plot_image(image_matrix):
ax = plt.sub... | null | assignment2/nn_classification_plot.py | nn_classification_plot.py | py | 2,721 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": ... |
214465440 | # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
import io
import os
import re
import subprocess
import zmq
from utils.sectionize import sectionize
class CommitError(Exception):
pass
# TODO: Move this to sectionize
def make_sections(section_lists):
sections = []
for sls in section_lists:
he... | null | snapshot.py | snapshot.py | py | 6,113 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zmq.Context",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "zmq.REQ",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "zmq.SUB",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "zmq.Context",
"line_number"... |
58842394 | import numpy as np
import sys,os
import configparser
class InputFile():
"""Class for packaging all input/config file options together.
.. note::
There are separate options required by InputFile depending on whether the intended goal is training or testing. The user must declare on the first line of... | null | src/InputFile.py | InputFile.py | py | 18,545 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 248,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 285,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 287,
"usage_type": "call"
}
] |
266534135 | #!/usr/bin/env python3
"""Plot subspecialties
Takes output of `subject-form-based-responses.sql` query as input via stdin
"""
import matplotlib.pyplot as plt
from numpy import average
import csv, os.path, sys
from plot_scenario_ite_correlation import plot
def main():
data = list(csv.DictReader(sys.stdin))
... | null | resources/scripts/plot_subspecialties.py | plot_subspecialties.py | py | 2,922 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.DictReader",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_nu... |
320043334 | '''
Designing Network Design Spaces
https://arxiv.org/pdf/2003.13678.pdf
'''
import os
import sys
BASE_DIR = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
sys.path.append(BASE_DIR)
import numpy as np
from simpleAICV.classification.common import load_state... | null | simpleAICV/classification/backbones/regnet.py | regnet.py | py | 15,490 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
562934361 | from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import TensorDataset, DataLoader, SequentialSampler
from transformers import BertModel, BertConfig, BertTokenizer
drive_dir = "/content/drive/My Drive/app/"
pretrained = "bert-large-uncased"
SEQ_LEN = 128
with open(drive... | null | 4/classification/bert_infer.py | bert_infer.py | py | 2,896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "transformers.BertTokenizer.from_pretrained",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "transformers.BertTokenizer",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 31,
"usage_type": "call"
},
{
... |
144183333 | from django.db.models import Q
from django.utils.decorators import classproperty
from alerts.modules.ef.ef_event import EFEventController
from alerts.modules.event_types import CRITICAL_PARAMETERS, DOCUMENTS
PROFILE_DESCRIPTIONS = {
'A1': 'No se ha realizado la validación de la información asociada al \
cumpli... | null | tranque_v1.8.4_source/backend/src/alerts/modules/ef/m2/cumplimiento_sistema_drenaje/base.py | base.py | py | 1,672 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "alerts.modules.ef.ef_event.EFEventController",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.db.models.Q",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.utils.decorators.classproperty",
"line_number": 30,
"usage_type": ... |
603669796 | """
This module exports comfiguration forthe current system
and is imported by the various run_xxx.py scripts
"""
import os
from pathlib import PurePath
#API Setting are needed to sore job details for later reference
API_URL = os.getenv('NZSHM22_TOSHI_API_URL', "http://127.0.0.1:5000/graphql")
API_KEY = os.getenv('... | null | src/python/automation/scaling/local_config.py | local_config.py | py | 1,532 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 14,
... |
298656328 | import argparse
import os
import json
from os.path import join
def process_arguments(args):
# args.checkpoint_path = join(args.checkpoint_path, args.name)
# args.prediction_path = join(args.prediction_path, args.name)
args.n_layers = int(args.gnn.split(':')[1].split(',')[0])
args.n_heads = int(args.gn... | null | config.py | config.py | py | 10,531 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.makedirs",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 1... |
324643221 | import sys
import numpy as np
import scipy.stats
import matplotlib.pyplot as plt
import scipy
import time
import readMapNew as rmN
import tqdm
import mplhep as hep
import lhe_parser as lhe
import hepmc_parser as hepmc
import Computation_Functions_asymmetric as cmfpa
import random
import math
import os
random.seed(123)... | null | CalRatioDisplacedJet/Asymetric process/Computation_Map_asymmetric.py | Computation_Map_asymmetric.py | py | 5,853 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mplhep.style.use",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mplhep.style",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_... |
506994663 | # -*- coding: utf-8 -*-
from pathlib import Path
from re import findall
_TEST_DATA = ( 'class: 1-3 or 5-7\n',
'row: 6-11 or 33-44\n',
'seat: 13-40 or 45-50\n',
'\n',
'your ticket:\n'
'7,1,14\n',
'\n',
'nearby tick... | null | jeff_hanna/16.py | 16.py | py | 4,779 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.findall",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.cwd",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 120,
"usage_type": "name"
}
] |
124778923 | # Your Agent for solving Raven's Progressive Matrices. You MUST modify this file.
#
# You may also create and submit new files in addition to modifying this file.
#
# Make sure your file retains methods with the signatures:
# def __init__(self)
# def Solve(self,problem)
#
# These methods will be necessary for t... | null | Agent.py | Agent.py | py | 21,161 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 28,
"usage_type": "call"
},
{
"api_name"... |
91898417 | """Samplesheet editor.
Apache WSGI interface using the 'wireframe' package.
The transfer of samplesheets to the remote machine (comicbookguy, CBG)
has been changed. The 'push' model used previously, whereby this script
used scp to transfer a newly modified file to CBG, has been scrapped.
Currently, CBG has a rsync c... | null | wsgi_application.py | wsgi_application.py | py | 28,733 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.gethostname",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "string.ascii_letters",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "string.digits",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "loggi... |
477881130 | import json
from collections import defaultdict
class Plugin(object):
def __init__(self, results):
self.__items = []
self.prefix = []
self.is_data_loaded = False
######################################################
# these should be set by classes inhereting this class
#
# the file to load fingerp... | null | classes/plugin.py | plugin.py | py | 2,661 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 42,
"usage_type": "call"
}
] |
189986556 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import json
import sys
import re
info = {}
choice1 = sys.argv[1]
choice2 = re.sub('[-=+,#/\?:^$.@*\"※~&%ㆍ!』\\‘|\(\)\[\]\<\>`... | null | 박지우/nodejsProject/crawling_test_lotte.py | crawling_test_lotte.py | py | 2,017 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
... |
547148182 | # maybe this file should be run by an administrator
import time, sys, queue
from multiprocessing.managers import BaseManager
class QueueManager(BaseManager):
pass
QueueManager.register('get_task_queue')
QueueManager.register('get_result_queue')
server_addr = '127.0.0.1'
print('Connect to sever {}'.f... | null | concurrent-computing/task_worker.py | task_worker.py | py | 840 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "multiprocessing.managers.BaseManager",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "queue.Empty",
"line_number": 27,
"usage_type": "attribute"
}
] |
277559126 | from flask import Flask, jsonify, request,render_template, redirect
from script import Predictor
import time
app = Flask(__name__)
url_timestamp = {}
url_viewtime = {}
prev_url = ""
working_url=""
eid = ''
doj = ''
gender = 0
company = 0
wfh = 0
des = 0
URL = ''
def url_strip(url):
if "http://" in url or "http... | null | app.py | app.py | py | 2,995 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
368485196 | #!/usr/bin/python2.4
#
# Copyright 2011 Google Inc. All Rights Reserved.
"""Displays the main page for the app."""
from google.appengine.dist import use_library
use_library("django", "1.2")
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util ... | null | chromium_automation/trunk/src/analysis/main.py | main.py | py | 780 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "google.appengine.dist.use_library",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.webapp",
"line_number": 17,
"usage_... |
230594764 | from tstk.common import *
import pysam
import sys
def parsearguments():
import argparse
description = """===================== Uber getter of overlapping reads ====================="""
epilog = """============================== Alea jacta est =============================="""
parser = argparse.Argumen... | null | tstk/get_overlapping_reads.py | get_overlapping_reads.py | py | 3,139 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
148311088 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Laurent El Shafey <Laurent.El-Shafey@idiap.ch>
# Wed Aug 21 16:56:53 CEST 2013
#
# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | null | oss/xbob.paper.tpami2013-1.0.0/xbob/paper/tpami2013/scripts/plda_scores.py | plda_scores.py | py | 7,406 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "imp.load_source",
"line_number": 58,
"usage_type": "call"
},
{
... |
82809914 | import numpy as np
import math
from matplotlib import pyplot as plt
from scipy.optimize import curve_fit
pi=np.pi
# This is the example of GOT09-dT-tao model writing with Python 3.7
# GOT09-dT-tao model is the recommended four-parameter DTC model
# GOT09-dT-tao model is modified from GOT09 model by fixing de... | null | DTC_GOT09_dT_tao.py | DTC_GOT09_dT_tao.py | py | 3,731 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.pi",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 25,
... |
171716905 | """"""
"""
* @file kwave_data_filters.py
*
* @author Filip Vaverka
* Faculty of Information Technology
* Brno University of Technology
* ivaverka@fit.vutbr.cz
*
* @brief Helper classes used to filter data used to generate k-Wave input files.
*
* @date 27 May 2... | null | Simulation/kwave_function/kwave_data_filters.py | kwave_data_filters.py | py | 4,770 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.fft.rfftn",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.fft",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "scipy.signal.blackman",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "numpy.fft.irfftn... |
637496668 | from django.http import Http404
from django.shortcuts import render
from models import Post, Blog
def home(request):
new_blogs = Blog.objects.filter(parsed=1, down=0).order_by('-id')[:30]
new_post = Post.objects.order_by('-id')[:10]
return render(request, 'blog/home.html', {'new_post': new_post,
... | null | blog/views.py | views.py | py | 1,284 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Blog.objects.filter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Blog.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.Blog",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.P... |
375414576 | #!/usr/bin/python
# -*- coding:utf-8 -*-
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import ElasticNetCV
import sklearn.datasets
from pprint import pprint
from sklearn.preprocessing import... | null | regression/9.5.Boston.py | 9.5.Boston.py | py | 4,566 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.... |
181247380 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c), 2016-2017, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/lice... | null | xmlschema/tests/test_regex.py | test_regex.py | py | 5,954 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xmlschema.codepoints.iter_code_points",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "xmlschema.codepoints.iter_code_points",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "xmlschema.codepoints.iter_code_points",
"line_number": 29,
"u... |
127702948 | import requests
import time
with open('username.txt', 'r') as f:
username = f.read()
with open('hue_ip.txt', 'r') as g:
ip = g.read()
url = f'http://{ip}/api/{username}/groups/1/action'
#body = '{"scene": "ZGnF8kDifgXKGhq"}'
#response = requests.put(url, data=body)
#print(response.json())
scene_list = ["P0Kv0ClKX... | null | house_party/hue/set_state.py | set_state.py | py | 544 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.put",
"line_number": 20,
"usage_type": "call"
}
] |
151048304 | import pandas as pd
import numpy as np
import nltk
from nltk.corpus import stopwords
yelp = pd.read_csv('yelp.csv')
yelp_train_class = yelp[(yelp['stars'] == 1) | (yelp['stars'] == 5)]
yelp_test_class = yelp[(yelp['stars'] == 2) | (yelp['stars'] == 3) | (yelp['stars'] == 4)]
X = yelp_train_class['text']
y = yelp_trai... | null | sentiment_analysis_sup.py | sentiment_analysis_sup.py | py | 1,774 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "nl... |
154457566 | import os
import sys
from flask import Flask, request, json, make_response
from flask_json import FlaskJSON, JsonError, json_response, as_json
import re
import tensorflow as tf
from matplotlib import pyplot as plt
from PIL import Image
from io import BytesIO
import numpy as np
import glob
BATCH_SIZE = 1
BUFFER_SIZE = ... | null | flask/app.py | app.py | py | 7,270 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.json",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "flask_json.FlaskJSON",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_num... |
543539180 | """Modelling classes for Make 13 Lolo game mode."""
import tile_generators
__author__ = "Benjamin Martin and Brae Webb"
__copyright__ = "Copyright 2017, The University of Queensland"
__license__ = "MIT"
__version__ = "1.1.2"
import model
import game_regular
from modules.weighted_selector import WeightedSelector
cla... | null | game_make13.py | game_make13.py | py | 4,541 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "model.AbstractTile",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "game_regular.RegularGame",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "modules.weighted_selector.WeightedSelector",
"line_number": 80,
"usage_type": "call... |
502651288 | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
data = pd.read_csv('big.csv', sep=",", header=None) #loading data file
feature_name=list(data.columns.values)
data[1] = data[1].astype('category')
data[2] = data[2].astype('category')
data[3] = data[3].astype('category')... | null | three/datasplit.py | datasplit.py | py | 1,376 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 38,
"usage_type": "call"
},
{
"api_name... |
462072486 | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 law... | null | caesarlinsa/api/app.py | app.py | py | 5,515 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "oslo_config.cfg.CONF",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "oslo_co... |
375440512 |
import requests
import json
import sqlite3
import datetime
from datetime import datetime, timedelta
def Display_Currencies():
currencies = requests.get("https://api.pro.coinbase.com/products")
y = currencies.json()
list_cur= []
for i in y:
mybool = False
for a in list_cur:
... | null | TD3.py | TD3.py | py | 3,910 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
596671243 |
import unittest
from lib import jig
import time
class Test(unittest.TestCase):
'''Test that we can interact with the jig'''
def setUp(self):
jig.reset()
def tearDown(self):
jig.reset()
def _set(self, control, state):
control.set(state)
self.assertTrue(control.state =... | null | tests/tests/test_01_jig.py | test_01_jig.py | py | 872 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "lib.jig.reset",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lib.jig",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "lib.jig.reset",
"line... |
369431752 | import pcapy
import os
import re
#Definer fil listen som vil indeholde alle Pcap filer
File_list = []
def Flow_monitor():
# Vi laeser foesrt indholdet af XML filen
f= open('Aodvtest.xml', 'r')
f1 = f.readlines()
f.close()
#vi gemmer dog kun linje 3 som indeholder det relevante data
Data_line = f... | null | Overhead2.py | Overhead2.py | py | 2,952 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.popen",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.popen",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pcapy.open_offline",
"line_number": 61... |
605449560 | import os
import torch
from data.dataset import Dataset
image_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'train')
all_file_names = sorted(os.listdir(image_dir))
train_file_names = all_file_names[:-256]
valid_file_names = all_file_names[len(train_file_names):]
preview = Dataset(image_dir, all_fil... | null | Project/data/premade.py | premade.py | py | 605 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"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.realpath",
"line_n... |
74999418 | from django.shortcuts import render, redirect
from django.views import View
from django.http import FileResponse, HttpResponse
from io import BytesIO
import json
import re
from .services.qr_code_generator import generate_link_qrcode, generate_wifi_qrcode
from .services.vcard_generator import VCardGenerator
from .servi... | null | qr/views.py | views.py | py | 6,906 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.View",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.views.View",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.... |
474462100 | import cv2
import time
from PIL import Image
import sys,time
from collections import Counter
faceCascade = cv2.CascadeClassifier('pyfacesdemo/haarcascade_frontalface_alt2.xml')
video = cv2.VideoCapture(0)
ret, frame = video.read()
index = 0
start = time.time()
cv2.imshow('Video', frame)
time.sleep(5)
while index < 10:... | null | project_4/code/recognize_emotion/getEmotions.py | getEmotions.py | py | 936 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line... |
356908153 | import asyncio
import panoramisk
from panoramisk import Manager
from threading import Thread
import sqlite3 as sq
import time
manager = Manager(loop=asyncio.get_event_loop(),
host='127.0.0.1',
port='5038',
username='testuser',
secret='12345678',
... | null | main.py | main.py | py | 3,619 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "panoramisk.Manager",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "panoramisk.Manager",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "panor... |
441197925 | from datetime import datetime, timedelta
from sqlalchemy.orm import relationship
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Boolean, Integer, String, DateTime,Float
from ..database import db
from ..mixins import CRUDModel
class Sklad(CRUDModel):
__tablename__ = 'sklad'
__tab... | null | src/data/models/sklad.py | sklad.py | py | 925 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mixins.CRUDModel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.schema.Column",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.types.Integer",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": ... |
148060485 | #!/usr/bin/python3
from multiprocessing import Pipe
from multiprocessing import Process
from os import makedirs, environ
from os.path import isfile
import time as lap
import numpy as np
import scipy.sparse as sps
import scipy.io as sio
import scipy.linalg as sla
import scipy.sparse.linalg as spsla
from qgl_util impo... | null | qgl.py | qgl.py | py | 36,955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "numpy.prod",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 1... |
498415501 | import numpy as np
from typing import List, Dict
from sklearn.metrics import classification_report, accuracy_score
from collections import defaultdict
class SupportVectorMachine():
def __init__(self):
self.w = defaultdict(lambda: 0)
self.last = defaultdict(lambda: 0)
self.c = 0.0001
def creat... | null | hirao/tutorial06/tutorial06.py | tutorial06.py | py | 3,474 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 14,
"usage_type": "call"
},
{
"api_name":... |
654083968 | import os
import numpy as np
from collections import Counter
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import confusion_matrix
from numpy import genfromtxt
def make_Dictionary(train_dir):
emails = [os.path.join(train_dir,f) for f in os.listdir(train_dir)]
all_words = []
for ... | null | spamfilter.py | spamfilter.py | py | 2,296 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_num... |
175772785 | import cv2 as cv
img = cv.imread('cat.jpg', cv.IMREAD_UNCHANGED)
def on_mouse(event, x, y, flags, param):
print(event, x, y, flags, param)
cv.namedWindow('img')
cv.setMouseCallback('img', on_mouse)
# 아무 입력없는 창 생성
# cv.imshow('img', img)
cv.waitKey()
| null | Computer Vision/2. OpenCV/03.mouse_event_0.py | 03.mouse_event_0.py | py | 280 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_UNCHANGED",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "cv2.namedWindow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.setMouseCallba... |
579667413 | """FasterRunner URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')... | null | fastrunner/urls.py | urls.py | py | 4,569 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "fastrunner.views.project.ProjectView.as_view",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "fastrunner.views.project.ProjectView",
"line_number": 23,
"usage_type": "at... |
229193312 | # import datetime
# from datetime import time
# import datetime
import time
from datetime import datetime, timedelta
from flask import Blueprint, render_template, request, session, redirect, url_for, jsonify, g, current_app
from info import constants, db
from info.models import User, News, Category
from info.utils.co... | null | info/modules/admin/views.py | views.py | py | 13,991 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "info.models.C... |
453714921 | #!/bin/python
import glob
import os
import sys
import argparse
import subprocess
####################
# Informations #
####################
courriel = 'francois-xavier.babin@outlook.fr'
parser=argparse.ArgumentParser( #creation of a parser which g... | null | python/reads_recruiter.py | reads_recruiter.py | py | 2,257 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "subprocess.call... |
556078967 | from __future__ import absolute_import
from celery.utils.log import get_task_logger
from celery import shared_task
import envoy
import time
from tasks.models import Task
from djcelery.models import TaskMeta
logger = get_task_logger(__name__)
@shared_task
def sum_two_numbers(x, y):
logger.info("Adding numbers")
... | null | dispatcher/tasks.py | tasks.py | py | 1,107 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "celery.utils.log.get_task_logger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "celery.shared_task",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "envoy.r... |
346262717 | from Object_Files.mapper5 import mapper,np
from Object_Files.basic_operator import operator
import matplotlib.pyplot as plt
import random
mapping = mapper(50000,3000)
default_bits = mapping.bits
default_maps = mapping.map
def array_normalization(input_array):
array_norm = np.linalg.norm(input_array)
# print ... | null | Dimensionality-Reduction - Real/Test Files/Other Experiments/memory_mapping_testing.py | memory_mapping_testing.py | py | 4,959 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Object_Files.mapper5.mapper",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "Object_Files.mapper5.np.linalg.norm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "Object_Files.mapper5.np.linalg",
"line_number": 11,
"usage_type": "attribu... |
374490343 | import sys
import argparse
import ceph_core as ceph
import local_spec as spec
import hubble_core as hubble
from os import listdir
def graph_all(calibrate_slope = None, calibrate_intercept = None, distance = None):
ceph.writeFileOut("\n\t------------------------------------------------------")
if ( calibrate_sl... | null | main.py | main.py | py | 4,027 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ceph_core.writeFileOut",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ceph_core.plot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ceph_core.writeFileOu... |
529980219 | import pandas as pd
from keras.layers import Dense, Dropout, LSTM, Embedding
from keras.models import Sequential
from sklearn.model_selection import train_test_split
def load_data():
train = pd.read_csv("./Data/train/random_train_data.csv",
header=None,
sep=",",
... | null | trainer/lstm.py | lstm.py | py | 2,151 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 21,
"usage_type": "call"
},
{
"api_name"... |
82569385 | import numpy as np
import pyedflib
from sklearn.preprocessing import LabelEncoder
import glob
def parse_raw_data(path):
"""
Parse raw data from edf file and return required information in the form of
a dictionary.
Args:
path (string): path to the edf file.
Returns:
(dict): dictio... | null | eeg_classification_threshold/data_utils/data_utils.py | data_utils.py | py | 5,329 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyedflib.EdfReader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "nu... |
183639183 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# We need sys to get the command line arguments
import sys
# And pyspark.sql to get the spark session
from pyspark.sql import SparkSession
# Imports
import itertools
from pyspark.sql.functions import explode
from pyspark.ml.recommendation import ALS
from pyspark.ml impor... | null | baseline/baseline_train.py | baseline_train.py | py | 4,160 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyspark.ml.feature.StringIndexer",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pyspark.ml.recommendation.ALS",
"line_number": 42,
"usage_type": "call"
},
{
"... |
626984253 | import json
from tqdm import tqdm
from glob import glob
import os
from PIL import Image
label_file = '/tcdata/tile_round2_train_20210204_update/train_annos.json'
target_file = 'data/annotations/train_round2_1.json'
with open(label_file, 'r', encoding='utf-8') as f:
labels = json.load(f)
categoryid2name = {
# ... | null | tools/process_data/label2json.py | label2json.py | py | 1,909 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 4... |
364300734 | from __future__ import print_function
import argparse
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torchvision.util... | null | fisherGenerateSamples.py | fisherGenerateSamples.py | py | 8,249 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "random.seed",
"l... |
586370245 | ###############################################################################
### KPI plots/tables for individual measured parameters
###############################################################################
### Description:
# - KPI function for creating a pie chart for a single parameter
# - KPI function for ... | null | Script/quince_kpi/meas_param_kpis.py | meas_param_kpis.py | py | 6,199 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.unique",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "matplotlib.... |
407138660 | from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import os
import argparse
import cv2
import numpy as np
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--directory", required=True,
help="path to the input imag... | null | image_generator.py | image_generator.py | py | 1,309 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 24,
"usage_type": "call"
},
{
"ap... |
515824949 | import unittest
# Third party imports
from mock import mock, patch
from tools import run_deid
class RunDeidTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
print(
'\n**************************************************************')
print(cls.__name__)
print('***... | null | tests/unit_tests/data_steward/tools/run_deid_test.py | run_deid_test.py | py | 2,587 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tools.run_deid.get_known_tables",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tools.run_deid",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "... |
427286181 | """
Copyright 2017-2018 lvaleriu (https://github.com/lvaleriu/)
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 law or ... | null | keras_retinanet/preprocessing/kitti_csv.py | kitti_csv.py | py | 9,330 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.version_info",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "generator.Generator",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "os.path.path.join",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "os.path.p... |
88509817 | import requests
import json
json_eth = []
block = 6801254
for i in range(block-5, block):
r = requests.get('https://api.etherscan.io/api?module=proxy&action=eth_getBlockByNumber&tag={}&boolean=true&'
'apikey=YourApiKeyToken'.format(hex(i)))
json_eth.append(r.json())
with open('eth_dump',... | null | extra/download_data.py | download_data.py | py | 421 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 13,
"usage_type": "call"
}
] |
266500895 | from django.test import TestCase
from django.http import HttpRequest
from django.template.loader import render_to_string
from lists.views import home_page
class HomePageViewTest(TestCase):
def test_home_page_uses_home_template(self):
request = HttpRequest()
response = home_page(request)
... | null | lists/tests.py | tests.py | py | 2,325 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.http.HttpRequest",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lists.views.home_page",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "dja... |
625803596 | import logging
import os
import subprocess
import sys
from pathlib import Path
from typing import Any, List, Optional
# need minimum 3.7 for capture_output=True
assert sys.version_info >= (
3,
7,
), f"Expected version info to be gt, but was {sys.version_info}"
logging.basicConfig(stream=sys.stdout, level=logg... | null | etc/ci_scripts/dump_artifacts.py | dump_artifacts.py | py | 3,377 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.version_info",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.st... |
587458927 | #!/usr/bin/python3
"""Defines the entity models"""
import os
import sys
__SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
__SCRIPT_DIR = os.path.normpath(os.path.join(__SCRIPT_DIR, '..'))
if not __SCRIPT_DIR in sys.path:
sys.path.append(__SCRIPT_DIR)
#from u... | null | data/models.py | models.py | py | 2,662 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_n... |
487558064 | import os
import ee
import re
import sys
import logging
import requests
import rasterio
import rioxarray as rxr
from glob import glob
from typing import Literal
from pathlib import Path
from shapely.geometry import box
from multiprocessing import Pool, cpu_count
class LandUseClassification(object):
def __init__(... | null | senegal_lcluc_tensorflow/model/pipelines/landuse_classification.py | landuse_classification.py | py | 9,048 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Literal",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number"... |
53780176 | import requests
import datetime as dt
from functools import wraps
import pytz
import numbers
__title__ = "solaredge"
__version__ = "0.0.1"
__author__ = "Bert Outtier"
__license__ = "MIT"
BASEURL = 'https://monitoringapi.solaredge.com'
def urljoin(*parts):
part_list = []
for part in parts:
p = str(par... | null | solaredge/solaredge.py | solaredge.py | py | 4,629 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
318624128 | import os
import sys
import unittest
from pathlib import Path
parentdir = Path(__file__).parents[1] #submission_template
sys.path.append(os.path.join(parentdir))
from src import utils
class CleanTest(unittest.TestCase):
def load_fixture(self, f_name):
dir=os.path.dirname(__file__)
fixture_path = o... | null | hw5/submission_template/test/test_clean.py | test_clean.py | py | 3,494 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_numb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.