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
393829156
import warnings from cytoolz.functoolz import ( compose, curry, ) from .decorators import ( return_arg_type, ) from .functional import ( to_dict, ) @return_arg_type(2) def apply_formatter_at_index(formatter, at_index, value): if at_index + 1 > len(value): raise IndexError( "N...
null
venv/lib/python3.6/site-packages/eth_utils/applicators.py
applicators.py
py
3,269
python
en
code
null
code-starcoder2
66
[ { "api_name": "decorators.return_arg_type", "line_number": 16, "usage_type": "call" }, { "api_name": "warnings.warn", "line_number": 31, "usage_type": "call" }, { "api_name": "cytoolz.functoolz.curry", "line_number": 39, "usage_type": "call" }, { "api_name": "cyto...
460967434
#librairies import matplotlib.pyplot as plt import numpy as np #Wavelengh (cm) to energy (eV) def energy(l, c): h = 6.6260755e-34/1.602e-19 #Planck's constant (eV/K) return h*c/l #Parametre s def parametre_s(eps, E, mc2, theta): return eps*E/(2*mc2**2)*(1-np.cos(theta)) #Parametre beta def beta_func(s): ...
null
Codes/Vieux/Cross_section_complete2.py
Cross_section_complete2.py
py
1,502
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.cos", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 23, ...
515898384
from random import randrange from hashlib import sha1 from gmpy2 import xmpz, to_binary, invert, powmod, is_prime # Esta fase têm como objectivo a criação de uma classe que implemente o algoritmo DSA. Uma instância desta classe # irá receber como parâmetros os tamanhos dos primos p e q. Com uma instância desta classe ...
null
TP1/DSA_Parte2.py
DSA_Parte2.py
py
4,621
python
en
code
null
code-starcoder2
66
[ { "api_name": "gmpy2.xmpz", "line_number": 42, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 42, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 43, "usage_type": "call" }, { "api_name": "gmpy2.to_binary", "line_...
64576160
from flask_wtf import FlaskForm from wtforms import StringField, HiddenField, IntegerField, SelectField, \ BooleanField from wtforms.validators import DataRequired, ValidationError, NumberRange, \ InputRequired, Optional from .models import Action import re class ActionForm(FlaskForm): id = HiddenField('i...
null
potnanny/apps/action/forms.py
forms.py
py
3,020
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_wtf.FlaskForm", "line_number": 10, "usage_type": "name" }, { "api_name": "wtforms.HiddenField", "line_number": 11, "usage_type": "call" }, { "api_name": "wtforms.StringField", "line_number": 12, "usage_type": "call" }, { "api_name": "wtforms.v...
570315398
import time import rrdtool from getSNMP import consultaSNMP import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import style from math import * import os class Visual(): def __init__(): style.use('fivethirtyeight') fig = plt.figure() ax1 = fig.add_subplot...
null
proyecto.py
proyecto.py
py
2,692
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.style.use", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplo...
120039636
from collections import defaultdict from itertools import product import os from typing import List import numpy from scipy.sparse import coo_matrix, diags from ast2vec.coocc import Cooccurrences from ast2vec.uast import UASTModel from role2vec.map_reduce import MapReduce from role2vec.random_walk import Graph from r...
null
role2vec/node2vec.py
node2vec.py
py
4,864
python
en
code
null
code-starcoder2
66
[ { "api_name": "role2vec.map_reduce.MapReduce", "line_number": 16, "usage_type": "name" }, { "api_name": "role2vec.random_walk.Graph", "line_number": 25, "usage_type": "name" }, { "api_name": "role2vec.utils.read_vocab", "line_number": 36, "usage_type": "call" }, { ...
248541807
import pandas as pd import uuid import requests import urllib.request import time from bs4 import BeautifulSoup from shapely.geometry import Polygon import uuid from subprocess import call bbox = pd.read_csv("bbox.csv").set_index("Unnamed: 0") bbox = Polygon(bbox.values).buffer(0.1).boundary.minimum_rotated_rectangle...
null
download_osm_data.py
download_osm_data.py
py
1,750
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "shapely.geometry.Polygon", "line_number": 13, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "...
620370871
from copy import deepcopy, copy from django.utils.datastructures import SortedDict from django.db import models from django.db.models.fields import FieldDoesNotExist from django.db.models.related import RelatedObject from django.db.models.sql.constants import LOOKUP_SEP from django.utils.text import capfirst from djang...
null
slickgrid/slickgrid.py
slickgrid.py
py
11,863
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.CharField", "line_number": 63, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 63, "usage_type": "name" }, { "api_name": "django.db.models.TextField", "line_number": 66, "usage_type": "attribute" }, { "...
403033269
from datetime import datetime from GalaxyCurrencyCalculator import calculator test_input_path = 'test_input.txt' with open('correct_result.txt', 'r', encoding='utf-8') as fp: correct_result = fp.read() with open('test_input.txt', 'r', encoding='utf-8') as fp: test_input_text = fp.read() test_result = calcul...
null
calculator_test.py
calculator_test.py
py
880
python
en
code
null
code-starcoder2
66
[ { "api_name": "GalaxyCurrencyCalculator.calculator.main", "line_number": 12, "usage_type": "call" }, { "api_name": "GalaxyCurrencyCalculator.calculator", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 29, "usage_type": "ca...
174603440
from flask import Flask from flask_cors import CORS from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine,MetaData app = Flask(__name__, instance_relative_config=True) CORS(app) #load defalut config app.config.from_object('config.default') app.config["...
null
ledger_microservice/backend/service/app/__init__.py
__init__.py
py
1,074
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlalchemy.MetaData", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engin...
25110236
from django.db import models from django.contrib.auth.models import User class Gruppo(models.Model): nome = models.CharField(max_length=20) def __str__(self): return self.nome class Meta: verbose_name = "Gruppo" verbose_name_plural = "Gruppi" class Utente(models.Model): email...
null
DjangoBICAP/BICAPweb/models.py
models.py
py
3,812
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "...
90898510
#!/usr/bin/python3 """ Class BaseModel defines common attributes/methods for other classes """ import uuid from datetime import datetime as dt from models import storage class BaseModel: """ Class BaseModel """ def __init__(self, *args, **kwargs): """ Initilize a new instance of BaseModel class ...
null
models/base_model.py
base_model.py
py
1,487
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "uuid.uuid4", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.date...
596132342
#!/usr/bin/python3 import matplotlib.pyplot as plt import numpy as np import keras.models print ( "Now loading data" ) import pickle f=open("data.pcl","rb") tr_data=pickle.load ( f ) tr_labels=pickle.load ( f ) val_data=pickle.load ( f ) val_labels=pickle.load ( f ) f.close() def Hash ( A ): return int(A[0]*1000...
null
Wolfgang/draw.py
draw.py
py
969
python
en
code
null
code-starcoder2
66
[ { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": ...
587767816
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Oct 31 19:57:14 2018 @author: dilu """ import numpy as np import matplotlib.pyplot as plt import core_lib as cl n_med=1.0 #The medium in which the experiment is conducted theta_i1=np.pi/6 wl=np.arange(450, 800, 1) wl_p=168.26 wl_c=8934.20 d_met...
null
N_vs_minR.py
N_vs_minR.py
py
1,145
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.pi", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numbe...
264832899
import json REQUEST_META_FIELDS = [ 'REQUEST_METHOD', 'PATH_INFO', 'REMOTE_ADDR', 'SERVER_NAME', 'SERVER_PROTOCOL', 'SERVER_PORT', 'CONTENT_TYPE', 'CONTENT_LENGTH', 'HTTP_HOST', 'HTTP_CONNECTION', 'HTTP_CACHE_CONTROL', 'HTTP_USER_AGENT', 'HTTP_ACCEPT', 'HTTP_ACC...
null
logtools/utils.py
utils.py
py
1,940
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 46, "usage_type": "call" } ]
460288481
from django.contrib import admin from basics.relatedfield_admin import * from accounts.models import * from .models import * class AboutAdmin(admin.ModelAdmin): fieldsets = ( ('Post',{ 'fields':('title','image','post') }), ) list_display = ('title','post','date') list_f...
null
basics/admin.py
admin.py
py
1,422
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 24, "usage_type": "call" },...
614594985
import unittest from teschelpers import UrlBuilder, UrlFetcher from bs4 import BeautifulSoup from requests import Response class TestTescHelpers(unittest.TestCase): @classmethod def setUpClass(cls): start = 2016 end = 2016 search = '^title:"experience sampling" OR abstract:"experience sampling"' cls.url_w...
null
lib/TescPerf/test_tesc_helpers.py
test_tesc_helpers.py
py
2,228
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "teschelpers.UrlBuilder", "line_number": 15, "usage_type": "call" }, { "api_name": "teschelpers.UrlBuilder", "line_number": 16, "usage_type": "call" }, { "api_name": "t...
221746437
from models.user import User from models.tweet import Tweet from models.comment import Comment from session import session from utils import log, template from routes import ( redirect, http_response, error, check_id_tweet, check_id_comment, ) from routes.routes_user import current_user from rout...
null
server_normal/routes/routes_tweet.py
routes_tweet.py
py
3,865
python
en
code
null
code-starcoder2
66
[ { "api_name": "routes.routes_user.current_user", "line_number": 24, "usage_type": "call" }, { "api_name": "models.user.User.find", "line_number": 26, "usage_type": "call" }, { "api_name": "models.user.User", "line_number": 26, "usage_type": "name" }, { "api_name":...
551653233
#!/usr/bin/env python # coding: utf-8 # In[6]: import pandas as pd import math import numpy as np import time from collections import defaultdict from sklearn.model_selection import train_test_split from sklearn import preprocessing from sklearn.preprocessing import OneHotEncoder from sklearn.feature_extraction.t...
null
project.py
project.py
py
8,679
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.download", "line_number": 37, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 39, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 42, "usage_type": "call" }, { "api_name": "nltk.corpus.s...
377398067
# Import dependencies from flask import Flask, render_template, request, jsonify import base64 import numpy as np import pandas as pd import io from PIL import Image from clarifai.rest import ClarifaiApp from utils.get_top_k import get_top_k from utils.get_pearson import pearson from utils.get_new_pic_matrix import b...
null
app.py
app.py
py
1,995
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "clarifai.rest.ClarifaiApp", "line_number": 37, "usage_type": "call" }, { "api_name": "load_all_tags....
127084401
import pygame as pg class Shadow: """ A class for adding dynamic shadows to 2d-sprites. """ def __init__(self, image): self.image = image self.w, self.h = self.image.get_size() self.shadow_strips = self.make_shadow_elements(self.image) def make_shadow_elements(self, image)...
null
Script/Shadows.py
Shadows.py
py
1,718
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.Surface", "line_number": 19, "usage_type": "call" } ]
524376971
from audio.models import Audio, Chapter, Audio_twenty, Audio_forty, Audio_sixty from pydub import AudioSegment import os import shutil from os.path import expanduser from django.core.files import File def concatenate_audio(chapter_id, length_audio): queryset = Audio.objects.filter(chapter_id = chapter_id) audios_t...
null
django-backend/populate_audio_aggregate.py
populate_audio_aggregate.py
py
3,439
python
en
code
null
code-starcoder2
66
[ { "api_name": "audio.models.Audio.objects.filter", "line_number": 10, "usage_type": "call" }, { "api_name": "audio.models.Audio.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "audio.models.Audio", "line_number": 10, "usage_type": "name" }, { ...
88877373
import sys import itertools from collections import Counter import logging logger = logging.getLogger('spectral_peaks') if not logger.handlers: stream = logging.StreamHandler(sys.stdout) stream.setLevel(logging.INFO) logger.addHandler(stream) import librosa import numpy as np import scipy import matplotlib...
null
fingerprint/spectral_peaks.py
spectral_peaks.py
py
5,789
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.INFO", ...
573728683
import numpy as np import json from collections import defaultdict from util import * import matplotlib.pyplot as plt import bisect class pop_sz_dst: def __init__(self, i_file): pop_sz = defaultdict(lambda : defaultdict(int)) f = open(i_file, "r") key = "-" t_pop = 0 ...
null
data/joint_dst.py
joint_dst.py
py
3,241
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 38, "usage_type": "call" }, { "api_name"...
608639776
import torch import torch.autograd as autograd import torch.nn as nn import torch.optim as optim import numpy as np torch.manual_seed(111) class semiCRF(nn.Module): def __init__(self, tagset_size=3, max_seq_len=4): ''' Note in this model, suppose a beginning node ''' super(semiCRF, s...
null
uni_semiCRF.py
uni_semiCRF.py
py
10,842
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.manual_seed", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", ...
315467713
from django.urls import path from . import views app_name = "blogs" urlpatterns = [ # home page path('', views.index, name='index'), # add new post path('new_post/$', views.new_post, name='new_post'), # edit previous posts path('edit_post/<post_id>/$', views.edit_post, name='edit_post'), ]
null
Chapters 18 to 20/blog/blogs/urls.py
urls.py
py
303
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": 12, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" } ]
621775785
import sys import urllib import urllib.parse import urllib.request import json import collections DOMAIN = 'http://api.geonames.org/' USERNAME = 'asv2015' #username MAPS = 'https://maps.google.de/maps?q=' class Location(object): def __init__(self, geonameId, name, lng, lat): self.geonameId = geonameId self.nam...
null
Abgabe/Programm/geonames.py
geonames.py
py
2,088
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.OrderedDict", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.parse.urlencode", "line_number": 38, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 38, "usage_type": "attribute" }, { "api_name": "urll...
93399477
""" Implement a triplet network, because this implicitly implements a margin-loss! """ import random import numpy as np import torch from matplotlib.markers import MarkerStyle from sklearn.decomposition import PCA from torch import nn, optim from torch.distributions import Categorical # TODO: we need to make sur...
null
notebooks/2020_04_08 deep metric learning/triplet_network_test.py
triplet_network_test.py
py
9,244
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
163158621
#!/usr/bin/env python3 from bottle import route, run, request, response, static_file import YakDB import json import os.path from Languages import findAvailableLanguages import pofilter from toolz.dicttoolz import valmap import operator from collections import OrderedDict conn = YakDB.Connection() conn.connect("tcp://...
null
PolyglottServer.py
PolyglottServer.py
py
3,189
python
en
code
null
code-starcoder2
66
[ { "api_name": "YakDB.Connection", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path", "l...
602292660
# -*- coding: utf-8 -*- """ Showcases *CIECAM02* colour appearance model computations. """ import numpy as np import colour from colour.utilities import message_box message_box('"CIECAM02" Colour Appearance Model Computations') XYZ = np.array([19.01, 20.00, 21.78]) XYZ_w = np.array([95.05, 100.00, 108.88]) L_A = 31...
null
colour/examples/appearance/examples_ciecam02.py
examples_ciecam02.py
py
1,291
python
en
code
null
code-starcoder2
66
[ { "api_name": "colour.utilities.message_box", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "colour.VIEWING_C...
292784721
from flask import g,request from app.models import User,Cookbook,Schedule from flask_restful import Resource,fields,marshal_with,reqparse,inputs,marshal from app.extensions import db from app.api.common.auth import token_auth from app.api.resources.users import user_fields from app.api.resources.cookbooks import cookbo...
null
app/api/resources/schedules.py
schedules.py
py
2,500
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_restful.Resource", "line_number": 11, "usage_type": "name" }, { "api_name": "flask_restful.fields.Raw", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask_restful.fields", "line_number": 17, "usage_type": "name" }, { "api_nam...
637256353
from django.test import TestCase from django.contrib.auth.models import User from django.urls import reverse from django.utils import timezone from . import models class TestStudentSpecifiesCommuteDistance(TestCase): def test_successfully(self): examples = [ {"username": "joe", "miles": 42}, ...
null
mileage_tracker/tests.py
tests.py
py
9,321
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 17, "usa...
84257285
import boto3 import botocore from botocore.exceptions import ClientError, ParamValidationError import json import os # Written by Dane Fetterman September 2019 # This lambda function runs against the Master Account Env. env=os.environ['env'] # def response(message, status_code): # return { # 'statusCode...
null
AddMemberAccount.py
AddMemberAccount.py
py
4,223
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "boto3.client", "line_number": 28, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 40, "usage_type": "name" }, { "api_name": "json.dum...
579469336
# -*- coding: utf_8 -*- import cgi import os import wsgiref.handlers import logging import urllib import urllib2 import socket import csv import datetime import datamodel import md5 from StringIO import StringIO from google.appengine.ext.webapp import template from google.appengine.api import users from google.appeng...
null
Cobitia/main.py
main.py
py
5,565
python
en
code
null
code-starcoder2
66
[ { "api_name": "google.appengine.ext.webapp.RequestHandler", "line_number": 40, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.webapp", "line_number": 40, "usage_type": "name" }, { "api_name": "google.appengine.api.users.get_current_user", "line_number": 44, ...
620973880
import csv from math import * import matplotlib from matplotlib import pyplot as plt import numpy as np plt.rc('text', usetex=True) #plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) #plt.rc('font',**{'family':'serif','serif':['Palatino']}) plt.rc('font', family='serif') #### data #### xtau = np....
null
latex/04 - Final Project Report/data/intensity.py
intensity.py
py
1,574
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib....
223753905
# -*- coding: utf-8 -*- # Name: InstanceLock # Purpose: Lockfile para detectar instancias previas de la app # # Author: Pela # # Created: 11/03/2013 # Copyright: (c) Pela 2013 # flock.py import os import socket import logging class Ilock(object): """ Class to handle creating and rem...
null
_classes/InstanceLock.py
InstanceLock.py
py
2,943
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 35, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path.isfile", "...
129251154
import pickle from collections import defaultdict import sqlite3 def main(): conn = sqlite3.connect('course_surfer.db') conn1 = sqlite3.connect('course_surfer1.db') cursor1 = conn1.cursor() cursor = conn.cursor() query1 = "" query1 += "INSERT OR IGNORE INTO course " query1 += "(dept_code, num, id, name, ...
null
CourseSurferDbFiles/read_output1.py
read_output1.py
py
2,948
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 40, "usage_type": "call" } ]
185053458
from django.db import models from django.contrib.auth.models import User from datetime import datetime class Customer(models.Model): full_name = models.CharField("Name", max_length=255) address1 = models.CharField(max_length=255) address2 = models.CharField(" ", max_length=255, null=True, blank=True) ...
null
referral/core/models.py
models.py
py
4,241
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "...
495990778
# # Copyright (C) 2014-2019 S[&]T, The Netherlands. # from __future__ import absolute_import, division, print_function import logging import multiprocessing try: from tqdm import tqdm as bar except: def bar(range): return range import muninn from .utils import create_parser, parse_args_and_run log...
null
muninn/tools/update.py
update.py
py
5,021
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "muninn.open", "line_number": 43, "usage_type": "call" }, { "api_name": "muninn.open", "line_number": 91, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", ...
3416982
#!/usr/bin/env python3 # usage: # fwhmSweep.py 56530 7 14 # fwhmSweep.py <mjd> <file number first> <file nimber last> import glob import pyfits import sys, os import numpy as np from scipy import ndimage from pylab import * import scipy directory="/data/ecam/%s/" % (sys.argv[1]) # if directory exist? if os.pa...
null
old_bin/fwhmSweepTmp.py
fwhmSweepTmp.py
py
2,601
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number...
30606978
from threading import Thread import socket import json import time from PyQt5 import QtCore from PyQt5.QtCore import pyqtSignal host = "127.0.0.1" port = 10000 class SocketServer(QtCore.QThread): return_sig = pyqtSignal(str) def __init__(self, host, port): super().__init__() self.server_soc...
null
pythone_classPractice/tornado_web_socket/gui_class demo/SocketServer.py
SocketServer.py
py
1,782
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtCore.QThread", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 13, "usage_type": "call" }, { "api_name": "socket...
32391294
import os from base import * from decouple import ConfigIni import dj_database_url config = ConfigIni(PROJECT_DIR.child('infra_confs')+'/settings.ini') ########## INSTALLED APPS CONFIGURATION INSTALLED_APPS += ( 'django_nose', 'nose', ) ########## TEST SETTINGS TEST_RUNNER = "django_nose.NoseTestSuiteRunner...
null
apps/django_rest/django_rest/settings/ci.py
ci.py
py
839
python
en
code
null
code-starcoder2
66
[ { "api_name": "decouple.ConfigIni", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "dj_database_url.config", "line_number": 35, "usage_type": "call" } ]
464256803
# coding: utf-8 # # Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
null
jobs/io/ndb_io.py
ndb_io.py
py
4,963
python
en
code
null
code-starcoder2
66
[ { "api_name": "core.platform.models.Registry.import_datastore_services", "line_number": 28, "usage_type": "call" }, { "api_name": "core.platform.models.Registry", "line_number": 28, "usage_type": "attribute" }, { "api_name": "core.platform.models", "line_number": 28, "usa...
72781463
import numpy as np import matplotlib.pyplot as plt import sys def reproduct(k=2): base = np.loadtxt("H.csv", delimiter = ",") org = np.loadtxt("org.csv", delimiter = ",") weight = np.loadtxt("U.csv", delimiter = ",") for i in range(org.shape[1]): y = range( org.shape[0] ) fit = np.zeros( org.shape[0] ) for...
null
src_otherwise/reproduct.py
reproduct.py
py
779
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.loadtxt", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number...
572985932
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /home/travis/build/Dallinger/Dallinger/dallinger/jupyter.py # Compiled at: 2020-04-15 14:09:48 # Size of source mod 2**32: 1386 bytes from ipywidgets import widge...
null
pycfiles/dallinger-6.1.0.tar/jupyter.cpython-36.py
jupyter.cpython-36.py
py
1,636
python
en
code
null
code-starcoder2
66
[ { "api_name": "jinja2.Template", "line_number": 12, "usage_type": "call" }, { "api_name": "jinja2.Template", "line_number": 13, "usage_type": "call" }, { "api_name": "ipywidgets.widgets.VBox", "line_number": 15, "usage_type": "attribute" }, { "api_name": "ipywidge...
39921985
# Inverted Pendulum Parameter File import sys sys.path.append('..') # add parent directory import pendulumParam as P import numpy as np from scipy import signal import control as cnt # sample rate of the controller Ts = P.Ts # saturation limits F_max = P.F_max # Max Force, N ########################################...
null
control_book_public_solutions-master/_B_pendulum/python_old/hw14/pendulumParamHW14.py
pendulumParamHW14.py
py
3,340
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pendulumParam.Ts", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pendulumParam.F_max...
591296834
import sqlite3 conn = sqlite3.connect('zh.db') print("Opened database successfully") conn.execute('''CREATE TABLE USER (ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, TELEPHONE CHAR(15) NOT NULL, COMPANY TEXT NOT NULL, ADDRESS ...
null
HW10/Group9/hw10_1720408.py
hw10_1720408.py
py
1,726
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
479003407
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # author: bigfoolliu """ 给你一个有序数组 nums ,请你 原地 删除重复出现的元素,使每个元素 只出现一次 ,返回删除后数组的新长度。 不要使用额外的数组空间,你必须在 原地 修改输入数组 并在使用 O(1) 额外空间的条件下完成。   说明: 为什么返回数值是整数,但输出的答案是数组呢? 请注意,输入数组是以「引用」方式传递的,这意味着在函数里修改输入数组对于调用者是可见的。 你可以想象内部操作如下: // nums 是以“引用”方式传递的。也就是说,不对实参做任何拷贝 int len = re...
null
algorithms/leetcode/easy/0026_删除有序数组中的重复项.py
0026_删除有序数组中的重复项.py
py
2,983
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 69, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 88, "usage_type": "name" }, { "api_name": "doctest.testmod", "line_number": 101, "usage_type": "call" } ]
270644092
from django.contrib.auth.models import User from django.http import JsonResponse from django.shortcuts import redirect from rest_framework.response import Response from rest_framework.authentication import SessionAuthentication, BasicAuthentication from rest_framework.permissions import IsAuthenticated from rest_frame...
null
main/views.py
views.py
py
10,826
python
en
code
null
code-starcoder2
66
[ { "api_name": "abstract.viewsets.CreateListRetrieveUpdateViewSet", "line_number": 20, "usage_type": "name" }, { "api_name": "rest_framework.renderers.TemplateHTMLRenderer", "line_number": 23, "usage_type": "name" }, { "api_name": "rest_framework.response.Response", "line_numb...
421883207
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : 2019/7/4 10:50 @Author : geqh @file : tag_EN.py """ import jieba.posseg as pseg from utils.log import * from utils.confPaser import * import os def load_dict(): dic_path = os.path.join(project_path, "conf/dic_cn.txt") map = {} ...
null
tagCN/tag_CN.py
tag_CN.py
py
986
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "jieba.posseg.cut", "line_number": 29, "usage_type": "call" }, { "api_name": "jieba.posseg", "line_n...
358860780
from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns from respondents import views app_name = "respondents" urlpatterns = [ url(r"^search/$", views.search_results, name="search_results"), url( r"/".join([ r"^branchLocations", r"(?P<no...
null
respondents/urls.py
urls.py
py
634
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "respondents.views.search_results", "line_number": 10, "usage_type": "attribute" }, { "api_name": "respondents.views", "line_number": 10, "usage_type": "name" }, { "api_...
388332413
#%% import os import numpy as np import cv2 import torch import torch.nn as nn import torchvision.transforms as transforms import pandas as pd from torch.utils.data import DataLoader, Dataset import time #%% #读取图片 def readfile(path,lable): image_dir = sorted(os.listdir(path)) x = np.zeros((len(image_dir),128,12...
null
foodClassifier.py
foodClassifier.py
py
5,951
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_numbe...
332053335
import json import os import requests from math import radians, cos, sin, asin, sqrt def haversine(lon1, lat1, lon2, lat2): """ Calculate the great circle distance between two points on the earth (specified in decimal degrees) """ # convert decimal degrees to radians lon1, lat1, lon2, lat2 = ...
null
bars.py
bars.py
py
2,791
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.radians", "line_number": 14, "usage_type": "argument" }, { "api_name": "math.sin", "line_number": 19, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 19, "usage_type": "call" }, { "api_name": "math.asin", "line_number": 20,...
28391652
print("==============================================================================================") print("starting........................................................................................") import glob import numpy as np print("imported glob, np..............................................
null
Code/Latent_Variable_Models/deep-gen/autoencoder2.py
autoencoder2.py
py
4,479
python
en
code
null
code-starcoder2
66
[ { "api_name": "glob.glob", "line_number": 14, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 21, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_numbe...
51960428
''' State of a shifting puzzle. Python 3 AHN, Mar 2020 ''' from pdb import set_trace as BP import math, random, json from collections import defaultdict import numpy as np #=========================================== class StateJsonEncoder( json.JSONEncoder): def default(self, obj): if isinstance(obj, ...
null
pyth/proj/08_puzzlecomp/state.py
state.py
py
5,893
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.JSONEncoder", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.int64", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_number": 20, "usage_type": "attribute" }, { "api_name": "json.JSONEn...
99636927
#!/usr/bin/env python3 from browser import Browser from flask import Flask, render_template, request from flask import jsonify app = Flask(__name__) browser = Browser() @app.route('/') @app.route('/<string:rootid>') def index(rootid=0): return render_template('index.html', rootid=roo...
null
server.py
server.py
py
1,138
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "browser.Browser", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "browser.get", "li...
594537459
import matplotlib.pyplot as plt import matplotlib.animation as animation import random import math import mpl_toolkits.mplot3d.axes3d as p3 from numpy import numpyzdetz fig = plt.figure() ax = p3.Axes3D(fig) # fig, ax = plt.subplots() px = 0 py = 0 pz = 0 point = ax.scatter([px], [py], [pz], 'ro') # point = ax.pl...
null
flies/test1.py
test1.py
py
748
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "mpl_toolkits.mplot3d.axes3d.Axes3D", "line_number": 10, "usage_type": "call" }, { "api_n...
648391974
import pandas as pd import glob import os import sys import matplotlib.pyplot as plt project_id = sys.argv[1] genome = sys.argv[2] minreads = int(sys.argv[3]) bam_type = sys.argv[4] x = 1 # number of repetitions of codons. E.g. x=1 means we look for "ATG" and x=2 means we look for "ATGATG" and so on. # x can be theo...
null
ext_diricore/triplets/1_count_triplets.py
1_count_triplets.py
py
5,801
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": ...
304378358
# the maximum age of an event, in seconds, before it is published to the LRS PUBLISH_MAX_WAIT_TIME = 60 # the number of statements to publish per batch PUBLISH_MAX_PAYLOAD = 10 # maximum publish retries on LRS connection error PUBLISH_MAX_RETRIES = 1 # lrs credentials LRS_ENDPOINT = 'https://lrs.adlnet.gov/xAPI/' L...
null
xapi_bridge/settings-dist.py
settings-dist.py
py
976
python
en
code
null
code-starcoder2
66
[ { "api_name": "sentry_sdk.init", "line_number": 38, "usage_type": "call" } ]
446633123
from urllib.parse import urlencode import requests import json url = 'http://web.juhe.cn:8080/environment/air/cityair' params = { 'city': '郑州', 'key': 'bae9fd7d6958840b5f31f0ab49bb537c', } r = requests.get(url, params) d = json.loads(r.content) print(d) print(d.get('result')[0].get('citynow').get('AQI'))
null
test.py
test.py
py
323
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" } ]
508582007
# uncompyle6 version 3.7.4 # Python bytecode 3.5 (3350) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /Users/kmclaughlin/git/LABHR/octohatrack/octohatrack/utils.py # Compiled at: 2015-11-21 05:35:59 # Size of source mod 2**32: 1257 bytes import os, logging class ...
null
pycfiles/octohatrack-0.6.1.tar/utils.cpython-35.py
utils.cpython-35.py
py
1,198
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 30, "usage_type": "call" }, { "api_name": "os.environ....
640806391
from django.contrib.contenttypes.models import ContentType from apps.annotations.models import Annotation def delete_annotations_handler(sender, instance, **kwargs): Annotation.objects.filter( content_type=ContentType.objects.get_for_model(instance._meta.model), object_id=instance.pk, ).delet...
null
apps/annotations/handlers.py
handlers.py
py
324
python
en
code
null
code-starcoder2
66
[ { "api_name": "apps.annotations.models.Annotation.objects.filter", "line_number": 7, "usage_type": "call" }, { "api_name": "apps.annotations.models.Annotation.objects", "line_number": 7, "usage_type": "attribute" }, { "api_name": "apps.annotations.models.Annotation", "line_nu...
349988848
# Let's get this party started import re import os import sys import json import redis import falcon # Set the path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__)))) # load resources from resources.auth import AuthResource from resources.ping import PingResource from resources.summary import S...
null
app.py
app.py
py
2,709
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_num...
586901301
# -*- coding: utf-8 -*- ''' Created on 2019-May-27 08:51:22 TICKET NUMBER -AI_1231 @author: MS-Muhil ''' from scrapy.loader import ItemLoader from scrapy.loader.processors import MapCompose from w3lib.html import remove_tags, replace_escape_chars import glob from Data_scuff.extensions.feeds import ExcelFeedSpider fr...
null
all_spider/AI_1231/sc_liquor_licenses.py
sc_liquor_licenses.py
py
9,383
python
en
code
null
code-starcoder2
66
[ { "api_name": "Data_scuff.extensions.feeds.ExcelFeedSpider", "line_number": 28, "usage_type": "name" }, { "api_name": "Data_scuff.spiders.__common.DataFormatterMixin", "line_number": 28, "usage_type": "name" }, { "api_name": "Data_scuff.spiders.__common.LookupDatareaderMixin", ...
528697954
from django.http import HttpResponse, HttpResponseRedirect from datetime import datetime, timedelta, date from django.shortcuts import render, get_object_or_404 from django.views import generic from django.urls import reverse from django.utils.safestring import mark_safe from django.utils.dateparse import parse_datetim...
null
cal/views.py
views.py
py
3,145
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.views.generic.ListView", "line_number": 33, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 33, "usage_type": "name" }, { "a...
146925250
# Copyright 2018 Novo Nordisk Foundation Center for Biosustainability, DTU. # # 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 requir...
null
src/simulations/modeling/adapter.py
adapter.py
py
23,044
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "simulations.ice_client.ICE", "line_number": 35, "usage_type": "call" }, { "api_name": "json.load", "line_number": 38, "usage_type": "call" }, { "api_name": "collections.na...
570111721
import pymysql import numpy as np import psycopg2 import pickle from flask import Flask,render_template,request,jsonify from flask_cors import CORS,cross_origin import warnings from flask_sqlalchemy import SQLAlchemy warnings.filterwarnings("ignore") # db = pymysql.connect(host="localhost",user="root",passwd...
null
app.py
app.py
py
1,738
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 16, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "pickle.load", ...
639471304
from collections import defaultdict class graph: def __init__(self): self.node = defaultdict(list) def add_edge(self, u, v): self.node[u].append(v) # with stack def bfs_level(self, n, start_node): visited = [0 for i in range(n)] visited[start_node] = 0 bfs_tra...
null
2021/mar/21/bfs_level.py
bfs_level.py
py
1,059
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" } ]
462898394
# encoding:utf-8 import requests import base64 ''' 通用文字识别(高精度版) ''' def get_token(): ''' 获取access_token :param API_KEY: :param SECRET_KEY: :return: ''' access_token_url = "https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id={}&client_secret={}".format( ...
null
开发相关/Python/test.py
test.py
py
963
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 20, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 33, "usage_type": "call" } ]
57047322
import sqlite3 """ SELECT перечень_полей FROM имя_таблицы WHERE условие """ # Подключение к БД con = sqlite3.connect(input()) # Создание курсора cur = con.cursor() # Выполнение запроса и получение всех результатов result = cur.execute("""SELECT title FROM Films WHERE duration >= 60 AND ...
null
2nd_year/QT 7. Введение в БД, работа с SQL-таблицами и отображение данных в PyQT. Часть 1/Classwork/Музыкальные и анимационные новинки.py
Музыкальные и анимационные новинки.py
py
656
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" } ]
608762291
#!/usr/bin/env python import os import sys import json import datetime from pathlib import Path import pandas as pd from tqdm import tqdm from utils import plot_forecast, plot_column # Establish root of the project ROOT = Path(os.path.dirname(__file__)) / '..' pivot_columns = ['CountryCode', 'CountryName', 'Region...
null
input/compute_charts.py
compute_charts.py
py
3,708
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line...
37596720
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('themes', '0021_themecontent_json_file'), ] operations = [ migrations.RemoveField( model_name='twitteratimember',...
null
themes/migrations/0022_auto_20151209_1434.py
0022_auto_20151209_1434.py
py
535
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.RemoveField", "line_number": 14, "usage_type": "call" }, ...
246197953
import math import os import sys from multiprocessing import Value, Process, Queue, Pipe from threading import Thread import mplfinance as mpf import pandas as pd import finplot as fplt import requests import time from broker import Broker, Account class LivePlotter: def __init__(self, pipe, init_data, init_sym, ...
null
live_plotter.py
live_plotter.py
py
3,149
python
en
code
null
code-starcoder2
66
[ { "api_name": "finplot.create_plot", "line_number": 20, "usage_type": "call" }, { "api_name": "finplot.candlestick_ochl", "line_number": 24, "usage_type": "call" }, { "api_name": "finplot.volume_ocv", "line_number": 24, "usage_type": "call" }, { "api_name": "finpl...
612590330
""" SearchCore frontend searcher controller. """ import json from searchcore import config from searchcore import frontend from searchcore.frontend.controllers import app from searchcore.frontend.controllers import request from searchcore.frontend.controllers import jsonify from searchcore.frontend.services import ...
null
src/searchcore/frontend/controllers/searchers.py
searchers.py
py
8,755
python
en
code
null
code-starcoder2
66
[ { "api_name": "searchcore.frontend.searchers.items", "line_number": 60, "usage_type": "call" }, { "api_name": "searchcore.frontend.searchers", "line_number": 60, "usage_type": "attribute" }, { "api_name": "searchcore.frontend", "line_number": 60, "usage_type": "name" },...
591355760
import pygame from .board import newBoard from .constants import * from copy import deepcopy class Game: def __init__(self, Width, Height, Rows, Cols, Square,Win): self.Win = Win self.Board = newBoard(Width, Height, Rows, Cols,Square, Win) self.Square = Square self.selected = None ...
null
chess_game/game.py
game.py
py
6,446
python
en
code
null
code-starcoder2
66
[ { "api_name": "board.newBoard", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display.update", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 24, "usage_type": "attribute" }, { "api_name": "board.newBoa...
87978925
from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.chrome.options import Options from flask import Flask, escape, request, jsonify from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By fro...
null
API_Roraima_Captcha/Roraima.py
Roraima.py
py
4,542
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_name": "f...
624123828
from flask import Flask,request,abort from flask_restful import Resource, Api from productsinfo import ProductsInfo,Notify,Reviews app = Flask(__name__) api = Api(app) api.add_resource(ProductsInfo,'/productdetails') api.add_resource(Notify,'/notify') api.add_resource(Reviews,'/reviews') @app.after_request def afte...
null
SERVICES/productpos.py
productpos.py
py
664
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 6, "usage_type": "call" }, { "api_name": "productsinfo.ProductsInfo", "line_number": 8, "usage_type": "argument" }, { "api_name": "productsinfo...
273445981
import re from pyramid.httpexceptions import HTTPFound from pyramid.view import view_config @view_config(route_name='home', renderer='base.mako') def my_view(request): user_agent = request.user_agent ie_version = re.compile(r"MSIE ([^;]+)") if 'Windows' in user_agent: version = ie_version.search(u...
null
ERP/erp/views.py
views.py
py
641
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "pyramid.httpexceptions.HTTPFound", "line_number": 15, "usage_type": "call" }, { "api_name": "pyramid.view.view_config", "line_number": 6, "usage_type": "call" }, { "api_name": "py...
187319497
import json import plotly.express as px import pandas as pd filename = 'eq_data_30_day_m1.json' with open(filename) as f: all_eq_data = json.load(f) all_eq_dicts = all_eq_data['features'] eqtitle = all_eq_data['metadata']['title'] mags, titles, lons, lats = [], [], [], [] for eq_dict in all_eq_dict...
null
16/eq_world_map.py
eq_world_map.py
py
1,484
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "plotly.express.scatter", "line_number": 26, "usage_type": "call" }, { "api_name": "plotly.express", ...
467272608
#! /opt/local/bin/python import numpy as np from array_util import * from obspy.core import UTCDateTime import matplotlib.pyplot as plt from scipy.signal import * ## pre-computed travel time and ray parameter from support reflector on grid ttimefile = 'ttime.txt' fid = open(ttimefile, 'r') ## read dimension ndepth =...
null
DSM_SYNTHETIC/migration.py
migration.py
py
4,810
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.loadtxt", "line_number": 18, "usage_type": "call" }, { "api_name": "obspy.core.UTCDateTime", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 41, "usage_type": "attribute" }, { "api_name": "numpy.sin", "l...
322033026
import os import time from datetime import datetime import logging #import logging #logging.basicConfig(level = logging.INFO,format = '%(asctime)s:%(levelname)s - %(message)s') import tensorflow as tf from tensorflow.python.training import session_run_hook from tensorflow.python.training import basic_session_run_ho...
null
evaluater.py
evaluater.py
py
6,272
python
en
code
null
code-starcoder2
66
[ { "api_name": "multiprocessing.Queue", "line_number": 26, "usage_type": "call" }, { "api_name": "multiprocessing.Event", "line_number": 27, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 31, "usage_type": "call" }, { "api_name": "t...
591425691
from PyQt5 import QtCore, QtGui, QtWidgets class Ui_STATUS_CHOPPER(object): def setupUi(self, STATUS_CHOPPER): STATUS_CHOPPER.setObjectName("STATUS_CHOPPER") STATUS_CHOPPER.resize(1040, 685) STATUS_CHOPPER.setMinimumSize(QtCore.QSize(1040, 685)) STATUS_CHOPPER.setMaximumSize(QtCore...
null
status.py
status.py
py
35,652
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtCore.QSize", "line_number": 8, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.QSize", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "l...
417725750
import csv import os import re import zipfile import pandas as pd from sqlalchemy import create_engine import xlrd def _get_xls_filename_list(): xls_dir = './test' for _, _, filename_list in os.walk(xls_dir): pass xls_filename_list = [] for file_name in filename_list: if file_name.end...
null
csi/t_csi.py
t_csi.py
py
3,386
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.walk", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "xlrd.open_workbook", "line_numb...
601756499
# -*- coding: utf-8 -*- """ Created on Sun Aug 26 17:15:15 2018 @author: Kai Steverson This file trains a recurrent neural net to use titles to predict SJR score. This file assumes process_raw_data() from process_raw_data.py has been run. This file assumes preprocess() from preprocess.py has been run. """ import t...
null
train_model.py
train_model.py
py
16,319
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.inf", "line_number": 30, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 56, "usage_type": "call" }, { "api_name": "paths.glove", "line_number": 56, "usage_type": "attribute" }, { "api_name": "paths.processed", "line_num...
337355188
import os import json def classesNames(dataset): class_names = "" if dataset == 'MHEALTH.npz': actNameMHEALTH = { 0: 'Standing still', 1: 'Sittingand relaxing', 2: 'Lying down', 3: 'Walking', 4: 'Climbing stairs', 5: 'Waist bends fo...
null
utils.py
utils.py
py
7,409
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dump", "line_number": 151, "usage_type": "call" } ]
503414168
from nltk.tokenize import word_tokenize from nltk.util import ngrams from gensim.models import LdaModel import logging from gensim import corpora import pandas import numpy stop_words = pandas.read_csv("stop_Words.txt", header=None) stop_words = stop_words[0].tolist() # scale an input array-like to a min...
null
assets/api/lda_model.py
lda_model.py
py
2,974
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_n...
318485167
from transformers import * from typing import List, Dict from common import Instance from config import Config import torch.nn as nn from termcolor import colored context_models = { 'bert-base-uncased' : { "model": BertModel, "tokenizer" : BertTokenizer }, 'bert-base-cased' : { "model": BertModel, "tokeni...
null
config/transformers_util.py
transformers_util.py
py
3,916
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.Config", "line_number": 24, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 24, "usage_type": "name" }, { "api_name": "termcolor.colored", "...
476161257
from dataclasses import dataclass, field from typing import List @dataclass class Product: """ :ivar name: :ivar size: """ class Meta: name = "product" name: List[str] = field( default_factory=list, metadata=dict( type="Element", namespace="", ...
null
tests/fixtures/defxmlschema/chapter06/example0611.py
example0611.py
py
625
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 14, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 23, "usage_type": "name" }, { "api_name": "dataclasses.field", "li...
260730685
import os import urllib.request import zipfile import tarfile import glob import io make_dirs = ['./data/', './vocab', './weights'] for d in make_dirs: if not os.path.exists(d): os.makedirs(d) # ----- # # vocab # # ----- # # 'bert-base-uncased': # https://s3.amazonaws.com/models.huggingface.co/bert/bert...
null
bert/make_folders_and_data_downloads.py
make_folders_and_data_downloads.py
py
2,854
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib.request.request.urlret...
191257765
"""Module for constructing RNN Cells.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.ops.rnn_cell import RNNCell from tensorflow.python.ops import variable_scope as vs from tensorflow.python.ops import array_ops from tensorflow.py...
null
tensorflow/models/rnn/translate/seq2seq/wrapper_cells.py
wrapper_cells.py
py
4,067
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.python.ops.rnn_cell.RNNCell", "line_number": 15, "usage_type": "name" }, { "api_name": "tensorflow.python.ops.rnn_cell.RNNCell", "line_number": 65, "usage_type": "name" }, { "api_name": "tensorflow.python.ops.variable_scope.variable_scope", "line_num...
369504021
#!/usr/bin/env python3 # coding: UTF-8 import rclpy from rclpy.node import Node import math import socket import struct import RPi.GPIO as GPIO import time import serial import struct from message_info.msg import RobotCommands from message_info.msg import RealCommands GPIO.setwarnings(False) class RealSender(Nod...
null
src/rasp/python_programs/main.py
main.py
py
4,804
python
en
code
null
code-starcoder2
66
[ { "api_name": "RPi.GPIO.setwarnings", "line_number": 19, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 19, "usage_type": "name" }, { "api_name": "rclpy.node.Node", "line_number": 21, "usage_type": "name" }, { "api_name": "math.pi", "line_num...
595722938
import numpy as np import cv2 import imutils import math class segmentor: def __init__(self): #Constant variables and kernels used for Segmentation #minLim refers to the lower limit of skin pixel intensities in YCrCb colorspace self.minLim = np.array([0, 133, 77], dtype = np.uint8) ...
null
Segmentor_App.py
Segmentor_App.py
py
6,420
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_numb...
317412374
# -*- coding: utf-8 -*- from __future__ import print_function import click import os import re import scipy.misc import warnings import face_recognition.api as face_recognition import multiprocessing import itertools import sys def scan_known_people(known_people_folder): known_names = [] known_face_encodings ...
null
face_recognition/face_recognition/cli.py
cli.py
py
3,765
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.splitext", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 19, "usage_type": "call" }, { "api_name": "face_recognition.api.l...
630157185
import numpy as np from flask import Flask, request, jsonify, render_template from joblib import load app = Flask(__name__) model = load("naive.save") sc=load("transform.save") @app.route('/') def home(): return render_template('index.html') @app.route('/y_predict',methods=['POST']) def y_predict(...
null
Flask/ML Flask (Classification)/app.py
app.py
py
904
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 7, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_nu...
188249783
import telebot from threading import Thread from telebot import types from mainmain import * import logging import schedule bot = telebot.TeleBot(TOKEN) logging.basicConfig(filename=LOG_FILE, filemode='a', level=logging.DEBUG, format='%(asctime)s,%(msecs)d %(levelname)s %(message)s', datefmt='%Y-...
null
bot.py
bot.py
py
4,489
python
en
code
null
code-starcoder2
66
[ { "api_name": "telebot.TeleBot", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "telebot.logging...
364632761
import os import pandas as pd import numpy as np import sklearn import glob from sklearn.model_selection import GridSearchCV from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import precision_recall_curve,auc from sklearn.metrics import precision_recall_curve,auc import matplotlib.pyplot as plt ...
null
Lu_Dataset/Program_FinalModel.py
Program_FinalModel.py
py
3,419
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_number": 34, "usage_type": "call" }, { "api_name": "sklearn.utils", "line_number": 34, "usage_type": "attribute" }, { "api_name": "sklearn.ense...
40299007
from pymongo import MongoClient def mongoOutput(document, filename): docu = document.find() with open(filename, 'w',encoding='utf-8') as f: for d in docu: f.write(str(d)+'\n') f.close() if __name__ == '__main__' : conn = MongoClient(localhost, 27017) # train documents db1 =...
null
src/MongoOutput.py
MongoOutput.py
py
949
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" } ]
322446229
# lot/lot.py class Lot(): def __init__(self): CAPACITY = 75 def lot_details(self, used, *season, **ay): self.capacity = CAPACITY self.remaining = CAPACITY - used self.lot = {'capacity': capacity, 'assignments': assigned,'available_spots': remaining} return lot ...
null
lot/lot.py
lot.py
py
881
python
en
code
null
code-starcoder2
66
[ { "api_name": "plotly.offline.plot", "line_number": 36, "usage_type": "call" } ]
510744168
from datetime import datetime as dt from provider.utils import get_dom URL = "http://dezsoba.hu/hu/heti-menue" def getMenu(today): day = today.weekday() try: dom = get_dom(URL) menu = dom.xpath('//div[@class="sppb-menu-text"]') menu = '<br>'.join(menu[day].xpath("text()")) except: ...
null
provider/dezso.py
dezso.py
py
488
python
en
code
null
code-starcoder2
66
[ { "api_name": "provider.utils.get_dom", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "name" } ]
69666747
# -*- coding:utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the ...
null
built-in/TensorFlow/Research/cv/image_classification/Darts_for_TensorFlow/automl/vega/algorithms/nas/auto_lane/auto_lane_nas_algorithm.py
auto_lane_nas_algorithm.py
py
4,211
python
en
code
null
code-starcoder2
66
[ { "api_name": "vega.search_space.search_algs.search_algorithm.SearchAlgorithm", "line_number": 27, "usage_type": "name" }, { "api_name": "conf.AutoLaneConfig", "line_number": 34, "usage_type": "call" }, { "api_name": "vega.search_space.search_algs.random_search.RandomSearchAlgori...