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
6564816
# -*- coding: utf-8 -*- """ Created on Tue Oct 30 10:52:46 2018 @author: sgb35 """ from io import BytesIO from picamera.array import PiRGBArray from picamera import PiCamera import picamera from time import sleep import numpy as np ##from skimage import data from skimage.feature import blob_dog, blob_log, b...
null
Project_Code/camera_routines_2.py
camera_routines_2.py
py
4,890
python
en
code
null
code-starcoder2
76
[ { "api_name": "picamera.PiCamera", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 22, "usage_type": "call" }, { "api_name": "picamera.PiCamera", "line_number": 37, "usage_type": "call" }, { "api_name": "picamera.exc", "li...
219333778
import time from playsound import playsound websites = [] #websites to be blocked# ip = '127.0.0.1' while True: web = input('Enter a website you want to block. Type done to exit. ') if web == 'done': break websites.append(web) t = int(input('How long would you want to block these websites? (in s...
null
website_blocker.py
website_blocker.py
py
684
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "playsound.playsound", "line_number": 30, "usage_type": "call" } ]
46872610
#Author #Felice De Luca #https://github.com/felicedeluca import sys import os import pygraphviz as pgv import networkx as nx from networkx.drawing.nx_agraph import write_dot from networkx.drawing.nx_agraph import read_dot as nx_read_dot import math import random import vertexmanager def get_bounding_box(G): xm...
null
impred_layout_generator/modules/drawing_improvement/impred.py
impred.py
py
2,408
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.nodes", "line_number": 35, "usage_type": "call" }, { "api_name": "vertexmanager.shiftVertex", "line_number": 36, "usage_type": "call" }, { "api_name": "networkx.get_node_attributes", "line_number": 42, "usage_type": "call" }, { "api_name": ...
233804653
# 导入requests库 import requests """ ConnectionError异常,原因为网络问题(如DNS查询失败、拒绝连接等等...) Requests.raise_for_status()抛出一个HTTPError异常,原因为HTTP请求返回了不成功的状态(如网页不存在,返回404) Requests抛出一个Timeout异常,原因为请求超时 Requests抛出一个TooManyRedirects异常,原因为请求超过了设定的最大重定向次数 """ """ # requests方法。网络请求,如果返回结果是<200>,说明请求网址成功 # "http://bj.xiaozhu.com/" 北京小住...
null
zz_01.py
zz_01.py
py
1,163
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 34, "usage_type": "call" } ]
151109156
import pytest import torch.nn import librl.nn.core, librl.nn.classifier import librl.task import librl.train.train_loop, librl.train.classification from . import * ################### # GPU Based Tests # ################### @pytest.mark.skipif(not torch.cuda.is_available(), reason="GPU tests require CUDA.") def test...
null
tests/test_gpu.py
test_gpu.py
py
1,113
python
en
code
null
code-starcoder2
76
[ { "api_name": "librl.nn.core.nn.core.MLPKernel", "line_number": 17, "usage_type": "call" }, { "api_name": "librl.nn.core.nn", "line_number": 17, "usage_type": "attribute" }, { "api_name": "librl.nn.core", "line_number": 17, "usage_type": "name" }, { "api_name": "l...
154089323
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$',views.load ), url(r'^(?P<ware>[a-zA-Z]+)/$',views.tab, name = "tab"), url(r'^(?P<ware>[a-zA-Z]+)/add/$',views.part_new, name = "part_new"), url(r'^(?P<ware>[a-zA-Z]+)/info/(?P<elemID>[0-9]+)/$',views.inform, name = "inform"...
null
wareapp/urls.py
urls.py
py
325
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.co...
409411440
from .common import ln, BaseClient from .errors import handle_rpc_errors from datetime import datetime import binascii class LightningRPC(BaseClient): # LIGHTNINGRPC @handle_rpc_errors def get_info(self): response = self._ln_stub.GetInfo(ln.GetInfoRequest()) return response @handle_rpc...
null
lndgrpc/lightning.py
lightning.py
py
15,381
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.BaseClient", "line_number": 6, "usage_type": "name" }, { "api_name": "common.ln.GetInfoRequest", "line_number": 10, "usage_type": "call" }, { "api_name": "common.ln", "line_number": 10, "usage_type": "name" }, { "api_name": "errors.handle_rpc...
413139450
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Sequence, Column, Integer, String, DateTime GuestBase = declarative_base() class Guest(GuestBase): __tablename__ = 'guests' id = Column(Integer, Sequence('guest_id_seq'), primary_key=True) project = Column(String(100)) en...
null
guest.py
guest.py
py
1,626
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 10, "usage_type": "argument" }, { ...
218992936
#!/local/cluster/bin/python from Bio import SeqIO from Bio.Seq import Seq from Bio import motifs import sys import warnings from Bio import BiopythonWarning warnings.simplefilter('ignore', BiopythonWarning) if len(sys.argv) < 2: print("too few arguments") exit() motifLen=6 delimeter="\t" motifDict = {"AAT...
null
bioPyTest.py
bioPyTest.py
py
2,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.simplefilter", "line_number": 9, "usage_type": "call" }, { "api_name": "Bio.BiopythonWarning", "line_number": 9, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "Bio.motifs...
475459711
import numpy as np import matplotlib.pyplot as plt # vitesse # Arg : float v0, int k, def vitesse(v0,k,m,n,h): t = np.zeros(n+1) v = np.zeros(n+1) v[0] = v0 for i in range(1,n+1): t[i] = t[i-1]+h v[i] = v[i-1] + h*(9.81-(k/m)*(v[i-1]**2)) return (t,v) ## Avec p...
null
TP 8 - Schéma d'Euler/ex 1.py
ex 1.py
py
1,170
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
271077112
from django.conf.urls import url from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required from contabilidad.views import * from contabilidad.ajax import * from taller.ajax import EliminarNotacredito urlpatterns = [ url(r'^cambiar/tarjeta/$',...
null
web/contabilidad/urls.py
urls.py
py
4,836
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.admin.views.decorators.staff_member_required", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": ...
371031223
import soundfile as sf import io from google.cloud import speech client = speech.SpeechClient() import base64 import os import datetime import matplotlib.pyplot as plt from scipy.io import wavfile import numpy as np from pydub import AudioSegment from pydub.silence import split_on_silence def get_overall_score(pace, ...
null
backend/audio.py
audio.py
py
3,943
python
en
code
null
code-starcoder2
76
[ { "api_name": "google.cloud.speech.SpeechClient", "line_number": 4, "usage_type": "call" }, { "api_name": "google.cloud.speech", "line_number": 4, "usage_type": "name" }, { "api_name": "io.open", "line_number": 60, "usage_type": "call" }, { "api_name": "google.clo...
123308315
import pygame as pg from . import FPS, ANCHO, ALTO from .entidades import Raqueta, Bola, Ladrillo, Marcador class Escena(): def __init__(self, pantalla): self.pantalla = pantalla self.reloj = pg.time.Clock() def bucle_principal(self): pass class Portada(Escena): def __init...
null
arkanoid/escenas.py
escenas.py
py
3,051
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.time.Clock", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.image", ...
310816867
# pip install sqlalchemy # pip install sqlalchemy-utils from sqlalchemy import ( create_engine, Table, Column, Integer, String, MetaData, ForeignKey, ) from sqlalchemy_utils import create_database, drop_database, database_exists user = "postgres" password = "postgres" host = "localhost" por...
null
Yurii_Khomych/l_11_sqlalchemy/slqalchemy_core_examples/ex_1_define_and_create_tables_core.py
ex_1_define_and_create_tables_core.py
py
1,185
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.MetaData", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.Table", "line_number": 24, "usage_type": "call" }, { "api_name": "sqlalch...
437032650
import subprocess import pexpect import os import sys import pwd from charms.reactive import when, when_not, set_state from charmhelpers.core import hookenv, host, templating from charmhelpers.core.hookenv import status_set from jujubigdata import utils import charms.apt @when_not('superset.installed') @when('apt.inst...
null
reactive/superset.py
superset.py
py
3,860
python
en
code
null
code-starcoder2
76
[ { "api_name": "charmhelpers.core.hookenv.status_set", "line_number": 21, "usage_type": "call" }, { "api_name": "charmhelpers.core.hookenv.log", "line_number": 23, "usage_type": "call" }, { "api_name": "charmhelpers.core.hookenv", "line_number": 23, "usage_type": "name" ...
555872171
__author__ = 'Kirill Korovin' import pygame import kezmenu import pygame.font from player import Player from game import Game class Menu(object): running = True def main(self, screen): clock = pygame.time.Clock() sprites = pygame.sprite.Group() self.player = Player(sprites) ...
null
menu.py
menu.py
py
1,801
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.time.Clock", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Group", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.sprite"...
375608843
from lxml import etree import requests headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36' } r = requests.get('https://www.xicidaili.com/nn/1', headers=headers).content.decode() html = etree.HTML(r) trs = html.x...
null
day16/use_etree_xpath.py
use_etree_xpath.py
py
544
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 10, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 10, "usage_type": "name" } ]
137213220
#!/usr/bin/python # -*- coding:utf-8 -*- import numpy as np import matplotlib.pyplot as plt x=np.linspace(-3,3,50) y1=10*x**2+x*3+2 y2=3*x**3-x**2+6*x-8 plt.figure(num=0 ,figsize=(8 ,6)) plt.plot(x,y1,color='green',linewidth=3.0,label='y1') plt.plot(x,y2,color='yellow',linewidth=2.0,label='y2') plt.legend(loc='lower r...
null
tick能见度.py
tick能见度.py
py
959
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
419474333
#!/usr/bin/env python3 import sys import requests import pandas as pd from bs4 import BeautifulSoup as bs # constants used by crawler # target url as the start page TGT_URL = 'https://maoyan.com/films?showType=3' # request header, fake as Firefox browser, somehow chrome hit the slide bar # authentication with high ch...
null
week01/pa01/requests_crawler.py
requests_crawler.py
py
2,398
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 29, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_...
76663966
import numpy as np from collections import OrderedDict import torch import torch.optim as optim from torch import nn from torch import autograd import torch.nn.functional as F import rlkit.torch.pytorch_util as ptu from rlkit.torch.core import np_to_pytorch_batch from rlkit.torch.torch_base_algorithm import TorchBase...
null
rlkit/torch/state_marginal_matching/ebil_smm.py
ebil_smm.py
py
7,532
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.exp", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.exp", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.exp", "line_number": 28, "usage_type": "call" }, { "api_name": "rlkit.torch.torch_base_algorithm.TorchB...
642931764
import requests import re # https://search.jd.com/Search?keyword=ed&enc=utf-8&qrst=1&rt=1&stop=1&vt=2&bs=1&wq=ed&ev=exbrand_ED%5E&page=1&s=1&click=0 # https://search.jd.com/Search?keyword=ed&enc=utf-8&qrst=1&rt=1&stop=1&vt=2&bs=1&wq=ed&ev=exbrand_ED%5E&page=3&s=61&click=0 def gethtmltext(key): url = 'https://s.t...
null
TaoBao.py
TaoBao.py
py
1,968
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 24, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "line_number": ...
170810041
import logging from typing import List, Optional import click from .config import RABBIT_CONFIG from .core import inspect from .db import DBContextManager from .rabbitmq import RabbitMQ from .utils import wrap_async_call log = logging.getLogger(__name__) @click.command() @click.option("--job_id", default=0, type=i...
null
services/sidecar/src/simcore_service_sidecar/cli.py
cli.py
py
1,725
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.wrap_async_call", "line_number": 25, "usage_type": "call" }, { "api_name": "click.command", "line_number": 15, "usage_type": "call" }, { "api_name": "click.option", ...
592887612
# Local imports from utils.sikuliUtils import log class Panel: def __init__(self, testInfo, name): self.beatsDir = testInfo.getBeatsDir() self.supportedBeats = testInfo.supportedBeats self.name = name self.duration = 1 def getBeat(self): """Returns the beat of a given...
null
Lib/panel.py
panel.py
py
2,380
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.sikuliUtils.log", "line_number": 88, "usage_type": "call" } ]
411208723
import configparser import ast class CAMParamParser: def __init__(self, conf_file): self.conf_file = conf_file def readConfig(self): self.config = configparser.ConfigParser() self.config.read(self.conf_file) self.config_dict = self.configEval() def configEval(self): ...
null
cam_parser.py
cam_parser.py
py
1,218
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.ConfigParser", "line_number": 9, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 19, "usage_type": "call" } ]
193581115
from selenium import webdriver import math def calc(number): return str(math.log(abs(12 * math.sin(number)))) browser = webdriver.Chrome() link = "https://SunInJuly.github.io/execute_script.html" browser.get(link) x = int(browser.find_element_by_css_selector("#input_value").text) result = calc(x) print(x) inp...
null
selenium_lessons/lesson8_step6.py
lesson8_step6.py
py
1,193
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.log", "line_number": 6, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "li...
455317832
import numpy as np import os import scipy.io import tensorflow as tf VGG19_LAYERS = ( 'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1', 'conv2_1', 'relu2_1', 'conv2_2', 'relu2_2', 'pool2', 'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2', 'conv3_3', 'relu3_3', 'conv3_4', 'relu3_4', 'pool3', ...
null
show_attend_and_tell/vgg.py
vgg.py
py
2,785
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.placeholder", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 19, "usage_type": "attribute" }, { "api_name": "tensorflow.nn.conv2d", "line_number": 22, "usage_type": "call" }, { "api_name": "t...
322985385
import Default from AppInstall.Menu import SHOW_ALL, SHOW_ONLY_SUPPORTED, SHOW_ONLY_FREE, SHOW_ONLY_MAIN, SHOW_ONLY_PROPRIETARY, SHOW_ONLY_THIRD_PARTY, SHOW_ONLY_INSTALLED from AppInstall.Util import * import datetime import locale from gettext import gettext as _ class Distribution(Default.Distribution): def...
null
usr/share/pyshared/AppInstall/distros/Ubuntu.py
Ubuntu.py
py
10,215
python
en
code
null
code-starcoder2
76
[ { "api_name": "Default.Distribution", "line_number": 12, "usage_type": "attribute" }, { "api_name": "Default.Distribution.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "Default.Distribution", "line_number": 15, "usage_type": "attribute" }, { ...
60953430
import cv2 import numpy as np cap = cv2.VideoCapture(0) whT = 320 #- Width High Target. We are using 320 yolo confThreshold = 0.5 nms_threshold = 0.3 # The lower is more aggresive and less number of boxes. Can reduce the boxes classesFile = r'E:\Python Project\Resources\AI_Files\Yolo_v3\coco.names' classNam...
null
open_cv_yolo3.py
open_cv_yolo3.py
py
3,843
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.dnn.readNetFromDarknet", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.dnn", "line_number": 23, "usage_type": "attribute" }, { "api_name": "cv2.dnn", ...
160815724
from loguru import logger from czsc import CZSC from collections import OrderedDict from czsc.utils import create_single_signal, get_sub_elements def bar_eight_V230702(c: CZSC, **kwargs) -> OrderedDict: """8K走势分类 参数模板:"{freq}_D{di}#8K_走势分类V230702" **信号逻辑:** 参见博客:https://blog.sina.com.cn/s/blog_486e...
null
examples/signals_dev/merged/bar_eight_V230702.py
bar_eight_V230702.py
py
3,483
python
en
code
null
code-starcoder2
76
[ { "api_name": "czsc.CZSC", "line_number": 7, "usage_type": "name" }, { "api_name": "czsc.utils.create_single_signal", "line_number": 35, "usage_type": "call" }, { "api_name": "czsc.utils.get_sub_elements", "line_number": 37, "usage_type": "call" }, { "api_name": "...
383441306
# -*- coding: utf-8 -*- """ Common functions for urlbot """ import config import re import time import requests import sleekxmpp import html.parser from urllib.error import URLError import logging log = logging.getLogger(__name__) BUFSIZ = 8192 USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64; rv:31.0) ' \ ...
null
common.py
common.py
py
4,565
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "sleekxmpp.Message", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sleekxmpp.Presence", "line_number": 36, "usage_type": "attribute" }, { "api_name": "conf...
322948917
#!/usr/bin/python # -*- coding: utf-8 -*- import os import logging import logging.handlers import re import struct import requests from PyQt4.QtCore import QObject, pyqtSignal from operator import itemgetter import socket from requests import exceptions class NoInternetConnectionFound(Exception): pass class In...
null
src/utils.py
utils.py
py
6,936
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt4.QtCore.QObject", "line_number": 28, "usage_type": "name" }, { "api_name": "PyQt4.QtCore.pyqtSignal", "line_number": 30, "usage_type": "call" }, { "api_name": "PyQt4.QtCore.pyqtSignal", "line_number": 31, "usage_type": "call" }, { "api_name": "...
550872980
from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD from keras.initializers import RandomNormal, RandomUniform from funcoes import * from pyfiglet import * import matplotlib.pyplot as plt import os import datetime os.environ['TF_CPP_MIN_LOG_LEVE...
null
main.py
main.py
py
5,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.system", "line_number": 21, "usage_type": "call" }, { "api_name": "os.system", "line_number": 22, "usage_type": "call" }, { "api_name": "os.system", "line_number": 30...
206936762
# !/usr/bin/env python # -*- coding:utf-8 -*- from selenium import webdriver import time from tqdm import tqdm import os from multiprocessing import Pool def get_driver(): options = webdriver.ChromeOptions() prefs = { 'profile.default_content_setting_values': { 'notifications': 2 } } options.add_exper...
null
tools/py_spider/spider_farmer.py
spider_farmer.py
py
3,552
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 20, "usage_type": "call" }, { "api...
71102723
from flask import Flask, request, abort, render_template, flash, redirect, url_for from linebot import (LineBotApi, WebhookHandler) from linebot.exceptions import (InvalidSignatureError) from linebot.models import * import configparser # LINE 聊天機器人的基本資料 config = configparser.ConfigParser() config.read('config.ini') #Y...
null
line_chat_bot/appss_1.py
appss_1.py
py
1,615
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.ConfigParser", "line_number": 8, "usage_type": "call" }, { "api_name": "linebot.LineBotApi", "line_number": 11, "usage_type": "call" }, { "api_name": "linebot.WebhookHandler", "line_number": 13, "usage_type": "call" } ]
40799826
import json from scripts.utils.mylogger import mylogger import pickle import redis import zlib import pandas as pd from tornado.gen import coroutine from datetime import datetime, timedelta import numpy as np logger = mylogger(__file__) EXPIRATION_SECONDS = 86400*4 #retain for 4 days in redis class PythonRedis: ...
null
scripts/databases/pythonRedis.py
pythonRedis.py
py
5,234
python
en
code
null
code-starcoder2
76
[ { "api_name": "scripts.utils.mylogger.mylogger", "line_number": 12, "usage_type": "call" }, { "api_name": "redis.StrictRedis", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 31, "usage_type": "call" }, { ...
617896988
# -*- coding: UTF-8 -*- import time import json import requests import threading class DrivingSpider: def __init__(self): self.session = requests.Session() self.session.headers.update({ "Accept":"application/json, text/javascript, */*; q=0.01", "Accept-Encoding": "gzip, deflate", "Accept-Language": "en-...
null
main_all_coaches.py
main_all_coaches.py
py
5,020
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Session", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 107, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 142, "usage_type": "call" }, { "api_name": "threading.Thread", "line...
551254482
# encoding:utf-8 from selenium import webdriver import time driver = webdriver.Chrome() driver.get("http://www.baidu.com") driver.implicitly_wait(5) #单个浏览器多个标签(Tab)的状况时,先取得所有标签的句柄,然后循环遍历并判断是否是当前标签页,如果不是则切换 def handle(): driver.find_element_by_id("setf").click() handles = driver.window_handles for handle ...
null
selenium/handle.py
handle.py
py
968
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" } ]
376024211
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('todolist', '0006_auto_20150601_0950'), ] operations = [ migrations.AlterModelOptions( name='notification', ...
null
todolist/migrations/0007_auto_20150719_1250.py
0007_auto_20150719_1250.py
py
1,825
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterModelOptions", "line_number": 14, "usage_type": "call" ...
395891903
#!/usr/bin/env python # -*- coding: utf-8 -*- import faulthandler import functools import logging import sys from pynextion import PySerialNex from pynextion.device import NexDevice, NexEventPoller from PyQt5 import QtCore from Mesdan.Exceptions.Hooks.Logger import install_logger_excepthook def printargs(message,...
null
examples/qnextion.py
qnextion.py
py
3,100
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.info", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QCoreApplication", "line_number": 22, "usage_type": "call" }, { "api_name": "PyQt5.QtCore", "line_number": 22, "usage_type": "name" }, { "api_name": "logging.basic...
369668357
# -*- coding: utf-8 -*- import pyaudio import wave import sounddevice as sd import time import settings.DIR_PATH as bpath def play(name,type): chunk = 1024 # path = type+name+'.wav' f = wave.open(path,'rb') p = pyaudio.PyAudio() # print(p.get_device_count()) # print(p.get_default_output_de...
null
utils/play_aidio.py
play_aidio.py
py
1,024
python
en
code
null
code-starcoder2
76
[ { "api_name": "wave.open", "line_number": 12, "usage_type": "call" }, { "api_name": "pyaudio.PyAudio", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 42, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": ...
517659429
from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Firefox() driver.get("http://www.google.com") assert "Google" in driver.title elem = driver.find_element_by_id('lst-ib') elem.clear() elem.send_keys("Python is rad!") elem.send_keys(Keys.RETURN) assert "No results found."...
null
webtest.py
webtest.py
py
364
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 4, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 4, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.keys.Keys.RETURN", "line_number": 10, "usage_type": "attribute" }...
449539815
# -*- coding: UTF-8 -*- # File: sun_info # Author: Philip Cheng # Time: 7/22/16 -> 5:25 PM from datetime import date, datetime, timedelta from astral import Astral from framework import Memoized import numpy as np astral = Astral() @Memoized def day_light(date_time, lati, longi): sunrise, sunset = astral.dayligh...
null
utils/sun_info.py
sun_info.py
py
962
python
en
code
null
code-starcoder2
76
[ { "api_name": "astral.Astral", "line_number": 10, "usage_type": "call" }, { "api_name": "astral.daylight_utc", "line_number": 15, "usage_type": "call" }, { "api_name": "framework.Memoized", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.timedel...
366009673
# -*- coding:utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the ...
null
vega/model_zoo/fusion.py
fusion.py
py
1,699
python
en
code
null
code-starcoder2
76
[ { "api_name": "vega.is_torch_backend", "line_number": 17, "usage_type": "call" }, { "api_name": "vega.is_torch_backend", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.nn", ...
425829299
import steps import logging import json # THIS IS THE SEQUIENCER !!!! 11 elf def sequencer_loadconfigfromfile(infile): ''' Load config from file. ''' config = None composedsequence = [] with open(infile) as file: config = json.load(file) if config is not None: composeds...
null
sequencer.py
sequencer.py
py
1,648
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 32, "usage_type": "call" }, { "api_name": "steps.sequencer_step_filecopy", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.info", ...
103843995
import random import torch from PIL import Image from glob import glob import os import numpy as np class Places2(torch.utils.data.Dataset): def __init__(self, img_root, mask_root, img_transform, mask_transform, split='train',targeted = True): super(Places2, self).__init__() self.i...
null
places2.py
places2.py
py
2,530
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.utils", "line_number": 8, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 17, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 20, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 22...
570562326
#!/usr/env/bin/ python3 """ [extract_sequence.py] DESCRIPTION: Extracts sequence corresponding to the documented sequence in a mmCIF file, also extracts sequence based on structural data in pdb file, this is to compare sequences for missing residues USAGE: python3 extract_sequence.py <PDBfile> <CIFfile> <EntityNumbe...
null
extract_sequence.py
extract_sequence.py
py
6,009
python
en
code
null
code-starcoder2
76
[ { "api_name": "Bio.PDB.PDBParser", "line_number": 65, "usage_type": "call" }, { "api_name": "os.rename", "line_number": 117, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 117, "usage_type": "call" }, { "api_name": "os.path", "line_number...
192233312
import pygame import random pygame.init() speed_game = 4 score = 0 scores = [] menu_img = pygame.image.load('menu.jpeg') pygame.mixer.music.load('music.mp3') pygame.mixer.music.play() RED = (255, 0, 0) LIGHT_BLUE = (227, 243, 255) COL_BACKGROUND = (63, 174, 196) COLOUR_OF_FRAME_MIN = (139, 0, 255) ...
null
main(1).py
main(1).py
py
12,218
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.mixer.music.load"...
284730828
#!/usr/bin/env python from __future__ import absolute_import, division, print_function __metaclass__ = type import argparse import getpass import sys import xml.etree.ElementTree import pan.xapi import xmltodict import xlsxwriter from panos_util import VulnerabilitySignature def parse_xml(xml_doc): tree = xml....
null
threat_signature_report.py
threat_signature_report.py
py
3,141
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.etree.ElementTree.etree.ElementTree.fromstring", "line_number": 18, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.etree", "line_number": 18, "usage_type": "attribute" }, { "api_name": "xml.etree.ElementTree", "line_number": 18, "usage_typ...
40291532
import scipy.io from sklearn.tree import DecisionTreeClassifier import numpy as np from sklearn import svm import csv ''' Final submission functions ''' if __name__=='__main__': # load train data classifiers_svm=[] for patient in range(1,8): readin_ict=scipy.io.loadmat('patient_'+str(p...
null
final_submission_svm.py
final_submission_svm.py
py
3,932
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.io.io.loadmat", "line_number": 20, "usage_type": "call" }, { "api_name": "scipy.io.io", "line_number": 20, "usage_type": "attribute" }, { "api_name": "scipy.io", "line_number": 20, "usage_type": "name" }, { "api_name": "scipy.io.io.loadmat", ...
134288248
from django.template import Template , Context from django.shortcuts import render, render_to_response from django.views import View from django.db import connection from django.conf import settings from .forms import UserLoginForm, UserEditForm, UserRegistrationForm, ReportForm from django.contrib.auth import login, a...
null
Gifts/views.py
views.py
py
14,487
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.View", "line_number": 32, "usage_type": "name" }, { "api_name": "django.db.connection.cursor", "line_number": 36, "usage_type": "call" }, { "api_name": "django.db.connection", "line_number": 36, "usage_type": "name" }, { "api_name": "dj...
427982046
from django.http import HttpResponse, JsonResponse from rest_framework.parsers import MultiPartParser, FormParser, JSONParser from rest_framework.decorators import api_view,permission_classes,authentication_classes,parser_classes from rest_framework import status from rest_framework.permissions import IsAuthenticated f...
null
FourYouth_API/fourYouth/fourYouthAPI/views/aboutUsViews.py
aboutUsViews.py
py
2,552
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.response.Response", "line_number": 22, "usage_type": "call" }, { "api_name": "rest_framework.status.HTTP_201_CREATED", "line_number": 22, "usage_type": "attribute" }, { "api_name": "rest_framework.status", "line_number": 22, "usage_type": "na...
399873743
# # djblets/siteconfig/django_settings.py # # Copyright (c) 2008 Christian Hammond # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the r...
null
seahub/thirdpart/Djblets-0.6.14.dev-py2.6.egg/djblets/siteconfig/django_settings.py
django_settings.py
py
5,599
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.settings", "line_number": 102, "usage_type": "argument" }, { "api_name": "django.conf.settings", "line_number": 103, "usage_type": "argument" }, { "api_name": "django.conf.settings", "line_number": 168, "usage_type": "argument" }, { "api...
105749018
# encoding:utf-8 """ All constants could be used in other modules For reasons that models, views can't have unicode text in this project, all unicode text go here. """ from django.utils.translation import ugettext as _ MODERATOR_STATUS_CHOICES = ( ('a', _('approved')), ...
null
patches/twmode/twmode.py
twmode.py
py
3,950
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.utils.translation.ugettext", "line_number": 10, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext", "line_number": 11, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext", "line_number": 12, "usage_type": ...
138401305
__author__ = 'antonior' from django.conf.urls import url from . import views urlpatterns = [ url(r'^/*$', views.input), url(r'run$', views.run), url(r'result', views.result), url(r'test', views.test), ]
null
sRNAtoolboxweb/sRNAdejBrowser/urls.py
urls.py
py
223
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django....
216482339
#!/usr/bin/env python """ file: test_coverage.py (tests) author: Jess Robertson, jess@unearthed.solutions date: Thursday, 03 January 2019 description: Tests for coverage wrangling """ import unittest from pathlib import Path import numpy as np import rasterio import requests from explore_australi...
null
tests/test_coverage.py
test_coverage.py
py
5,708
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.ConnectionError", "line_number": 23, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pat...
531346268
''' Description: Random pts in edge with black value spread in black area only in one direction stop when reach the border and the value is white,get the growth path length sum histogram Fake code: ''' import random import numpy as np import cv2 import math import os from collectio...
null
post-process/v2_1_binaryGrowth.py
v2_1_binaryGrowth.py
py
11,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 76, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 77, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 81, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 91, ...
461338912
import logging from PySide2.QtWidgets import QFrame, QLabel, QVBoxLayout, QHBoxLayout, QScrollArea, QSizePolicy, \ QTableWidget, QTableWidgetItem, QLineEdit, QComboBox, QPushButton, QMessageBox from PySide2.QtCore import Qt, QSize class QStateSolver(QFrame): COLUMNS = ["Name","Cast to", "Value"] def __i...
null
angrmanagement/ui/widgets/qstate_solver.py
qstate_solver.py
py
2,545
python
en
code
null
code-starcoder2
76
[ { "api_name": "PySide2.QtWidgets.QFrame", "line_number": 8, "usage_type": "name" }, { "api_name": "PySide2.QtWidgets.QVBoxLayout", "line_number": 31, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QHBoxLayout", "line_number": 33, "usage_type": "call" }, { ...
405722774
# -*- coding: utf-8 -*- from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from scrapy.http import Request from obi.items import ObiItem class ParseObiSpider(CrawlSpider): name = 'obi' allowed_domains = ['obi.ch'] start_urls = ( 'https://www.obi.ch/bauen...
null
obi/obi/spiders/parse_obi.py
parse_obi.py
py
1,839
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 10, "usage_type": "name" }, { "api_name": "scrapy.spiders.Rule", "line_number": 21, "usage_type": "call" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 21, "usage_type": "call" }, { ...
137340793
"""the_wall_app URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-...
null
django/the_wall/the_wall_app/urls.py
urls.py
py
1,233
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 20, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 22, "usage_type": "call" }, { "api_name": "django.urls.path",...
369155562
import maya.cmds as cmds # -------------------------------------------- Functions ------------------------- # --------------------------- UI Col Management --------------------------- # Transfer Brightness from B to A def brightnessCol(A, b): import colorsys hsvA = colorsys.rgb_to_hsv(A[0], A[1]...
null
Maya/UITools/BasicInterface_V1.0.py
BasicInterface_V1.0.py
py
2,484
python
en
code
null
code-starcoder2
76
[ { "api_name": "colorsys.rgb_to_hsv", "line_number": 16, "usage_type": "call" }, { "api_name": "colorsys.hsv_to_rgb", "line_number": 17, "usage_type": "call" }, { "api_name": "colorsys.rgb_to_hsv", "line_number": 25, "usage_type": "call" }, { "api_name": "colorsys....
110038235
#Part 2 Task 1 #Import Modules from pyspark.sql import SparkSession #Create a spark session spark = SparkSession.builder.appName("AirBnB").getOrCreate() #Dataset path path = 'C:/Users/Ashish/Desktop/Truata/airbnbdata.parquet' #Load parquet file into dataframe airbnb_Data = spark.read.parquet(path)
null
src/task2_1.py
task2_1.py
py
316
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 7, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 7, "usage_type": "...
242792757
"""movies, actors, genders tables Revision ID: eb5bdaad569a Revises: Create Date: 2020-08-06 20:30:56.692972 """ from alembic import op import sqlalchemy as sa import sqlalchemy_utils # revision identifiers, used by Alembic. revision = 'eb5bdaad569a' down_revision = None branch_labels = None depends_on = None def...
null
projects/capstone/thecrew_full_stack/thecrew-app-backend-api-python/migrations/versions/eb5bdaad569a_movies_actors_genders_tables.py
eb5bdaad569a_movies_actors_genders_tables.py
py
2,190
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.create_table", "line_number": 22, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 22, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
75067804
import numpy as np import cv2 import math def HomographyMatrix(src_img_pts,world_plane_pts): tb=[] ta=[] for i in range(0,len(src_img_pts)): tmp=[world_plane_pts[i][0],world_plane_pts[i][1],1,0,0,0,-src_img_pts[i][0]*world_plane_pts[i][0],-src_img_pts[i][0]*world_plane_pts[i][1]] ...
null
hw3_1.py
hw3_1.py
py
3,773
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.asarray", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.linalg.pinv", "line_n...
360366670
#! /usr/bin/env py.test import contextlib import glob import logging import os import subprocess import pytest import webtest from pypiserver import __main__, bottle # Enable logging to detect any problems with it ## __main__.init_logging(level=logging.NOTSET) @pytest.fixture() def _app(app): return app.modu...
null
tests/test_app.py
test_app.py
py
8,746
python
en
code
null
code-starcoder2
76
[ { "api_name": "pypiserver.__main__.init_logging", "line_number": 17, "usage_type": "call" }, { "api_name": "pypiserver.__main__", "line_number": 17, "usage_type": "name" }, { "api_name": "logging.NOTSET", "line_number": 17, "usage_type": "attribute" }, { "api_name...
399416502
#!/usr/bin/env python # # activerecords_imp2.py # # Copyright Kostadin Atanasov(all rights reserved). # author: Kostadin Atanasov. # This program is released under terms of GPLv2. See LICENSE or visit: # http://www.gnu.org/licenses/gpl.html ''' Actual implementation of ActiveRecord class for python 2.x. ''' from met...
null
active_records/activerecords_imp2.py
activerecords_imp2.py
py
8,298
python
en
code
null
code-starcoder2
76
[ { "api_name": "metaflow.active_records.activerecord_utils.ActiveRecordError", "line_number": 25, "usage_type": "call" }, { "api_name": "metaflow.active_records.activerecord_utils.ActiveRecordError.unsupported_keyword", "line_number": 25, "usage_type": "attribute" }, { "api_name":...
83067679
import csv import sys import os import pandas as pd from typing import Any, Optional, List from plot import catplot, plt, apply_hatch from graph_utils import ( apply_aliases, column_alias, systems_order, change_width, apply_to_graphs, PAPER_MODE, ) if PAPER_MODE: color: Optional[str] = "bl...
null
apps/nix/graphs.py
graphs.py
py
7,981
python
en
code
null
code-starcoder2
76
[ { "api_name": "graph_utils.PAPER_MODE", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.List", ...
522440821
from mininet.net import Mininet from lib.router import Router from lib.switch import Switch from lib.host import Host from lib.device import Device from mininet.cli import CLI from mininet.log import setLogLevel, info import sys def main(): net = Mininet() a1 = Router('1', [{'interface': 'eth0', 'ip': '12.1.1.1...
null
VLANs/main.py
main.py
py
3,022
python
en
code
null
code-starcoder2
76
[ { "api_name": "mininet.net.Mininet", "line_number": 10, "usage_type": "call" }, { "api_name": "lib.router.Router", "line_number": 11, "usage_type": "call" }, { "api_name": "lib.switch.Switch", "line_number": 12, "usage_type": "call" }, { "api_name": "lib.host.Host...
404856039
#!/usr/bin/env python # # Test the electrolib.channel interface # electrolib.channel exposes the ChanOrderFile class # import datetime import numpy from electrolib.channel import ChanOrderFile from electrolib.sources import SampleFile # Create a SampleFile instance to test ChanOrderFile on nchan = 10 nsamples = 25...
null
tests/test_chanorderfile.py
test_chanorderfile.py
py
2,080
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "datetime.ti...
24932686
import datetime # from twilio.rest import Client # from datetime import datetime # now = datetime.now() all_studs = [] all_books = [] all_issued = [] class StudentInfo: s_roll = None s_name = None s_class = None s_mob = None s_email = None def accept_stud_info(self): ...
null
library2.py
library2.py
py
6,051
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 49, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 49, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 67, "usage_type": "call" }, { "api_name": "da...
371093526
import json from recastai import sentence class Response(object): def __init__(self, response): self.raw = response response = json.loads(response) response = response['results'] self.source = response['source'] self.intents = response['intents'] self.sentences = [Sentence(s) for s in respo...
null
recastai/response.py
response.py
py
1,076
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 8, "usage_type": "call" }, { "api_name": "recastai.sentence", "line_number": 31, "usage_type": "name" }, { "api_name": "recastai.sentence.entities", "line_number": 32, "usage_type": "attribute" }, { "api_name": "recastai....
630581059
import pefile import argparse import os import sys import fnmatch from sectiondefs.commondefs import common_sections_dict from sectiondefs.packerdefs import packer_sections_dict def main(): args = buildargparser() delimeter = ',' if args.path: try: args.ext extenstion = arg...
null
peparser.py
peparser.py
py
10,807
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.exit", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pefile.PE", "line_number": ...
270464659
# Created: November 1 2020 # (c) Copyright governed by MIT License. # To edit: Add values wherever "ADD" is written import requests, json, time, datetime, smtplib, ssl, email.utils from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart #Send Email def sendEmail(output, address, recipie...
null
G999 MasterNode Alert.py
G999 MasterNode Alert.py
py
5,938
python
en
code
null
code-starcoder2
76
[ { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 70, "usage_type": "call" }, { "api_name": "email.utils.utils.formataddr", "line_number": 72, "usage_type": "call" }, { "api_name": "email.utils.utils", "line_number": 72, "usage_type": "attribute" }, {...
67779502
# -*- coding: utf-8 -*- """ Multivariate time-series analysis model using Restricted Boltzmann machines (RBM) and temporal dynamic Bayesian networks (tDBN) Created on Tue Jun 11 2019 @author: João Henrique Rodrigues, IST version: 1.0 """ import sys, os import numpy as np import torch from rbm_categorical import Cate...
null
rbm_tdbn.py
rbm_tdbn.py
py
30,413
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.set_printoptions", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.set_printoptions", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 107, "usage_type": "call" }, { "api_name": "rbm_ut...
415742881
import os.path from typing import List from src.Car import Car class Exporter: def __init__(self, filename: str) -> None: self.filename: str = filename self.vehicles: List[Car] = [] def setVehicles(self, vehicles: list) -> None: self.vehicles = vehicles # Export the output to a fi...
null
src/Exporter.py
Exporter.py
py
933
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "src.Car.Car", "line_number": 8, "usage_type": "name" } ]
508994577
import numpy as np import torch import torch.nn as nn from utils_global import remove_illegal, action_mask from agents.common.model import DQN, DuelingDQN, DeepConvNet from agents.common.buffers import PrioritizedBuffer """ Experience replay memory is sampled uniformly with BasicBuffer. Novel and interesting transiti...
null
DouDizhu/agents/value_based/per_noisy_duel_double_dqn_agent.py
per_noisy_duel_double_dqn_agent.py
py
16,671
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 68, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 68, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 68, "usage_type": "attribute" }, { "api_name": "numpy.linspace",...
285645008
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('visit', '0044_auto_20150808_2151'), ] operations = [ migrations.RemoveField( model_name='visit', nam...
null
visit/migrations/0045_auto_20150808_2231.py
0045_auto_20150808_2231.py
py
952
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RemoveField", "line_number": 14, "usage_type": "call" }, ...
198876250
import numpy as np from itertools import product def get_initial_region(lines): region = None for line in lines: arr = np.array([1 if x == "#" else 0 for x in line]) if region is None: region = arr else: region = np.vstack((region, arr)) region = np.expand_d...
null
day-17/script2.py
script2.py
py
1,373
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.expand_dims", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.pad", "line_numbe...
496918838
# CD Marker Handbook import numpy as np import pandas as pd import scipy.stats #from random import randint #from sklearn.datasets.samples_generator import make_blobs def find_k_closest(matrix, x_coord, y_coord, k): list_of_points = [] nodes = np.asarray(matrix.values) node = (x_coord, y_coord) for i ...
null
markers.py
markers.py
py
2,336
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.asarray", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.argmin", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.delete", "line_number"...
578267499
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse from django.core import serializers from django.http import JsonResponse from .models import Post from .forms import PostForm def post_create(request): form=PostForm(request.Post or None) if form.is_valid(): in...
null
posts/views.py
views.py
py
1,138
python
en
code
null
code-starcoder2
76
[ { "api_name": "forms.PostForm", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 21, "usage_type": "call" }, { "api_nam...
266286600
import logging from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from dynamic_preferences.users.forms import user_preference_form_builder logger = logging.getLogger(__name__) def uniq_sections(user): """ Returns number of unique instances of Sections. ...
null
papermerge/contrib/admin/views/preferences.py
preferences.py
py
1,412
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "dynamic_preferences.users.forms.user_preference_form_builder", "line_number": 32, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 41, "usage_type"...
493095992
from AxonDeepSeg.data_management.dataset_building import * from AxonDeepSeg.ads_utils import download_data import os, shutil from pathlib import Path data_split_path = Path("./split") data_patched_path = Path("./patched") data_training_path = Path("./training") ''' # If dataset building folders already exist, remove ...
null
notebooks/train_own.py
train_own.py
py
2,362
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number":...
155336761
import os import theano import numpy as np # from random import random import theano.tensor as T import d random = np.random x = T.dvector("x") w1 = T.dmatrix("w1") s1 = T.dot(x, w1) y1 = 1 / (1 + T.exp(-s1)) w2 = T.dmatrix("w2") s2 = T.dot(y1, w2) y2 = 1 / (1 + T.exp(-s2)) t = T.dvector("t") L = 1 / 2 * T.sum((t - y2)...
null
b.py
b.py
py
2,693
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "theano.tensor.dvector", "line_number": 8, "usage_type": "call" }, { "api_name": "theano.tensor", "line_number": 8, "usage_type": "name" }, { "api_name": "theano.tensor.dmat...
421965221
""" html-pdf-webservice Copyright 2014 Nathan Jones See LICENSE for more details """ # Gunicorn server config # See http://docs.gunicorn.org/en/latest/settings.html import multiprocessing bind = "0.0.0.0:8080" workers = multiprocessing.cpu_count() * 2 errorlog = "-"
null
config.py
config.py
py
283
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.cpu_count", "line_number": 14, "usage_type": "call" } ]
390923689
import nltk from nltk.corpus import wordnet as wn, stopwords from nltk.corpus import wordnet from nltk import pos_tag from nltk.tokenize import sent_tokenize, word_tokenize from tkinter import * import random import sqlite3 import os import sys import time sys.setrecursionlimit(20000) global story, stop_words, wordNu...
null
Final Project/Final Product/Final Product.py
Final Product.py
py
29,689
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setrecursionlimit", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 31, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 31, "usage_type": "name" }, { "api_name"...
524569804
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.http import HttpResponse from django.shortcuts import render,render_to_response from django.core import serializers from models import students from django.views.decorators.csrf import csrf_exempt,csrf_protect import json import sqlite3 import ...
null
ScoreManager/views.py
views.py
py
3,130
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render_to_response", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "models.students.objects.create", "line_number": 23, "usage_type": "call" },...
483659708
from modeltranslation.translator import translator, TranslationOptions from modules.blog.models import Blog from modules.page.models import Page from modules.portfolio.models import Portfolio from modules.index.models import Index class BlogTranslationOptions(TranslationOptions): fields = ('title', 'brief', 'desc...
null
src/project/translation.py
translation.py
py
800
python
en
code
null
code-starcoder2
76
[ { "api_name": "modeltranslation.translator.TranslationOptions", "line_number": 8, "usage_type": "name" }, { "api_name": "modeltranslation.translator.TranslationOptions", "line_number": 12, "usage_type": "name" }, { "api_name": "modeltranslation.translator.TranslationOptions", ...
630575336
import numpy as np from sklearn.metrics import accuracy_score from sklearn.neighbors import NearestNeighbors from sklearn.svm import LinearSVC import matplotlib.pyplot as plt def svm_tree_init(X,y,depth=3): Xy_n = (X,y) nt = svt(Xy_n,depth) return nt class svt: def __init__(self,Xy_n,depth): s...
null
svm_tree.py
svm_tree.py
py
8,485
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.argsort", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number"...
494432056
import decimal import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc from dash.exceptions import PreventUpdate from dash.dependencies import Input, Output, State from ... import app from ... import snmp from ... import database as db from ...utils import stl_toa...
null
app/layout/edit/radios.py
radios.py
py
10,496
python
en
code
null
code-starcoder2
76
[ { "api_name": "decimal.Decimal", "line_number": 15, "usage_type": "attribute" }, { "api_name": "dash_html_components.Div", "line_number": 51, "usage_type": "call" }, { "api_name": "dash_html_components.H6", "line_number": 53, "usage_type": "call" }, { "api_name": ...
269176100
# -*- coding: utf-8 -*- import os, sys sys.path.append(os.getcwd()) import time import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import sklearn.datasets import tensorflow as tf import tflib as lib import tflib.ops.linear import tflib.ops.conv2d import t...
null
gan_bionics_light.py
gan_bionics_light.py
py
20,227
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.use", "line_numbe...
646461634
#!/usr/bin/env python # -*- coding: utf-8 -*- # # (C) 2013 Pengkui Luo <pengkui.luo@gmail.com> # Created 6/12/2013, updated 6/19/2013 # """ Unit tests """ print('Executing %s' % __file__) import unittest import os, sys, time from netutils import dnsblav, publicsuffix class Test_DNSBLAV (unittest.TestCase): de...
null
tests/test_dnsblav.py
test_dnsblav.py
py
963
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "netutils.dnsblav.is_dnsav_service", "line_number": 20, "usage_type": "call" }, { "api_name": "netutils.dnsblav", "line_number": 20, "usage_type": "name" }, { "api_nam...
440039837
import os from IPython.display import display, Markdown from databaker.framework import loadxlstabs # Stringifys some metadata-like output for the fake scrape def fakeMetadata(metaDict): firstEntry = True for k, v in metaDict.items(): if firstEntry: display(Markdown('**{}**\n'.format(k))) ...
null
databaker-lab-exercises/tutorialResources/scraper.py
scraper.py
py
1,579
python
en
code
null
code-starcoder2
76
[ { "api_name": "IPython.display.display", "line_number": 11, "usage_type": "call" }, { "api_name": "IPython.display.Markdown", "line_number": 11, "usage_type": "call" }, { "api_name": "IPython.display.display", "line_number": 12, "usage_type": "call" }, { "api_name...
543916417
import pygame from constant import * from Ship import * from new_front_enemy import new_front_enemy import sys def game(screen): all_sprites = pygame.sprite.Group() player = pygame.sprite.Group() enemies = pygame.sprite.Group() Player(enemies, all_sprites, player) BackEnemy(player, all_sprites, e...
null
game.py
game.py
py
5,003
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.sprite.Group", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Group", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.sprit...
407342168
from random import random from math import log from matplotlib import pyplot import numpy def multiClassAttr(arr,legend,append="",sort=False, title='Stevilo pomembnih znacilk za razred'): plt = [] if sort: for i in arr: plt.append([len(i["c"+str(y)]) for y in sorted([int(x[1:]) for x in i])]) else: for i i...
null
naloga02/src/graf.py
graf.py
py
2,230
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.py...
353430971
import cv2 def change_color(image, color): img_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) height, width = img_gray.shape[:2] color_list = {"b": [1, 0, 0], "g": [0, 1, 0], "r": [0, 0, 1]}[color] for x in range(height): for y in range(width): intensity = img_gray[x, y] ...
null
image_process.py
image_process.py
py
411
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.cvtColor", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 4, "usage_type": "attribute" } ]
605599955
'''Trains a simple deep NN on the MNIST dataset. Gets to 98.40% test accuracy after 20 epochs (there is *a lot* of margin for parameter tuning). 2 seconds per epoch on a K520 GPU. ''' from __future__ import print_function import keras from keras.datasets import mnist from keras.models import Sequential from keras.la...
null
autoxd/cnn_boll/my_recognition.py
my_recognition.py
py
2,360
python
en
code
null
code-starcoder2
76
[ { "api_name": "autoxd.myredis.gen_data", "line_number": 20, "usage_type": "call" }, { "api_name": "autoxd.myredis", "line_number": 20, "usage_type": "name" }, { "api_name": "autoxd.cnn_boll.load_img.load_data", "line_number": 20, "usage_type": "call" }, { "api_nam...
239213679
import csv import cv2 import numpy as np import sklearn from sklearn.model_selection import train_test_split from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, Cropping2D, Dropout from keras.layers.convolutional import Convolution2D from keras.layers.convolutional import MaxPooling2D f...
null
model.py
model.py
py
5,268
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 16, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy....
558366186
# encoding=utf-8 import sys import json def get_segment_pieces(mapping, segment_number, one_indexed=True): if one_indexed: segment_number -= 1 start, end = mapping['realignment'][segment_number] text = mapping['match_text'] [start:end] indices = mapping['matches'][start:end] return indic...
null
sources/Yerushalmi/helper.py
helper.py
py
956
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 20, "usage_type": "call" } ]
624826033
import io import re import lxml import zipfile from cgi import escape class Memory(): 'zip and unzip in memory' def __init__(self): self.memory = io.BytesIO() def __get_data(self): self.memory.seek(0) return self.memory.read() def __save(self, out): with open(out, 'w...
null
simple_tamplate/tools.py
tools.py
py
4,061
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.BytesIO", "line_number": 12, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 25, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 30, "usage_type": "call" }, { "api_name": "zipfile.ZIP_DEFLATED", ...
296614773
""" Combined RDTs ------------- This module contains combined resonance driving terms calculations functionality of ``optics_measurements``. It provides functions to compute combined resonance driving terms following the derivations in https://arxiv.org/pdf/1402.1461.pdf. """ from pathlib import Path import numpy as n...
null
omc3/optics_measurements/crdt.py
crdt.py
py
7,720
python
en
code
null
code-starcoder2
76
[ { "api_name": "omc3.utils.logging_tools.get_logger", "line_number": 22, "usage_type": "call" }, { "api_name": "omc3.utils.logging_tools", "line_number": 22, "usage_type": "name" }, { "api_name": "omc3.optics_measurements.constants.AMPLITUDE", "line_number": 24, "usage_typ...
23080298
from django.shortcuts import render from .forms import * from scm.models import Person from datetime import datetime,timedelta,timezone from django.contrib.auth.models import User from django.http import HttpResponse from django.shortcuts import render, redirect def registerUser(request): formP = RegisterUserForm(req...
null
users/views.py
views.py
py
1,369
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 26, "usage_type": "call" }, { "api_name": "djang...