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
265836602
#!/usr/bin/env python3 # -*- coding:utf-8 -*- import http.client import json import os from socket import AF_INET6, SOCK_DGRAM, socket from urllib import parse import dns.resolver # pip3 install dnspython -i https://pypi.tuna.tsinghua.edu.cn/simple LOGIN_TOKEN = "13490,6b5976c68aba5b14a0558b77c17c3932" DOMAIN = "dn...
null
ddns-dnspod-win.py
ddns-dnspod-win.py
py
7,574
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 16, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 21, "usage_type": "call" }, { "api_name": "socket.AF_INET6", "line_number": 21, "usage_type": "argument" }, { "api_name": "socket.SOCK_DGRAM", "...
10808552
from kivy.app import App from kivy.uix.boxlayout import BoxLayout from math import factorial def binomial(n, k): """ Calculates the binomial coefficient (n over k). """ return factorial(n) / (factorial(k) * factorial(n-k)) def calc_odds(num_dice, win_with): """ Computes the probabilities for killing an...
null
main.py
main.py
py
3,133
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.factorial", "line_number": 9, "usage_type": "call" }, { "api_name": "kivy.uix.boxlayout.BoxLayout", "line_number": 51, "usage_type": "name" }, { "api_name": "kivy.app.App", "line_number": 92, "usage_type": "name" } ]
646453220
# /bin/env python3 # coding: utf-8 import sys import stanza # stanza.download("no") # stanza.download("nn") lang = sys.argv[1] # State the segmenter model (no or nn) nlp = stanza.Pipeline(lang, processors="tokenize") stack = [] for line in sys.stdin: doc = nlp(line.strip()) for sentence in doc.sentences:...
null
preprocessing/segmenter2.py
segmenter2.py
py
389
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "stanza.Pipeline", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 16, "usage_type": "attribute" } ]
341047647
''' For this script to work, you must have your application default credentials set up in the Google Cloud utility (in terminal). Then, just run 'python ImageDownloader.py'. ''' from google.cloud import storage import os import subprocess def main(): client = storage.Client() bucket = client.get_bucket('blobs...
null
ImageDownloader.py
ImageDownloader.py
py
1,769
python
en
code
null
code-starcoder2
76
[ { "api_name": "google.cloud.storage.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "google.cloud.storage", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 34, "usage_type": "call" }, { "api_name": "os.pa...
194940278
""" Ax_Metrics - MQEngine metrics query running engine ------------------------------------------------------------------------------ Author: Dan Kamins <dos at axonchisel dot net> Copyright (c) 2014 Dan Kamins, AxonChisel.net """ # ---------------------------------------------------------------------------- impor...
null
py/axonchisel/metrics/run/mqengine/mqengine.py
mqengine.py
py
8,373
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "axonchisel.metrics.foundation.ax.obj.AxObj", "line_number": 43, "usage_type": "name" }, { "api_name": "axonchisel.metrics.foundation.metricdef.metset.MetSet", "line_number": 59, "...
503952528
''' @Description: Python提供的sum()函数可以接受一个list并求和,请编写一个prod()函数,可以接受一个list并利用reduce()求积: @Author: ouyhlan @Date: 2019-07-31 18:13:00 ''' # -*- coding: utf-8 -*- from functools import reduce def prod(L): def mul(x, y): return x * y return reduce(mul, L) print('3 * 5 * 7 * 9 =', prod([3, 5, 7, 9])) if pr...
null
Practice/list_sum.py
list_sum.py
py
474
python
en
code
null
code-starcoder2
76
[ { "api_name": "functools.reduce", "line_number": 13, "usage_type": "call" } ]
463973215
#!/usr/bin/python # Python 2 and 3, print compatibility from __future__ import print_function import docopt import random import subprocess """ List of things which this enhanced adb tool does * adbe rotate [left|right] * adbe gfx [on|off] * adbe overdraw [on|off] * adbe layout [on|off] * adbe destroy-activities-in...
null
adbe.py
adbe.py
py
21,365
python
en
code
null
code-starcoder2
76
[ { "api_name": "docopt.docopt", "line_number": 96, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 401, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 412, "usage_type": "call" }, { "api_name": "subprocess.Popen", ...
75033270
""" Policies Module Contains the definition of the cadCAD system's policies. Policies are typically broken down into `{{policy_name}}_all()` and `{{policy_name}}()` functions, where the `_all()` is the actual "policy" function passed into the PSUBs, and the other is a helper function. The helper function typically co...
null
dai_cadcad/policies.py
policies.py
py
19,811
python
en
code
null
code-starcoder2
76
[ { "api_name": "dai_cadcad.pymaker.numeric.Wad", "line_number": 34, "usage_type": "call" }, { "api_name": "dai_cadcad.pymaker.numeric.Wad.from_number", "line_number": 42, "usage_type": "call" }, { "api_name": "dai_cadcad.pymaker.numeric.Wad", "line_number": 42, "usage_type...
178408610
from bs4 import BeautifulSoup import requests class Crawler: url = '' found_urls = [] found_imgs = [] ignored = 0 def get_url(self) -> str: return self.url def set_url(self, url): self.url = url return self def get_found_urls(self) -> list: return self.fo...
null
old/crawler.py
crawler.py
py
1,131
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 38, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
257911415
# -*- coding: utf-8 -*- """ Created on Sun Feb 16 16:59:47 2020 @author: Conor """ from CrankNicolsonNeumann import crank_nicolson_neu import CrankNicolsonDirichlet as cnd import matplotlib.pyplot as plt import numpy as np import UsefulFunctions as uf """ Set-up """ # Step sizes x_start = 0 x_stop = 50 #xN = 300 #tN...
null
will/CNNmoderror.py
CNNmoderror.py
py
3,220
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number"...
15733208
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
null
conf.py
conf.py
py
8,649
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygments.formatters.latex.LatexFormatter", "line_number": 30, "usage_type": "name" }, { "api_name": "sphinx.highlighting.PygmentsBridge.latex_formatter", "line_number": 36, "usage_type": "attribute" }, { "api_name": "sphinx.highlighting.PygmentsBridge", "line_n...
207445993
# 主业务逻辑处理路由和视图的定义 # 导入蓝图程序,用于构建路由 import datetime import os import re from sqlalchemy import text from . import main # 导入db,用于操作数据库 from app import db # 导入实体类,用于操作数据库 from ..models import * from flask import render_template, make_response from flask import request from flask import redirect from flask import session ...
null
app/main/views.py
views.py
py
13,296
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.text", "line_number": 35, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 37, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 38, "usage_type": "name" }, { "api_name": "flask.render_template", ...
645479752
import numpy as np import matplotlib.pyplot as plt import matplotlib.lines as mlines plt.rcParams['font.sans-serif'] = ['SimHei'] # 步骤一(替换sans-serif字体) plt.rcParams['axes.unicode_minus'] = False # 步骤二(解决坐标轴负数的负号显示问题) log = print class PointBrowser: """ 选中点并且使其高亮 -- 按键‘a’查看前一个点, ‘d’查看后一个点 """ def...
null
Matplotlib_With_PYQT/封装toolbar功能/demo_line_point.py
demo_line_point.py
py
9,760
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "ap...
389197491
""" Python code for z3checkins product. # This module could be split into three: timeutils.py, message.py and views.py # but it is small enough IMHO. $Id: message.py,v 1.40 2004/05/14 19:56:05 gintautasm Exp $ """ import re import email import email.Utils import mailbox import time from StringIO import StringIO from...
null
Zope3/branches/jim-default-traversal/src/z3checkins/message.py
message.py
py
26,118
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.tzinfo", "line_number": 43, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 60, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 63, "usage_type": "call" }, { "api_name": "time.localtime"...
436367680
#coding=utf8 ''' Created on 2019年5月15日 @author: 82114 ''' import torch as t class Evaluation(): def __init__(self,net,pr): print ("Evaluate....") dataiter = iter(pr.testloader) images, labels = dataiter.next() # 一个batch返回4张图片 print('实际的label: ', labels) #s...
null
evaluation/evaluation.py
evaluation.py
py
1,288
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.max", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 36, "usage_type": "call" } ]
78658253
#!/usr/bin/python #from shutil import copyfile import os import cups from PIL import Image import time import logging import subprocess as sub #preset = "4zu6" preset = "streifen" #preset = "test" IMG1 = "./fotos/IMG1.jpg" IMG2 = "./fotos/IMG2.jpg" IMG3 = "./fotos/IMG3.jpg" #CurrentWorkingDir= os.getcwd() + "/f...
null
print.py
print.py
py
3,523
python
en
code
null
code-starcoder2
76
[ { "api_name": "cups.Connection", "line_number": 28, "usage_type": "call" }, { "api_name": "cups.setUser", "line_number": 31, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 33, "usage_type": "call" }, { "api_name": "PIL.Image.new", "line_n...
372776679
# -*- coding: utf-8 -*- from __future__ import unicode_literals # Djando import from django.test import TestCase # Django-rest-framework import from rest_framework import status from rest_framework.test import APITestCase # Service app import from service.models import User class UserTestsCreate(APITestCase): ...
null
service/tests.py
tests.py
py
1,455
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 15, "usage_type": "name" }, { "api_name": "service.models.User.objects.count", "line_number": 17, "usage_type": "call" }, { "api_name": "service.models.User.objects", "line_number": 17, "usage_type": "attribu...
192193999
# -*- coding: utf-8 -*- """ Created on Thu May 2 21:55:58 2019 @author: 53445 import sys import codecs sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) """ import sqlite3 import networkx as nx import matplotlib.pyplot as plt from scipy.sparse import csc_matrix import numpy as np import pand...
null
gcn_doc/data_process.py
data_process.py
py
22,620
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 49, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 74, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
43430505
import cv2 from Common.utils import * # def print_matInfo(name, image): # if image.dtype == 'uint8': # 데이터타입 확인 # mat_type = "CV_8U" # elif image.dtype == 'int8': # mat_type = "CV_8S" # elif image.dtype == 'uint16': # mat_type = "CV_16U" # elif image.dtype == 'int16': # ...
null
openCV/4.윈도우 제어/12.read_image1.py
12.read_image1.py
py
1,692
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.IMREAD_GRAYSCALE", "line_number": 25, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", ...
190082800
import pygame from time import sleep import copy import game_environment import DQN2 from sys import exit class GameRendering: def __init__(self, game, agent, Config): pygame.init() pygame.font.init() self.side_length = 100 self.game = copy.deepcopy(game) self.don...
null
rendering.py
rendering.py
py
4,708
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.font.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 11, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "li...
391910566
import io import socket import struct from PIL import Image import shutil import math import numpy as np import cv2 as cv from scipy import stats from skimage.metrics import _structural_similarity as ssim from ImageCopyPaste import frameCopy #funciton used to write frames to file def write_bytesio_to_file(filename, ...
null
ServerReplayAttack.py
ServerReplayAttack.py
py
3,129
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 28, "usage_type": "call" }, { "api_name": "skimage.metrics._structural_similarity.structural_similarity", "line_number": 30, "usage_type": "call" }, { ...
394785633
from django.urls import path, re_path from .views import * app_name = 'user' urlpatterns = [ path('', home_view, name='home'), path('login/', login_view, name='login'), path('ogretmenekle/', ogretmen_ekle_view, name='ogretmenEkle'), path('logout/', logout_view, name='logout'), ]
null
User/urls.py
urls.py
py
299
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", ...
552130015
# coding=utf-8 from socket import * from multiprocessing import Process import time import binascii def hexStr_to_str(hex_str): return hex_str def main(): tcpSocket = socket(AF_INET, SOCK_STREAM) # 重复使用绑定信息,不必等待2MSL时间 tcpSocket.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) address = ('', 8001) tcpS...
null
tcp4.py
tcp4.py
py
1,092
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 25, "usage_type": "call" } ]
58419549
from mark import MarkType from range import Range import re from utils import isprintable MINIMUM_STRING_LENGTH = 3 def stringify(trace_info): def get_string(marks, start_index, end_index): return "".join([chr(mark.value) for mark in marks[start_index : end_index]]) def create_string_name(i, s): cleaned_...
null
da65trace/da65tracelib/stringifier.py
stringifier.py
py
1,127
python
en
code
null
code-starcoder2
76
[ { "api_name": "mark.value", "line_number": 10, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.isprintable", "line_number": 19, "usage_type": "call" }, { "api_name": "mark.value", "line_numbe...
283215412
from __future__ import print_function import sys from itertools import count SCHEMA = {} def update_schema(list_of_fields): global SCHEMA SCHEMA = {kv[0]: index for kv, index in zip(list_of_fields, count())} def get_name_value(part): name, _, value = part.partition('=') return name, value de...
null
tsv/use_lists_and_schema.py
use_lists_and_schema.py
py
1,066
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.count", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 36, "usage_type": "attribute" }, { "api_name": "itertools.count", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.stderr", "line_...
220828968
from flask import Flask,jsonify from flask_restful import Api, Resource, reqparse from PIL import Image import io import base64 import cv2 from nid_ocr import extract_and_update_csv import pymssql import subprocess import threading app = Flask(__name__) api = Api(app) def thread_job(): subprocess.run(['sh','spli...
null
nocr_app/app.py
app.py
py
2,945
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 14, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_restful.Resource",...
218213729
import boto3 from io import StringIO DESTINATION = 'prospectparkmodel' def _write_dataframe_to_csv_on_s3(dataframe, filename): """ Write a dataframe to a CSV on S3 """ print("Writing {} records to {}".format(len(dataframe), filename)) # Create buffer csv_buffer = StringIO() # Write dataframe to bu...
null
model/write_to_s3.py
write_to_s3.py
py
602
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.StringIO", "line_number": 10, "usage_type": "call" }, { "api_name": "boto3.resource", "line_number": 14, "usage_type": "call" } ]
593683498
import os.path import time from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.common.alert import Alert # ControlWebsite # 웹 컨트롤을 위한 클래스 # # exec_flow_list(Array) # 배열 순차적으로 실행 # # exec_row(Dictionary) # Dictionary 자료형으로 한번 실행 # # base_controller(ev...
null
Python/ControlWebsite.py
ControlWebsite.py
py
4,250
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.path.expanduser", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 32, "usage_type": "name" }, { "api_name": "selenium.webdriver....
315470619
import sys import torch from torch._C import _add_docstr, _special # type: ignore from torch._torch_docs import common_args # type: ignore Tensor = torch.Tensor entr = _add_docstr(_special.special_entr, r""" entr(input, *, out=None) -> Tensor Computes the entropy on :attr:`input` (as defined bel...
null
torch/special/__init__.py
__init__.py
py
3,511
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.Tensor", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch._C._add_docstr", "line_number": 9, "usage_type": "call" }, { "api_name": "torch._C._special.special_entr", "line_number": 9, "usage_type": "attribute" }, { "api_name"...
485599101
# -*- coding: utf-8 -*- import requests import unittest root = 'https://api.fundusd.com/v2/' test_root = 'http://test.fundusd.com/v2/' class TestInfo(unittest.TestCase): def myinfo(self, headers): r = requests.get(test_root + 'users/my', headers = headers) return r def test_myinfo(self): headers = {'Auth...
null
fundusd/myinfo.py
myinfo.py
py
669
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" } ]
379200793
import random import timeit import time import configparser import os from classfiles.Lighting import * class FishTankLightingControl(): CreatureList = [] DayCount = 100000 AirTemperature = 75 RunTimer = 0 FoodTimer = 0 SexTimer = 0 def __init__(self): print('EcoSim started on', t...
null
main.py
main.py
py
8,260
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.strftime", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser"...
578113094
from multiprocessing import Process, Pool,Lock import time def f(i): print('hello word %s' %i) time.sleep(1) return i def callback(data): #回执,相当于 子进程执行完毕后。告诉主进程. 这里callback还可以干很多事,因为这里设置的是把结果都返回给这里了。。所以可以把结果写入日志中 print('exec done---->',data) if __name__ == '__main__': lock =Lock() poo...
null
untitled1/dream/day-10/进程池.py
进程池.py
py
807
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 6, "usage_type": "call" }, { "api_name": "multiprocessing.Lock", "line_number": 12, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 14, "usage_type": "call" } ]
618273602
from pwn import * import sf import sys target = process("./chall-test_LocalLibcId-03-x86") gdb.attach(target, execute="get_libc_puts_address") bof_payload = sf.BufferOverflow(arch=32) bof_payload.set_input_start(0x3e) rop_chain = [134513472, b'0000', 134520852] bof_payload.add_rop_chain(rop_chain) payload = bof_pay...
null
07_LocalLibcId-unit-tests/03_32/remenissions-work/binded-in-chains.py
binded-in-chains.py
py
1,935
python
en
code
null
code-starcoder2
76
[ { "api_name": "sf.BufferOverflow", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 37, "usage_type": "call" } ]
404322554
#!/usr/bin/env python # -*- coding: utf-8 -*- """:Mod: test_data_table :Synopsis: :Author: servilla :Created: 9/27/15 """ __author__ = 'servilla' from tests import config # This is effectively "from __init__ import config" import logging logger = logging.getLogger('tests.test_file_hash') logger.setLeve...
null
src/tests/test_data_table.py
test_data_table.py
py
1,750
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 21, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 28, "usage_type": "attribute" }, { "api_name": "tests.con...
567138076
import csv import time import numpy as np from sklearn.preprocessing import LabelBinarizer from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from sklearn.multiclass import OneVsRestClassifier from sklearn.svm import LinearSVC import pandas as pd class ...
null
app3.py
app3.py
py
4,242
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.random.permutation", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 44, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
602774711
#!/usr/bin/env python # -*- encoding: utf-8 -*- #---------------------------------------------------------------------- # xoutil.tests.test_functools #---------------------------------------------------------------------- # Copyright (c) 2015 Merchise and Contributors # Copyright (c) 2013, 2014 Merchise Autrement and C...
null
tests/test_functools.py
test_functools.py
py
3,503
python
en
code
null
code-starcoder2
76
[ { "api_name": "xoutil.functools.lru_cache", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 52, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 52, "usage_type": "name" }, { "api_name": "da...
138626704
# -*- coding: utf-8 -*- from __future__ import unicode_literals from random import randint from .forms import SummarizerForm import requests import sys import json from django.utils.encoding import smart_unicode import urllib from string import maketrans import re from django.shortcuts import render, HttpResponse, red...
null
apps/nlp_app/views.py
views.py
py
2,596
python
en
code
null
code-starcoder2
76
[ { "api_name": "forms.SummarizerForm", "line_number": 29, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 37, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 55, "usage_type": "call" }, { "api_name": "re.sub", ...
84607816
import pandas as pd from django.contrib.auth.models import User from django.core.cache import cache from django.core.validators import MinValueValidator from django.db import models from common.constants import DATA_SOURCES, DATA_SOURCE_INTERNAL from locations.models import Location from reporters.models import Report...
null
br/models.py
models.py
py
5,846
python
en
code
null
code-starcoder2
76
[ { "api_name": "unicefng.querysets.SearchableLocationQuerySet", "line_number": 13, "usage_type": "name" }, { "api_name": "django.db.models.Manager.from_queryset", "line_number": 17, "usage_type": "call" }, { "api_name": "django.db.models.Manager", "line_number": 17, "usage...
98666513
import sqlite3 import argparse import datetime import itertools class Tracker(): def __init__(self, name, group_by_category): self.db_conn = sqlite3.connect(name) self.db_conn.row_factory = sqlite3.Row self.cursor = self.db_conn.cursor() self.cursor.execute('CREATE TABLE IF NOT EXI...
null
main.py
main.py
py
4,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.dateti...
125407893
from unittest import mock from unittest.mock import patch import requests from myapp import models test_payloads = { "security_event": [{"sqreen_payload_type": "security_event", "date_occurred": "2018-10-10T08:32:25.169232+00:00"}], "unknown": [{"sqreen_payload_type": "unknown"}] } def test_check_signature...
null
tests/functional/test_main.py
test_main.py
py
2,991
python
en
code
null
code-starcoder2
76
[ { "api_name": "myapp.models.LogTargetBackend", "line_number": 46, "usage_type": "call" }, { "api_name": "myapp.models", "line_number": 46, "usage_type": "name" }, { "api_name": "unittest.mock.patch.object", "line_number": 50, "usage_type": "call" }, { "api_name": ...
646560278
# Copyright 2018-2022 Xanadu Quantum Technologies 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...
null
tests/ops/op_math/test_sprod.py
test_sprod.py
py
26,134
python
en
code
null
code-starcoder2
76
[ { "api_name": "pennylane.Barrier", "line_number": 33, "usage_type": "attribute" }, { "api_name": "pennylane.WireCut", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pennylane.Identity", "line_number": 38, "usage_type": "attribute" }, { "api_name": ...
618050045
import os import time import openpyxl import urllib.request import pytesseract as tess from PIL import Image from tqdm import tqdm from colorama import Fore from colorama import Style from openpyxl import workbook from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriv...
null
rgpv.py
rgpv.py
py
7,108
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.system", "line_number": 26, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 47, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.ui.Select", "line_number": 49, "usage_type": "call" }, { "api_name": "selenium.co...
470381208
import numpy as np import numpy.linalg.linalg as la import matplotlib.pyplot as plt import pickle fst = lambda x: x[0] snd = lambda x: x[1] distance = lambda p1, p2: la.norm(p1 - p2) neighborhoodPath = lambda r, paths, pnt: [path for path in paths if distance(path[0], pnt) < r] matchPaths = lambda r, scatter, paths...
null
PathHelper.py
PathHelper.py
py
3,859
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linalg.linalg.norm", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.linalg.linalg", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.array_equal", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.ar...
445013523
# Query the database from flask import request, jsonify, render_template, Blueprint from database import property_ref, search_database search_query = Blueprint('search', __name__) @search_query.route("/search") def search(): data = request.args city = data["city"].capitalize() zipcode = data["zipcode"].c...
null
search_query.py
search_query.py
py
2,558
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" }, { "api_name": "database.propert...
561652849
import configparser import requests import os.path import os import time import json import click import IPython.display from itertools import islice import urllib.parse import pandas as pd from .auth import do_global_login, get_connection, refresh_login from .utils import * from .walkup import * from .dsl_grammar im...
null
dimcli/core/api.py
api.py
py
19,200
python
en
code
null
code-starcoder2
76
[ { "api_name": "auth.get_connection", "line_number": 52, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 82, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 89, "usage_type": "call" }, { "api_name": "auth.refresh_login", ...
44529481
import http.server import socketserver import os current_dir = os.path.dirname(__file__) project_dir = os.path.join(current_dir, 'export', '0.2.0', 'web') os.chdir(project_dir) PORT = 8000 handler = http.server.SimpleHTTPRequestHandler http_daemon = socketserver.TCPServer(('', PORT), handler) print('Go to: http://lo...
null
serve-html.py
serve-html.py
py
371
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6...
255094974
#!usr/bin/env python #-*- coding:utf-8 -*- import requests import jsonpath,json import time,pprint import csv class Maoyan(): def __init__(self): self.headers = { 'User-Agent': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)', 'Referer': 'http://m.maoyan.com...
null
spider/ArticleSpider/App/maoyan.py
maoyan.py
py
1,946
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 23, "usage_type": "call" }, { "api_name": "jsonpath.jsonpath", "line_numb...
180763329
#encoding:utf-8 # Create your views here. #Importar modelos de la aplicacion from captura.models import * from captura.forms import * #Modulos de Django from django.core.mail import * from email.mime.image import MIMEImage from django.contrib import auth from django.contrib.humanize.templatetags.humanize import * fr...
null
captura/views.py
views.py
py
6,784
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Q", "line_number": 37, "usage_type": "call" }, { "api_name": "django.template.loader.render_to_string", "line_number": 69, "usage_type": "call" }, { "api_name": "django.utils.html.strip_tags", "line_number": 70, "usage_type": "call" }, ...
341636346
from sklearn.neighbors import KNeighborsClassifier from sklearn.naive_bayes import GaussianNB import numpy as np def get_percents(protein): ''' according the protein to calculate the percentes: ''' aa20 = ('A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T',...
null
exp7/Amino_acid_classifier.py
Amino_acid_classifier.py
py
4,401
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 86, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 87, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 97, "usage_type": "call" }, { "api_name": "sklearn.naive_bayes.GaussianNB", ...
156377366
import pygame.font class Informaciones(): """ Muestra informacion en pantalla marcadores p.e""" def __init__(self,configuracion,pantalla,marcador): self.pantalla=pantalla self.pantalla_rect=pantalla.get_rect() #rectangulo de pantalla self.configuracion=configuracion self.marcador=marcador self.vidas= co...
null
informaciones.py
informaciones.py
py
1,989
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.font.font.SysFont", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.font.font", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.font", "line_number": 14, "usage_type": "name" }, { "api_name": "pygame.fon...
545063963
#coding: utf-8 from flask import Flask, render_template, request import aiml import os import sys reload(sys) sys.setdefaultencoding('utf-8') kernel = aiml.Kernel() if os.path.isfile("bot_brain.brn"): kernel.bootstrap(brainFile = "bot_brain.brn") else: kernel.bootstrap(learnFiles = "std-startup.xml", command...
null
main.py
main.py
py
1,089
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setdefaultencoding", "line_number": 9, "usage_type": "call" }, { "api_name": "aiml.Kernel", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_...
582317586
import protobuf.addressbook_pb2 as addressbook_pb2 def ListPeople(address_book): for person in address_book.people: print("Person ID:", person.id) print(" Name:", person.name) print(" E-mail address:", person.email) for phone_number in person.phones: if phone_number.type == addressbook_pb2....
null
addressbook_test_reading.py
addressbook_test_reading.py
py
882
python
en
code
null
code-starcoder2
76
[ { "api_name": "protobuf.addressbook_pb2.Person", "line_number": 11, "usage_type": "attribute" }, { "api_name": "protobuf.addressbook_pb2", "line_number": 11, "usage_type": "name" }, { "api_name": "protobuf.addressbook_pb2.Person", "line_number": 13, "usage_type": "attribu...
517946631
#importing the libraries for multi linear regression import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.pylab as plt2 import seaborn as sns #importing tbe file startups=pd.read_csv("E://excelr data//assignments//multi linear regression//50_Startups.csv") startups.shape s...
null
startup.py
startup.py
py
1,592
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "seaborn.pairplot", "line_number": 12, "usage_type": "call" }, { "api_name": "statsmodels.formula.api.ols", "line_number": 20, "usage_type": "call" }, { "api_name": "statsmode...
470412847
''' Created on Oct 17, 2018 @author: xuwang ''' import csv import argparse import pandas ap = argparse.ArgumentParser() ap.add_argument("-s", "--srcFile", required=True, help="source file") #============== ap.add_argument("-i", "--plotInfo", required=True, help="plot file") #============== arg...
null
PyPlotExtraction/src/linkPlotInfo.py
linkPlotInfo.py
py
700
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" } ]
246158318
from django.urls import path from . import views urlpatterns = [ path('', views.record_list.as_view(), name='record_list'), path('record/detail/<pk>', views.record_detail.as_view(), name='record_detail'), path('record/update/<pk>', views.record_update.as_view(), name='record_update'), path('record/dele...
null
Billing/urls.py
urls.py
py
800
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
536203215
# coding=utf-8 from django.conf.urls import url from users import views urlpatterns = [ url(r'^login/$', views.login_page, name='login_page'), url(r'^login/submit/$', views.login, name='login'), url(r'^register/$', views.register_page, name='register_page'), url(r'^register/submit/$', views.register...
null
users/urls/account_urls.py
account_urls.py
py
394
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "users.views.login_page", "line_number": 9, "usage_type": "attribute" }, { "api_name": "users.views", "line_number": 9, "usage_type": "name" }, { "api_name": "django.conf...
593673825
import sys,pyperclip,shelve,os if len(sys.argv)!=2: print("Enter the command in the form: python prg command") sys.exit() command=sys.argv[1] os.chdir("A:\\") shel_file=shelve.open('Multiclip') counter=0 #an alternative an simpler method is to not use this variable if len(list(shel_file.keys()))==0: ...
null
Python/Industrial Training Files/prog_19_shelve_pyper.py
prog_19_shelve_pyper.py
py
1,097
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number": 6, ...
214525515
#-*-coding:utf-8-*- from __future__ import print_function import curses from pick import Picker def go_back(picker): return (None, -1) title = 'Please choose your favorite NBA trio: ' options = [ 'Bill Russell\nBob Cousy\nJohn Havlicek', 'Magic Johnson\nKareem Abdul Jabbar\nJames Worthy', 'Larry Bir...
null
example/multiline_options.py
multiline_options.py
py
683
python
en
code
null
code-starcoder2
76
[ { "api_name": "pick.Picker", "line_number": 21, "usage_type": "call" }, { "api_name": "curses.KEY_LEFT", "line_number": 22, "usage_type": "attribute" } ]
348300179
#!/usr/bin/python """ Starter code for the evaluation mini-project. Start by copying your trained/tested POI identifier from that which you built in the validation mini-project. This is the second step toward building your POI identifier! Start by loading/formatting the data... """ import pickl...
null
evaluation/evaluate_poi_identifier.py
evaluate_poi_identifier.py
py
1,263
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 19, "usage_type": "call" }, { "api_name": "feature_format.featureForma...
250107920
from django.core.urlresolvers import reverse from django.http import HttpResponsePermanentRedirect try: from django.conf.urls import patterns, include, url except ImportError: from django.conf.urls.defaults import patterns, include, url from timepiece import views urlpatterns = patterns('', # Redirect t...
null
timepiece/urls.py
urls.py
py
6,195
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.defaults.patterns", "line_number": 12, "usage_type": "call" }, { "api_name": "django.conf.urls.defaults.url", "line_number": 14, "usage_type": "call" }, { "api_name": "django.http.HttpResponsePermanentRedirect", "line_number": 14, "usage_ty...
60402380
from sklearn import datasets from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt loaded_data = datasets.load_boston() data_X = loaded_data.data data_y = loaded_data.target model = LinearRegression() model.fit(data_X, data_y) # print(model.predict(data_X[:4])) # print(data_y[:4]) print...
null
scikit_learn/ex3.py
ex3.py
py
605
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.load_boston", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 5, "usage_type": "name" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 10, "usage_type": "call" } ]
222057583
import urllib2 import base64 import json class DomoticzClient: def __init__(self, logger): self.base = "https://domoticz.totalize.nl/json.htm?username=a3IwbnQ0Ygo=&password=c2lsOEhlZWQK" #self.on_off_cmd = self.base + "&type=command&param=switchlight&idx=%s&switchcmd=%s" self.logger = log...
null
bin/Domoticz/Domoticz.py
Domoticz.py
py
2,709
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib2.Request", "line_number": 66, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 67, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "li...
125730964
import sys import parmed as pmd import simtk.openmm as mm import simtk.openmm.app as app import simtk.unit as u import scripts.omm_scripts.omm_rwmd as omm_rwmd ####################### ### Random Walk Molecular Dynamics OpenMM script for use with the CHARMM force field ### Note: the use of parmed to generate the mm.St...
null
mccabe_group/scripts/omm_scripts/run_rwmd.py
run_rwmd.py
py
3,276
python
en
code
null
code-starcoder2
76
[ { "api_name": "simtk.unit.kelvin", "line_number": 23, "usage_type": "attribute" }, { "api_name": "simtk.unit", "line_number": 23, "usage_type": "name" }, { "api_name": "simtk.unit.bar", "line_number": 24, "usage_type": "attribute" }, { "api_name": "simtk.unit", ...
500619165
import pandas as pd import datetime as dt from sklearn import linear_model import numpy as np import math import statsmodels.api as sm from scipy.optimize import curve_fit from sklearn.linear_model import LinearRegression from EnergyIntensityIndicators.pull_eia_api import GetEIAData from EnergyIntensityIndicators.weat...
null
EnergyIntensityIndicators/commercial.py
commercial.py
py
39,761
python
en
code
null
code-starcoder2
76
[ { "api_name": "EnergyIntensityIndicators.LMDI.CalculateLMDI", "line_number": 31, "usage_type": "name" }, { "api_name": "EnergyIntensityIndicators.pull_eia_api.GetEIAData", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 112, "us...
338449239
import flask import requests blueprint = flask.Blueprint('gitlab', __name__) DOMAIN = 'https://gitlab.com/api/v4' PROJECTS_URL = DOMAIN + '/projects?owned=true&private_token=1prFvNtqT6HhbXEz34QA' @blueprint.route('/gitlab', methods=[ 'GET' ]) def get_gitlab(): context = { 'page': 'gitlab', ...
null
blueprints/gitlab.py
gitlab.py
py
1,174
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "attribute" }, { "api_name": "requests.get...
27494708
import numpy as np import pandas as pd import matplotlib.pyplot as plt import random from sklearn.metrics import confusion_matrix data = pd.read_csv("Financial Distress.csv") data.describe() data.drop('x80', inplace=True,axis=1) #We'll take care of it later final_test=data[3172:] data=data[:3172] Y =...
null
ThirdModel.py
ThirdModel.py
py
4,560
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 26, "usage_type": "call" }, { "api_name...
450406114
import pytest import re import boto from boto.vpc import VPCConnection from boto.ec2.connection import EC2Connection from boto.ec2.instance import Instance from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType from pytest import fixture, raises from mock import MagicMock, call from paws.ec2 impor...
null
tests/ec2_test.py
ec2_test.py
py
10,660
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto.ec2", "line_number": 16, "usage_type": "attribute" }, { "api_name": "mock.MagicMock", "line_number": 16, "usage_type": "call" }, { "api_name": "boto.vpc", "line_number": 17, "usage_type": "attribute" }, { "api_name": "mock.MagicMock", "line...
62903581
from typing import List import pandas as pd from newsapi import NewsApiClient from pymongo import MongoClient from pymongo.collection import Collection from pymongo.database import Database from textblob import TextBlob from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer from config import NEWSAPI_K...
null
data/scrape/news.py
news.py
py
1,235
python
en
code
null
code-starcoder2
76
[ { "api_name": "newsapi.NewsApiClient", "line_number": 16, "usage_type": "call" }, { "api_name": "config.NEWSAPI_KEY", "line_number": 16, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "call" }, { "api_name": "typing.List...
183685017
# coding=utf-8 import re import os from bs4 import BeautifulSoup import requests import time import pymysql import datetime import urllib.request def crawler(n): session=requests.session() main_url="http://www.qiushibaike.com/imgrank/page/%s"%n req=session.get(main_url,headers=headers) start_html=req...
null
qiushibaike/qiushibaikeCrawler.py
qiushibaikeCrawler.py
py
1,725
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.session", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.request.request.urlretrieve", "line_number": 36, "usage_type": "call" }, { "api_name": ...
342812247
"""add name column on datasets table Revision ID: cbf947ca88d7 Revises: c0aea6931214 Create Date: 2019-10-17 00:15:11.304818 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'cbf947ca88d7' down_revision = 'c0aea6931214' branch_labels = None depends_on = None d...
null
alembic/versions/cbf947ca88d7_add_name_column_on_datasets_table.py
cbf947ca88d7_add_name_column_on_datasets_table.py
py
680
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
391788358
from django.contrib import admin from .models import Users, Watermeter, Fees class UsersAdmin(admin.ModelAdmin): list_display = ('u_name', 'u_address', 'created_at') list_filter = ['created_at'] search_fields = ['u_name', 'u_phone'] list_per_page = 10 #date_hierarchy = 'created_at' class FeesAdmin...
null
household/admin.py
admin.py
py
922
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 11, "usage_type": "attribute" ...
173954174
# Alexa Liaskovski # fortunes taken from here: http://www.fortunecookiemessage.com/archive.php # ------------------------------------------------------------------------------ # # IMPORTS # #------------------------------------------------------------------------------- import json import logging from ask_sdk_core.sk...
null
lambda_function.py
lambda_function.py
py
11,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 21, "usage_type": "attribute" }, { "api_name": "ask_sdk_core.dispatch_components.AbstractRequestHandler", "line_number": 67, "usage_type": "name" }...
213254102
import sklearn import json import re import numpy as np from sklearn import svm from sklearn.neighbors import KNeighborsClassifier from sklearn.ensemble import RandomForestClassifier,BaggingClassifier import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Drop...
null
testModelMorph.py
testModelMorph.py
py
4,291
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.search", "line_number": 20, "usage_type": "call" }, { "api_name": "re.search", "line_number": 22, "usage_type": "call" }, { "api_name": "re.search", "line_number": 24, "usage_type": "call" }, { "api_name": "re.search", "line_number": 32, ...
450952902
from django.conf.urls import url, include from rest_framework import routers from . import views router = routers.DefaultRouter() router.register(r'products', views.ProductViewSet, base_name='products') router.register(r'categories', views.CategoriesViewSet, base_name='categories') router.register(r'product-detail',...
null
django_start/django_start/apps/product/urls.py
urls.py
py
498
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 7, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 7, "usage_type": "name" }, { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "ap...
533107888
# coding=utf8 """ zhiz.views.settings ~~~~~~~~~~~~~~~~~~~ routes: settings GET, `/settings`, display settings update_settings POST, `/settings/update`, update settings """ from flask import render_template, request, redirect, url_for from zhiz import app from zhiz.models im...
null
zhiz/views/settings.py
settings.py
py
1,337
python
en
code
null
code-starcoder2
76
[ { "api_name": "zhiz.models.Blog.getone", "line_number": 28, "usage_type": "call" }, { "api_name": "zhiz.models.Blog", "line_number": 28, "usage_type": "name" }, { "api_name": "zhiz.models.Blog.fields", "line_number": 31, "usage_type": "call" }, { "api_name": "zhiz...
396868997
import sys import time from datetime import datetime, timedelta from queue import Queue from PyQt5.QtWidgets import QApplication from pandas import DataFrame from skogkatt.api.kiwoom.broker import KiwoomBroker from skogkatt.api.kiwoom.constants import CHART_TR_TIME_INTERVAL from skogkatt.api.trader import Trader from...
null
api/kiwoom/collector.py
collector.py
py
9,744
python
en
code
null
code-starcoder2
76
[ { "api_name": "skogkatt.core.LoggerFactory.get_logger", "line_number": 22, "usage_type": "call" }, { "api_name": "skogkatt.core.LoggerFactory", "line_number": 22, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 29, "usage_type": "name" }, { ...
211461950
import tensorflow as tf import numpy as np import math import scipy.io as sio import optunity as opt def get_weight(shape, lambda1): var = tf.Variable(tf.random_normal(shape), dtype=tf.float32) tf.add_to_collection('losses', tf.contrib.layers.l2_regularizer(lambda1)(var)) return var def add_layer(input,in_size,...
null
LAmbDA_functions5FF1.py
LAmbDA_functions5FF1.py
py
16,456
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.Variable", "line_number": 8, "usage_type": "call" }, { "api_name": "tensorflow.random_normal", "line_number": 8, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 8, "usage_type": "attribute" }, { "api_name": "ten...
90882692
import numpy as np import dlib import sys face_detector = dlib.get_frontal_face_detector() """ shape_predictor_68_face_landmarks.dat is trained on the ibug 300-W dataset and gives back 68 face landmarks dlib_face_recognition_resnet_model_v1.dat is a pre learned dataset of about 3 million faces. The mode...
null
libs/FacialRecognitionData.py
FacialRecognitionData.py
py
4,988
python
en
code
null
code-starcoder2
76
[ { "api_name": "dlib.get_frontal_face_detector", "line_number": 5, "usage_type": "call" }, { "api_name": "dlib.shape_predictor", "line_number": 18, "usage_type": "call" }, { "api_name": "dlib.face_recognition_model_v1", "line_number": 19, "usage_type": "call" }, { ...
330918009
# Copyright The Lightning AI team. # # 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 wri...
null
tests/tests_fabric/strategies/test_strategy.py
test_strategy.py
py
5,869
python
en
code
null
code-starcoder2
76
[ { "api_name": "lightning.fabric.strategies.SingleDeviceStrategy", "line_number": 27, "usage_type": "call" }, { "api_name": "unittest.mock.Mock", "line_number": 28, "usage_type": "call" }, { "api_name": "unittest.mock.patch", "line_number": 30, "usage_type": "call" }, ...
103863564
# -*- coding: utf-8 -*- """ 3D, Isotropic, 1st Order MKS Noah Paulson, 7/25/2014 """ import time import numpy as np import functions_small as rr from functools import partial ## el is the # of elements per side of the cube el = 21 ## the number of sample microstructures for calibration and validation. ns = 3 ## ...
null
pre_publish/main_serial_small.py
main_serial_small.py
py
2,384
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.strftime", "line_number": 22, "usage_type": "call" }, { "api_name": "functions_small.gen_micr", "line_number": 28, "usage_type": "call" }, { "api_name": "functions_small.mf", "line_number": 31, "usage_type": "call" }, { "api_name": "time.time",...
590925448
# -*- coding: utf-8 -*- import os from typing import Tuple, Union, Optional from pathlib import Path import numpy as np import pandas as pd from PIL import Image from sklearn.svm import SVR from scipy.sparse import spdiags, issparse, csr_matrix from scipy.sparse.linalg import norm from scanpy import logging as logg f...
null
tests/_helpers.py
_helpers.py
py
12,353
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.min", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.flip", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.argsort", "line_number": 3...
233578905
import cv2 import threading opencvDatapath = "/home/comx-admin/my360camera/FlaskApp/opencvdata/haarcascades/" class RecordingThread (threading.Thread): def __init__(self, name, camera): threading.Thread.__init__(self) self.name = name self.isRunning = True self.cap = camera ...
null
my360cam/FlaskApp/camera.py
camera.py
py
5,207
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 6, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 8, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv...
325877354
import warnings import numpy as np import pandas as pd from sklearn.metrics.cluster import normalized_mutual_info_score import woodwork as ww import woodwork.serialize as serialize from woodwork.datacolumn import DataColumn from woodwork.exceptions import ColumnNameMismatchWarning from woodwork.indexers import _iLocI...
null
woodwork/datatable.py
datatable.py
py
59,009
python
en
code
null
code-starcoder2
76
[ { "api_name": "woodwork.utils.import_or_none", "line_number": 27, "usage_type": "call" }, { "api_name": "woodwork.utils.import_or_none", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 135, "usage_type": "attribute" }, { ...
33341794
#_*_ coding:utf-8 _*_ import json class ServerConfig: def __init__(self, path): json_text = self.read_file(path) config = json.loads(json_text) self.ip = config['IP'] self.port = config['PORT'] self.max_link = config['MAX_LINK'] def read_file(self, path): json_t...
null
SlothServer/ServerConfig.py
ServerConfig.py
py
468
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 7, "usage_type": "call" } ]
311511790
from __future__ import division ipy = False try: ipy = __IPYTHON__ except NameError: pass import numpy as np import matplotlib if not ipy: matplotlib.use('Qt4Agg') matplotlib.rcParams.update({"figure.autolayout": "true"}) try: matplotlib.rcParams.update({"usetex": "true"}) except KeyErr...
null
colornet_scripts/plot_S_color_scaling.py
plot_S_color_scaling.py
py
2,232
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.rcParams.update", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "attribute" }, { "api_name": "ma...
411287767
import threading import time import os.path import io import urllib import json import csv import datetime from time import localtime, strftime, strptime now = datetime.datetime.now().strftime("%Y%m%d%H") # current day def main(): print("### STARTING... ###") checkCoin('https://api.bithumb.com/public...
null
time-thread-api.py
time-thread-api.py
py
1,630
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "threading.Timer", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path....
104782531
# coding: utf-8 from django.db import models from datetime import datetime from django.utils.translation import ugettext as _ from django.db.models.signals import post_save, pre_delete from courses.models import Course from groups.models import Group from django.db.models import Q, Max from django.contrib.auth.mode...
null
anytask/tasks/models.py
models.py
py
14,494
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 18, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 18, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 19, "usage_type": "call" }, { "api_name"...
251259465
# Adapted from: # https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/callback/profile_tasks.rst # (C) 2016 Matt Young <halcyondude@gmail.com> # (C) 2015, Tom Paine, <github@aioue.net> # (C) 2014, Jharrod LaFon, @JharrodLaFon # (C) 2012-2013, Michael DeHaan, <michael.dehaan@gmail.com> # # This file is fr...
null
tests/pip/plugins/callback/profile_tasks/profile_tasks.py
profile_tasks.py
py
5,179
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 44, "usage_type": "call" }, { "api_name": "time.time", "line_number": 66, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 70, "usage_type": "call" }, { "api_name": "time.time", "line_number": 71, ...
61643125
# -*- coding: utf-8 -*- __author__ = 'Administrator' from django.shortcuts import HttpResponse from django.shortcuts import HttpResponseRedirect from django.shortcuts import render_to_response import admininfo import account from app.common import validator from app.facade import factory from app.common import func fro...
null
app/views/admin/personhistory.py
personhistory.py
py
2,034
python
en
code
null
code-starcoder2
76
[ { "api_name": "app.facade.factory.CreateDepartmentTypeFacade", "line_number": 20, "usage_type": "call" }, { "api_name": "app.facade.factory", "line_number": 20, "usage_type": "name" }, { "api_name": "app.common.func.get_int_param_from_get", "line_number": 24, "usage_type"...
415908706
from unicon.statemachine import Path, State, StateMachine from unicon.plugins.generic.statements import default_statement_list from unicon.plugins.asa import statements, patterns from unicon.eal.dialogs import Dialog class ASAStateMachine(StateMachine): def create(self): p = patterns.ASAPatterns() ...
null
src/unicon/plugins/asa/ASAv/statemachine.py
statemachine.py
py
1,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "unicon.statemachine.StateMachine", "line_number": 9, "usage_type": "name" }, { "api_name": "unicon.plugins.asa.patterns.ASAPatterns", "line_number": 11, "usage_type": "call" }, { "api_name": "unicon.plugins.asa.patterns", "line_number": 11, "usage_type": "n...
460421225
import torch import torch.nn as nn import torch.nn.functional as F import modeling.deeplab from modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d from modeling.aspp import build_aspp from modeling.decoder import build_decoder from modeling.backbone import build_backbone class EEVOS(nn.Module): de...
null
modeling/eevos.py
eevos.py
py
4,093
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.BatchNorm2d", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
132578745
#!usr/bin/python3 """ more.py - Message Buffer Interface Author - mandarj """ import sqlite3 from tools import break_up, calling_module, DatabaseCursor, db_path, max_message_length def setup(self): self.more_db = db_path(self, 'more') connection = sqlite3.connect(self.more_db) cursor = connection.cursor(...
null
modules/more.py
more.py
py
4,406
python
en
code
null
code-starcoder2
76
[ { "api_name": "tools.db_path", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "tools.max_message_length", "line_number": 21, "usage_type": "name" }, { "api_name": "tools.break_up...
156246881
import numpy as np import binary_search as bs import matplotlib.pyplot as plt class LinearSpline: def __init__(self): self.tX = [] self.dirty = False def add_entry(self, t, x): self.tX.append([t, x]) self.dirty = True def interpolate(self, t): if(self.dirty): ...
null
interpolation.py
interpolation.py
py
4,017
python
en
code
null
code-starcoder2
76
[ { "api_name": "binary_search.search", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.linspace", "lin...
594134916
import matplotlib as mpl mpl.rcParams['text.usetex'] = True mpl.rcParams['font.family'] = 'serif' mpl.rcParams['font.serif'] = 'cm' mpl.rcParams['font.size'] = '22' import matplotlib.pyplot as plt import glob import os years = range(2006,2015) number_of_photos = [] for year in years: photos = [] filename...
null
count_photos.py
count_photos.py
py
1,377
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.rcParams", "line_number": 2, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 3, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 4, "usage_type": "attribute" }, { "api_name"...
99692555
from threading import Thread, Semaphore, BoundedSemaphore, Lock from time import sleep from random import choice import sys from queue import Queue import json import signal from .argument_parse import argparser from .utils import get_next_time from .message import MessageQueue from .conf import BARBER_LIST from .Barb...
null
barbershop/index.py
index.py
py
1,968
python
en
code
null
code-starcoder2
76
[ { "api_name": "argument_parse.argparser.parse_args", "line_number": 16, "usage_type": "call" }, { "api_name": "argument_parse.argparser", "line_number": 16, "usage_type": "name" }, { "api_name": "threading.BoundedSemaphore", "line_number": 18, "usage_type": "call" }, ...
293246455
from flask import Blueprint, request, jsonify import logic.file as file_logic import logic.embedding_model as emb_model_logic from models import EmbeddingModel, db, File, ModelWordVector embedding_model_bp = Blueprint('embedding-model', __name__) @embedding_model_bp.route("/", methods=["GET"]) def get_all(): m...
null
SentimentWebApi/controllers/embedding_model.py
embedding_model.py
py
2,695
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "models.db.session.query", "line_number": 13, "usage_type": "call" }, { "api_name": "models.EmbeddingModel", "line_number": 13, "usage_type": "argument" }, { "api_name": "mode...
378045208
import pandas,math,numpy, time from bokeh.layouts import gridplot, row, column from bokeh.io import output_file, show from bokeh.plotting import figure start = time.time() SData = pandas.read_excel('../../Final Data/Sensor Data.xlsx') MData = pandas.read_excel('../../Final Data/Meteorological Interpolated.xlsx') Fac...
null
code_and_data/PersonalFiles/Hidde/functions/plotter.py
plotter.py
py
7,677
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "lin...
327717391
def openTrainedModel(modelPath="../models/dummy.txt"): try: f = open(modelPath,"rb") return f # Do something with the file except IOError: print("The {} not accessible".format(modelPath)); return None def retFileName(pathToFile="../data/dummy.csv"): parsed = pathToF...
null
DistrictSchoolPerformancePrediction/spring 2021/thinkSmart_SWE_CSCE606_2021_Spring-20210503T230755Z-001/thinkSmart_SWE_CSCE606_2021_Spring/source_code0.01/src/learn.py
learn.py
py
3,516
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 56, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "line_number": 62, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
53654544
from __future__ import print_function import sys import os import math import random import numpy as np import progressbar import gym from sklearn.datasets import fetch_mldata # Import helper functions from mlfromscratch.utils.data_manipulation import to_categorical from mlfromscratch.utils.optimizers import Adam fro...
null
mlfromscratch/reinforcement_learning/deep_q_learning.py
deep_q_learning.py
py
5,812
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.make", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 65, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 65, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", ...
173654681
import numpy as np from keras import backend as K from keras.layers.normalization import BatchNormalization from keras.models import Model from keras.layers import Input, Flatten, Dense, Lambda, Concatenate from keras.layers import Convolution2D, Activation, MaxPooling2D from keras.optimizers import Adam, Adadelta, S...
null
common/custom_vgg_bn.py
custom_vgg_bn.py
py
5,171
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.backend.image_data_format", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 26, "usage_type": "name" }, { "api_name": "keras.layers.Concatenate", "line_number": 50, "usage_type": "call" }, { "api_name":...