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
556137290
from datetime import datetime from typing import List, Optional from app.base.base_accessor import BaseAccessor from app.quiz.models import Answer from app.quiz.schemes import ThemeListSchema from app.store.bot.models import User, UserModel, Game, GameModel, Score, ScoreModel class BotAccessor(BaseAccessor): as...
null
app/store/bot/accessor.py
accessor.py
py
3,941
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.base.base_accessor.BaseAccessor", "line_number": 10, "usage_type": "name" }, { "api_name": "app.store.bot.models.UserModel.create", "line_number": 13, "usage_type": "call" }, { "api_name": "app.store.bot.models.UserModel", "line_number": 13, "usage_type...
216771284
from rest_framework.permissions import DjangoModelPermissions from rest_framework.generics import ListAPIView, CreateAPIView, RetrieveUpdateDestroyAPIView from MHacks.v1.serializers.util import now_as_utc_epoch, parse_date_last_updated class GenericListCreateModel(CreateAPIView, ListAPIView): permission_classes ...
null
MHacks/v1/util.py
util.py
py
1,822
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.generics.ListAPIView", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.permissions.DjangoModelPermissions", "line_number": 8,...
616263300
import graphene import jwt import bcrypt import json import sys from datetime import datetime, timedelta from random import randint from graphene import relay from sqlalchemy.sql import exists from .connections import StudentFull as StudentFullField from .models import Student, Manager from .db import db_session from ....
null
app/mutations.py
mutations.py
py
4,266
python
en
code
null
code-starcoder2
66
[ { "api_name": "graphene.relay.ClientIDMutation", "line_number": 60, "usage_type": "attribute" }, { "api_name": "graphene.relay", "line_number": 60, "usage_type": "name" }, { "api_name": "graphene.String", "line_number": 62, "usage_type": "call" }, { "api_name": "g...
487997398
""" Active learning experiment. """ # Author: Alasdair Tran # License: BSD 3 clause import os import numpy as np from time import time from joblib import Parallel, delayed from numpy.random import RandomState from sklearn.cross_validation import StratifiedShuffleSplit from sklearn.linear_model import LogisticRegressi...
null
mclearn/experiment.py
experiment.py
py
9,477
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.join", "line_number...
93579406
import re import sys import datetime fblack = "30" fred = "31" fgreen = "32" fyellow = "33" fblue = "34" fpurple = "35" fcyan = "36" fwhite = "97" fdefault = "39" bblack = "40" bred = "41" bgreen = "42" byellow = "43" bblue = "44" bpurple = "45" bcyan = "46" bwhite = "47" bdefault = "49" need_high_light_tags = ['Act...
null
logcat.py
logcat.py
py
5,297
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.match", "line_number": 91, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 102, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 102, "usage_type": "attribute" }, { "api_name": "sys.stdout.write", "l...
520116732
#!/usr/bin/env python # coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from django import forms from app.models import Floor from app.models import Placement class CreateFloorForm(forms.ModelForm): image = forms.ImageField(label='image'...
null
app/forms.py
forms.py
py
1,243
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 14, "usage_type": "name" }, { "api_name": "django.forms.ImageField", "line_number": 15, "usage_type": "call" }, { "api_name": "djan...
236956106
from django.urls import path, include from . import views import main.views classroom_urls = [ # path('kids', # views.ChildrenListView.as_view(), name='list-children'), path('children/add', views.ChildAddView.as_view(), name='add-child'), # path('teachers', # views.TeachersList...
null
people/urls.py
urls.py
py
2,725
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.urls.path", ...
368543263
from datetime import datetime, timedelta import pytz from sqlalchemy import and_, case, func, literal, or_, select, union from sqlalchemy.orm import joinedload, noload, raiseload from sqlalchemy.dialects.postgresql import aggregate_order_by from app import db from app.api.helpers import Service from app.models import...
null
app/api/services/suppliers.py
suppliers.py
py
21,233
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.api.helpers.Service", "line_number": 19, "usage_type": "name" }, { "api_name": "app.models.Supplier", "line_number": 20, "usage_type": "name" }, { "api_name": "app.db.session.query", "line_number": 26, "usage_type": "call" }, { "api_name": "app....
415406507
# Justin Ventura # 01/11/20 # linearreg.py # Gull Code 2019 # Empty datasets (x = Iv, y = Dv) import matplotlib.pyplot as plt x = [] y = [] def mean(data): return (float(sum(data)) / float(len(data))) def variance(data, mean): return sum([(k - mean) ** 2 for k in data]) def covariance(x_data, x_mean, y_data, y_me...
null
linearregression/linearreg.py
linearreg.py
py
1,178
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 49, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 49, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 50, "usage_type": "call" }, { "api_name": "ma...
472547062
from flask import Flask, render_template, redirect, request import csv import collections import psycopg2 as pg import psycopg2.extras app = Flask(__name__) session = { 'sid': None, 'sname': None } db_connector = { 'host': 'localhost', 'user': 'postgres', 'dbname': 'dbapp', 'port': '5432', 'passw...
null
DB/contacts_db/app.py
app.py
py
11,975
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 28, "usage_type": "call" }, { "api_name": "flask.redirect", ...
594861120
#!/usr/bin/python # Copyright 2020 Hewlett Packard Enterprise Development LP # # 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 ...
null
ansible_collection/hpe/nimble/plugins/modules/hpe_nimble_performance_policy.py
hpe_nimble_performance_policy.py
py
12,329
python
en
code
null
code-starcoder2
66
[ { "api_name": "nimbleclient.v1.client", "line_number": 143, "usage_type": "name" }, { "api_name": "ansible_collections.hpe.nimble.plugins.module_utils.hpe_nimble.is_null_or_empty", "line_number": 152, "usage_type": "call" }, { "api_name": "ansible_collections.hpe.nimble.plugins.m...
545103348
import string import new import MySQLdb from types import * from MySQLdb.cursors import DictCursor bag_belongs_to, bag_has_many = [], [] def belongs_to(what): bag_belongs_to.append(what) def has_many(what): bag_has_many.append(what) class MysqlWrapper: def __init__(self, **kwargs): self.conn...
null
python/orm.py
orm.py
py
6,738
python
en
code
null
code-starcoder2
66
[ { "api_name": "MySQLdb.connect", "line_number": 21, "usage_type": "call" }, { "api_name": "MySQLdb.cursors.DictCursor", "line_number": 21, "usage_type": "name" }, { "api_name": "new.instancemethod", "line_number": 66, "usage_type": "call" }, { "api_name": "string....
124038523
# bdemeta import glob import json import os.path import pathlib import shutil import signal import subprocess import sys from typing import Callable, List, TextIO import bdemeta.cmake import bdemeta.graph import bdemeta.resolver import bdemeta.testing from bdemeta.cmake import Writer from bdemeta.testing import Run...
null
bdemeta/__main__.py
__main__.py
py
4,560
python
en
code
null
code-starcoder2
66
[ { "api_name": "subprocess.run", "line_number": 29, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.TextIO", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.List", "line_...
330882414
import numpy as np from cv2 import cv2 from cv2 import aruco import matplotlib.pyplot as plt import math def rotationMatrixToEulerAngles(R): sy = np.sqrt(R[0, 0] * R[0, 0] + R[1, 0] * R[1, 0]) singular = sy < 1e-6 if not singular: x = math.atan2(R[2, 1], R[2, 2]) y = math.atan2(-R[2, 0], s...
null
scripts/detect_marker_rt.py
detect_marker_rt.py
py
3,653
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sqrt", "line_number": 9, "usage_type": "call" }, { "api_name": "math.atan2", "line_number": 12, "usage_type": "call" }, { "api_name": "math.atan2", "line_number": 13, "usage_type": "call" }, { "api_name": "math.atan2", "line_number": 14, ...
165216186
from requests import request, Response from datetime import datetime from collections import namedtuple GridCell = namedtuple('GridCell', ['x', 'y']) class RobotCommands: def __init__(self, ip: str = "127.0.0.1"): self.ip = ip def _genericRequest(self, verb: str, endpoint: str, **kwargs): ur...
null
mistyPy/RobotCommands.py
RobotCommands.py
py
62,754
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.Response", "line_number": 38, "usage_type": "name" }, { "api_name": "requests.Res...
531878267
import torch import torch.nn as nn import torch.utils.model_zoo as model_zoo from torchvision.models import resnet import torch.nn.functional as F import pdb class CelebNet(nn.Module): def __init__(self, num_classes, num_features=0, dropout=0.6, set_pooling='max'): super(CelebNet, self).__init__() ...
null
SSIN/model/motionnet.py
motionnet.py
py
16,435
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torchvision.models.resnet.resnet50", "line_number": 17, "usage_type": "call" }, { "api_name": "torchv...
621299888
import connexion from service import cabys as service from service import utils # Searches for medicaments matching the received text def search_meds(): body = connexion.request.json stuff = service.search(body, service.Search.MEDS) # I'M BAD A NAMING THINGS response = utils.prepareResponse('medicamentos'...
null
routes/cabys.py
cabys.py
py
891
python
en
code
null
code-starcoder2
66
[ { "api_name": "connexion.request", "line_number": 8, "usage_type": "attribute" }, { "api_name": "service.cabys.search", "line_number": 9, "usage_type": "call" }, { "api_name": "service.cabys", "line_number": 9, "usage_type": "name" }, { "api_name": "service.cabys....
236149906
from flask import Flask, render_template import sqlite3 app = Flask(__name__) @app.route("/") def hello(): conn = sqlite3.connect('DB_10.db') conn.row_factory=sqlite3.Row c = conn.cursor() c.execute("select * from PLANT") rows = c.fetchall() return render_template("test_...
null
workspace/서버담당/test_s15.py
test_s15.py
py
434
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.render_template", ...
124765226
import json import csv class filter: def __init__(self, number, RGB, name, description): self.number = number self.rgb = RGB self.name = name self.description = description def diff(self, r2, g2, b2): r1 = self.rgb[0] g1 = self.rgb[1] b1 = self.rgb[2] ...
null
main.py
main.py
py
3,658
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 29, "usage_type": "call" }, { "api_name": "json.load", "line_number": 32, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_number": 54, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number"...
401198827
''' 所有表名等同于该py文件的文件名 ''' theModule_table_name = __file__.split('/')[-1].split('\\')[-1].split('.')[0] from database.base_table import BaseTable, Flag_TestIsNeed from database.all_info.all_tables_info import all_tables_info from database.all_info.DB_simulator_infos import DB_simulator_infos import warnings class Activ...
null
database/activity_student.py
activity_student.py
py
8,641
python
en
code
null
code-starcoder2
66
[ { "api_name": "database.base_table.BaseTable", "line_number": 9, "usage_type": "name" }, { "api_name": "database.all_info.all_tables_info.all_tables_info", "line_number": 10, "usage_type": "name" }, { "api_name": "database.all_info.DB_simulator_infos.DB_simulator_infos", "lin...
138924613
from django import forms #from App.models import Lugar, Area, Citacion, Asistente, Tema, Acta, Tarea #from django.forms import ModelForm from App.models import Lugar, Reuniones from django.forms import ModelForm #Form Citaciones class RegisReuniones(forms.ModelForm): #def __init__(self, *args, **kwargs): # super(Re...
null
P_Final/MiActasReuPanaWeb/App/forms.py
forms.py
py
707
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "App.models.Reuniones", "line_number": 15, "usage_type": "name" } ]
184787794
from urllib.parse import urlparse from urllib.parse import urlunparse from dns.exception import DNSException from dns.resolver import Resolver from requests import ConnectionError from requests import Session as _Session from requests.adapters import HTTPAdapter class SRVResolverHTTPAdapter(HTTPAdapter): def __i...
null
requests_srv.py
requests_srv.py
py
2,969
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.adapters.HTTPAdapter", "line_number": 11, "usage_type": "name" }, { "api_name": "dns.resolver.Resolver", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 23, "usage_type": "call" }, { "api_nam...
419737571
import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017") mydb = myclient["mydatabase"] mycol = mydb["customers"] mydict = { "nome" : "davi", "email": "davi@teste.com", "telefone" : "16 8888 7777"} x = mycol.insert_one(mydict) print(x.inserted_id)
null
Linguagens de programação/pymongo/ex_insert_mongo.py
ex_insert_mongo.py
py
270
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 3, "usage_type": "call" } ]
458231449
import numpy as np import pandas as pd from pandas import DataFrame, Series import random import time import math import datetime as dt import random import copy from datetime import datetime from time import mktime import os import json from functools import cmp_to_key from itertools import groupby impo...
null
BusRoute400/loaddata2.py
loaddata2.py
py
17,360
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 44, "usage_type": "call" }, { "api_name": "json.load", "line_number": 71, "usage_type": "call" }, { "api_name": "json.load", "line_number": 76...
483684014
# -*- coding: utf-8 -*- """ Created on Sun Aug 16 16:17:22 2020 @author: yunxuan """ import tensorflow as tf import numpy as np from tensorflow import keras from tensorflow.python.keras.layers.core import Dense from tensorflow.python.keras.models import Sequential from tensorflow.contrib import lite from t...
null
trainingtoLite.py
trainingtoLite.py
py
2,472
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.loadtxt", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.keras.Sequential", "line_number": 27, "usage_type": "call" }, { "api_name": "tensorflow.kera...
612042620
import sys import wordnet import argparse import os import pickle def update_def(wn, synset, defn, add): print("Previous definitions:") for d in synset.definitions: print("> " + d.text) wn_synset = wordnet.parse_wordnet("src/wn-%s.xml" % synset.lex_name) ss = wn_synset.synset_by_id(synset.id) ...
null
scripts/change-definition.py
change-definition.py
py
1,745
python
en
code
null
code-starcoder2
66
[ { "api_name": "wordnet.parse_wordnet", "line_number": 11, "usage_type": "call" }, { "api_name": "wordnet.Definition", "line_number": 14, "usage_type": "call" }, { "api_name": "wordnet.Definition", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse....
222666656
# Amanda Foun from __future__ import print_function from flask import Flask, request import os import random import math import sys from pymongo import MongoClient, TEXT import time import re import json from bson.son import SON from bson.json_util import dumps #from util import #log MONGO_URL = 'mongodb://allRecipes...
null
recipeQueries.py
recipeQueries.py
py
2,872
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 19, "usage_type": "call" } ]
32830546
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from settings import Global ## CHECK FOR GPU'S ## CUDA = torch.cuda.is_available() if CUDA: device = torch.device("cuda:0") else: device = torch.device("cpu") class Module(nn.Module, Global): def __init__(self, param): ...
null
references/Thesis_Data_Code/loss.py
loss.py
py
1,034
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.cuda.is_available", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.device", ...
546825625
import pandas as pd import numpy as np from mendeleev import element from fuerzas import * def ranf(): return np.random.uniform() def conf_inicial_2d(**kwargs): N = kwargs.get('N', 20) dens = kwargs.get('dens', 1) iter_check = kwargs.get('iter_check', 10) tol = kwargs.get('tol', 0.7) seed...
null
code/conf_inicial_2d.py
conf_inicial_2d.py
py
2,682
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.uniform", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random",...
260892494
from collections import Counter def compute_fitting_quotient(text: bytes) -> float: """ Given the stream of bytes `text` the function computes the fitting quotient of the letter frequency distribution for `text` with the letter frequency distribution of the English language. The function returns...
null
crack_repeating_key_xor.py
crack_repeating_key_xor.py
py
5,975
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.Counter", "line_number": 29, "usage_type": "call" } ]
259031461
#!/usr/bin/python3 import json import tinydb import random inFile = input('Enter JSON DB: ') with open(inFile, 'r') as file: db = json.loads(file.read()) index = random.randrange(0, len(db)) print('Experiment Acronym : ' + db[index]['Acronym']) guess = False while(guess == False): ExpName = input('Experim...
null
guess.py
guess.py
py
917
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 12, "usage_type": "call" } ]
446407573
#! /usr/bin/env python3 import os, sys import re import argparse import fileinput ###################################################################### # Parsing optional command line arguments ###################################################################### parser = argparse.ArgumentParser(description=""" R...
null
bin/remove-chunk.py
remove-chunk.py
py
4,518
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "fileinput.input", "line_number": 63, "usage_type": "call" }, { "api_name": "fileinput.input", "line_number": 83, "usage_type": "call" } ]
591030667
from unittest import TestCase # no need to use overbloated django testcase here from django.core.exceptions import ValidationError from challenges.validators import MaxFloatDigitValidator, PossibleFloatDigitValidator class MaxFloatDigitTests(TestCase): def test_valid_integers(self): validator = MaxFloa...
null
deadline_/challenges/tests/test_validators.py
test_validators.py
py
2,264
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "challenges.validators.MaxFloatDigitValidator", "line_number": 10, "usage_type": "call" }, { "api_name": "challenges.validators.MaxFloatDigitValidator", "line_number": 17, "usage_ty...
442170300
import unittest from pyapprox.variable_transformations import * from pyapprox.variables import IndependentMultivariateRandomVariable from scipy.linalg import lu_factor, lu as scipy_lu from pyapprox.tests.test_rosenblatt_transformation import rosenblatt_example_2d from scipy.stats import beta as beta_rv from scipy.stats...
null
pyapprox/tests/test_variable_transformations.py
test_variable_transformations.py
py
12,131
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "scipy.stats.uniform", "line_number": 35, "usage_type": "call" }, { "api_name": "scipy.stats.beta", "line_number": 35, "usage_type": "call" }, { "api_name": "scipy.sta...
432303579
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('herders', '0006_auto_20150421_0010'), ] operations = [ migrations.AddField( model_name='monster', na...
null
herders/migrations/0007_monster_archetype.py
0007_monster_archetype.py
py
553
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
391241355
import numpy as np from sklearn.svm import SVR from sklearn import cross_validation from numpy import unravel_index def get_lineage(tree,leaf_index,node_depth): left = tree.tree_.children_left right = tree.tree_.children_right threshold = tree.tree_.threshold lineage = [] for child in leaf_index: ...
null
help_functions.py
help_functions.py
py
2,184
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.where", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
474793192
from .models import PackingList, FarmersAll import os import math import json RICE_MOISTURE = json.load(open(os.path.join(os.path.dirname(__file__),'rice_moisture.json'))) RICE_PRICE = json.load(open(os.path.join(os.path.dirname(__file__),'rice_price.json'))) RICE_AMOUNTS = json.load(open(os.path.join(os.path.dirnam...
null
rice10701/rice_util.py
rice_util.py
py
8,127
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number":...
572771222
from flask import ( Blueprint, flash, g, redirect, render_template, request, url_for ) from werkzeug.exceptions import abort from flaskr.auth import login_required from flaskr.db import get_db # note: no url_prefix param bp = Blueprint('blog', __name__) @bp.route('/') def index(): db = get_db() posts = d...
null
flaskr/blog.py
blog.py
py
3,730
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "flaskr.db.get_db", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request....
600005543
""" scraping.base ~~~~~~~~~~~~~ This module provides: * Scraper class, which instances are used to manage the scraping procediment. * Interfaces to customize the behaviors to be used within Scraper instances. * ScrapingException, to be raised in case of an *expected* failure during ...
null
src/scraping/base.py
base.py
py
3,648
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "lxml.html.HTMLParser", "line_number": 30, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 30, "usage_type": "name" }, { "api_name": "lxml.html.document_fromst...
242486682
#!/usr/bin/env python # encoding: utf-8 """ __init__.py Created by Kurtiss Hare on 2010-08-15. Copyright (c) 2010 Medium Entertainment, Inc. All rights reserved. """ from fabric.api import abort, cd, env, sudo, put, run import collections, os, time def _(s, **kwargs): if kwargs: params = dict((k,v) for ...
null
src/fablib/__init__.py
__init__.py
py
8,288
python
en
code
null
code-starcoder2
66
[ { "api_name": "fabric.api.env.items", "line_number": 16, "usage_type": "call" }, { "api_name": "fabric.api.env", "line_number": 16, "usage_type": "name" }, { "api_name": "fabric.api.env", "line_number": 18, "usage_type": "name" }, { "api_name": "fabric.api.env.git...
228017263
#! /usr/bin/env python import matplotlib matplotlib.use('GTKAgg') import matplotlib.pyplot as plt import numpy as np import time plotters = {'background':0, 'qui':0, 'surf':0} def getSize(varsPath): size = 0 with open(varsPath) as inFile: for lines in inFile: lines = lines.rsplit() ...
null
src/plot.py
plot.py
py
1,944
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number"...
354651490
import bpy import time import sys import os import re from threading import Thread object_mode = 'OBJECT' edit = 'EDIT' sculpt = 'SCULPT' vertex_paint = 'VERTEX_PAINT' weight_paint = 'WEIGHT_PAINT' texture_paint = 'TEXTURE_PAINT' particle_edit = 'PARTICLE_EDIT' pose = 'POSE' a_props = [] class Menu(): def __init...
null
addons/advanced_ui_menus/core.py
core.py
py
7,667
python
en
code
null
code-starcoder2
66
[ { "api_name": "bpy.context.scene.statistics", "line_number": 64, "usage_type": "call" }, { "api_name": "bpy.context", "line_number": 64, "usage_type": "attribute" }, { "api_name": "bpy.context.scene.statistics", "line_number": 71, "usage_type": "call" }, { "api_na...
86246687
from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth import login,authenticate,logout #from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_exempt from django.http imp...
null
src/nyumba/views.py
views.py
py
35,519
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 20, "usage_type": "call" }, { "api_name": "user_account.models.myUser.objects.get", "line_number": 27, "usage_...
5928905
import pytest import numpy as np from numpy.testing import assert_equal from xarray.testing import assert_equal as xr_assert_equal from xarray.testing import assert_identical as xr_assert_identical from nd import utils from nd.testing import equal_list_of_dicts, generate_test_dataset import time from datetime import da...
null
nd/utils/tests/test_utils.py
test_utils.py
py
5,002
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "call" }, { "api_name": "dateutil.tz.tzutc", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.testing.assert_equal", "line_number": 21, "usage_type": "call" }, { "api_name": "nd.uti...
653985952
import jsonschema from craton import api from craton.api.v1.schemas import filters, validators from craton.tests import TestCase VALIDATORS = { "with_schema": [ ('ansible_inventory', 'GET'), ('cells', 'GET'), ('cells', 'POST'), ('cells_id', 'GET'), ('cells_id', 'PUT'), ...
null
craton/tests/unit/test_api_schema.py
test_api_schema.py
py
6,959
python
en
code
null
code-starcoder2
66
[ { "api_name": "craton.tests.TestCase", "line_number": 73, "usage_type": "name" }, { "api_name": "craton.api.v1.schemas.validators.keys", "line_number": 77, "usage_type": "call" }, { "api_name": "craton.api.v1.schemas.validators", "line_number": 77, "usage_type": "name" ...
634546219
from rest_framework import serializers from company import models class CompanySerializer(serializers.ModelSerializer): """ Serializer for Shop model from shop application. """ class Meta: model = models.Company class BillSerializer(serializers.HyperlinkedModelSerializer): """ User...
null
api/v1/company/serializers.py
serializers.py
py
739
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "company.models.Company", "line_number": 12, "usage_type": "attri...
211555574
import tweepy import twitter_api_client import config from datetime import timezone from kafka import KafkaProducer # twitter API config consumer_key = config.consumer_key consumer_secret = config.consumer_secret access_token = config.access_token access_secret = config.access_secret class CompanyStreamListener(twee...
null
sentiment_analysis/backend/twitter_functions/twitter_stream.py
twitter_stream.py
py
1,657
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.consumer_key", "line_number": 8, "usage_type": "attribute" }, { "api_name": "config.consumer_secret", "line_number": 9, "usage_type": "attribute" }, { "api_name": "config.access_token", "line_number": 10, "usage_type": "attribute" }, { "api_n...
60734242
import requests import uuid from datetime import datetime as dt from typing import List from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from passlib.context import CryptContext from models import DogsList, DogDelete from db import database, dogs pwd_context = CryptContext(schemes=["bcry...
null
main.py
main.py
py
2,323
python
en
code
null
code-starcoder2
66
[ { "api_name": "passlib.context.CryptContext", "line_number": 12, "usage_type": "call" }, { "api_name": "fastapi.FastAPI", "line_number": 14, "usage_type": "call" }, { "api_name": "db.database.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "db.d...
13593566
import spidev import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) sr_latch_pin = 13 GPIO.setup(13, GPIO.OUT) GPIO.output(sr_latch_pin, 1) #time.sleep(0.001) #GPIO.output(13, 0) #time.sleep(0.001) #GPIO.output(13, 1) spi = spidev.SpiDev() spi.open(1, 0) spi.max_speed_hz = 500000 # 100 kHz #spi.no_cs = False #...
null
block_checkoff_code/senior_design_spi_test.py
senior_design_spi_test.py
py
1,181
python
en
code
null
code-starcoder2
66
[ { "api_name": "RPi.GPIO.setmode", "line_number": 5, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 5, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 5, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setup", "line_n...
592902643
from NetworkBehaviour.Input.Pattern_Basics import * import random import numpy as np from collections import Counter import pypianoroll as piano import os import re from sklearn.feature_extraction.text import CountVectorizer from scipy.stats import entropy #{' PERIOD': '.', ' COMMA': '.', ' QUESTION': '.'} #, 'MNAME'...
null
NetworkBehaviour/Input/SORN/MusicActivator.py
MusicActivator.py
py
21,488
python
en
code
null
code-starcoder2
66
[ { "api_name": "pypianoroll.parse", "line_number": 62, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 66, "usage_type": "call" }, { "api_name": "numpy.any", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.any", "line_number"...
600066085
import numpy as np import matplotlib.pyplot as plt import seaborn as sns rc={'lines.linewidth': 2, 'axes.labelsize': 18, 'axes.titlesize': 18} sns.set(rc=rc) # Specify parameters n_gen = 16 r = 1e-5 # Total number of cells n_cells = 2**(n_gen - 1) ai_samples = np.random.binomial(n_cells, r, size=100000) # Plot his...
null
luria_delbruck.py
luria_delbruck.py
py
889
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random.binomial", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot....
340527140
#!/bin/python3 from PIL import Image from concurrent.futures import ThreadPoolExecutor import glob import sys import os default_frame_size = (640, 640) def squarify_image(output_dir, square_side, img_name): new_frame = Image.new('RGB', default_frame_size, 'white') new_frame.paste(Image.open(img_name), (0, 0)) new...
null
squarify-images.py
squarify-images.py
py
1,474
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.new", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number":...
382448006
from math import ceil import collections import sys FILE_NAME = "./D-large-practice" # initialize sys.setrecursionlimit(15000) MAXN = 10001 M = ceil(MAXN**0.5) cakes = [i * i for i in range(1, M)] dp = collections.defaultdict(lambda: 9999) dp[0] = 0 def dfs(x): if x not in dp: for cake in cakes: ...
null
Google Code Jam/2017 Kickstart Round F/D. Eat Cake.py
D. Eat Cake.py
py
947
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.setrecursionlimit", "line_number": 8, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" } ]
319405137
import pydicom class EquipmentAnonymizer: def __init__(self, address_anonymizer): """\ Create a new EquipmentAnonymizer. Parameters ---------- address_anonymizer : dicognito.addressanonymizer.AddressAnonymizer Provides anonymized address components. ...
null
src/dicognito/equipmentanonymizer.py
equipmentanonymizer.py
py
2,505
python
en
code
null
code-starcoder2
66
[ { "api_name": "pydicom.datadict.tag_for_keyword", "line_number": 17, "usage_type": "call" }, { "api_name": "pydicom.datadict", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pydicom.datadict.tag_for_keyword", "line_number": 18, "usage_type": "call" }, ...
261780097
from django.conf.urls import url from django.contrib import admin from atividade import views urlpatterns = [ url(r'^show/(?P<atividade_id>\d+)$', views.show, name='atividade_show'), url(r'^new/$', views.new, name='atividade_new'), url(r'^create/$', views.create, name='atividade_create'), url(r'^edit/$...
null
ref-mac0350/mac0350fase3/atividade/urls.py
urls.py
py
484
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "atividade.views.show", "line_number": 6, "usage_type": "attribute" }, { "api_name": "atividade.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.co...
526741299
import time from logging import getLogger from crawler.core.scheduler.crawl_task_scheduler import CrawlTaskScheduler from crawler.core.stock_cmdb.StockCmdb import StockCMDB from crawler.core.task_generator.task_generator import TaskGenerator import traceback logger = getLogger() class CrawlerManager(StockCMDB): ...
null
src/crawler/core/CrawlerManager.py
CrawlerManager.py
py
1,594
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "crawler.core.stock_cmdb.StockCmdb.StockCMDB", "line_number": 12, "usage_type": "name" }, { "api_name": "crawler.core.stock_cmdb.StockCmdb.StockCMDB", "line_number": 15, "usage_type...
550195924
# -*- coding: utf-8 -*- """ Created on Tue Jun 22 23:19:38 2021 @author: Anindita """ # -*- coding: utf-8 -*- """ Created on Tue Jun 22 20:04:22 2021 @author: Anindita """ import Pyro4 import sys HOST='localhost' PORT=9090 if len(sys.argv) == 2 or len(sys.argv) > 3: print(''' If you want to...
null
Advance Communication and TCP_IP/1/client7.py
client7.py
py
2,496
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 29, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
464521528
import os import unittest from datetime import datetime from quickbooks.client import QuickBooks from quickbooks.objects.term import Term class TermTest(unittest.TestCase): def setUp(self): self.qb_client = QuickBooks( sandbox=True, consumer_key=os.environ.get('CONSUMER_KEY'), ...
null
tests/integration/test_term.py
test_term.py
py
1,313
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "quickbooks.client.QuickBooks", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os....
202154460
from __future__ import print_function, division, absolute_import import atexit import logging import os from sys import exit import click from distributed import Nanny, Worker from distributed.config import config from distributed.utils import get_ip_interface, parse_timedelta from distributed.worker import _ncores f...
null
dask_cuda/dask_cuda_worker.py
dask_cuda_worker.py
py
7,730
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "click.Path", "line_number": 36, "usage_type": "call" }, { "api_name": "distributed.proctitle.enable_proctitle_on_current", "line_number": 165, "usage_type": "call" }, { "a...
624450062
""" These views pertain to BlogpostContent. """ from django.contrib.postgres.search import SearchVector from django.db.models import Q from django.utils import timezone from nltk.stem import PorterStemmer from rest_framework import filters, generics, viewsets, status from rest_framework.response import Response from .m...
null
backend/api/blogpost_content/views.py
views.py
py
5,051
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.generics.ListAPIView", "line_number": 14, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 14, "usage_type": "name" }, { "api_name": "models.BlogpostContent.objects.all", "line_number": 18, "usage_type": "c...
87665116
import boto3 import re import sys import argparse from xl_helper import ExcelSheet def camel_to_space(name): name = re.sub('(.)([A-Z][a-z]+)', r'\1 \2', name) return re.sub('([a-z0-9])([A-Z])', r'\1 \2', name) def get_savings_plans_recommendations(profile, term="ONE_YEAR", payment_options="NO_UPFRONT", acc...
null
cost_saving_recommendations_to_excel.py
cost_saving_recommendations_to_excel.py
py
10,334
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 10, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 11, "usage_type": "call" }, { "api_name": "boto3.session.Session", "line_number": 22, "usage_type": "call" }, { "api_name": "boto3.session", "line_number"...
112659847
def matchedFilter(data, template=None, makePlots=False): """ Created on Thu Feb 15 15:20:01 2018 @author: Michael Stephens Program performs matched filtering using the methods described in Allen et al., 2012. Parameters ---------- data: float64 numpy array ...
null
functions/matchedFilter.py
matchedFilter.py
py
4,350
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.loadtxt", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.pad", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.fft.rfftfreq", "line_number": 78, "usage_type": "call" }, { "api_name": "numpy.fft", "line_numb...
367233226
from django.http import HttpResponse from django.shortcuts import render, redirect from django.contrib import messages import bcrypt from .models import * from .forms import * from .utils import * def index(request): return render(request, "index.html") def guest(request): return render(request, "guest.html"...
null
church_app/views.py
views.py
py
18,145
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 16, "usage_type": "call" }, { "api_name"...
299505728
# -*- coding: utf-8 -*- """Constants for the builds app.""" from django.conf import settings from django.utils.translation import ugettext_lazy as _ BUILD_STATE_TRIGGERED = 'triggered' BUILD_STATE_CLONING = 'cloning' BUILD_STATE_INSTALLING = 'installing' BUILD_STATE_BUILDING = 'building' BUILD_STATE_FINISHED = 'fin...
null
readthedocs/builds/constants.py
constants.py
py
1,453
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 16, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 17, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 18, ...
579463466
#!/usr/bin/python2.4 # Copyright 2010 Google 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 ...
null
core/query_processor.py
query_processor.py
py
12,368
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.info", "line_number": 52, "usage_type": "call" }, { "api_name": "pickle.loads", "line_number": 67, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 73, "usage_type": "call" }, { "api_name": "google.appengine.api.datastore...
171114620
import torch import torch.nn as nn import torch.functional as F from torch.autograd import Variable from util.cuda import to_var,align import numpy as np from src.dec_image import DecoderConv from src.BigGAN_networks import Generator as G_net class Decoder(nn.Module): def __init__(self, vis_dim=512, vis_num=36, ...
null
src/decoder.py
decoder.py
py
17,019
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn", "line...
466952882
#%run c:\plr\catalys\analytics_5.py import pandas as pd import numpy as np import sys from openpyxl import load_workbook from bokeh.plotting import figure, show, output_file from bokeh.palettes import brewer from bokeh.models import HoverTool, FixedTicker from bokeh.plotting import ColumnDataSource, figure, show, ou...
null
analytics_5.py
analytics_5.py
py
6,974
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.ExcelFile", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 25, "usage_type": "call" }, { "api_name": "openpyxl.load_work...
647501725
''' NavigationMDP.py: Contains the NavigationMDP class. ''' # Python imports. from __future__ import print_function import numpy as np from simple_rl.tasks import GridWorldMDP from simple_rl.tasks.grid_world.GridWorldStateClass import GridWorldState class NavigationMDP(GridWorldMDP): ''' Class for Na...
null
simple_rl/tasks/navigation/NavigationMDP.py
NavigationMDP.py
py
7,620
python
en
code
null
code-starcoder2
66
[ { "api_name": "simple_rl.tasks.GridWorldMDP", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.random.choice", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 54, "usage_type": "attribute" }, { "api_name": "num...
520066666
import scipy, scipy.spatial import numpy as np np.random.seed(4) points = np.random.random((2, 100)) plot(points[0], points[1], 'ok') tree = scipy.spatial.KDTree(points.T) indices = tree.query_ball_point((0.5, 0.5), 0.1) plot([0.5], [0.5], 'or', ms=10) plot(points[0,indices], points[1, indices], 'oc') results = tree.q...
null
translation_of_course_in_french/source/arbre.py
arbre.py
py
408
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.random.random", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", ...
60735867
import torch from torchvision import transforms import torchvision from torch.utils.data import DataLoader from dataloader import BlurImageDataset IMAGE_PARENT = '/home/ubuntu/Workspace/blur_recog/blur_cam_test' IMAGE_W_LABEL_TXT = '../data_generator/class_id_to_files_70001_test.txt' MODEL_NAME = 'blur_cls_resnet18_128...
null
backup/test_model.bc.py
test_model.bc.py
py
2,078
python
en
code
null
code-starcoder2
66
[ { "api_name": "torchvision.transforms.Compose", "line_number": 13, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 13, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 14, "usage_type": "call" }, { ...
437091218
#!/usr/bin/env python # coding: utf-8 import json import numpy as np class Arrow(object): DELIMITER = "_" def __init__(self, waypoint=None): self.waypoint = waypoint self.__arrows = None self.__to_arrows = None self.__from_arrows = None def load(self, path): with ...
null
ams/utilities/arrow.py
arrow.py
py
7,244
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 44, "usage_type": "attribute" }, { "api_name": "numpy.subtract", "l...
214854365
# import necessary packages import numpy as np import matplotlib.pyplot as plt import calcModule as calMod # Important custom functions import constraintModule as conMod from calcModule import ATransformMatrix as ATrans, link2index, prettyMatVect2 # 1. === INPUT PARAMETERS (GLOBAL VARIABLES) ====== # ===============...
null
doublePendulumUTAMA.py
doublePendulumUTAMA.py
py
8,203
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.pi", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
419987317
import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt matplotlib.use("Agg") import warnings warnings.filterwarnings('ignore') ############################################################################# from sklearn import preprocessing import datetime ############################...
null
finrl/autotrain/training.py
training.py
py
6,522
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 5, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.path", "...
489600042
# -*- coding: utf-8 -*- """ Created on Tue Jan 30 10:38:23 2018 @author: 9888120 """ import sys from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfpage import PDFPage from pdfminer.converter import XMLConverter, HTMLConverter, TextConverter from pdfminer.layout import LA...
null
pdfTotext.py
pdfTotext.py
py
948
python
en
code
null
code-starcoder2
66
[ { "api_name": "pdfminer.pdfinterp.PDFResourceManager", "line_number": 17, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 18, "usage_type": "call" }, { "api_name": "pdfminer.layout.LAParams", "line_number": 20, "usage_type": "call" }, { "api_na...
400321169
# Copyright 2017 Google 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 applicable law or a...
null
upvote/gae/modules/upvote_app/lib/voting_test.py
voting_test.py
py
45,218
python
en
code
null
code-starcoder2
66
[ { "api_name": "upvote.gae.datastore.test_utils.CreateSantaEvent", "line_number": 36, "usage_type": "call" }, { "api_name": "upvote.gae.datastore.test_utils", "line_number": 36, "usage_type": "name" }, { "api_name": "upvote.gae.datastore.utils.ConcatenateKeys", "line_number": ...
172553495
""" University of Minnesota Aerospace Engineering and Mechanics - UAV Lab Copyright 2019 Regents of the University of Minnesota See: LICENSE.md for complete license details Author: Chris Regan Analysis for Huginn (mAEWing2) FLT 03 """ #%% # Import Libraries import numpy as np import matplotlib.pyplot as plt # Hack ...
null
Examples/HuginnAeroPID_Disturb.py
HuginnAeroPID_Disturb.py
py
13,646
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.insert", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 22, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_num...
530937780
from setuptools import setup, find_packages install_requires=['requests', 'docopt'] try: import json except ImportError: install_requires.append('simplejson') setup( name='gist_it', version='1.0.5', license='MIT', description='Gist_it can send gist', author='se s', url='https://github...
null
pypi_install_script/gist_it-1.0.5.tar/setup.py
setup.py
py
820
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 10, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 18, "usage_type": "call" } ]
142751419
from setuptools import find_packages, setup import os name = os.path.split(os.getcwd())[1] setup( name=name, packages=find_packages(), package_dir={'': 'src'}, version='0.1.0', description='description', author='Andrew', license='MIT', )
null
setup.py
setup.py
py
265
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.split", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 3, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number...
472444824
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('stream', '0003_remove_post_thumbnail'), ] operations = [ migrations.CreateModel( name='PostComment', ...
null
stream/migrations/0004_auto_20151129_0014.py
0004_auto_20151129_0014.py
py
848
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
342284335
import requests from bs4 import BeautifulSoup URL = f'http://www.saramin.co.kr/zf_user/search/recruit?search_area=main&search_done=y&search_optional_item=n&searchType=default_mysearch&searchword=Python' URL_op = f'&recruitSort=relation&recruitPageCount=40&inner_com_type=&company_cd=0,1,2,3,4,5,6,7,9&quick_apply=' de...
null
Java Study/saramin.py
saramin.py
py
1,824
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "l...
546055585
import pytest import snappi def test_slots(api): """Test that dynamically created attributes are disallowed. This is done by ensuring that the special variable __dict__ is not present in any classes. The proper use of the special variable __slots__ ensures that the __dict__ special variable will ...
null
snappi/tests/test_slots.py
test_slots.py
py
706
python
en
code
null
code-starcoder2
66
[ { "api_name": "snappi.snappicommon.SnappiBase", "line_number": 13, "usage_type": "call" }, { "api_name": "snappi.snappicommon", "line_number": 13, "usage_type": "attribute" }, { "api_name": "snappi.snappicommon.SnappiObject", "line_number": 15, "usage_type": "call" }, ...
251446360
import path import svg_parser from LaserCommandConstants import * from RasterPlotter import RasterPlotter, X_AXIS, TOP, BOTTOM VARIABLE_NAME_NAME = 'name' VARIABLE_NAME_COLOR = 'color' VARIABLE_NAME_FILL_COLOR = 'fill' VARIABLE_NAME_SPEED = 'speed' VARIABLE_NAME_POWER = 'power' VARIABLE_NAME_PASSES = 'passes...
null
ProjectNodes.py
ProjectNodes.py
py
13,072
python
en
code
null
code-starcoder2
66
[ { "api_name": "path.Matrix", "line_number": 156, "usage_type": "call" }, { "api_name": "svg_parser.parse_svg_transform", "line_number": 177, "usage_type": "call" }, { "api_name": "RasterPlotter.X_AXIS", "line_number": 220, "usage_type": "name" }, { "api_name": "Ra...
534058815
#Procesamiento de Data from poblar_onto import Populate from rdflib import RDF, OWL, URIRef, Graph from rdflib.plugins.sparql import prepareQuery #from numpy import nan import math import pandas as pd import urllib.parse def LeerDatos(filename : str, header = True): if (header): data = pd.r...
null
framework v. 0.2/trash/procesar_data_catalina.py
procesar_data_catalina.py
py
17,325
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "poblar_onto.Populate", "line_number": 72, "usage_type": "call" }, { "api_name": "rdflib.Graph", ...
454360217
# Author: Amee Trivedi # Objective: To plot formatting and insert times for various graph sizes as determined by the value of s import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot as plt import os def compute_speed(row): return(row["Disk_Space"]*1.0/row["Real_Time"]) def ...
null
outputs/plots/formatting_insert_times.py
formatting_insert_times.py
py
1,323
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 33, "usage_type": "call" }, { "api_name": "seaborn.lineplot", "l...
308100169
from unittest.mock import patch import pytest from oslash.either import Left, Right from jsonrpcserver.async_dispatcher import ( call, dispatch_deserialized, dispatch_request, dispatch_to_response_pure, ) from jsonrpcserver.async_main import default_deserializer, default_validator from jsonrpcserver.c...
null
tests/test_async_dispatcher.py
test_async_dispatcher.py
py
3,046
python
en
code
null
code-starcoder2
66
[ { "api_name": "jsonrpcserver.result.Success", "line_number": 23, "usage_type": "call" }, { "api_name": "jsonrpcserver.result.Result", "line_number": 22, "usage_type": "name" }, { "api_name": "jsonrpcserver.async_dispatcher.call", "line_number": 28, "usage_type": "call" ...
36804946
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import datetime class Migration(migrations.Migration): dependencies = [ ('login', '0002_staff_can_scan_ticket'), ('seminar', '0015_clientattendance_scan_count'), ] operations = [ ...
null
seminar/migrations/0016_auto_20160517_1027.py
0016_auto_20160517_1027.py
py
996
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 16, "usage_type": "call" }, { ...
454768817
"""empty message Revision ID: e4d95e5cac23 Revises: dd0add1fef94 Create Date: 2019-09-06 10:22:37.609143 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'e4d95e5cac23' down_revision = 'dd0add1fef94' branch_labels = None depends_on = None def upgrade(): # ...
null
migrations/versions/e4d95e5cac23_.py
e4d95e5cac23_.py
py
670
python
en
code
null
code-starcoder2
66
[ { "api_name": "alembic.op.drop_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.add_column", "line_number": 27, "usage_type": "call" }, { "api_name": "alembic.op", ...
585054279
import dash import dash_core_components as dcc import dash_html_components as html from scrapedData import Open Y1 , X1 = Open() app = dash.Dash() app.layout = html.Div(children=[ html.H1('Dash Board'), dcc.Graph(id = 'example', figure={ 'data':[ {'x':X1...
null
chart.py
chart.py
py
539
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapedData.Open", "line_number": 7, "usage_type": "call" }, { "api_name": "dash.Dash", "line_number": 9, "usage_type": "call" }, { "api_name": "dash_html_components.Div", "line_number": 11, "usage_type": "call" }, { "api_name": "dash_html_component...
612068557
import numpy as np from scipy import sparse import scipy.special as sp import pdb from .common import _validate_params from ..utils.graph_functions import is_forest from maxprod import inference_max_product as mp def edges_to_graph(edges, n_vertices=None): if n_vertices is None: n_vertices = np.max(edges...
null
pystruct/inference/inference_spsp.py
inference_spsp.py
py
15,625
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.max", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.sparse.coo_matrix", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.sparse", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.ones", "line...
648900309
#-*-coding:utf-8-*- #Web API Interface import web import utility from entity import * from cache import * import config def set_login_session_cookie(username, id): web.ctx.session["loggedin"] = True web.ctx.session['username'] = username web.ctx.session['id'] = id web.setcookie('username', username, c...
null
web/api.py
api.py
py
11,076
python
en
code
null
code-starcoder2
66
[ { "api_name": "web.ctx", "line_number": 11, "usage_type": "attribute" }, { "api_name": "web.ctx", "line_number": 12, "usage_type": "attribute" }, { "api_name": "web.ctx", "line_number": 13, "usage_type": "attribute" }, { "api_name": "web.setcookie", "line_numb...
347518262
import pymysql import schedule import time import logging import os import pandas as pd import smtplib from selenium import webdriver from logging.handlers import TimedRotatingFileHandler from config.ini import host, db, password, charset, usr, email_sender, email_sender_passcode, email_receiver from image_match.goldbe...
null
main.py
main.py
py
8,640
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.handlers.TimedRotatingFileHandler", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 18, "usage_type": "call" }, { "api...
415330293
import xgboost as xgb import numpy as np import helpers.data_load as dl from sklearn.model_selection import train_test_split import os print(os.getcwd()) # Loading files print('Loading Trainset') DATA_FOLDER = '../../../results/pca/' RES_FOLDER = '../../../results/pca/' # Nb PCs to use n_pcs=500 pc_labels = np.linsp...
null
src/training/pca/xgboost_pca.py
xgboost_pca.py
py
2,564
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 18, "usage_type": "call" }, { "api_name": "helpers.data_load.load_response", ...
107259692
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('controllers', '0002_auto_20151202_1443'), ] operations = [ migrations.AlterField( model_name='controller', ...
null
apps/controllers/migrations/0003_auto_20151202_1525.py
0003_auto_20151202_1525.py
py
446
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
366414313
from django.urls import path from .views import * urlpatterns = [ path('room/<int:slug>', room, name="room"), path('signup/', register, name="register"), path('login/', user_login, name="login"), path('logout/', user_logout, name="logout"), path('shop/', shop, name="shop"), path('cart/', cart, ...
null
webserver/auctionApp/urls.py
urls.py
py
818
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
596349436
from selenium import webdriver import time try: link = "http://suninjuly.github.io/math.html" browser = webdriver.Chrome() browser.get(link) time.sleep(10) # атрибут "disabled" с помощью встроенного метода get_attribute и проверим его значение button = browser.find_element_by_css_selector(".bt...
null
lesson21_step65.py
lesson21_step65.py
py
810
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", ...
313145649
# Author: Claudio Moises Valiense de Andrade, Licence: MIT import claudio_funcoes as cv # functions of general use import torch # lib for deep learning from torch import nn # neural network in pytorch from sklearn.feature_extraction.text import TfidfVectorizer # Apply TF-IDF import random # utilize in random iteration...
null
nn.py
nn.py
py
32,324
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.seed", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.random", "l...
437359647
""" functions that read efficiently files from hdfs without saving it on disk """ from typing import Iterator, List import numpy as np import pyarrow as pa import pyarrow.parquet as pq from tqdm import tqdm as tq def read_filenames(parquet_embeddings_path: str) -> List[str]: """ Read the name of all the par...
null
autofaiss/datasets/readers/remote_iterators.py
remote_iterators.py
py
2,324
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyarrow.hdfs.connect", "line_number": 27, "usage_type": "call" }, { "api_name": "pyarrow.hdfs", "line_number": 27, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", ...
505302154
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' if __name__ == '__main__': url = 'http://kinokong.net/29053-vse-o-muzhchinah-2016-smotret-online.html' import requests rs = requests.get(url) import re match = re.search(r'new.+?Uppod\(.*?file:.*?"(.+?mp4)"', rs.text) if ...
null
parse_video_url_from_kinokong_net.py
parse_video_url_from_kinokong_net.py
py
357
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "re.search", "line_number": 13, "usage_type": "call" } ]
622257854
from flask import request, Blueprint, jsonify from flask_login import login_required import requests from cromwell_frontend.config import CROMWELL_URL from cromwell_frontend.util import handle_exception cromwell_api = Blueprint('cromwell_api', __name__, url_prefix='/cromwell_api') @cromwell_api.route('/', defaults={...
null
cromwell_frontend/blueprints/cromwell_api.py
cromwell_api.py
py
1,242
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "cromwell_frontend.config.CROMWELL_URL", "line_number": 18, "usage_type": "name" }, { "api_name": "requests.request", "line_number": 19, "usage_type": "call" }, { "api_name": ...
232287974
import configparser import ast from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QPlainTextEdit,QLabel import psycopg2 from pyqtgraph.flowchart import Flowchart, Node import numpy as np import pyqtgraph.flowchart.library as fclib from node_editor_wnd import NodeEditorWnd from node_scene import Scen...
null
Source code/firstScreen.py
firstScreen.py
py
27,075
python
en
code
null
code-starcoder2
66
[ { "api_name": "node_node.Node", "line_number": 22, "usage_type": "name" }, { "api_name": "node_node.Node.__init__", "line_number": 29, "usage_type": "call" }, { "api_name": "node_node.Node", "line_number": 29, "usage_type": "name" }, { "api_name": "numpy.zeros", ...