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
182084307
import sys import json import os import datetime try: from unittest import mock except ImportError: import mock try: from io import StringIO except ImportError: from StringIO import StringIO import py import pytest import requests import arrow from dateutil.tz.tz import tzutc from click import get_...
null
tests/test_watson.py
test_watson.py
py
25,549
python
en
code
null
code-starcoder2
83
[ { "api_name": "py.path.local", "line_number": 28, "usage_type": "call" }, { "api_name": "py.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number...
236068755
''' program to make .png screenshot of web page and send it to email ''' import os import time from urllib.parse import urlparse from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from send_mail import send_mail __author__ = 'sashko' def main(url, fname)...
null
My_Py_Code/screenshot.py
screenshot.py
py
1,856
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.PHANTOMJS", "line_number": 22, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities", "line_number": 22, "usage_type": "name" }, { "api_name...
515947236
""" Implements HyperNEAT's conversion from genotype to phenotype. """ ### IMPORTS ### from itertools import product # Libs import numpy as np # Local from ..networks.rnn import NeuralNetwork class HyperNEATDeveloper(object): """ HyperNEAT developer object.""" def __init__(self, substrate=Non...
null
peas/methods/hyperneat.py
hyperneat.py
py
4,068
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.mgrid", "line_number": 45, "usage_type": "attribute" }, { "api_name": "networks.rnn.NeuralNetwork", "line_number": 62, "usage_type": "argument" }, { "api_name": "networks.rnn.NeuralNetwork", "line_number": 63, "usage_type": "call" }, { "api_na...
517167102
from django.urls import path from .import views app_name='login' urlpatterns = [ path('signup', views.signup,name='signup'), path('profile/', views.profile,name='profile'), path('profile/edite', views.profile_edit,name='profile_edit'), #path('create/', views.create_post, name='create_post'), ]
null
login/urls.py
urls.py
py
312
python
en
code
null
code-starcoder2
83
[ { "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" } ]
242938236
import csv import math import subprocess as sp from argparse import ArgumentParser as ArgPar def load_storage(model, num, is_round, cuda): with open("storage/{}/{}/storage.csv".format(model, num), "r", newline = "") as f: reader = csv.DictReader(f, delimiter = ",", quotechar = '"') target = {} ...
null
env.py
env.py
py
2,591
python
en
code
null
code-starcoder2
83
[ { "api_name": "csv.DictReader", "line_number": 8, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 20, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 71, "usage_type": "call" } ]
528532283
# -*- coding: utf-8 -*- """ Created on Wed Sep 18 19:39:52 2019 @author: eliphat """ import sys import io import ltokenizer import lparser import levaluator def main(): inp = '' if len(sys.argv) > 1: with open(sys.argv[1]) as fi: inp = fi.read(-1) else: with io.StringIO() as b...
null
main.py
main.py
py
589
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 20, "usage_type": "call" }, { "api_name": "levaluator.evaluate", "li...
465343936
import sys import schiene import datetime import pytz import json import configparser import boto3 import pickle from pytictoc import TicToc import multiprocessing as mp import logging import numpy as np logpath = "/home/ubuntu/sbmd/logs/" normlogfilename = "sb03clog_" + sys.argv[1] + "_" \ + datetime.da...
null
sbahnmuc03c_reversed.py
sbahnmuc03c_reversed.py
py
3,360
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.ba...
354392259
from django.urls import path from . import views app_name = 'polls' urlpatterns = [ path('home/', views.home, name='home'), path('polls/', views.pollview, name='pollview'), path('polls/<int:poll_id>/page/<int:page_idx>', views.pages, name='pages'), path('polls/poll<int:poll_id>/results', views.result,...
null
dlp/polls/urls.py
urls.py
py
1,016
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
2704383
import numpy import matplotlib.pyplot as plt def sample_new_point(origin_square, length_halfsquare, subidx): dx, dy = subidx % 2, subidx // 2 offset = length_halfsquare * numpy.array([dx, dy], dtype=float) random_offset = numpy.array([numpy.random.random(), numpy.random.random()]) return origin_square...
null
YALE_3D_Design_and_Fab/Voronoi Foam Project/original supplement/code/generate_seeds_recursive.py
generate_seeds_recursive.py
py
2,479
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_num...
622679236
# Execute a trigger using a congressional vote. # --------------------------------------------- from django.core.management.base import BaseCommand, CommandError from django.conf import settings from contrib.models import Trigger from contrib.legislative import execute_trigger_from_data_urls class Command(BaseComman...
null
contrib/management/commands/execute_trigger.py
execute_trigger.py
py
1,172
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 10, "usage_type": "name" }, { "api_name": "contrib.models.Trigger.objects.get", "line_number": 22, "usage_type": "call" }, { "api_name": "contrib.models.Trigger.objects", "line_number": 22, "usage_typ...
286039787
# coding=utf-8 ''' ====================== 3D surface (color map) ====================== Demonstrates plotting a 3D surface colored with the coolwarm color map. The surface is made opaque by using antialiased=False. Also demonstrates using the LinearLocator and custom formatting for the z axis tick labels. ''' from m...
null
Optimisation_lineaire/simplex_dev2_ex3_plot3d.py
simplex_dev2_ex3_plot3d.py
py
1,427
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.arange"...
16914057
""" This module provides a CNN auto-encoder. The model can be adjusted, such that 0-3 pooling operations will be performed. """ import numpy as np from torch import nn class MaxGridPool(nn.Module): """ This class enables max pooling relative to the featuremaps size. Its counterpart is the :class:`src.nn.U...
null
src/nn.py
nn.py
py
9,125
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn.MaxPool2d", "line...
226979710
from datetime import datetime, timedelta from pymongo import MongoClient import os # cliente = MongoClient('localhost', 27017) cliente = MongoClient(os.environ.get('data_eoc_mongo_host'), int(os.environ.get('data_eoc_mongo_port'))) banco = cliente['doc'] class MongoArticleItem: collection ...
null
doc/doc/mongo_wrapper.py
mongo_wrapper.py
py
577
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
355579185
import pickle as pk import re import numpy as np from keras.models import load_model from keras.preprocessing.sequence import pad_sequences from util import load_word_re, load_type_re, load_pair, word_replace, map_item def ind2label(label_inds): ind_labels = dict() for word, ind in label_inds.items(): ...
null
classify.py
classify.py
py
2,116
python
en
code
null
code-starcoder2
83
[ { "api_name": "util.load_word_re", "line_number": 27, "usage_type": "call" }, { "api_name": "util.load_type_re", "line_number": 28, "usage_type": "call" }, { "api_name": "util.load_pair", "line_number": 29, "usage_type": "call" }, { "api_name": "util.load_pair", ...
95195473
import plotly import plotly.graph_objs as go import pandas as pd import json def create_plot_calculos(capital_vector): x_axis = capital_vector.index.values fig = go.Figure(data=[ go.Scatter( name='Juros', x=x_axis, y=capital_vector['Juros Acumulados'].values ...
null
application/plotly_wrapper.py
plotly_wrapper.py
py
2,150
python
en
code
null
code-starcoder2
83
[ { "api_name": "plotly.graph_objs.Figure", "line_number": 10, "usage_type": "call" }, { "api_name": "plotly.graph_objs", "line_number": 10, "usage_type": "name" }, { "api_name": "plotly.graph_objs.Scatter", "line_number": 11, "usage_type": "call" }, { "api_name": "...
451117721
import csv import time import requests from bs4 import BeautifulSoup url = 'https://quotes.toscrape.com/' website = BeautifulSoup(requests.get(url).text, 'html.parser') quotes = website.find_all('div', class_='quote') header = ['Text', 'Author', 'Tags'] text, author, tags = [], [], [] for quote in quotes...
null
quizz4.py
quizz4.py
py
820
python
en
code
null
code-starcoder2
83
[ { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 22, "usage_type": "call" } ]
412615273
from argparse import ArgumentParser from lxml import etree import logging import numpy as np def restricted_float(x): try: x = float(x) except ValueError: raise ArgumentTypeError("%r not a floating-point literal" % (x,)) if x < 0.0 or x > 1.0: raise ArgumentTypeError("%r not in ra...
null
compress.py
compress.py
py
9,250
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.info", "line_number": 49, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 59, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 60, "usage_type": "call" }, { "api_name": "logging.info", "line_num...
573304916
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ #import copy import numpy as np import pandas as pd import matplotlib #import matplotlib.pyplot as plt matplotlib.style.use('ggplot') formatDate = lambda x: (int(x[1]) - 1) * 7 + int(x[3]) def writeLocalCsv(path, frames): #output = o...
null
bbb.py
bbb.py
py
2,796
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.style.use", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.int"...
600559882
from django.conf import settings import pytest from model_mommy import mommy from usaspending_api.references.models import Agency, OfficeAgency, SubtierAgency, ToptierAgency def pytest_configure(): # To make sure the test setup process doesn't try # to set up another test db, remove everything but the defau...
null
usaspending_api/conftest.py
conftest.py
py
1,345
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.settings.DATABASES.pop", "line_number": 13, "usage_type": "call" }, { "api_name": "django.conf.settings.DATABASES", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 13, "usage_type": "name" }...
194012912
import numpy as np import cv2 pictureNum = 6 showTime = 5 timeStep = 100 picture = list() for i in range(pictureNum): pictureAdress = 'C:/Users/zczc1/Pictures/Saved Pictures/Picture #' + str(i + 1) + '.jpg' picture.append(cv2.imread(pictureAdress, 1)) def slideShow(): while(True): f...
null
Desk Arranging Robot/Vision/OpenCV Examples/slideShow.py
slideShow.py
py
742
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.addWeighted", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number"...
606495558
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
null
custom/Report_8_Se/sale.py
sale.py
py
1,947
python
en
code
null
code-starcoder2
83
[ { "api_name": "osv.osv.osv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "osv.osv", "line_number": 26, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime...
237836787
#!/bin/env python # -*- coding: cp1252 -*- """ Simple HtmlWindow that redirects all web links (http://) to a new browser instance. Created on: 7/09/2010 Author: Tennessee Carmel-Veilleux (tcv -at- ro.boto.ca) Revision: $Rev: 20 $ Copyright 2010 Tennessee Carmel-Veilleux Description: Simple HtmlWindow t...
null
AutoBGA/ExternalBrowserHtmlWindow.py
ExternalBrowserHtmlWindow.py
py
2,378
python
en
code
null
code-starcoder2
83
[ { "api_name": "wx.html.HtmlWindow", "line_number": 50, "usage_type": "attribute" }, { "api_name": "wx.html", "line_number": 50, "usage_type": "name" }, { "api_name": "wx.html.HtmlWindow.__init__", "line_number": 52, "usage_type": "call" }, { "api_name": "wx.html.H...
76095793
import json #dirbti su json tipo duomenim import requests #siusti http uzklausas import csv #dirbti su .csv tipo failais createUrl = 'http://127.0.0.1:5000/create/' usersUrl = 'http://127.0.0.1:5000/members/' #Sukuria tik viena useri pagal imputa def fun_create_usr(createUrl): fname = input('enter name:...
null
webscript.py
webscript.py
py
1,909
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.put", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 24, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": ...
210240400
""" Первая версия первого задания """ from collections import Counter import timeit from students.mignatenko.day1.task1.constants import TEXT, REPEAT_COUNT def func(): result={} result['vowels'] = dict(Counter(c for c in TEXT.lower() if c in 'aeiou')) result['consonants'] = dict(Counter(c for c in TEXT.l...
null
Python/SCRIPT-003 Python Applied/src/students/mignatenko/day1/task1/init.py
init.py
py
495
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Counter", "line_number": 12, "usage_type": "call" }, { "api_name": "students.mignatenko.day1.task1.constants.TEXT.lower", "line_number": 12, "usage_type": "call" }, { "api_name": "students.mignatenko.day1.task1.constants.TEXT", "line_number": 12, ...
374463287
from nose.tools import raises, assert_raises from MTADelayPredict.subway_line import SubwayLine, N_STOP_LIST @raises(ValueError) def test_wrong_direction_line(): bad_line = SubwayLine(['R1N', 'R2S']) @raises(ValueError) def test_underspecified_stops(): bad_line = SubwayLine(['R1', 'R2']) def test_stop_idx():...
null
tests/test_subway_line.py
test_subway_line.py
py
942
python
en
code
null
code-starcoder2
83
[ { "api_name": "MTADelayPredict.subway_line.SubwayLine", "line_number": 6, "usage_type": "call" }, { "api_name": "nose.tools.raises", "line_number": 4, "usage_type": "call" }, { "api_name": "MTADelayPredict.subway_line.SubwayLine", "line_number": 10, "usage_type": "call" ...
67832360
from django.test import TestCase from django.contrib.auth.models import User from rest_framework.test import APIClient class TestPost(TestCase): def setUp(self): self.user = User.objects.create(username="Foo") def test_post_request_json(self): """ Ensure POST'd JSON data is accepted """ ...
null
snippets/tests.py
tests.py
py
930
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 8, "usage_type...
368835803
#!/usr/bin/env python import http.client # address = "example.com" address = "127.0.0.1:1234" conn = http.client.HTTPSConnection(address) conn.request("GET", "/") r = conn.getresponse() print(r.status, r.reason) data1 = r.read() print(data1) # conn.request("GET", "/") # r = conn.getresponse() # while not r.closed...
null
client/client_http.py
client_http.py
py
410
python
en
code
null
code-starcoder2
83
[ { "api_name": "http.client.client.HTTPSConnection", "line_number": 9, "usage_type": "call" }, { "api_name": "http.client.client", "line_number": 9, "usage_type": "attribute" }, { "api_name": "http.client", "line_number": 9, "usage_type": "name" } ]
613531386
import pygame class Player: def __init__(self,x=120,y=300,width=32,height=32): self.rect = pygame.Rect(x,y,width,height) self.texture = pygame.transform.scale(pygame.image.load("./data/img/player.png"),(width,height)) self.texture.set_colorkey((255,255,255)) self.gravity = 4 ...
null
first/data/player.py
player.py
py
981
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.Rect", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.transform.scale", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.image.lo...
322551242
from aniLink import animeLink from flask import Flask,render_template,request from aniForm import aniForm from colorama import Fore, Back, Style import time import random import binascii app=Flask(__name__) app.secret_key=binascii.hexlify(str(random.random()).encode("utf-8")) def getData(website,keyword): anime=a...
null
anigrab/server.py
server.py
py
2,853
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "binascii.hexlify", "line_number": 10, "usage_type": "call" }, { "api_name": "random.random", "line_number": 10, "usage_type": "call" }, { "api_name": "aniLink.animeLink", "li...
461493472
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Gated working memory with an echo state network # Copyright (c) 2018 Nicolas P. Rougier # # Distributed under the terms of the BSD License. # ------------------------------------------------------------------------...
null
attic/data.py
data.py
py
7,940
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.r_", "line_number": 30, "usage_type": "attribute" }, { "api_name": "numpy.ones", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.convolve", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
170791410
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author : Emma E. M. Hobbs # # Contact: # eemh1@st-andrews.ac.uk # # Emma Hobbs, # School of Biology, # University of St Andrews, # Biomedical Sciences Research Complex, # St Andrews, # Fife, # KY16 9ST # Scotland, # UK # # MIT License import setuptools from pathlib im...
null
setup.py
setup.py
py
2,099
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 27, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 31, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 62, "usage_type": "call" } ]
410376779
#app/ecommend.py # Imports from os import path import pandas as pd import pickle import json # Load pickled vectorizer and model with open('./pickles/tfidf.pkl', 'rb') as tfidf_pkl: tfidf = pickle.load(tfidf_pkl) with open('./pickles/nn_model.pkl', 'rb') as nn_pkl: nn_model = pickle.load(nn_pkl) #with ...
null
app/recommend.py
recommend.py
py
3,175
python
en
code
null
code-starcoder2
83
[ { "api_name": "pickle.load", "line_number": 16, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28,...
502260800
import cv2 import numpy as pd img = cv2.imread('lenna.png') height, width = img.shape[:2] #starting pixel coordinates('top left of cropping rectangle') start_row, start_col = int(height*.25), int(width*.25) #ending the pixel coordinates(bottom right) end_row, end_col = int(height*.75), int(width*.75) #Use indexing ...
null
crop.py
crop.py
py
502
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 19, ...
52272731
import os import shutil import markdown def isCustomCompile(): return True js_outer = '<script type="text/javascript">%s</script>' def genHtml(folderOut): files = os.listdir('.') files = [f for f in files if f.find('__pycache') == -1] for f in files: shutil.copyfile(f, os.path.join(f, os...
null
articles/web/HTMLCanvasAnimationAtoms/compile.py
compile.py
py
895
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_name": "shutil.copyfile", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
554764691
# write your code here import collections import os import sys import re import hashlib import sqlite3 args = sys.argv if len(args) != 2: print('Directory is not specified') exit(-1) path = args[1] sorting_options = {'1': 'DESC', '2': 'ASC'} file_format = input('Enter file format: ') print('\nSize sorting op...
null
Duplicate File Handler/Duplicate File Handler/task/handler.py
handler.py
py
3,973
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 30, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 38, "usage_type": "call" }, { "api_name": "re.match", "line_number": 40...
130925232
#!/usr/bin/python import os import sys import time import datetime from dateutil.relativedelta import relativedelta import operator import re import shutil from config_upload import upload_base '''this is launched by file_upload to update the index page of the media folder; consolidate bulletins later''' allowed_ex...
null
maintenance/media_archives.py
media_archives.py
py
6,382
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.getmtime", "line_num...
201288243
#!/usr/bin/env python3 """Import data from daily attitudes heartbeat survey into BigQuery.""" import datetime as dt import itertools import re from argparse import ArgumentParser from time import sleep import pytz import requests from google.cloud import bigquery parser = ArgumentParser(description=__doc__) parser....
null
sql/moz-fx-data-shared-prod/telemetry_derived/surveygizmo_daily_attitudes/import_responses.py
import_responses.py
py
4,868
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 33, "usage_type": "attribute" }, { "api_nam...
246912248
import jsonlines from collections import Counter from collections import defaultdict def read_in_jsonl(file): with open(file, 'r') as infile: reader = jsonlines.Reader(infile) lines = reader.iter() lines = list(lines) return lines def count_entity_types(json_docs): all_types = []...
null
descriptives.py
descriptives.py
py
1,641
python
en
code
null
code-starcoder2
83
[ { "api_name": "jsonlines.Reader", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 24, "usage_type": "call" }, { "api_name": "collectio...
342440913
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages val_data = np.genfromtxt('/scratch/src/cuIBM-FSI/validation-data/cylinderRe40-KL95.txt') force = np.genfromtxt('forces.txt') plt.plot(0.5*val_data[:,0], val_data[:,1], 'o', color = 'red', mark...
null
scripts/python/plotDrag.py
plotDrag.py
py
732
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.genfromtxt", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
8365695
import requests from bs4 import BeautifulSoup as bs # 使用def定义函数,myurl是函数的参数 def get_url_name(myurl): user_agent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36" header = {'user-agent' : user_agent} response = requests.get(myurl, headers...
null
week01/shuncon_requests/shun_bs4_autopages.py
shun_bs4_autopages.py
py
1,016
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 31, "usage_type": "call" }, { "api_name": "time.sleep", "line_numb...
631233844
import pickle import os import six from enum import Enum class DictOption(Enum): Radical = 1 Pinyin = 2 all_option = list(DictOption) class Radical(object): _dictionary_file_name = 'dictionary.pickle' _dict_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') def __init__(se...
null
cnradical/radical.py
radical.py
py
1,812
python
en
code
null
code-starcoder2
83
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number...
588225000
import logging import cStringIO import traceback import os import datetime import pytz from db.db import SS import db.model as m from app.util import Selector, Batcher from app.i18n import get_text as _ log = logging.getLogger(__name__) def run_recurring_utterance_selections(task): rs = m.UtteranceSelection.que...
null
jobs/job_run_recurring_utterance_selections.py
job_run_recurring_utterance_selections.py
py
2,034
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "db.model.UtteranceSelection.query.filter", "line_number": 20, "usage_type": "call" }, { "api_name": "db.model.UtteranceSelection", "line_number": 20, "usage_type": "attribute" }...
130019134
#!/usr/bin/env python #-*- coding: utf-8 -*- ''' # -*- coding: Latin-1 # -*- coding: iso-8859-1 # -*- coding: utf-8 -*- Created on 18 jun 2015 @author: s057wl ''' import ibm_db ibm_db_conn = ibm_db.connect('pydev', 'PDSN', 'secret') import ctypes def getConnectAtrr(conn, odbc, infotype): # total_buf_le...
null
src/misc/test_db2_connect.py
test_db2_connect.py
py
5,356
python
en
code
null
code-starcoder2
83
[ { "api_name": "ibm_db.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 61, "usage_type": "attribute" }, { "api_name": "pypyodbc.dataSources", "line_number": 65, "usage_type": "call" }, { "api_name": "api_databbases...
322471476
#!/usr/bin/python from jinja2 import Environment, FileSystemLoader from xhtml2pdf import pisa import optparse import logging import json import sys logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO) env = Environment(loader=FileSystemLoader('.')) class Reporter: def __i...
null
test/benchmark/FosdkBenchmark/report.py
report.py
py
2,271
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "jinja2.Environment", "line_number": 11, "usage_type": "call" }, { "api_name": "jinja2.FileSys...
388086055
from datetime import datetime class BankAcc: def __init__(self,name,phone_number): self.name=name self.phone_number=phone_number self.balance=0 self.loan=0 self.statement=[] def show_balance(self): return f"Hello {self.name} you balance is {self.balance}" ...
null
bank.py
bank.py
py
6,150
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 31, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 53, "usage_type": "call" }, { "api_name": "datetim...
584801874
import pytz from datetime import datetime from amazon.api import AsinNotFound from django.db.models import CharField from django.db.models import Manager as DgManager from django.db.models import Model from django.db.models import PositiveSmallIntegerField from django.db.models import Q from accounts.models import A...
null
coop/models.py
models.py
py
5,214
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Manager", "line_number": 22, "usage_type": "name" }, { "api_name": "accounts.models", "line_number": 23, "usage_type": "name" }, { "api_name": "accounts.models.AccountManager", "line_number": 23, "usage_type": "call" }, { "api_name"...
478981248
from rest_framework.throttling import SimpleRateThrottle from django.conf import settings class AccountThrottling(SimpleRateThrottle): scope = 'account' THROTTLE_RATES = { 'account': settings.THROTTLING_RATES, } def get_cache_key(self, request, view): account = request.query_params.ge...
null
luffyapi/apps/user/throttling.py
throttling.py
py
408
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.throttling.SimpleRateThrottle", "line_number": 5, "usage_type": "name" }, { "api_name": "django.conf.settings.THROTTLING_RATES", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 8, "usage_typ...
366581422
from selenium import webdriver from paresrs.ncert_parsers import Ncert_Parser chrome = webdriver.Chrome(executable_path="/Users/ulaganathan/Software/ChromeDriver/chromedriver") chrome.get("https://ncert.nic.in/textbook.php") ncert_parser_obj = Ncert_Parser(chrome) for classes in ncert_parser_obj.class_options: p...
null
chrome_driver_programs/ncert_website/app.py
app.py
py
955
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 4, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 4, "usage_type": "name" }, { "api_name": "paresrs.ncert_parsers.Ncert_Parser", "line_number": 7, "usage_type": "call" } ]
92283236
import asyncio from typing import List import pytest from typedflow.nodes import LoaderNode from typedflow.tasks import DataLoader @pytest.fixture def loader_node() -> LoaderNode[str]: lst: List[str] = ['hi', 'hello', 'konnichiwa'] loader: DataLoader[str] = DataLoader(gen=lst, batch_size=2) node: Loader...
null
typedflow/tests/nodes/test_loader_node.py
test_loader_node.py
py
1,074
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "typedflow.tasks.DataLoader", "line_number": 13, "usage_type": "name" }, { "api_name": "typedflow.nodes.LoaderNode", "line_number": 14, "usage_type": "name" }, { "api_name": "pyt...
338311187
__author__ = 'cfiloteo' from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core import serializers import json class ajaxPaginator(Paginator): rows_per_page = 5 page_number = 1 fields = () format = 'json' def __init__(self, *args, **kwargs): super().__in...
null
lib/ajaxPagination.py
ajaxPagination.py
py
1,480
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.paginator.Paginator", "line_number": 7, "usage_type": "name" }, { "api_name": "django.core.paginator.PageNotAnInteger", "line_number": 21, "usage_type": "name" }, { "api_name": "django.core.paginator.EmptyPage", "line_number": 24, "usage_type": ...
622509543
import json from django.core.paginator import EmptyPage, Paginator, PageNotAnInteger from django.shortcuts import render, get_object_or_404 from django.contrib.auth.decorators import login_required from .models import ArticleColumn, ArticlePost from .forms import ArticleColumnForm, ArticlePostForm from django.views.dec...
null
article/views.py
views.py
py
8,821
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.ArticleColumn.objects.filter", "line_number": 26, "usage_type": "call" }, { "api_name": "models.ArticleColumn.objects", "line_number": 26, "usage_type": "attribute" }, { "api_name": "models.ArticleColumn", "line_number": 26, "usage_type": "name" },...
477118132
import torch from pytorch_pretrained_bert import BertTokenizer from pytorch_pretrained_bert.modeling import BertPreTrainedModel, BertModel from pytorch_pretrained_bert.optimization import BertAdam from pytorch_pretrained_bert.file_utils import WEIGHTS_NAME, CONFIG_NAME import csv, os import numpy as np import ast from ...
null
others/BERT_multilabel.py
BERT_multilabel.py
py
17,234
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "pytorch_pretrained_bert.modeling.BertPreTrainedModel", "line_number": 22, "usage_type": "name" }, { "api_name": "pytorch_pretrained_bert.modeling.BertModel", "line_number": 31, "u...
322071772
import os import sys import torch import struct import numpy as np sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '.\\'))) from KeyMap import * fileName = os.path.join('checkpoint', '20191104_resnet10_quant_ch8_224x', 'checkpoint_224x_fuse_b100.pth') # fileName = os.path.join('checkpoint', ...
null
examples/classifier_compression/LoadModelCkp.py
LoadModelCkp.py
py
12,278
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number...
495725401
import pygame import math from effects.Explosion import Explosion class EnemyProjectile(pygame.sprite.Sprite): """This class is base class for all bullet projectiles by the enemy. """ def __init__(self, game, enemy, pos): """__init__ method for EnemyProjectile class Args: ...
null
bullets/EnemyProjectile.py
EnemyProjectile.py
py
4,602
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.sprite", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 21, "usage_type": "attribute" }, { "api_name": "py...
150503246
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), migrations.swappable_depen...
null
client/migrations/0001_initial.py
0001_initial.py
py
5,012
python
en
code
null
code-starcoder2
83
[ { "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.swappable_dependency", "line_number": 11, "usage_type": "call...
477607430
from django.shortcuts import render,redirect from .models import properties,shortlist,notes,tourrequests,offers,propertyrating from .forms import propertyform from django.contrib.auth.decorators import login_required from django.core.files.storage import FileSystemStorage from mysite.models import profileModel from dja...
null
ptm/functionality/views.py
views.py
py
17,700
python
en
code
null
code-starcoder2
83
[ { "api_name": "mysite.models.profileModel.objects.get", "line_number": 15, "usage_type": "call" }, { "api_name": "mysite.models.profileModel.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "mysite.models.profileModel", "line_number": 15, "usage_typ...
114300888
import os import re from sys import stdout from time import sleep from datetime import datetime from subprocess import Popen, PIPE from copy import deepcopy as copy # from random import randint # TODO Usado somente em testes import multiprocessing as mp import xml.etree.ElementTree as et def memory_usage_ps(): o...
null
RanSharing/Filter/filter.py
filter.py
py
6,171
python
en
code
null
code-starcoder2
83
[ { "api_name": "subprocess.Popen", "line_number": 14, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 15, "usage_type": "name" }, { "api_name": "sys.stdout", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.stdout", "li...
300910657
import pandas as pd import numpy as np from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split from sklearn.linear_model import Lasso from sklearn.feature_selection import SelectFromModel import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) def fea...
null
MachineLearning-Projects--master/House Price prediction (kaggle)/feature_selection.py
feature_selection.py
py
1,445
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFra...
356714770
import base64 import uuid import os from openpyxl.chart import ( LineChart, BarChart, Reference, Series ) from openpyxl.styles import PatternFill, Border, Side, Alignment, Font from openpyxl.drawing.image import Image from openpyxl import Workbook from openpyxl.chart.label import DataLabelList #######...
null
myems-api/excelexporters/virtualmetercost.py
virtualmetercost.py
py
13,827
python
en
code
null
code-starcoder2
83
[ { "api_name": "base64.b64encode", "line_number": 51, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 56, "usage_type": "call" }, { "api_name": "openpyxl.Workbook", "line_number": 63, "usage_type": "call" }, { "api_name": "openpyxl.styles.Font", ...
589367352
""" 构建数据集 """ import json import torch import torch.nn as nn import nn_models.nn_config as nn_config from torch.utils.data import Dataset import numpy as np from tqdm import tqdm import pickle import dgl import random from functools import reduce def tokenizer(s): """ :param s: 摘要文本,切分成token :return: ...
null
code/nn_models/data.py
data.py
py
8,928
python
en
code
null
code-starcoder2
83
[ { "api_name": "pickle.load", "line_number": 45, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 61, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 65, "usage_type": "call" }, { "api_name": "random.shuffle", "line_...
295911800
from pyspark import SparkContext from pyspark.python.pyspark.shell import spark from pyspark.sql import SQLContext sc = SparkContext(appName="query1") sqlContext = SQLContext(sc) lineitem = spark.read.parquet("hdfs://namenode:8020/hossein-parquet-data/lineitem.parquet") from datetime import datetime from datetime im...
null
OLAP/spark_query/query_in_parquet_format/spark_query1.py
spark_query1.py
py
1,307
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyspark.SparkContext", "line_number": 5, "usage_type": "call" }, { "api_name": "pyspark.sql.SQLContext", "line_number": 6, "usage_type": "call" }, { "api_name": "pyspark.python.pyspark.shell.spark.read.parquet", "line_number": 8, "usage_type": "call" }, ...
526655981
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== from __future__ import print_function import os import math import argparse import ...
null
cntk/vgg16/VGG16_ImageNet_Distributed.py
VGG16_ImageNet_Distributed.py
py
10,779
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line...
442342683
from .AbstractPoolingPyramid import AbstractPoolingPyramid import scipy.sparse import pyamg import numpy as np #from graphcnn.util.modelnet.pointCloud2Graph import ply2graph import tensorflow as tf class LloydPoolingPyramid(AbstractPoolingPyramid): def __init__(self,numRepresentations,companderConstructor, ratios...
null
src/graphcnn/util/pooling/LloydPoolingPyramid.py
LloydPoolingPyramid.py
py
1,331
python
en
code
null
code-starcoder2
83
[ { "api_name": "AbstractPoolingPyramid.AbstractPoolingPyramid", "line_number": 8, "usage_type": "name" }, { "api_name": "pyamg.aggregation.aggregate.lloyd_aggregation", "line_number": 19, "usage_type": "call" }, { "api_name": "pyamg.aggregation", "line_number": 19, "usage_...
373411794
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Sep 6 17:42:28 2018 @author: Samuele Garda """ import argparse from utils.prepare_shootout import preprocess from evaluation.evaluation import load_eval_data def parse_arguments(): """ Parse command line arguments. """ parser = argparse.Ar...
null
evaluation/gen_keep_vocab.py
gen_keep_vocab.py
py
1,234
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "evaluation.evaluation.load_eval_data", "line_number": 28, "usage_type": "call" }, { "api_name": "utils.prepare_shootout.preprocess", "line_number": 34, "usage_type": "call" ...
312280234
# coding=utf-8 import argparse import textwrap import time import os, sys from torch.autograd import Variable sys.path.append(os.path.dirname(__file__)) from utils.config import process_config, check_config_dict from utils.logger import ExampleLogger from trainers.example_model import ExampleModel from trainers.exampl...
null
test.py
test.py
py
3,771
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number...
359581538
import script_context import requests from Stonks.utilities.config import apikey import pandas as pd import matplotlib.pyplot as plt import time import importlib import h5py import os import sys import numpy as np import arrow def grub(symbol='VIX9D', startdate=1581921000000): # define endpoint price_endpoin...
null
Stonks/DataGrubbing/VIX_grubbing.py
VIX_grubbing.py
py
2,388
python
en
code
null
code-starcoder2
83
[ { "api_name": "Stonks.utilities.config.apikey", "line_number": 20, "usage_type": "argument" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.Dat...
374192318
import base64 import json import boto3 import os import uuid ROUTING_KEY = "delivery-receipts" def lambda_handler(event, context): sqs = boto3.resource('sqs') queue = sqs.get_queue_by_name( QueueName=f"{os.getenv('NOTIFICATION_QUEUE_PREFIX')}{ROUTING_KEY}" ) for record in event["Records"]: ...
null
lambda_functions/ses_callback/ses_callback_lambda.py
ses_callback_lambda.py
py
1,746
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.resource", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 19, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_numb...
225214698
import serial import struct import sys import operator import argparse import binascii import time #VRCSR protocol defines SYNC_REQUEST = 0x5FF5 SYNC_RESPONSE = 0x0FF0 PROTOCOL_VRCSR_HEADER_SIZE = 6 PROTOCOL_VRCSR_XSUM_SIZE = 4 #CSR Address for sending an application specific custom command ADDR_CUSTOM_COMM...
null
thruster.py
thruster.py
py
4,959
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 40, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 55, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 60, "usage_type": "call" }, { "api_name": "struct.pack", "lin...
291913872
#!/usr/bin/python # modini.py -- modifies ini files from commandline # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # pmoss.robinson@gmail.com # wrote this file. As long as you retain this notice you # can do whatever you want with this stuf...
null
modini.py
modini.py
py
1,156
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "configobj.ConfigObj", "line_number": 22, "usage_type": "call" } ]
343979802
import gym from Reinforcement_learning import DDPG import numpy as np MAX_EPISODES = 200 MAX_EP_STEPS = 200 LR_A = 0.001 # learning rate for actor LR_C = 0.002 # learning rate for critic GAMMA = 0.9 # reward discount TAU = 0.01 # soft replacement MEMORY_CAPACITY = 10000 BATCH_SIZE = 32 RENDER = False E...
null
build/lib/Reinforcement_learning/test/run_ddpg.py
run_ddpg.py
py
1,322
python
en
code
null
code-starcoder2
83
[ { "api_name": "gym.make", "line_number": 18, "usage_type": "call" }, { "api_name": "Reinforcement_learning.DDPG", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.clip", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.random.normal",...
157851199
import cv2 import numpy as np from scipy import sparse # Read the image image = cv2.imread('MicrosoftTeams-image (2).png') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # Set threshold level threshold_level = 100 # Find coordinates of all pixels below threshold coords = np.column_stack(np.where(gray < t...
null
matrix_process.py
matrix_process.py
py
1,613
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.column_stack", ...
41317362
import math import fractions n= int(input()) while(n > 0 ): st = (input()) L = st.split(); a = int(L[0]) b = int (L[1]) cd = fractions.gcd(a, b) print(cd)
null
পাইথন /gcd.py
gcd.py
py
180
python
en
code
null
code-starcoder2
83
[ { "api_name": "fractions.gcd", "line_number": 9, "usage_type": "call" } ]
164350404
#coding: utf-8 import jieba from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import CountVectorizer texts=[] for i in range(3): with open('text'+str(i+1)+'.txt') as fr: texts+=fr.readlines() # print(texts[0]) def creadstoplist(): stwlist =...
null
tf-idf/tf-idf_chinese_2.py
tf-idf_chinese_2.py
py
1,685
python
en
code
null
code-starcoder2
83
[ { "api_name": "jieba.cut", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 37, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfTransformer", "line_number": 38, "usage_ty...
289446614
import numpy as np get_ipython().run_line_magic('matplotlib', 'inline') import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from sklearn.svm import SVR from qiskit import Aer from qiskit.aqua import QuantumInstance from qiskit.aqua.components.feature_maps import SecondOrderExpansion from tools ...
null
non-linear.py
non-linear.py
py
1,925
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.sort", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.random", ...
345516899
#!/usr/bin/env python import numpy as np from keras.models import Sequential from keras.layers import Dense, Flatten, TimeDistributed, Reshape from keras.layers import LSTM, Conv2D, MaxPooling2D, Activation from keras.preprocessing.image import img_to_array, array_to_img from keras.preprocessing import sequence import...
null
readData.py
readData.py
py
4,291
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.load", "line_number": 13, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 23, "usage_type": "call" }, { "api_name": "keras.layers.TimeDistributed", "line_number": 26, "usage_type": "call" }, { "api_name": "keras...
380214788
# Copyright 2020 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
null
dev_tools/conftest.py
conftest.py
py
1,082
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytest.mark.skip", "line_number": 28, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 28, "usage_type": "attribute" } ]
161618604
from flask import Flask from flask import render_template from flask import Response, request, jsonify import re import copy app = Flask(__name__) current_id = 1 word_learned_lists = [] # non_ppc_people = [ # "Phyllis", # "Dwight", # "Oscar", # "Creed", # "Pam", # "Jim", # "Stanley", # "Michael", # "Kevin", #...
null
Korean_Learning_Website/server.py
server.py
py
16,357
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 336, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 351, "usage_type": "call" }, { "api_name": "flask.render_templat...
356491312
# -*- coding: utf-8 -*- """ fichier Solve """ import numpy as np import scipy as sp from scipy.sparse.linalg import spsolve from scipy.sparse import lil_matrix from element import RefElement, Element, Simplex class Forms : """ Formes varitionnelles""" def __init__(self, a, b, c, q, d, beta): "...
null
solve.py
solve.py
py
4,083
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.dot", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 39, "usage_type": "call" }, { "api_name": "scipy.loadtxt", "line_number": 61, ...
299115672
from django.urls import path from mainapp.views import ( main, contacts, about ) app_name = 'mainapp' urlpatterns = [ path('contacts/', contacts, name='contacts'), path('about/', about, name='about'), path('', main, name='index'), ]
null
server/mainapp/urls.py
urls.py
py
252
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "mainapp.views.contacts", "line_number": 10, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "mainapp....
262159560
# -*- encoding: utf-8 -*- from ..lb_task import LbTask from lazyblacksmith.extension.celery_app import celery_app from lazyblacksmith.extension.esipy import esiclient from lazyblacksmith.extension.esipy.operations import get_characters_skills from lazyblacksmith.models import Skill from lazyblacksmith.models import Ta...
null
lazyblacksmith/tasks/character/skills.py
skills.py
py
2,218
python
en
code
null
code-starcoder2
83
[ { "api_name": "lazyblacksmith.models.User.query.get", "line_number": 26, "usage_type": "call" }, { "api_name": "lazyblacksmith.models.User.query", "line_number": 26, "usage_type": "attribute" }, { "api_name": "lazyblacksmith.models.User", "line_number": 26, "usage_type": ...
231800076
# coding: utf-8 import pytest from tapioca_iugu.tapioca_iugu import IuguClientAdapter def test_resource_access(api_client): resource = api_client.customer_list() assert resource.data == "https://api.iugu.com/v1/customers" iterator_data = [ ({}, {"totalItems": 730, "items": ["item"] * 100}, {"params": {...
null
tests/test_tapioca_iugu.py
test_tapioca_iugu.py
py
853
python
en
code
null
code-starcoder2
83
[ { "api_name": "tapioca_iugu.tapioca_iugu.IuguClientAdapter", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 19, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 19, "usage_type": "attribute" } ]
574255471
from influxdb import InfluxDBClient from random import randint import datetime class Metrics(object): def __init__(self): self.client = InfluxDBClient('54.161.112.58', 8086, 'root', 'root', 'example') self.client.create_database('example') self.send_metrics() def send_metrics(self): ...
null
metrics.py
metrics.py
py
929
python
en
code
null
code-starcoder2
83
[ { "api_name": "influxdb.InfluxDBClient", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "r...
588607266
"""The runes Flask web application.""" import json from flask import Flask, request, render_template, jsonify import re import os from runes import getSequences, reduce, fold app = Flask(__name__) @app.route('/', methods=['GET','POST']) def root(): if request.method=='GET': return render_template('inde...
null
app.py
app.py
py
1,238
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.render_temp...
250105787
import sys import wx import wx.html import wx.lib.wxpTag import __version__ #--------------------------------------------------------------------------- class MyHelpCVS(wx.Dialog): text = ''' <html> <body bgcolor="#dddaec"> <table bgcolor="#7a5ada" width="100%%" cellspacing="0" cellpadding="0" border="1"> <tr> ...
null
HelpCVSDialog.py
HelpCVSDialog.py
py
1,307
python
en
code
null
code-starcoder2
83
[ { "api_name": "wx.Dialog", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wx.Dialog.__init__", "line_number": 39, "usage_type": "call" }, { "api_name": "wx.Dialog", "line_number": 39, "usage_type": "attribute" }, { "api_name": "wx.html.HtmlWindow",...
593316441
"""Initial authentication handlers (``/login``).""" from __future__ import annotations import base64 import os from typing import TYPE_CHECKING, Optional from fastapi import APIRouter, Depends, HTTPException, Query, status from fastapi.responses import RedirectResponse from httpx import HTTPError from gafaelfawr.de...
null
src/gafaelfawr/handlers/login.py
login.py
py
10,057
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 21, "usage_type": "name" }, { "api_name": "fastapi.APIRouter", "line_number": 27, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 48, "usage_type": "name" }, { "api_name": "typing.Optiona...
97251826
import time import numpy as np import tensorflow as tf import tensorflow.contrib as contrib from PIL import Image from scipy.io import loadmat from imageio import imread, imwrite from skimage.transform import resize np.random.seed(1024) HEIGHT = 360 WIDTH = 360 CHANNEL = 3 PATCH_SIZE = [1, 3, 3, 1] MAX_ITER = 100 ME...
null
code/StyleSwap_W.py
StyleSwap_W.py
py
8,694
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray",...
639958671
import asyncore import socket import errno import logging from ..core import deferred from ..comm import PDU DEBUG = True _logger = logging.getLogger(__name__) __all__ = ['TCPClient'] CONNECT_TIMEOUT = 30.0 class TCPClient(asyncore.dispatcher): """ This class is a mapping between the client/server pattern...
null
bacpypes/transport/tcp_client.py
tcp_client.py
py
6,503
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "asyncore.dispatcher", "line_number": 17, "usage_type": "attribute" }, { "api_name": "asyncore.dispatcher.__init__", "line_number": 28, "usage_type": "call" }, { "api_name"...
437447831
import datetime from threading import Thread import logging import redis class EventListener(Thread): def __init__(self): Thread.__init__(self) self.__r = redis.Redis(charset="utf-8", decode_responses=True) self.__events = [] def run(self): pubsub = self.__r.pubsub() ...
null
lab3/Listener.py
Listener.py
py
662
python
en
code
null
code-starcoder2
83
[ { "api_name": "threading.Thread", "line_number": 8, "usage_type": "name" }, { "api_name": "threading.Thread.__init__", "line_number": 10, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 10, "usage_type": "name" }, { "api_name": "redis.Redi...
206397758
import discord from discord.ext import commands as bot import urllib import urllib.request import urllib.error import json import asyncio import re import random import os import aiohttp import csv def trunc_to(ln, s): if len(s) <= ln: return s else: return s[:ln-3] + "..." def highlight(s, term, type='**'): ...
null
helpful.py
helpful.py
py
9,528
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.sub", "line_number": 20, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 20, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 25, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 2...
202090211
import logging import os import sys import time import aiohttp_jinja2 import jinja2 from aiohttp import web import ledfx_frontend from ledfx.api import RestApi try: base_path = sys._MEIPASS except BaseException: base_path = os.path.abspath(".") _LOGGER = logging.getLogger(__name__) class HttpServer(object...
null
ledfx/http_manager.py
http_manager.py
py
2,490
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys._MEIPASS", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.getLogger", ...
502780999
""" The Python standard library's 'calendar' module allows you to render a calendar to your terminal. https://docs.python.org/3.6/library/calendar.html Write a program that accepts user input of the form `14_cal.py [month] [year]` and does the following: - If the user doesn't specify any input, your program shoul...
null
src/14_cal.py
14_cal.py
py
3,024
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.today", "line_number": 42, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 42, "usage_type": "name" }, { "api_name": "calendar.month", "line_number": 59, "usage_type": "call" } ]
612097054
from VideoGet import VideoGet from imutils.object_detection import non_max_suppression from imutils.video import FPS import numpy as np import pytesseract import argparse import imutils import time import cv2 as cv ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", type=str, help='path to input image') ap...
null
multithreading_video_recognition.py
multithreading_video_recognition.py
py
3,566
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 40, "usage_type": "call" }, { "api_name": "cv2.dnn.readNet", "li...
644589274
""" -A simple link simulator that emulates the transmission of packets from a -sender A to a receiver B. - -""" from collections import deque received_packets = [] received_packets_atC = [] received_packets_atD = [] class Packet: """ This stores the information associated with a packet """ ...
null
networkstype.py
networkstype.py
py
8,690
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 44, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 45, "usage_type": "call" } ]
561200121
""" ******************************************************* * Copyright (C) 2017 MindsDB Inc. <copyright@mindsdb.com> * * This file is part of MindsDB Server. * * MindsDB Server can not be copied and/or distributed without the express * permission of MindsDB Inc **************************************************...
null
mindsdb/proxies/mysql/mysql_proxy.py
mysql_proxy.py
py
6,349
python
en
code
null
code-starcoder2
83
[ { "api_name": "socketserver.BaseRequestHandler", "line_number": 38, "usage_type": "attribute" }, { "api_name": "libs.helpers.logging.logging.info", "line_number": 47, "usage_type": "call" }, { "api_name": "libs.helpers.logging.logging", "line_number": 47, "usage_type": "n...
600341298
from flask import Flask, request,render_template, url_for ,redirect #UPLAD_FLODER ='static/uploads' app = Flask(__name__) @app.route('/') def hello(): return render_template('test.html') @app.route('/test',methods=['GET', 'POST']) def test(): return render_template('test.html') @app.route('/first1',methods...
null
covid19_vaccine/main.py
main.py
py
4,013
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.render_te...
196290852
import os import pandas as pd import wget LIFESAT_PATH = os.path.join("datasets", "lifesat", "") DOWNLOAD_ROOT = "https://raw.githubusercontent.com/ageron/handson-ml2/master/" LIFESAT_URL = DOWNLOAD_ROOT + "datasets/lifesat/" FILE_NAMES = ("oecd_bli_2015.csv", "gdp_per_capita.csv") def fetch_lifesat_data(lifesat_ur...
null
example1-1/util/dataset.py
dataset.py
py
2,047
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
304746831
import pygame import os.path from Cell import Cell # Loading all images bg = pygame.image.load(os.path.join('Pictures', 'BG.jpg')) cross = pygame.image.load(os.path.join('Pictures', 'Cross.png')) zero = pygame.image.load(os.path.join('Pictures', 'Zero.png')) draw = pygame.image.load(os.path.join('Pictures', ...
null
Desk.py
Desk.py
py
4,488
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.image.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.path", ...
360007670
import numpy as np import os from scipy.interpolate import interp1d import matplotlib.pyplot as plt import nlp.nlp as nlp import nlp.dynamics as dynamics import nlp.cost_functions as cost_functions import nlp.constraints as constraints import nlp.measurements as measurements import utils.gnss as gnss import utils.utils...
null
autonomous-car.py
autonomous-car.py
py
15,648
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.vehicle_sim.vehicle_dynamics", "line_number": 23, "usage_type": "call" }, { "api_name": "utils.vehicle_sim", "line_number": 23, "usage_type": "name" }, { "api_name": "utils.vehicle_sim.linear_tire_model", "line_number": 23, "usage_type": "attribute" ...
323064837
import html as escaper from typing import List import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from matplotlib import colors from sklearn.metrics import confusion_matrix from analyser.legal_docs import LegalDocument from analyser.ml_tools import Pr...
null
colab_support/renderer.py
renderer.py
py
13,632
python
en
code
null
code-starcoder2
83
[ { "api_name": "analyser.structures.OrgStructuralLevel.BoardOfDirectors", "line_number": 27, "usage_type": "attribute" }, { "api_name": "analyser.structures.OrgStructuralLevel", "line_number": 27, "usage_type": "name" }, { "api_name": "analyser.structures.OrgStructuralLevel.Shareh...
107657196
#!/usr/bin/env python3 __version__ = "0.1.0" import os __location__ = os.path.realpath( os.path.join(os.getcwd(), os.path.dirname(__file__))) import sys import json import argparse import importlib.resources from dpterminal import printingloop class appcaller(): def startfromscratch(self, config='confi...
null
dpterminal/dpterm.py
dpterm.py
py
4,676
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...