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
353370212
from bs4 import BeautifulSoup from Scraper_Class import Scraper, requests import re from pprint import pprint class OfferUp(Scraper): def __init__(self): super().__init__(this_products=[], listing={}) #Same parameters as Scraper class and reset the values def site_scrape(self, search, av...
null
Backend/OfferUp_Class.py
OfferUp_Class.py
py
9,274
python
en
code
null
code-starcoder2
76
[ { "api_name": "Scraper_Class.Scraper", "line_number": 6, "usage_type": "name" }, { "api_name": "Scraper_Class.requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "Scraper_Class.requests", "line_number": 17, "usage_type": "name" }, { "api_name":...
98632297
# coding=utf-8 from tornado import gen from service.data.base import DataService from util.common.decorator import cache from util.common import ObjectDict class JobApplicationDataService(DataService): # must not cache this func @gen.coroutine def get_job_application(self, conds, fields=None): ...
null
service/data/job/job_application.py
job_application.py
py
2,224
python
en
code
null
code-starcoder2
76
[ { "api_name": "service.data.base.DataService", "line_number": 9, "usage_type": "name" }, { "api_name": "tornado.gen.Return", "line_number": 19, "usage_type": "call" }, { "api_name": "tornado.gen", "line_number": 19, "usage_type": "name" }, { "api_name": "util.comm...
460697424
import requests from bs4 import BeautifulSoup from flask import Flask from flask_cors import CORS from html2text import html2text import classifier import preprocessor import time import datetime app = Flask(__name__) CORS(app) @app.route('/rest_doc/<path:url>', methods = ['GET']) def read_text_url(url): start = ...
null
rest.py
rest.py
py
1,179
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp...
646535147
""" NDA JADI """ from pyXSteam.XSteam import XSteam steamT = XSteam(XSteam.UNIT_SYSTEM_MKS) import numpy as np import matplotlib.pyplot as plt temperatur = np.arange(10,100,1,dtype= int) print(temperatur) h = steamT.hV_t(temperatur) print(h) plt.plot(temperatur,h) plt.show()
null
Geothermal/Tes 1.py
Tes 1.py
py
319
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyXSteam.XSteam.XSteam", "line_number": 4, "usage_type": "call" }, { "api_name": "pyXSteam.XSteam.XSteam.UNIT_SYSTEM_MKS", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 10, "usage_type": "call" }, { "api...
598594909
''' from scipy import stats slope, intercept, r_value, p_value, sd_error = stats.linregress(x, y) ''' import matplotlib.pyplot as plt import numpy as np import statsmodels.api as sm import json with open("melb_education_stats.json", "r") as mel_e: mel_education = json.load(mel_e) with open("vic_income.json", "r")...
null
Results/education_melb.py
education_melb.py
py
1,957
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "statsmodels.api.add_constant", "line_number": 51, "usage_type": "call" }, { "api_name": "statsmodels.api", ...
597072642
import pygame import random pygame.init() colors = { 'WHITE': (255,255,255), 'BLUE': (0, 0, 255), 'GREEN': (0,255,0), 'RED': (255, 0, 0), 'BLACK': (0, 0, 0) } clock = pygame.time.Clock() display_width = 1024 display_height = 768 FPS = 60 font = pygame.font.SysFont("calibri", 32, bold=True) bor...
null
skil1/safnarinn/safnarinn.py
safnarinn.py
py
6,305
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont", ...
159330243
import multiprocessing import time x = multiprocessing.Value('i', 0) start = time.perf_counter() def counter_one(counter_x): for i in range(1000000): with counter_x.get_lock(): counter_x.value += 1 def counter_two(counter_x): for i in range(1000000): with counter_x.get_lock(): counter_x.value += 1 proc...
null
multiprocessing_lock.py
multiprocessing_lock.py
py
778
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.Value", "line_number": 4, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 6, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 18, "usage_type": "call" }, { "api_name": "multipr...
166170708
__author__ = 'Tony' import xml.etree.ElementTree as ET configfile = 'config.xml' class SysConfig(): __root = None def __init__(self): tree = ET.parse(configfile) self.__root = tree.getroot() def getdatabasefiename(self): try: for dbase in self.__root.findall('databa...
null
SysConfig.py
SysConfig.py
py
1,727
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 12, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 12, "usage_type": "name" } ]
212233087
#!/usr/bin/env mdl import argparse import numpy as np import os import sys import json from glob import glob from tqdm import tqdm import cv2 import torch import torch.nn as nn from torch.autograd import Variable from model import Network from pathlib import Path datasets_catch = dict() MEAN_FACE = np.array([ [...
null
pytorch_model/config/pytorch.update.base.20190308/torch_inference_gpu.py
torch_inference_gpu.py
py
7,388
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 58, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 80,...
70096843
# # Run flask app: python3 application.py # For uwsgi container to host flask in a production setting # -> sudo apt-get install gcc (Need to have c compiler) -> If using mac command is sudo brew install gcc # You also need the python development headers, to get this run the command or equivalent to apt-get install...
null
tex2speech/application.py
application.py
py
7,773
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.Flask", "line_...
454602923
import numpy as np from sklearn.svm import LinearSVC, SVC, NuSVC, SVR, LinearSVR, NuSVR from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn import tree from argparse import ArgumentParser from pydotplus import graph_from_dot_data from sklearn.model_selection i...
null
anaylsis/ml.py
ml.py
py
13,667
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "argparse.add_argument", "line_number": 20, "usage_type": "call" }, { "api_name": "argparse.add_argument", "line_number": 25, "usage_type": "call" }, { "api_name": "a...
14977058
from nltk.corpus import stopwords stop_words = set(stopwords.words('english')) file1 = open("AI1.txt") line = file1.read() words = line.split() for r in words: if not r in stop_words: appendFile = open('filteredtext.txt','a') appendFile.write(" "+r) appendFile.close()
null
stopremoval.py
stopremoval.py
py
306
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 5, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 5, "usage_type": "name" } ]
41560199
#!/usr/bin/env python import random from datetime import datetime ''' 数据格式 # 商品id与内容 items => {'12':'PHP','1203':'Storm','123':'Ubuntu'} # 商品id items_pool => [12,32,121,324,532,123,53,1203,429,2932] # 用户与对应的商品id user_items => {'1010':[12,1203,123,429]} ''' # 随机抽样负样本 def RandomSelectNagativeSample(items, items_pool):...
null
MyPaper/LFM.py
LFM.py
py
6,687
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randint", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 83, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 83, "usage_type": "name" }, { "api_name": "codecs.open", ...
138641300
import xlrd from string import Template import os import shutil def jsWriter(folder_name, small_folder_name): if os.path.exists(folder_name +'/js'): shutil.rmtree(folder_name +'/js') shutil.copytree(os.getcwd() + '/js', folder_name+'/js') with open(folder_name+'/js/externalFile.js', "a") a...
null
jsWriteFile.py
jsWriteFile.py
py
2,254
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "shutil.rmtree", "line_number": 12, "usage_type": "call" }, { "api_name": "shutil.copytree", "line...
161495583
# -*- coding:utf-8 -*- # Copyright (C) 2012 Juan Carlos Moreno <juancarlos.moreno at ecmanaged.com> # # 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...
null
ecagent/agent.py
agent.py
py
6,154
python
en
code
null
code-starcoder2
76
[ { "api_name": "twisted.internet.reactor.callWhenRunning", "line_number": 42, "usage_type": "call" }, { "api_name": "twisted.internet.reactor", "line_number": 42, "usage_type": "name" }, { "api_name": "ecagent.twlogging.critical", "line_number": 57, "usage_type": "call" ...
638680882
import os import pickle import sys from collections import Counter import fasttext import matplotlib.pyplot as plt import numpy as np import sklearn import tensorflow as tf from sklearn.manifold import TSNE SHORT_TITLE_LENGTH = 10 MARKERS = [['red', 100, 'o'], ['black', 100, 'x'], ['cyan', 100, 'd'], ['blue', 150, '...
null
helper.py
helper.py
py
3,293
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.__version__", "line_number": 22, "usage_type": "attribute" }, { "api_name": "tensorflow.__version__", "line_number": 23, "usage_type": "attribute" }, { "api_name": "s...
133107215
from rest_framework import serializers from supermarket_ms.models.product_model import Product from supermarket_ms.models.category_model import Category from supermarket_ms.serializers.category_serializer import CategorySerializer class ProductSerializer(serializers.ModelSerializer): unit_measurement = serializer...
null
lab2/SupermarketMS/supermarket_ms/serializers/product_serializer.py
product_serializer.py
py
1,980
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.ChoiceField", "line_number": 8, "usag...
168235596
import requests from bs4 import BeautifulSoup def get_equipment(): URL = "https://game8.co/games/Animal-Crossing-New-Horizons/archives/286679" page = requests.get(URL) # Get DIYS soup = BeautifulSoup(page.content, "html.parser") elements = soup.find_all("td", class_="center") # Filter out a ...
null
diys/equipment.py
equipment.py
py
579
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" } ]
420077700
from requests import request, post from json import loads,dumps import logging from pymongo import MongoClient import time import datetime logging.basicConfig(level=logging.DEBUG) client = MongoClient('localhost',27017) db = client.ksbao ksbao_test = db.ksbao_test9 # ksbao_testInfo = db.ksbao_testInfo class logi...
null
loginTestKsbao.py
loginTestKsbao.py
py
11,365
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.info"...
403541074
import os.path import math import numpy as np import cv2 import torch import torch.utils.data as data import data.util as util class LRHRFourLevelsDataset(data.Dataset): ''' Read LR, HR and intermediate target image groups. If only HR image is provided, generate LR image on-the-fly. The group is match...
null
code/data/LRHR_four_levels_dataset.py
LRHR_four_levels_dataset.py
py
6,660
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.p...
284259721
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.decorators import login_required from django.shortcuts import render from django.core.files.storage import FileSystemStorage from services.models import Service from .models import Person from django.views.generic.edit import CreateView,...
null
gestao_desafio/persons/views.py
views.py
py
5,506
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 17, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 17, "usage_type": "name" }, { "api_name": "models.Person.objects.all", "line_number": 18, "usage_type": "call" }...
388588937
import numpy as np import cv2 from matplotlib import pyplot as plt MIN_MATCH_COUNT = 5 img1 = cv2.imread('./src1.png', 0) # 目标图像 img2 = cv2.imread('./test1.jpg', 0) # 原图像 # Initiate SIFT detector sift = cv2.xfeatures2d.SIFT_create() # find the keypoints and descriptors with SIFT kp1, des1 = sift.detectAndCompute(i...
null
SIFT.py
SIFT.py
py
2,362
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.xfeatures2d.SIFT_create", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.xfeatures2d", ...
534372757
# Copyright 2018 The NLP Odyssey Authors. # Copyright 2018 Marco Nicola <marconicola@disroot.org> # # 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/LICENS...
null
colonel/emptynode.py
emptynode.py
py
3,513
python
en
code
null
code-starcoder2
76
[ { "api_name": "colonel.base_rich_sentence_element.BaseRichSentenceElement", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 32, "usage_type": "name" },...
486313874
import xml.etree.ElementTree as ET import pandas as pd cols = ["name", "phone", "email", "date"] rows = [] #Parse XML file tree = ET.parse('employee.xml') root = tree.getroot() for elem in root: name = elem.find("name").text phone = elem.find("phone").text email = elem.find("emai...
null
samp.py
samp.py
py
623
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 8, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 8, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" } ]
257551216
from collections import deque ''' problem: You want to keep a limited history of the last few lines during iteration or during some kind of other process solution: Keeping a limited history is perfect usecase for collections.deque. Code below performs a simple text match on a sequence of lines and yields the matching...
null
Chapter1/collectsions_deques.py
collectsions_deques.py
py
1,466
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 28, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 53, "usage_type": "call" } ]
464553374
import pygame BLACK = pygame.Color(0, 0, 0) WHITE = pygame.Color(255, 255, 255) pygame.init() screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption('Collision') # cria o Rect para o quadrado square = pygame.Rect(300, 230, 20, 20) # cria o Rect para os pads left_pad = pygame.Rect(20, 210, 20, 60)...
null
test.py
test.py
py
965
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.Color", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "lin...
41020797
#!/usr/bin/env python3 from gpiozero.pins.pigpio import PiGPIOFactory from gpiozero import PhaseEnableMotor from time import sleep class GpiozeroDrive(): DIRECTION_FORWARD = 1 DIRECTION_BACKWARD = 0 DIRECTION_STRAFELEFT = 3 DIRECTION_STRAFERIGHT = 4 __pwmEnablePinWhiteLeftChannel = 12 __phase...
null
dev/gpiozero_drive.py
gpiozero_drive.py
py
2,189
python
en
code
null
code-starcoder2
76
[ { "api_name": "gpiozero.PhaseEnableMotor", "line_number": 18, "usage_type": "call" }, { "api_name": "gpiozero.PhaseEnableMotor", "line_number": 20, "usage_type": "call" } ]
161013368
import numpy import skfuzzy import matplotlib.pyplot as plt import seaborn as sns # Variável de tempo (s), intervalo de tempo (s) e constante de segundos t = 0 t_ = 0.001 seconds = int(1/t_) # Referência da posição (m) r = 5 # Posição (m), velocidade (m/s), aceleração (m/s²) e massa (kg) do sistema p = 0 v = 0 a = 0...
null
1. Sistemas Fuzzy/fuzzy_controller_1.py
fuzzy_controller_1.py
py
13,491
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.arange", "line_numbe...
27815138
#!/usr/bin/python3 # -*- coding: utf-8 -*- # 日志模块配置 import logging LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s" DATE_FORMAT = "%Y/%m/%d %H:%M:%S %p" logging.basicConfig(filename='donghuan.log', level=logging.WARNING, format=LOG_FORMAT, datefmt=DATE_FORMAT) # 日志装饰器 def logger(func): def inner(*args, *...
null
utils/log.py
log.py
py
523
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.warning", "line_number": 17, "usage_type": "call" } ]
196472431
# Copyright (C) 2017 DataArt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
null
web/controllers.py
controllers.py
py
2,734
python
en
code
null
code-starcoder2
76
[ { "api_name": "web.base.Controller", "line_number": 22, "usage_type": "name" }, { "api_name": "http.HTTPStatus.OK", "line_number": 28, "usage_type": "attribute" }, { "api_name": "http.HTTPStatus", "line_number": 28, "usage_type": "name" }, { "api_name": "http.HTTP...
630690672
import re from django.contrib.staticfiles.storage import staticfiles_storage from django.core.urlresolvers import reverse, NoReverseMatch from jinja2 import Environment, contextfunction, evalcontextfilter, Markup, \ escape from crispy_forms.utils import render_crispy_form def navbar_active(request, pattern_or_url...
null
ivy/jinja2.py
jinja2.py
py
1,336
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.urlresolvers.reverse", "line_number": 14, "usage_type": "call" }, { "api_name": "django.core.urlresolvers.NoReverseMatch", "line_number": 15, "usage_type": "name" }, { "api_name": "re.search", "line_number": 18, "usage_type": "call" }, { ...
555931650
from recorder import SimpleRecorder from recorder import AudioAnalyzer import logging import numpy as np import threading import time import bisect class RecorderWatcher(threading.Thread): def __init__(self, defaut_bpm = 120, master = None ): threading.Thread.__init__(se...
null
recorder/recorder_watcher.py
recorder_watcher.py
py
3,327
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 9, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 14, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 14, "usage_type": "attribute" }, { "api_name": "...
20789080
# coding: utf-8 import sys import os import shutil import re import json import time import subprocess import datetime import hashlib import urllib import logging from random import randint # for generating seed text import random import string import warnings import os from flask import Flask, request import reques...
null
facebook-chatbot/server.py
server.py
py
9,956
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 51, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 68, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 69, "usage_type": "call" }, { "api_name": "logging.INFO", ...
546075758
import numpy as np import xarray as xr import datetime as dt import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.feature as cfeature def snow_depth(lon, lat, month): """ Calculates Warren snow depth climatology for an array of latitude and and longitude points for a given month. Par...
null
source/warren_climatology/warren_climatology.py
warren_climatology.py
py
7,202
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
316434986
#!/usr/bin/env python """ Create mutation summary excel from given tsvs """ import argparse import pandas as pd import os def create_absolute_df(absolute_somatic_txts, absolute_segments): absdf = pd.concat([pd.read_csv(asegs, sep="\t", dtype={"Chromosome":str}) for asegs in absolute_somatic_txts], ...
null
scripts/mutation_summary_excel.py
mutation_summary_excel.py
py
7,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.concat", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "li...
368887052
from django.core.paginator import EmptyPage, Paginator import json from django.core.paginator import PageNotAnInteger from django.http import HttpResponse from rest_framework.permissions import AllowAny from rest_framework.views import APIView from fuel.api import serializers from fuel.models import Fuel ...
null
fuel/api/views.py
views.py
py
4,681
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.views.APIView", "line_number": 12, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_number": 13, "usage_type": "name" }, { "api_name": "fuel.api.serializers.FuelReadSerializer", "line_number": 18, "usage_type...
390827652
# -*- coding: utf-8 -*- """ Copyright 2019 eBay Inc. Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
null
ebayoauthclient/eBayOAuthClient.py
eBayOAuthClient.py
py
4,447
python
en
code
null
code-starcoder2
76
[ { "api_name": "model.model.environment", "line_number": 34, "usage_type": "argument" }, { "api_name": "base64.b64encode", "line_number": 39, "usage_type": "call" }, { "api_name": "urllib.urlencode", "line_number": 62, "usage_type": "call" }, { "api_name": "urllib....
522418635
import typing from abc import ABC, abstractmethod from ..http import HTTPClient from ..state import ConnectionState if typing.TYPE_CHECKING: from ..clash_of_code import ClashOfCode from ..codingamer import CodinGamer from ..leaderboard import ( ChallengeLeaderboard, GlobalLeaderboard, ...
null
codingame/client/base.py
base.py
py
10,392
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 7, "usage_type": "attribute" }, { "api_name": "abc.ABC", "line_number": 20, "usage_type": "name" }, { "api_name": "http.HTTPClient", "line_number": 44, "usage_type": "call" }, { "api_name": "state.ConnectionStat...
586463494
import attr from django.db.transaction import atomic from .models import Currency @attr.s(frozen=True) class CurrencyBuilder(): """ Builds a Currency """ _name = attr.ib() _base_price = attr.ib() @atomic() def build(self): return Currency.objects.create( name=self._name, ...
null
currencies/builders.py
builders.py
py
368
python
en
code
null
code-starcoder2
76
[ { "api_name": "attr.ib", "line_number": 12, "usage_type": "call" }, { "api_name": "attr.ib", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Currency.objects.create", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Currency.object...
612631209
import pygame from pygame.locals import * import sqlite3 from Const import * from Paddle import * from Brick import * from random import randint class BoardFactory: def get_board(self, nb, type_game): if type_game == GameType.LEVEL: return BoardLevel(nb) elif type_game == GameType.ENDLE...
null
Breakout/Board.py
Board.py
py
3,763
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.draw.rect", "line_number": 35, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 57, "usage_type": "call" }, { "api_name": "random.randint", ...
517016915
# -*- coding=utf-8 -*- ''' Faça um programa que leia o ano de nascimento de um jovem e informe, de acordo com sua idade, se ele ainda vai se alistar ao serviço militar, se é a hora de se alistar ou se já passou do tempo de alistamento seu programa também deverá mostrar o tempo que falta ou que passou do prazo. ''' fro...
null
ex039.py
ex039.py
py
790
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" } ]
573321917
# noinspection PyPackageRequirements from sqlalchemy.engine.url import URL # noinspection PyPackageRequirements from starlette import status # noinspection PyPackageRequirements from starlette.exceptions import HTTPException # noinspection PyPackageRequirements from starlette.types import Message, Receive, Scope, Send ...
null
gino/ext/starlette.py
starlette.py
py
6,863
python
en
code
null
code-starcoder2
76
[ { "api_name": "starlette.exceptions.HTTPException", "line_number": 21, "usage_type": "call" }, { "api_name": "starlette.status.HTTP_404_NOT_FOUND", "line_number": 21, "usage_type": "attribute" }, { "api_name": "starlette.status", "line_number": 21, "usage_type": "name" ...
616960495
import base64 import json import pickle from io import BytesIO import cv2 import numpy import requests import werkzeug.exceptions from PIL import Image from flask import Flask, abort, jsonify, request from flask.json import JSONEncoder url = "https://fashion.recoqnitics.com/analyze" accessKey = "9ff85e93750d9449738a"...
null
Tacocat/REST Server/src/main.py
main.py
py
16,979
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.json.JSONEncoder", "line_number": 20, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 81, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 89, "usage_type": "call" }, { "api_name": "pickle.HIGHEST_PROTOCO...
616264405
# uncompyle6 version 3.7.4 # Python bytecode 2.5 (62131) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-i686/egg/epscApp/optNotebook.py # Compiled at: 2009-05-29 13:49:10 import wx from SCMPanel import SCMPanel from optAlgorithmPanel import OptAlg...
null
pycfiles/SCM-1.0alpha-py2.5/optNotebook.py
optNotebook.py
py
4,906
python
en
code
null
code-starcoder2
76
[ { "api_name": "wx.Panel", "line_number": 14, "usage_type": "attribute" }, { "api_name": "SCMPanel.SCMPanel", "line_number": 14, "usage_type": "name" }, { "api_name": "SCMPanel.SCMPanel.__init__", "line_number": 19, "usage_type": "call" }, { "api_name": "SCMPanel.S...
545644854
import numpy as np import glob from os import path from collections import deque import random import pickle import heapq import re import settings class DataLoader: def __init__(self, mode, label_mode, fold_nbs, scene_nbs, batchsize=50, timesteps=4000, epochs=10, buffer=10, features=160, class...
null
feedforward/modelsv2/dataloader.py
dataloader.py
py
20,262
python
en
code
null
code-starcoder2
76
[ { "api_name": "settings.dir", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "name" }, { "api_name": "os.path.join", "line_numbe...
146753218
from owners.tests.helpers import logUserIn, logUserOut, putUserInDb from accounts.models import AddressBase from renters.models import RenterAddress, Renter, Vehicle, Booking from django.utils import timezone import datetime existing_user = { 'email':'zammitriley@gmail.com', 'password':'rileyzammit123', } mali...
null
renters/tests/helpers.py
helpers.py
py
2,717
python
en
code
null
code-starcoder2
76
[ { "api_name": "accounts.models.AddressBase.CANADA", "line_number": 22, "usage_type": "attribute" }, { "api_name": "accounts.models.AddressBase", "line_number": 22, "usage_type": "name" }, { "api_name": "accounts.models.AddressBase.CANADA", "line_number": 29, "usage_type":...
397608580
""" 1. concurrent.futures对threading和multiprocessing的进行了高级别的抽象,暴露出统一的接口。 2. 常用方法submit和map。如果任务是一样的,用map。 3. 如果任务不一样,且任务可能会出现异常,则需要用submit。 4. 本程序展示map。 """ import time from concurrent.futures import ProcessPoolExecutor from functools import wraps from os import getpid NUMBERS = range(20, 40) def tim...
null
00017._concurrent_programming/multiprocessing/process_pool/v2.py
v2.py
py
1,140
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "time.time", "line_number": 21, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 36...
627948658
import cv2 import numpy as np import face_recognition import os from datetime import datetime # initialization part path = "img" images = [] className = [] myList = os.listdir(path) print(myList) # this part fetch name from images for cl in myList: curImg = cv2.imread(f'{path}/{cl}') images.append(curImg) ...
null
main.py
main.py
py
2,351
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
448027411
import akshare as ak import time, datetime import numpy as np from com.swordfall.service.hk.HKStockService import HKStockService from com.swordfall.utils.CommonUtils import CommonUtils from com.swordfall.trade.hk.HkStockSpot import get_hk_stock_exist common_utils = CommonUtils() hk_stock_service = HKStockService() de...
null
com/swordfall/trade/hk/HkStockDaily.py
HkStockDaily.py
py
4,707
python
en
code
null
code-starcoder2
76
[ { "api_name": "com.swordfall.utils.CommonUtils.CommonUtils", "line_number": 8, "usage_type": "call" }, { "api_name": "com.swordfall.service.hk.HKStockService.HKStockService", "line_number": 9, "usage_type": "call" }, { "api_name": "com.swordfall.trade.hk.HkStockSpot.get_hk_stock_...
20171787
from zeit.cms.checkout.helper import checked_out from zeit.cms.testcontenttype.testcontenttype import ExampleContentType from zeit.newsletter.category import NewsletterCategory from zeit.newsletter.interfaces import INewsletterCategory from zeit.newsletter.newsletter import Newsletter import datetime import mock import...
null
core/src/zeit/newsletter/tests/test_category.py
test_category.py
py
14,998
python
en
code
null
code-starcoder2
76
[ { "api_name": "zeit.cms.checkout.helper.newsletter", "line_number": 15, "usage_type": "attribute" }, { "api_name": "zeit.cms.checkout.helper", "line_number": 15, "usage_type": "name" }, { "api_name": "zeit.newsletter.category.NewsletterCategory", "line_number": 18, "usage...
174755186
import socket import json import datetime import os print("starting ServiceListener") class ServiceListener(): #checking local text file if os.path.exists("onlineusers.txt"): os.remove("onlineusers.txt") global f,flag flag=0 port = 5000 f=open("onlineusers.txt","a+"...
null
ServiceListener.py
ServiceListener.py
py
1,357
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number": 11, "usage_type": "call" }, { "api_name": "socket.socket", "line_numbe...
150948087
from django.urls import path,include from . import views app_name = 'base' urlpatterns = [ path('login', views.loginpage, name='login'), path('logout', views.logoutUser, name='logout'), path('register', views.registerUser, name='register'), path('index/', views.home, name='home'), path('index/room...
null
base/urls.py
urls.py
py
570
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
254805970
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jul 6 11:30:24 2019 @author: macbook """ import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import StandardScaler from sklearn.naive_bayes import GaussianNB from sklearn.metrics import confusion_matrix import ...
null
gender_pre.py
gender_pre.py
py
1,466
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 22, "usage_type": "call" }, ...
451912295
from sklearn.linear_model import LinearRegression import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv('ml\\data\\tem10y.csv', sep=',', encoding = 'utf-8') train_year = (df['연'] <= 2015) test_year = (df['연'] >= 2016) interval = 6 # 과거 6일의 데이터를 기반으로 학습할 데이터 만들기 def make_data(data): ...
null
mlearn/m08_weather1.py
m08_weather1.py
py
3,617
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 38, "usage_type": "call" }, { "api_name": "nump...
446392325
""" # MAML python3 main.py --datasource=omniglot-py --suffix=png --load-images --ml-algorithm=MAML --first-order --network-architecture=CNN --no-batchnorm --min-way=5 --max-way=5 --num-epochs=100 --resume-epoch=0 --train python3 main.py --datasource=miniImageNet --suffix=jpg --load-images --ml-algorithm=MAML --first-o...
null
main.py
main.py
py
9,025
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 110, "usage_type": "call" }, { "api_name": "os.path", "line_number": 110, "usage_type": "attribute" }, { "api_name": "os.path.exists", ...
55230417
from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager #from phone_field import PhoneField from django.core.validators import MinLengthValidator # Create your models here. class MyAccountManager(BaseUserManager): def create_user(self,email,username,firstname,lastname,a...
null
account/models.py
models.py
py
3,849
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.models.BaseUserManager", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.AbstractBaseUser", "line_number": 68, "usage_type": "name" }, { "api_name": "django.db.models.EmailField", "line_number": 69, "u...
493206880
import os import argparse import time from pathlib import Path import torch import torch.nn as nn import torch.optim as optim from tensorboardX import SummaryWriter from tqdm import tqdm from checkpointer import Checkpointer, BestCheckpointer from helper import get_model, create_dataloader classes = ('plane', 'car',...
null
main.py
main.py
py
7,454
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 21, "usage_type": "name" }, { "api_name": "tensorboardX.SummaryWriter", "line_number": 22, "usage_type": "call" }, { "api_name": "tensorboardX.SummaryWriter", "line_number": 23, "usage_type": "call" }, { "api_name": "to...
368940658
import requests from flask import request, jsonify import json from werkzeug.wrappers import Request, Response usr = 'sapwarrantyrecall' pwd = 'sapwarrantyrecall' print('\nstarting sapwarrantyrecall request\n') def response(): print('in the response function \n') resp = requests.get('http://localhost:5000/s...
null
__offline/__Digital_Twin/__release2/__release2_sprint3/flask_project/__sapwarrantyrecall/__Request.py
__Request.py
py
617
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" } ]
445357591
""" This sample is extensions of "write_schema_and_cred_def.py" Shows how to issue a credential as a Trust Anchor which has created a Cred Definition for an existing Schema. After Trust Anchor has successfully created and stored a Cred Definition using Anonymous Credentials, Prover's wallet is created and opened, and...
null
doc/how-tos/issue-credential/python/issue_credential.py
issue_credential.py
py
8,082
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 44, "usage_type": "call" }, { "api_name": "indy.pool.create_pool_ledger...
630504071
from django.urls import path from . import views app_name = 'leads' urlpatterns = [ path('' , views.LeadListView.as_view() , name = 'home_page'), path('<int:pk>/' , views.LeadDetailView.as_view() , name = 'lead_detail'), path('<int:pk>/update/' , views.LeadUpdateView.as_view() , name = 'lead_update'), ...
null
leads/urls.py
urls.py
py
946
python
en
code
null
code-starcoder2
76
[ { "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", ...
44152998
# -*- coding: utf-8 -*- from django.db import connection # retrieve universe universe = "ng03" ''' function openDB(connStr) set openDB = Server.CreateObject("ADODB.Connection") openDB.Open connStr end function ''' def dict_fetchall(cursor): columns = [col[0] for col in cursor.description] return [ ...
null
web_game/lib/sql.py
sql.py
py
1,936
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.connection.cursor", "line_number": 31, "usage_type": "call" }, { "api_name": "django.db.connection", "line_number": 31, "usage_type": "name" } ]
484755508
import os, datetime, logging import apache_beam as beam from apache_beam.io import ReadFromText from apache_beam.io import WriteToText ### The purpose of this beam pipeline is to cleanse our data. ### Some of the values in our data are Null ### We would like to assign the Nulls to a value of 0. ### This pipeline clean...
null
MASSACHUSETTS/MASSACHUSETTS_TOBACCO_USE_beam_dataflow.py
MASSACHUSETTS_TOBACCO_USE_beam_dataflow.py
py
3,944
python
en
code
null
code-starcoder2
76
[ { "api_name": "apache_beam.DoFn", "line_number": 11, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 40, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 40, "usage_type": "attribute" }, { "api_name": "ap...
436012478
#!/usr/bin/python3 # coding: utf-8 # https://danijar.com/building-variational-auto-encoders-in-tensorflow/ import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data fig, ax = plt.subplots(nrows=20, ncols=11, figsize=(10, 20)) mnist = input_data...
null
bin/template/src/jpttensorflow/l86_Variational-Autoencoder.py
l86_Variational-Autoencoder.py
py
3,803
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "line_number": 9, "usage_type"...
359074826
#!/usr/bin/python # -*- coding: utf-8 *-* ##@package srd_light_tcs # Package with automated Search/Download tab tests using # Selenium Webdriver ##@file numfiles_minvalue_light_test.py # @brief Test Cases searching different values in the min and max number # of files fields of the Extended Search tab # @ingroup su...
null
SRDTestSuite/srd_crud_tcs/example_files/numfiles_minvalue_light_test.py
numfiles_minvalue_light_test.py
py
3,219
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 19, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 19, "usage_type": "name" }, { "api_name": "...
411665822
import logging import fire from .defaults import load_config, RequestError from .helpers import decorate_for_fire from zia import ZscalerInternetAccess def main(): load_config() LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) try: z = decorate_for_fire(ZscalerInternetAcce...
null
zia/__main__.py
__main__.py
py
458
python
en
code
null
code-starcoder2
76
[ { "api_name": "defaults.load_config", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "helpers.dec...
370557487
import tweepy import json import array import random import time import datetime from PIL import Image, ImageDraw, ImageFont LOWHOUR = 2 HIGHHOUR = 9 # Python program to illustrate the intersection # of two lists using set() method def intersection(lst1, lst2): return list(set(lst1) & set(lst2)) def createFo...
null
FollowerWarBotRecover.py
FollowerWarBotRecover.py
py
6,070
python
en
code
null
code-starcoder2
76
[ { "api_name": "tweepy.Cursor", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "tweepy.Cursor", "line_number": 26, "usage_type": "call" }, { "api_name": "time.sleep", "line_number"...
419024165
# Imports from pyimagesearch.tempimage import TempImage from picamera.array import PiRGBArray from picamera import PiCamera import argparse import warnings import datetime import imutils import dropbox import json import time import cv2 # arg parser ap = argparse.ArgumentParser() ap.add_argument("-c", "--conf", requir...
null
pi_surveillance.py
pi_surveillance.py
py
4,903
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 20, "usage_type": "call" }, { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "dropbox.Dro...
235371666
#!/usr/local/bin/python # -*- coding: utf-8 -*- import urllib2 import selenium import unittest from time import sleep import json,httplib class stb_rcu(object): STB_PORT = '8081' STB_IP = '192.168.1.57' def __init__(self): self.stb_connection = httplib.HTTPConnection(self.ST...
null
lib/remote_control.py
remote_control.py
py
1,688
python
en
code
null
code-starcoder2
76
[ { "api_name": "httplib.HTTPConnection", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 30, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 34, "usage_type": "call" }, { "api_name": "json.dumps", "line_n...
652676542
# -*- coding:utf-8 -*- # 爬虫组件类 import time import logging import re from urllib.parse import urlparse import time from datetime import datetime from datetime import timedelta import random import itertools import os import csv import hashlib import shelve import requests from requests.exceptions import RequestExceptio...
null
lagouSpider/spider.py
spider.py
py
11,740
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 51, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 54, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 64, "usage_type": "call" }, { "api_name": "logging.info", ...
462196275
from pyflink.common.time import Instant from pyflink.common import Types from pyflink.datastream import StreamExecutionEnvironment from pyflink.table import( DataTypes,TableDescriptor, Schema, StreamTableEnvironment ) from pyflink.table.expressions import lit, col from pyflink.table.window import Tumble env = Str...
null
data-engineering/04-flink/20_sliding_window_sql.py
20_sliding_window_sql.py
py
2,212
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyflink.datastream.StreamExecutionEnvironment.get_execution_environment", "line_number": 10, "usage_type": "call" }, { "api_name": "pyflink.datastream.StreamExecutionEnvironment", "line_number": 10, "usage_type": "name" }, { "api_name": "pyflink.table.StreamTableEn...
576332240
from pypylon import pylon import cv2 import sys import numpy as np from scipy.interpolate import interp2d from PyQt5.QtCore import pyqtSignal, Qt from PyQt5.QtGui import QImage, QPixmap from freespin import Ui_FreeSpin from PyQt5.QtWidgets import QApplication import asyncio import inspect from PyQt5.QtCore import QRec...
null
image_processing.py
image_processing.py
py
20,472
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.max", "line_number": 65, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 66, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 75, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 76...
295777502
from datetime import datetime import random import sqlite3 from collections import namedtuple from jinja2 import Template from quart import Quart, request MAX_BETA = 30 # Prevent recall rate from converging by setting a max number of obsevations. app = Quart(__name__) Word = namedtuple('Word', ['rank', 'type', 'w...
null
play.py
play.py
py
6,321
python
en
code
null
code-starcoder2
76
[ { "api_name": "quart.Quart", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 17, "usage_type": "call" }, { "api_name": "random.uniform", ...
62294861
import numpy as np import cv2 import matplotlib.pyplot as plt import glob import pickle from pathlib import Path ########## camera calibration ############### if Path('./calibration.p').exists(): with open('./calibration.p', 'rb') as handle: calibration = pickle.load(handle) ret = calibration['ret'...
null
1-Computer-Vision-and-Deep-Learning/CarND-P4-Advanced-Lane-Lines/finding_lane.py
finding_lane.py
py
2,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 23...
625451475
import sys sys.path.append('../..') import os import copy import logging import numpy as np from typing import List, Optional, Union, Any import torch from torch.utils.data import DataLoader from transformers import AutoTokenizer, AutoModel from nltk.tokenize import word_tokenize, sent_tokenize from tokenizations i...
null
LabelModel/CHMM/Data.py
Data.py
py
14,283
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.utils", "line...
636905129
import logging from threading import Lock, get_ident sql_thread_logger = logging.getLogger("sqlite_thread") class RWLock: """A class implementing a read/write lock with writer priority. """ _readtry: Lock _rlock: Lock _wlock: Lock _resource: Lock _readers: int _writers_waiting: int ...
null
package/common/rwlock.py
rwlock.py
py
3,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 11, "usage_type": "name" }, { "api_name": "threading.Lock", "line_number": 12, "usage_type": "name" }, { "api_name": "threading.Lock", "...
495929129
import pandas as pd ##https://plotly.com/python/line-charts/ import plotly.express as px data = pd.read_csv('videos_export.csv') data['uploaded_at'] = pd.to_datetime(data['uploaded_at']) #Calculate aggregation by codec plot_df = [] for codec in data['codec'].unique(): temp = data[data.cod...
null
plots.py
plots.py
py
1,216
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.concat", ...
163939647
import asyncio class Server: def __init__(self, host, port): self.storage = {} self.host = host self.port = port async def start(self): serv = await asyncio.start_server(self.server, self.host, self.port) await serv.serve_forever() async def server(self, reader, ...
null
final_project/server_coroutines.py
server_coroutines.py
py
2,638
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.start_server", "line_number": 12, "usage_type": "call" }, { "api_name": "asyncio.run", "line_number": 84, "usage_type": "call" } ]
450522283
import math import random import numpy as np import torch def shift(xy, center): # theta = random.random() * 2.0 * math.pi xy = xy - center[np.newaxis, np.newaxis, :] return xy def theta_rotation(xy, theta): # theta = random.random() * 2.0 * math.pi ct = np.cos(theta) st = np.sin(theta) ...
null
trajnetplusplusbaselines/trajnetbaselines/cfvae/utils.py
utils.py
py
2,454
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.newaxis", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
318023350
#!/usr/bin/env python3 import unittest from pathlib import Path from src.anonfile import AnonFile TOKEN = None def test_option(token): TOKEN = token class TestAnonFile(unittest.TestCase): def setUp(self): self.anon = AnonFile(TOKEN) if TOKEN else AnonFile() self.test_file = Path("tests/tes...
null
tests/test_anonfile.py
test_anonfile.py
py
1,009
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "src.anonfile.AnonFile", "line_number": 16, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" } ]
201230292
from sqlalchemy import create_engine,MetaData, select,update from sqlalchemy.orm import Session # import pandas as pd # import numpy import csv import math from scipy.stats import sem # import pdb; pdb.set_trace() from sqlalchemy.sql import func from datetime import datetime,date, timedelta #from datetime import datet...
null
ISO/validation_chk_now.py
validation_chk_now.py
py
14,674
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 31, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 31, "usage_type": "call" }, { "api_name": "sqlalchemy.MetaData", "line_number": 33, "usage_type": "call" }, { "api_name": "sys.exit...
19577851
from django.urls import path from . import views urlpatterns = [ path('internships/', views.Internships, name='internships'), path('my-internships/', views.MyInternships, name='my-internships'), path('internships/create/', views.Intern...
null
internshipPortal/urls.py
urls.py
py
1,365
python
en
code
null
code-starcoder2
76
[ { "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", ...
645172816
from django.core.management import BaseCommand from plans import tasks class Command(BaseCommand): help = 'Autorenew accounts and with recurring payments' def handle(self, *args, **options): # pragma: no cover self.stdout.write("Starting renewal") renewed_accounts = tasks.autorenew_account()...
null
plans/management/commands/autorenew_accounts.py
autorenew_accounts.py
py
523
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.BaseCommand", "line_number": 5, "usage_type": "name" }, { "api_name": "plans.tasks.autorenew_account", "line_number": 10, "usage_type": "call" }, { "api_name": "plans.tasks", "line_number": 10, "usage_type": "name" } ]
295217286
# Copyright (c) 2021 OpenKS Authors, DCD Research Lab, Zhejiang University. # All Rights Reserved. """ Basic class for loading data from file or database systems """ from typing import List from enum import Enum, unique import csv from zipfile import ZipFile from io import TextIOWrapper import json import logging imp...
null
openks/loaders/loader.py
loader.py
py
7,983
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 20, "usage_type": "name" }, { "api_name": "enum.unique", "line_number": 19, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number"...
553298015
# Copyright 2018 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
null
tensorflow_transform/nodes_test.py
nodes_test.py
py
7,699
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.test", "line_number": 27, "usage_type": "attribute" }, { "api_name": "collections.namedtuple", "line_number": 30, "usage_type": "call" }, { "api_name": "tensorflow_transform.nodes.OperationDef", "line_number": 30, "usage_type": "attribute" }, ...
18957056
import pickle as pk import tensorflow as tf from tqdm import tqdm from tqdm import trange from .hamming import hamming_score from sklearn.metrics import f1_score from .elmo_bilstm import BiElmo_model import numpy as np import pickle as pk class BiLstm_Elmo(object): def __init__(self, X_train, y_train, X...
null
multilab/Models/Bilstm_elmo/elmo_bilstm_train.py
elmo_bilstm_train.py
py
6,884
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 70, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
476140315
from collections.abc import Iterable from pathlib import Path import time import h5py import openmc from openmc.checkvalue import check_type, check_value class Model: """Model container. This class can be used to store instances of :class:`openmc.Geometry`, :class:`openmc.Materials`, :class:`openmc.Set...
null
openmc/model/model.py
model.py
py
10,145
python
en
code
null
code-starcoder2
76
[ { "api_name": "openmc.Geometry", "line_number": 52, "usage_type": "call" }, { "api_name": "openmc.Materials", "line_number": 53, "usage_type": "call" }, { "api_name": "openmc.Settings", "line_number": 54, "usage_type": "call" }, { "api_name": "openmc.Tallies", ...
528204886
import logging log_file = logging.FileHandler('myserver.log') console_out = logging.StreamHandler() logging.basicConfig(handlers=(log_file, console_out), format = '[%(asctime)]: %(message)s', datefmt='%m.%d.%Y %H:%M:%S' , level = logging.ERROR) import socket import os with open('settings.txt', 'r+') as f: ...
null
web-server.py
web-server.py
py
2,974
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.FileHandler", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.ER...
451264403
from collections import Counter from collections import defaultdict from collections import namedtuple # Example of Counter Class letters = 'aaaaaaaabbbbbbacccccccddddddddddddddddddddddddd' c = Counter(letters) print(c) print(c.most_common()) print(list(c)) # Example of defaultdict to not get error while indexing ...
null
CollectionsModule.py
CollectionsModule.py
py
561
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 24, "usage_type": "call" } ]
418645356
from numba import cuda, guvectorize, void, float64 import numpy as np @guvectorize([void(float64[:,:], float64[:,:], float64[:,:])], '(m,l),(l,n)->(m,n)', target='cuda') def matmul_gu3(A, B, out): """Perform square matrix multiplication of out = A * B """ # out = np.empty((A.shape[0], B.shape[1]), A.dtyp...
null
GCI-cuda/MatrixOperation.py
MatrixOperation.py
py
2,087
python
en
code
null
code-starcoder2
76
[ { "api_name": "numba.cuda.grid", "line_number": 11, "usage_type": "call" }, { "api_name": "numba.cuda", "line_number": 11, "usage_type": "name" }, { "api_name": "numba.guvectorize", "line_number": 6, "usage_type": "call" }, { "api_name": "numba.void", "line_nu...
127176099
#-*- coding: utf-8 -*- import requests from bs4 import BeautifulSoup import mysql.connector mydb = mysql.connector.connect( host="localhost", user="root", passwd="adminek107", database="wynajem_warszawa" ) mycursor = mydb.cursor() def cena(soup): cena = str(soup.find_all(attrs="amount")[0]) cena =...
null
src/test.py
test.py
py
1,307
python
en
code
null
code-starcoder2
76
[ { "api_name": "mysql.connector.connector.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 7, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 7, "usage_type": "name" }, { "api...
541700943
""" Update OSPR with link to survey. """ import arrow from ....lib.github.client import get_authenticated_gh_client from ....lib.jira.client import get_authenticated_jira_client from ...models import GithubEvent from .utils import find_issues_for_pull_request EVENT_TYPES = ( 'pull_request', ) SURVEY_URL = ( ...
null
openedx_webhooks/github/dispatcher/actions/closed_ospr_survey.py
closed_ospr_survey.py
py
2,554
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.github.client.get_authenticated_gh_client", "line_number": 47, "usage_type": "call" }, { "api_name": "models.GithubEvent", "line_number": 48, "usage_type": "call" }, { "api_name": "lib.jira.client.get_authenticated_jira_client", "line_number": 49, "usag...
534961078
import os import numpy as np import tensorflow as tf from tensorflow.contrib.layers import batch_norm, flatten from tensorflow.contrib.layers import xavier_initializer from tensorflow.contrib.framework import arg_scope from tflearn.layers.conv import global_avg_pool from PIL import Image import matplotlib.image as mpim...
null
DenseVnet.py
DenseVnet.py
py
12,921
python
en
code
null
code-starcoder2
76
[ { "api_name": "data_aug.scale", "line_number": 33, "usage_type": "call" }, { "api_name": "data_aug.rotate", "line_number": 34, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 43, "usage_type": "call" }, { "api_name": "tensorflow.name_scope", ...
140113191
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Crawls a website, sticking to just the given domain and not following external links. Reports non-200 response codes to the emails provided if any. Emails can be omitted if you're just interested in warming the cache. by Phillip Stromberg on 2015-01-27 """ from boto i...
null
site_scan.py
site_scan.py
py
6,889
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.RawConfigParser", "line_number": 37, "usage_type": "call" }, { "api_name": "logging.warning", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 48, "usage_type": "call" }, { "api_name": "request...
483392824
import helpers import cv2 import random import numpy as np import tensorflow as tf model = tf.keras.models.load_model('model.h5') def get_standatr_signs(): """Функция, позволяющая получить стандартные изображения знаков для сравнения с оригинальными изображениями. Стандартные изображения знаков хран...
null
eval.py
eval.py
py
3,453
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2...
284402848
from tkinter import * import numpy as np import random from PIL import Image, ImageTk, ImageDraw #Подключим необходимые библиотеки. from tkinter import filedialog import os import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.dates as mdates import datetime as dt import csv def open_img(): ...
null
7-AnalizImage_graf.py
7-AnalizImage_graf.py
py
5,931
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line_number": 18, "usage_type": "attribute" }, { "api_name": "PIL.Image", "li...
578345061
# CivicTechHub AIRTABLE TO SQL # by Franco Morero (https://github.com/francomor) # This auto populate the tables topic, group, group_topic and service_link # in Mysql database taking the data from Airtable import enum from airtable import Airtable from sqlalchemy import create_engine, text, Table, Column, Integer, St...
null
app/py_scripts/airtable2sql/airtable_to_sql.py
airtable_to_sql.py
py
11,842
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 14, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 17, ...
264439317
import sys import cv2 import pyflycap2.interface as flycap if __name__ == '__main__': fname1 = "Capture.png" fname2 = "Capture2.png" flycap.init_conf('.//interface.conf') cam = flycap.Camera(serial=[15631910]) # other = GigE # print cam.get_num_cameras() cam.connect() cam.start_capture() ...
null
t.py
t.py
py
719
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyflycap2.interface.init_conf", "line_number": 8, "usage_type": "call" }, { "api_name": "pyflycap2.interface", "line_number": 8, "usage_type": "name" }, { "api_name": "pyflycap2.interface.Camera", "line_number": 9, "usage_type": "call" }, { "api_nam...
472290890
import mock from tempfile import NamedTemporaryFile import unittest from auslib.AUS import AUS3 def RandomAUSTest(AUS, throttle, force): with mock.patch('auslib.db.Rules.getRulesMatchingQuery') as m: m.return_value=[dict(throttle=throttle, priority=1)] results = AUS.rand.getRange() result...
null
auslib/test/test_AUS.py
test_AUS.py
py
5,652
python
en
code
null
code-starcoder2
76
[ { "api_name": "mock.patch", "line_number": 8, "usage_type": "call" }, { "api_name": "mock.patch", "line_number": 15, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 29, "usage_type": "attribute" }, { "api_name": "auslib.AUS.AUS3", "li...
531918641
from itertools import permutations def solution(k, dungeons): L = len(dungeons) answer = 0 for perms in permutations(dungeons, L): tmp_k, cnt = k, 0 for req, cost in perms: if tmp_k >= req and tmp_k >= cost: cnt += 1 tmp_k -= cost els...
null
Programmers/위클리 챌린지/12주차/피로도.py
피로도.py
py
539
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.permutations", "line_number": 7, "usage_type": "call" } ]
433007687
from django.conf.urls import url from django.contrib import admin from .views import ( categories_list, categories_create, categories_detail, categories_update, categories_delete ) urlpatterns = [ url(r'^$', categories_list, name='list'), url(r'^create/$', categories_create), url(r'^(?P<pk>[\w-]+)/$'...
null
Categories/urls.py
urls.py
py
486
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "api_name": "views.categories_list", "line_number": 13, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 14, "usage_type": "call" }, { "api_name": "v...