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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25632516559 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = 'CwT'
import logging
from bs4 import BeautifulSoup
from urllib.parse import urljoin
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
def extract_form_fields(soup):
"""Turn a BeautifulSoup form in to a dict of fields and default valu... | futurelighthouse/crawler_sqlmap | crawler/util/findPageForm.py | findPageForm.py | py | 2,639 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "urllib.parse.ur... |
15228847457 | import numpy as np
import scipy as sp
'''
Given a flattened stack of n dxd matrices, computes the transpose operator
that, when applied to this stack, returns another flattened stack of n dxd transposed versions
of the original matrices.
Assumes column-major flattening.
'''
'''
1x 1y
1z 1w
2x 2y
2z 2w
3x 3y
3z 3w
... | otmanon/fast_cody | src/fast_cody/vectorized_transpose.py | vectorized_transpose.py | py | 1,023 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_nu... |
11670746683 | # See https://www.codingame.com/ide/puzzle/code-royale
import sys
from collections import defaultdict
from dataclasses import dataclass
from enum import Enum
from itertools import count
from typing import NamedTuple, Optional, Iterable
from math import dist, hypot
def debug(*args):
print(*args, file=sys.stderr, ... | bdaene/codingame | puzzles/code-royale.py | code-royale.py | py | 6,154 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stderr",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.NamedTuple",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_num... |
31141138842 | import json
def mbpp_sanitized():
with open("/home/ICTDOMAIN/d20126116/Datasets/MBPP/sanitized.json") as file:
rows = json.load(file)
return rows
def few_shot_mbpp(test_instance, training_instances):
prefix_and_prompt = ""
for instance in training_instances:
for line in instance["pr... | jjjmillist/ttc-workbench | data.py | data.py | py | 1,049 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
}
] |
9166227627 | import random
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from create_tables import Player, Spin, History
engine = create_engine('sqlite:///slots_game.db')
Session = sessionmaker(bind=engine)
def pull_lever():
symbols = [5, 6, 7, 8, 9]
result = [random.choice(symbols) for _ in... | wangozz/SLOTS | slots_game.py | slots_game.py | py | 1,844 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "crea... |
74636476988 | import unittest
import ast
import astpretty
from h2p.hast import (
HExpression,
HApplication,
HValue,
HVariable,
HNumber,
HListEnumeration,
HListComprehension,
HListComprehensionProduction,
HListComprehensionCondition,
HRange,
... | Afoucaul/h2p | test/test_transpiler.py | test_transpiler.py | py | 3,157 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "h2p.hast.transpiler.transpile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "h2p.hast.transpiler",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "h2p.hast",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "ast.A... |
39945812924 | import torch
import torch.nn as nn
_device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class Generator(nn.Module):
def __init__(self, config):
super().__init__()
self.z_size = config['z_size']
self.use_bias = config['model']['G']['use_bias']
self.model = nn.Seq... | MaciejZamorski/3d-AAE | models/aae_bin.py | aae_bin.py | py | 3,258 | python | en | code | 64 | github-code | 6 | [
{
"api_name": "torch.device",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
... |
38431824386 | # -*- coding: utf-8 -*-
import sys
import os
import glob
import cv2
import numpy as np
import json
#---below---imgaug module
import imgaug as ia
import imgaug.augmenters as iaa
from imgaug.augmentables import Keypoint, KeypointsOnImage, BoundingBox, BoundingBoxesOnImage
import io
from labelme import utils
from labelme... | HelloSZS/Common-tools_FOR_Object-detection | voc_data_aug_v5不稳定版本.py | voc_data_aug_v5不稳定版本.py | py | 20,430 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "labelme.utils.apply_exif_orientation",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "la... |
20803291 | #!flask/bin/python
import sys, os
sys.path.append(os.path.abspath(os.path.join('..', 'utils')))
from env import AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY, AWS_REGION, PHOTOGALLERY_S3_BUCKET_NAME, RDS_DB_HOSTNAME, RDS_DB_USERNAME, RDS_DB_PASSWORD, RDS_DB_NAME, SERVER_HOSTNAME
from flask import Flask, jsonify, abort, request... | sahmed85/AWSEC2PhotoGalleryApp | SQL/app.py | app.py | py | 27,643 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
42214833305 | import global_variable as glv
import multiprocessing as mp
from data import queueDictInit
from multiprocessing import Pipe
from multiBar import *
from collections import defaultdict
from Bhive import *
from llvm_mca import *
from OSACA import *
from collections import defaultdict
class Process(mp.Process):
def __i... | Kirrito-k423/DynamoRIO-basicBlock-collection | src/multiProcess.py | multiProcess.py | py | 6,964 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "multiprocessing.Process",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.Process.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 14,
"usage_type": "attribute"
},... |
27031878814 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 7 16:15:06 2018
@author: ykarpitski
"""
data = [
{'age': 33, 'sex': 'F', 'BP': 'high', 'cholesterol': 'high',
'Na': 0.66, 'K': 0.06, 'drug': 'A'},
{'age': 77, 'sex': 'F', 'BP': 'high', 'cholesterol': 'normal',
'Na': 0.19, 'K': 0.03, 'drug': 'D'}... | kry8056/test_python | text_ml_ex1.py | text_ml_ex1.py | py | 3,470 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 54,
"usage_type": "name"
},
{
"api_na... |
70827766587 | import datetime
from datetime import datetime as dt
import imageio
import glob
Bucket_name = "googletrafficmap"
yesterday = dt.now() - datetime.timedelta(days=1)
prefix = yesterday.strftime("%Y%m%d") + "/"
gif_name = yesterday.strftime("%Y%m%d")
#folder = dt.now().strftime("%Y%m%d")
folder = "image list"
pa... | nathan36/GoogleTrafficMap-GIF | GoogleTrafficMap-GIF/createGIFlocal.py | createGIFlocal.py | py | 880 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "glob.glob",
... |
10279860661 | import os
import time
import json
import pynvml
if __name__ == '__main__':
start_time = time.strftime("%m-%d %H : %M : %S", time.localtime(time.time()))
print(start_time)
str = [
"python ./train5.py",
"python ./eval.py"
]
k = 0
while (k < len(str)):
pynvml.nvmlInit()... | Chen-Yang-Liu/MLAT | run.py | run.py | py | 1,082 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "time.strftime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pynvml.nvmlInit",
"line_numbe... |
39476644525 | from py2neo import Graph,Node
import json
'''导入120 手术数据'''
# graph = Graph(
# host="127.0.0.1", # neo4j 搭载服务器的ip地址,ifconfig可获取到
# http_port=7474, # neo4j 服务器监听的端口号
# user="neo4j", # 数据库user name,如果没有更改过,应该是neo4j
# password="123")
# graph = Graph(
# ... | zhang8929/zhangyuguang | zhangyuan/db/import_data/import_120_surgery.py | import_120_surgery.py | py | 7,830 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "py2neo.Node",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "py2neo.Node",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "py2neo.Node",
"line_number":... |
2594786279 | from brownie import network
from scripts.helpful_scripts import (
LOCAL_BLOCKCHAIN_ENVIRONMENTS,
get_account,
get_contract,
)
from scripts.deploy import deploy_token_farm_and_dapp_token
import pytest
def test_stake_and_issue_correct_amounts(amount_staked):
if network.show_active() in LOCAL_BLOCKCHAIN_... | thomas192/brownie-defi-stake-yield | tests/integration/test_token_farm_integration.py | test_token_farm_integration.py | py | 1,596 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "brownie.network.show_active",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "brownie.network",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "scripts.helpful_scripts.LOCAL_BLOCKCHAIN_ENVIRONMENTS",
"line_number": 12,
"usage_type": "nam... |
41958021648 | from PIL import Image
def get_frames(env, policy_fn):
reward_sum = 0
frame_list = []
i = 0
env.reset()
for agent in env.agent_iter():
observation, reward, done, info = env.last()
reward_sum += reward
if done:
action = None
else:
action = pol... | ezxzeng/syde750_waterworld | utils.py | utils.py | py | 545 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.fromarray",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 21,
"usage_type": "name"
}
] |
8028707376 | #!/usr/bin/env python
"""
Written for python 2.7 or later. Needs pysam package
Report the coverage of reads for each BED entry. Reads that partially overlap the BED entry are also counted. By default, the coverage is normalized to total number of mapped reads. The scaling factor is dependent on the file with least se... | sachingadakh/pyR | pythonscripts/bam_coverageT.py | bam_coverageT.py | py | 7,712 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "argparse.FileType",
"line_number": 35,
"usage_type": "call"
},
{
... |
30997998630 | import requests
from vk_api.keyboard import VkKeyboardColor, VkKeyboard
import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
import random
from city_exist import city_exist
from data import db_session_cities, db_session
from data.cities import City
from data.users import User
from data.games impo... | brrr-ali/vk-bot | app.py | app.py | py | 10,516 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "vk_api.VkApi",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "token_vk.TOKEN",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "vk_api.bot_longpoll.VkBotLongPoll",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.... |
30947609477 | from django.shortcuts import render
from election.models import Election
# Create your views here.
def election(request):
if request.method == "POST":
obj=Election()
obj.ndate= request.POST.get("nomd")
obj.wdate= request.POST.get("withd")
obj.edate= request.POST.get("ed")
obj... | samueljazzjohn/Biometric_Authentication_based_voting | Python/bio_auth/election/views.py | views.py | py | 378 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "election.models.Election",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
}
] |
22560579599 | from flask import abort
from .snmp_device import SNMP_Device
class SwitchDB():
_switches = {}
def __init__(self):
pass
def init_app(self, app):
# if self._initialized: return
self._switches = {}
if 'SWITCHES' in app.config:
for switchname, values in app.config... | jkur/snmp-manager | app/services/snmp_db.py | snmp_db.py | py | 1,748 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "snmp_device.SNMP_Device",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.abort",
"line_number": 26,
"usage_type": "call"
}
] |
18865805348 | #####################################################################
# This program deals with AC classification.
# 1. It reads file with elements which classification you want to fix.
# 2. Reads Classification mapping file (where you write mapping between AC element type and AC classification items)
# 3. Script try t... | dradomtsev/AC-Automate | ChecknFixClassification/AC-AUT-FixClassification.py | AC-AUT-FixClassification.py | py | 6,523 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "types.SimpleNamespace",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
4151405820 | import aiohttp
import gpt
import eleven
import moviepy.editor as mov
import json
image_path = 'images/'
audio_path = 'audio/'
output_path = 'output/'
current_eleven_requests = 0 # max 3 concurrent
max_concurrent_eleven_requests = 3
current_gpt_requests = 0 # max 10? concurrent
max_concurrent_gpt_reques... | cwiley-dev/gpt-mov | Sequence.py | Sequence.py | py | 11,563 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.JSONDecodeError",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "eleven.async_tts",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "gpt.async_dalle"... |
35085114615 | import cv2
from hyperlpr import *
def detect(image):
# 定义分类器
cascade_path = 'cascade.xml'
cascade = cv2.CascadeClassifier(cascade_path)
# 修改图片大小
resize_h = 600
height = image.shape[0]
scale = image.shape[1] / float(height)
image = cv2.resize(image, (int(scale * resize_h), resize_h))
... | Hosimizu/txfx | pai.py | pai.py | py | 1,089 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2GRAY",
... |
26537384066 | import matplotlib.pyplot as plt
import numpy as np
import os
PI=3.14159265358979323
x2=[]
y2=[]
x3=[]
y3=[]
x2 , y2 = np.loadtxt('corrections.txt', delimiter=' ', unpack=True)
x3 , y3 = np.loadtxt('no_corrections.txt', delimiter=' ', unpack=True)
T_c = np.loadtxt('temp_c.txt');
T_nc =np.loadtxt('temp_nc.txt');
fig... | steinhor/best_sampler | test_run/fcomp.py | fcomp.py | py | 773 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.loadtxt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_n... |
21356514074 | # coding=utf-8
# 用于爬取各个小区的租房成交记录
import os
import pandas as pd
from selenium.webdriver.support.wait import WebDriverWait
from selenium import webdriver
import numpy as np
import _thread
def sub_rental_list_func(driver,communityidlist,filetowrite,province,lock):
web_outcome = 'https://' + province + '... | Catherinecode/spider_house | houseinfo_thread/houseinfo_5_thread.py | houseinfo_5_thread.py | py | 7,225 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.support.wait.WebDriverWait",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 91,
"usage_type": "attribute"
},
{
"api_nam... |
5034538314 | from selenium import webdriver
from discord.ext import commands
from .utils import checks
import asyncio
import discord
import challonge
import json
def load_challonge_urls():
with open('challongeurls.json') as c:
return json.load(c)
class Challonge:
""" Commands that are used from Challonge. """
... | louissmokesbackwoods/Inkxbot | Inkxbotcogs/ChallongeCog.py | ChallongeCog.py | py | 2,707 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "challonge.set_credentials",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "discord.utils.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "discord.utils",... |
29358683033 |
import os
import tempfile
import zipfile
import fnmatch
from urllib import request
from Qt import QtCore, QtWidgets, Qt
import json
import ts2
from ts2.utils import settings
from ts2.gui import widgets
translate = QtWidgets.qApp.translate
class C:
name = 0
file_name = 1
description = 2
file_path =... | ts2/ts2 | ts2/gui/opendialog.py | opendialog.py | py | 11,892 | python | en | code | 43 | github-code | 6 | [
{
"api_name": "Qt.QtWidgets.qApp",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "Qt.QtWidgets",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "Qt.QtWidgets.QDialog",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "Qt.QtWi... |
18525254107 | from itertools import product
f = open('file6.txt','r')
input = f.read()
str = input.split('\n',1)
num = int(str[1])
str = str[0].replace(' ','')
all = [''.join(s) for s in product(str,repeat=num)]
all = sorted(all)
print(*all,sep='\n')
| typek22/Introduction-to-bioinformatics | 14 Enumerating k-mers Lexicographically.py | 14 Enumerating k-mers Lexicographically.py | py | 255 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.product",
"line_number": 9,
"usage_type": "call"
}
] |
72132444027 | import numpy as np
import cv2
import os
from PIL import Image
import glob
def process():
counter =0;
for filename in glob.glob("../src/words/*.png"):
img=Image.open(filename)
#img=cv2.cvtColor(image,cv2.IMREAD_GRAYSCALE)
# increase contrast
pxmin = np.min(img)
pxmax = np.max(img)
temp=img-pxmin
imgCont... | FaiqaIftikhar/AI-Project | src/preprocessTextImage.py | preprocessTextImage.py | py | 577 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.min",
"line_number": 13,
... |
30405380864 | import pygame as pg
import sys,math,time,os
#セーブデータの読み込み
savepath="game_make\savedate\main_save" #セーブデータのパス
if os.path.isfile(savepath) == False:
with open(savepath, 'w', encoding='utf-8') as f_main:
f_main.write('money 0')
f_main.write('hit 0')
with open(savepath, 'r', encoding='utf-8')... | mikeneko-cat/kimagure | game_make_blockbreak/burokku kuzusi.py | burokku kuzusi.py | py | 8,243 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"... |
20331893009 | import random
import math
import utils
import itertools
def getAllCombinations(lista):
combinations = []
for r in range(len(lista)+1):
for combination in itertools.combinations(set(lista), r):
combinations.append(combination)
return combinations
def are_coprime(a,b):
hcf = 1
... | Laccer01/Kriptografia | assign3/Merkle-Hellman-Knapsack.py | Merkle-Hellman-Knapsack.py | py | 4,310 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "itertools.combinations",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_... |
19042788589 | import logging
import json
import django.dispatch
from django.contrib import messages
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from allauth.socialaccount.models import SocialToken
from requests_oauthlib import OAuth1Session, OAuth2Session
from builds import utils a... | adrianmugnoz/Documentacion-Divulgame | readthedocs/projects/signals.py | signals.py | py | 3,736 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.dispatch.dispatch.Signal",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.dispatch.dispatch",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.dispatch",
"line_number": 14,
"usage_type": "name"
},
{
"api... |
22458806138 | import math
import warnings
import collections
# Krasovsky 1940 ellipsoid
# @const
GCJ_A = 6378245
GCJ_EE = 0.00669342162296594323 # f = 1/298.3; e^2 = 2*f - f**2
# Epsilon to use for "exact" iterations.
# Wanna troll? Use Number.EPSILON. 1e-13 in 15 calls for gcj.
# @const
PRC_EPS = 1e-5
# Baidu's artificial deviat... | Artoria2e5/PRCoords | py/prcoords.py | prcoords.py | py | 5,440 | python | en | code | 125 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.hypot",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "math.asin",
"line_numb... |
18211487124 | #!/usr/bin/env python3
import argparse
import sys
import os
import re
import glob
import subprocess
import json
import pandas as pd
from collections import defaultdict
from lib.six_frame_translation import six_frame_translate, extract_frame_aa, codon2aa
from lib.file_io import get_seq_content
from lib.file_utils import... | sanger-bentley-group/GBS-Typer-sanger-nf | bin/process_res_typer_results.py | process_res_typer_results.py | py | 12,678 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 154,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 166,
"usage_type": "call"
},
{
"api_na... |
32368478237 |
from pyecharts.charts import Map
import pandas as pd
from pyecharts import options as opts
df = pd.read_csv('./pneumoniaView/data.csv' ,encoding='utf-8')
# print(df)
china_map = (
Map()
.add('现有确诊',[list(i) for i in zip(df['area'].values.tolist(),df['curConfirm'].values.tolist())],'china')
.set_global_op... | ALIEN-orBoT/spider | pneumoniaView/map.py | map.py | py | 506 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyecharts.charts.Map",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyecharts.options.TitleOpts",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyech... |
22603113926 | import yfinance as yf
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
st.write("""
# Shown here are the stock closing price and volume of Google
The text is written in markdown style you can use a cheat sheet
to find all the characters
The # creates... | Henrysua12/Streamlit | myApp.py | myApp.py | py | 1,054 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.write",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "yfinance.Ticker",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "streamlit.line_chart",... |
23242252430 | from flask import Flask
from config import Config
from flask_migrate import Migrate
from flask_cors import CORS
from app.database import db, create_tables
import logging
import os
from flask_graphql import GraphQLView
# from .graphql import schema
from .graphql import schema
def initialize_weather_api(app... | NEECIST/neec-hub | backend/app/__init__.py | __init__.py | py | 1,297 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.database.register_blueprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "weather_api.bp",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "app.database",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "app.d... |
33056332875 | import openai
with open("keys.txt") as f:
# converting our text file to a list of lines
lines = f.read().split('\n')
# openai api key
openai.api_key = lines[0]
# discord token
DISCORD_TOKEN = lines[1]
# close the file
f.close()
response = openai.Image.create(
prompt="a beautiful London spring day, vintage vib... | katsully/chatgpt-discord-bot | 07_DallE.py | 07_DallE.py | py | 422 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "openai.api_key",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "openai.Image.create",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "openai.Image",
"line_number": 13,
"usage_type": "attribute"
}
] |
74866671228 | from typing import Callable
from uuid import uuid4
from xmlrpc.client import Boolean
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import gettext as _
from rest_framework.authtoken.models import Token
from core.consts import SocialMediaType, SocialMediaShareTyp... | alimahdiyar/brightidsocial | core/models.py | models.py | py | 4,263 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.db.models.UUIDField",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
3847349740 | import matplotlib
matplotlib.use('Agg')
import numpy as np
# import tinyarray
import matplotlib.pyplot as plt
from scipy.sparse import spdiags
from scipy.sparse import eye
from scipy.sparse import kron
from scipy.sparse.linalg import inv
from scipy.sparse import csc_matrix
from functools import partial
from scipy.inter... | hainingpan/nanowire_matlab | Ldos_dis_parallel.py | Ldos_dis_parallel.py | py | 9,060 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number"... |
42482270299 | from typing import Callable, List, Tuple
import matplotlib.pyplot as plt
import numpy as np
def plotas(x:float, y:float, z:float):
return x+y+z == 1
def turis(x:float, y:float, z:float):
return (x * y * z / 8) * -1
def gauti_z(x:float, y:float):
return 1 - x - y
def f(x:float, y:float):
z = gauti_... | Dizgog/UNI_CODE | 3_kursas/Optimizavimai metodai/Antras/Antras_Lab_Darbas/2_lab.py | 2_lab.py | py | 8,125 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "numpy.linalg.nor... |
14154238073 | import os, pygame
from pygame.locals import *
from DynamicRect import *
### Variables ###
# Position where the Window opens
WindowPosX = 0
WindowPosY = 30
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (WindowPosX, WindowPosY)
pygame.init()
# InfoObject to get the width and height of the monitor
inf... | ixahedron/pyortal | Level_Editor/LevelEditor.py | LevelEditor.py | py | 2,911 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display.Info",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display",
... |
19797992641 | from contextlib import contextmanager
from aiohttp import web
from aegis.routes import make_me_route, make_auth_route
class MockAuthenticator:
"""
MockAuthenticator has an almost identical API to default
authenticator classes. You can use this authenticator in your unit tests
to bypass the authentic... | mgurdal/aegis | aegis/test_utils.py | test_utils.py | py | 2,903 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "aiohttp.web.Request",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.web",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "aiohttp.web.middleware",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "aioh... |
12343316690 | # Importing Required Modules
from flask import Flask, render_template
from flask_login import LoginManager
from os import environ
from Models.userModel import Users
from blueprints.register import signup
from blueprints.adminlogin import admin
from blueprints.emplogin import employee
from blueprints.login import logged... | Atulpratapsingh67/Flask_app | app.py | app.py | py | 1,306 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "blueprints.register.signup",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "blueprints.adminlogin.admin",
"line_number": 17,
"usage_type": "argument"
},
{
"api_na... |
40551027904 | # import the libraries
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.bash import BashOperator
# from airflow.utils.dates import days_ago
# defining DAG arguments
# You can override them on a per-task basis during operator initialization
default_args = {
'owner': 'Nuttawic... | nuttawich/airflow_docker | dags/our_first_dag_v1.py | our_first_dag_v1.py | py | 1,301 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.timedelta",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "airflow.operators.ba... |
7809195191 | import os
import re
import json
import math
import subprocess
import torch
import torch.nn as nn
import pandas as pd
import numpy as np
import sys
from os.path import dirname, realpath
# Add root directory to path
file_path = realpath(__file__)
file_dir = dirname(file_path)
parent_dir = dirname(file_dir)
root_dir = di... | DanCunnington/FFNSL | examples/follow_suit/test_unstructured_data_without_problog.py | test_unstructured_data_without_problog.py | py | 11,365 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.realpath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
... |
9513684171 | import time
import cv2
import play
from finger_recognize import finger_detect
import gui_and_key_adjust
from gui_and_key_adjust import key_sta
#定义finger字典,存储指尖坐标信息
finger = {}
#初始化摄像头
cap=cv2.VideoCapture(0)
cap.set(3,800) #设置分辨率
cap.set(4,600)
#播放控制数组
play_buf = [0,0,0,0,0,0,0]
#img_path = "orignal.jpg"
while Tru... | techHappyWater/Visual_Piano | visual_piano.py | visual_piano.py | py | 1,175 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "finger_recognize.finger_detect",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.flip",... |
18152885521 | """."""
# -*- coding: utf-8 -*-
from datetime import datetime
import numpy as np
import cv2
import math
import imutils
import pathlib
from functools import lru_cache
from typing import Tuple, Union, List, Iterable, cast # , Any, NewType, TypeVar
from typing import Optional as Opt
from mytypes import imageType, contou... | Yobmod/dmltests | ML/dmlutils.py | dmlutils.py | py | 7,584 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "mytypes.imageType",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "mytypes.imageTyp... |
71313432187 | import pyautogui
import threading
class ButtonLocate():
def __init__(self,log):
self.log = log
self.btn = None
self.w = "./assets/w.jpg"
self.a = "./assets/a.jpg"
self.s = "./assets/s.jpg"
self.d = "./assets/d.jpg"
self.space = "./assets/space.jpg"
se... | leekycauldron/vampEscapev2 | utils/btn_locate.py | btn_locate.py | py | 2,481 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pyautogui.locateOnScreen",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 59,
"usage_type": "call"
}
] |
5449252810 | import os
from setuptools import setup
__version__ = '0.3'
setup(
name = 'TracMikenekoTheme',
version = __version__,
description = 'Mikeneko theme for Trac and ThemeEnginePlugin.',
url = 'https://github.com/t-kenji/trac-mikeneko-theme',
keywords = 'trac plugin theme',
classifiers = ['Framework... | t-kenji/trac-mikeneko-theme | setup.py | setup.py | py | 909 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
}
] |
14187123386 | from typing import List
class Solution:
def get_letter_stat(self, word):
output = {}
for letter in word:
if letter not in output:
output[letter] = 1
else:
output[letter] += 1
return output
def groupAnagrams(self, strs: List[str])... | DanilaLabydin/Competitive-Programming | src/Leetcode/49_group_anagrams.py | 49_group_anagrams.py | py | 2,324 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 48,
"usage_type": "name"
}
] |
50568071 | # 675. Cut Off Trees for Golf Event
from typing import *
from collections import deque
class Solution:
def cutOffTree(self, forest: List[List[int]]) -> int:
dirs = [[-1, 0], [0, -1], [1, 0], [0, 1]]
def bfs(m, n, start, end):
q = deque([(start, 0)])
visited = set()
... | code-cp/leetcode | solutions/675/main.py | main.py | py | 1,434 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
72102759869 | import numpy as np
from sklearn import preprocessing, utils
from .basevectorizer import BaseVectorizer
from ..utils import _validation
class OneHotVectorizer(BaseVectorizer):
"""Vectorizer for categorical values.
One-hot encoding using scikit-learn's :class:`OneHotEncoder`.
Parameters
----------
... | arsarabi/jsonvectorizer | jsonvectorizer/vectorizers/onehotvectorizer.py | onehotvectorizer.py | py | 3,636 | python | en | code | 25 | github-code | 6 | [
{
"api_name": "basevectorizer.BaseVectorizer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utils._validation.check_positive",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "utils._validation",
"line_number": 38,
"usage_type": "name"
},
{
"a... |
72531977789 | """
Showcases/tests an example of long running tasks.
How these tests works:
- setup a FastAPI server and launch it in the background.
- client directly makes requests to the FastAPI background client.
"""
# pylint: disable=redefined-outer-name
import asyncio
import json
from typing import AsyncIterator, Awaitable,... | ITISFoundation/osparc-simcore | packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks.py | test_long_running_tasks.py | py | 11,274 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "typing.Final",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "servicelib.fastapi.long_running_tasks.server",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "servicelib.fastapi.long_running_tasks",
"line_number": 34,
"usage_type": "... |
16512730604 | from django import forms
# choices de la busqueda
REGION_STATUS = [
(0,"Región"),
(1,'Reg. Antofagasta'),
(2,'Reg. Araucanía'),
(3,'Reg. Bernardo OHiggins'),
(4,'Reg. Bío-Bío'),
(5,'Reg. Coquimbo'),
(6,'Reg. Los Lagos'),
(7,'Reg. Maule'),
(8,'Reg. Metropolitana'),
(9,'Reg. Ñubl... | MatCodee/app-real-state | service/forms.py | forms.py | py | 1,012 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.Form",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "django.forms.ChoiceField",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "django.f... |
31664763484 | import cv2
import os
import numpy as np
from Settings import Settings as s
from Tools import *
def Find_Numbers(mask,image):
cnts = Get_Contours(mask)
letters = []
for c in cnts:
x,y,w,h = cv2.boundingRect(c)
# Get crop and resize
crop = mask[y:y+h,x:x+w]
crop = cv2.resize(... | Winter979/SignPerception | Task1.py | Task1.py | py | 2,691 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.boundingRect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_num... |
75051706748 | # -*- coding: utf-8 -*-
r"""
Main module for testing and debugging the MalGAN implementation.
:version: 0.1.0
:copyright: (c) 2019 by Zayd Hammoudeh.
:license: MIT, see LICENSE for more details.
"""
import argparse
import pickle
import sys
from typing import Union
from pathlib import Path
import nump... | ZaydH/MalwareGAN | main.py | main.py | py | 6,130 | python | en | code | 40 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "malgan.BlackBoxDetector.Type.names",
"line_number": 59,
"usage_type":... |
21246307514 | import os
import pickle
import pandas as pd
import click
import json
from sklearn.naive_bayes import GaussianNB
@click.command("train")
@click.option("--input-dir")
@click.option("--models-dir")
def validate(input_dir: str, models_dir: str):
data = pd.read_csv(os.path.join(input_dir, "data_val.csv"))
target =... | made-ml-in-prod-2021/anirill | airflow_ml_dags/images/airflow-validate/validate.py | validate.py | py | 678 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line... |
22777807790 | import cv2
import mediapipe as mp
def process_img(image, face_detection):
img_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
out = face_detection.process(img_rgb)
if out.detections is not None:
for detection in out.detections:
location_data = detection.location_data
... | vigilante23/OpenCv_Basics | faceBlur.py | faceBlur.py | py | 980 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.cvtColor",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.blur",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_num... |
31240889488 | #!/usr/bin/env python
# coding: utf-8
"""
Some sampling work for data
"""
# Author: Geel
import pdb
import pandas as pd
from pandas import DataFrame
# from .basic import BasicStatis
from .base import BaseSampler
from ..statistic.base import BaseItemStatis
from ..utils import coder
__all__ = ["ItemSampler"]
def _g... | geelisready/washer | rebuild/sample/data.py | data.py | py | 1,902 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "base.BaseSampler",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "statistic.base.BaseItemStatis",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "utils.coder.codeToStr",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_nam... |
13588423580 | ############## IMPORT MODULES ######################
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import cross_val_score
from sklearn import linear_model
from sklearn.model_selection import train_test_split
import numpy as np # linear algebra
import pandas as pd # data processing, CSV fi... | SchlossLab/Topcuoglu_ML_mBio_2020 | code/testing/test_DecisionTree.py | test_DecisionTree.py | py | 4,698 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "pandas.read_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sklearn.model_select... |
7782228007 | import sys
import pygame
import json
from bullet import Bullet
from alien import Alien
from time import sleep
def read_config(stats):
"""
read the config and set them
"""
with open('config.json', 'r') as f_obj:
settings = json.loads(f_obj.read())
stats.high_score = settings["high_score"... | fghnntp/pythonPracticeProject | AlianInvadation/game_functions.py | game_functions.py | py | 8,192 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.event.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.event",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pygame.QUIT",
"line... |
16546054257 | import os
import numpy as np
import PIL.Image as image
import random as ran
import cv2
dir = "bgpic"
x = 1
for filename in os.listdir(dir):
# print(filename)
bgpic = image.open("{0}\{1}".format(dir, filename))
bgpic_convert = bgpic.convert("RGB")
# shape = np.shape(bgpic)
# print(sha... | nuisttlj/AI_study | MyTest01/make_picsource.py | make_picsource.py | py | 1,296 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.random.randint",
"line_... |
75241447548 | from functools import wraps
def x2ms_func_decorator(*required_type, origin_mapping_func=''):
def x2ms_fun_decorator(func):
@wraps(func)
def wrapper(input_obj, *args, **kwargs):
# check input_obj is whether the required_type
if isinstance(input_obj, super) and isinstance(inp... | Gufrannn/W-MAE | MindSpore/x2ms_adapter/core/decorator.py | decorator.py | py | 807 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "functools.wraps",
"line_number": 6,
"usage_type": "call"
}
] |
26248061186 | import six
from oslo_config import cfg
from oslo_log import log
from delfin import db
from delfin import exception
from delfin.common.constants import TelemetryJobStatus, TelemetryCollection
from delfin.db.sqlalchemy.models import FailedTask
from delfin.db.sqlalchemy.models import Task
from delfin.i18n import _
from d... | sodafoundation/delfin | delfin/task_manager/scheduler/schedulers/telemetry/failed_performance_collection_handler.py | failed_performance_collection_handler.py | py | 4,841 | python | en | code | 201 | github-code | 6 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "oslo_config.cfg.CONF",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "oslo_co... |
4109632921 | from discord.ext import commands
import discord, aiohttp
import random, string, time
import datetime
import aiomysql
import config
import os
class Donator:
def __init__(self, bot):
self.bot = bot
async def execute(self, query: str, isSelect: bool = False, fetchAll: bool = False, commit: bool = False)... | cambobot-kh/NekoBotRewrite | modules/donator.py | donator.py | py | 10,400 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "aiomysql.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "config.dbpass",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "string.ascii_letters",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "string.... |
7175627675 | import sys
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from imblearn.over_sampling import SMOTE
from collections import Counter
from keras.models import Sequential
from keras.layers import Dense
from sklearn.model_selection import train_test_split
from sklearn.prepr... | SamIp-ac/Code_Base_Period2_heartdisease | Heart/Heart_DNN.py | Heart_DNN.py | py | 4,010 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.isnan",
"line_numbe... |
73832075386 | """Setup script for qt-range-slider"""
import os.path
import setuptools
# The directory containing this file
HERE = os.path.abspath(os.path.dirname(__file__))
# The text of the README file
with open(os.path.join(HERE, "README.md")) as fid:
README = fid.read()
# This call to setup() does all the work
setuptools.set... | introkun/qt-range-slider | setup.py | setup.py | py | 994 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.path.dirname",
... |
38745803879 | import docx
from docx.shared import Pt
from docx.shared import RGBColor
from docx.shared import Inches
import time
from docx2pdf import convert
def Resume_Generator(resume,template_no,has_pic):
k=0;
#doc=f"Z://Resume_builder//templates//resume_templates//template{template_no}.docx";
document=docx.Document(f... | Batty-sk/Django | Resume_builder/user_details/web_app.py | web_app.py | py | 2,826 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "docx.Document",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "docx2pdf.convert",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "docx.Document",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "docx.shared.Inches",
... |
25029789776 | from django.shortcuts import render,redirect
from django.contrib.auth import authenticate,login,logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from .models import TodoItem
def todoView(request):
all_todo_items = TodoItem.objects.all()
return rende... | Abhiramcm/todoapp | todolist/views.py | views.py | py | 1,872 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.TodoItem.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.TodoItem.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.TodoItem",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": ... |
38949479849 | # TODO: [x] Try 192.168.1.61:8000 first. If that doesn't work, then use
# 67.182.23.160
# TODO: [x] Toggle LED (button byte = 2) on face button push.
# TODO: [x] LIFO queue for faster polling...?
# TODO: [x] Set static IP for RPi.
# TODO: [x] Add exponential sensitivity curve.
import binascii
from struct imp... | Subsearesearch/2017-pi | controller.py | controller.py | py | 5,391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "steamcontroller.SCButtons.... |
3360777158 | import torch
class TargetEnhancedLoss(torch.nn.Module):
def __init__(self):
super(TargetEnhancedLoss,self).__init__()
def forward(self,feature1,feature2,gt):
fusion=feature1*feature2
return torch.nn.MSELoss()(fusion,gt)
class TaskFusionLoss(torch.nn.Module):
def __init__(self,subs... | Dootmaan/PFSeg | loss/TaskFusionLoss.py | TaskFusionLoss.py | py | 1,223 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "torch.nn",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.MSELoss",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number... |
15046731719 | from typing import Sequence
import pandas as pd
import os
import datetime
def WaitForText():
""" Waiting for user input string
:input: input string
:return: textToWrite string
"""
textToWrite = input("Write text: ")
answer = input("Are you sure you want to write it? y/n").strip().lower()
i... | hganchev/python-learning | excell-read-write/Main.py | Main.py | py | 1,471 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_numbe... |
10247852415 | #-*- coding: utf-8 -*-
"""Search for volumes/issues and fetch metadata for them on ComicVine
"""
import logging
from re import IGNORECASE, compile
from typing import List, Union
from aiohttp import ClientSession
from aiohttp.client_exceptions import ContentTypeError
from bs4 import BeautifulSoup
from requests import... | Casvt/Kapowarr | backend/comicvine.py | comicvine.py | py | 15,635 | python | en | code | 221 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 35,
"usage_type": "argument"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "backend.settings.priva... |
19380547720 | import plotly.figure_factory as ff
import numpy as np
import pandas as pd
df_sample = pd.read_csv('countyincome.csv')
values = df_sample['Per capita income'].tolist()
fips = df_sample['County'].tolist()
df_sample = pd.read_csv('countycode.csv')
state = df_sample['State FIPS Code'].tolist()
county = df_sample['C... | JalenYang1998/infsci2415 | main.py | main.py | py | 1,388 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "plotly.figure_factory.create_choropleth",
"line_number": 48,
"usage_type": "call"
},
{
"api_name":... |
10414374223 | from typing import Any
from executorch.exir.capture import (
_capture_legacy_do_not_use,
capture,
capture_multiple,
CaptureConfig,
EdgeCompileConfig,
ExecutorchBackendConfig,
)
from executorch.exir.emit import emit_program, EmitterOutput
from executorch.exir.program import (
_to_edge,
e... | pytorch/executorch | exir/__init__.py | __init__.py | py | 1,440 | python | en | code | 479 | github-code | 6 | [
{
"api_name": "typing.Any",
"line_number": 31,
"usage_type": "name"
}
] |
31536746494 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import json
import os
import re
import sys
import time
import requests
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
from musixmatch import Musixmatch
def get_spotify_client():
client_credentials_manager = SpotifyClientCredentials('YO... | lidor03/lidor03.github.io | code/Python/add_artists_to_json.py | add_artists_to_json.py | py | 7,115 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "spotipy.oauth2.SpotifyClientCredentials",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "spotipy.Spotify",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re... |
72704543228 | import haiku as hk
import jax
import jax.numpy as jnp
from .resnets import ResBlock
class MNIST_CNN_Encoder(hk.Module):
""" CNN Encoder for MNIST (used for VanillaVAE and for amortized drifts) """
def __init__(self, enc_size: int):
super().__init__()
# I think this is also TF tutorial
... | ciupakabra/diffusion-vaes | src/modules/mnist_networks.py | mnist_networks.py | py | 2,804 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "haiku.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "haiku.Sequential",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "haiku.Conv2D",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "jax.nn",
"line_num... |
7965799031 | #https://www.youtube.com/watch?v=JDcvtKsSfxg
from flask import Flask, render_template, request, Response, redirect, send_file, jsonify
import os
from os import remove
import pafy
import moviepy.editor as mp
app = Flask(__name__)
server = app.server
path = os.getcwd() + '..\\Downloads\\'
@app.route('/')
def route():
... | kiwi2899/ytubdowneq4 | app.py | app.py | py | 1,591 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
... |
74436425789 | import cv2
# loading pre-trained data on frontals
train_face_data = cv2.CascadeClassifier('C:\\Users\\etord\\OneDrive\\Desktop\\ME\\Git\Python\\Face_Detector\\haarcascade_frontalface_default.xml') # better safeto use paths
#CascadeClassifier is a detector for classification of you know
# Choosing an image to detect... | Etornyo/Python | Face_Detector/Face_detectwithVideo.py | Face_detectwithVideo.py | py | 2,136 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY... |
1332458092 | from bs4 import BeautifulSoup
import os
import glob
import pandas as pd
import numpy as np
if not os.path.exists("parsed_files"):
os.mkdir("parsed_files")
# df = pd.DataFrame(columns=['scrapping_time','short_name','name','market_cap','price','volume','supply','24H_change'])
df = pd.DataFrame()
#one_file_name = "bo... | Coryjsimpkins/ECON900_ps1 | boardgame_parser.py | boardgame_parser.py | py | 3,391 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number... |
10490789006 | from flask import Flask, render_template, request, redirect
import json
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///trainers.db'
db = SQLAlchemy(app) # link the app to the db
class TrainerPost(db.Model):
id = db.C... | saudabdulaziz/pt | app.py | app.py | py | 1,773 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "d... |
733002307 | import time
from matplotlib import pyplot as plt
from sklearn.metrics import ConfusionMatrixDisplay
def plot_confusion_matrix(cm, classes, title="Confusion Matrix"):
plt.clf()
plt.style.use('default')
fig, ax = plt.subplots(figsize=(12, 12))
disp = ConfusionMatrixDisplay(confusion_matrix=cm, display... | jszachew/genres-classification | src/utils.py | utils.py | py | 1,681 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.clf",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mat... |
7850384537 | import creds
import threading
from fbchat import Client
from fbchat.models import *
from twilio.rest import Client as TwilioClient
def forwardMsg(msg):
tclient.messages.create(
to=creds.twilio['phone'],
from_=creds.twilio['twilio_phone'],
body=str(msg)
)
class CustomClient(Client):
... | sam46/facetwilio | fb2twilio.py | fb2twilio.py | py | 1,048 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "creds.twilio",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "creds.twilio",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "fbchat.Client",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
... |
23041005525 | import csv
import matplotlib.pyplot as plt
import datetime
filename = 'file/sitka_weather_07-2018_simple.csv'
file2 = 'file/goal.txt'
try:
with open(filename) as f:
#reader处理以逗号分隔的第一行数据,并将每项数据存储在列表中
r = csv.reader(f)
header_now = next(r)
#获取最高温
highs,dates = [],[]
da... | chengdegang/testexcel | test_csv.py | test_csv.py | py | 1,336 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "m... |
72109732029 | from Effects import *
from Heroes import *
from Treasures import *
from c_Treasure import Treasure
import itertools
import copy
import random
from Spells import *
from Characters import *
import pandas as pd
import math
from datetime import datetime
import collections
class Player:
def __init__(self, name:str, log... | Luke-Patterson/SBB | Player.py | Player.py | py | 38,529 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.floor",
"line_number": 134,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 269,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 412,
"usage_type": "call"
},
{
"api_name": "c_Treasure.Treasure",
"... |
1777176846 | import os
import math
# Essential Libraries
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# Preprocessing
from sklearn.preprocessing import MinMaxScaler
# Algorithms
from minisom import MiniSom
from tslearn.barycenters import dtw_barycenter_averaging
from tslearn.clustering import TimeSeriesKMe... | yForecasting/LeadingIndicatorIntelligence | analysis.py | analysis.py | py | 3,104 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 33,
"usage_type": "call"
},
{
... |
31272620728 | # -*- coding: utf-8 -*-
"""Image transformation test meant to be run with pytest."""
import sys
import pytest
from confmap import ImageTransform
sys.path.append("tests")
def test_transform():
im=ImageTransform('./examples/sample1.png',2,prefix='./examples/',data=None,
r=0.01,c... | FCoulombeau/confmap | tests/test_transform.py | test_transform.py | py | 604 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "confmap.ImageTransform",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.main",
... |
40298700464 | from .briareo_loader import load_Briareo_data
from .shrec_loader import load_shrec_data
from .fpha_loader import load_FPHA_data
from .data_preprocessing_tools import Graph, Hand_Dataset
import torch
def init_data_loader(dataset_name, data_cfg, sequence_len, batch_size, workers, device):
if dataset_name=="SHR... | WaelRabah/STr-GCN | data_loaders/data_loader.py | data_loader.py | py | 4,113 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "shrec_loader.load_shrec_data",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "briareo_loader.load_Briareo_data",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "fpha_loader.load_FPHA_data",
"line_number": 53,
"usage_type": "call"
},
... |
35009477313 | # This script is to sample sentences
# from seed/exp sentences for pilot study
# Incorrect input (Ground Truth): # of l{i}_model != l{i}_human
# Reported bugs (Approach): # of l{i}_ours != l{i}_model
import re, os
# import nltk
# import copy
import random
import numpy
from typing import *
from pathlib import Path
f... | jasonlee27/alict | python/sa/exp/Humanstudy.py | Humanstudy.py | py | 43,348 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "utils.Utils.Utils.read_json",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "utils.Utils.Utils... |
24184567564 | import argparse
import os
import sys
import pickle
import math
import time
import numpy as np
import yaml
sys.path.append(os.getcwd())
from ego_pose.utils.metrics import *
from ego_pose.envs.humanoid_v1 import HumanoidEnv
from envs.visual.humanoid_vis import HumanoidVisEnv
parser = argparse.ArgumentParser()
parser.a... | marikoisogawa/OpticalNLOSPose | pose/ego_pose/eval_pose.py | eval_pose.py | py | 9,330 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"l... |
26040148326 | from __future__ import annotations
import sys
from collections import defaultdict
from types import SimpleNamespace
from typing import Any
from ruamel.yaml import YAML # pants: no-infer-dep
from ruamel.yaml.compat import StringIO # pants: no-infer-dep
from yamlpath import Processor # pants: no-infer-dep
from yamlp... | pantsbuild/pants | src/python/pants/backend/helm/subsystems/post_renderer_main.py | post_renderer_main.py | py | 4,613 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "ruamel.yaml.YAML",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "ruamel.yaml.compa... |
3525733410 | import errno
import os
import posixpath
from typing import (
TYPE_CHECKING,
Any,
BinaryIO,
Callable,
Dict,
Optional,
Tuple,
)
from fsspec.spec import AbstractFileSystem
if TYPE_CHECKING:
from io import BytesIO
from scmrepo.git import Git
from scmrepo.git.objects import GitTrie... | gshanko125298/Prompt-Engineering-In-context-learning-with-GPT-3-and-LLMs | myenve/Lib/site-packages/scmrepo/fs.py | fs.py | py | 6,938 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "posixpath.sep",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "posixpath.sep",
"line_number": 140,
"usage_type": "attribute"
},
{
"api_name": "os.SEEK_E... |
27213730765 | from itertools import product
def compare(user_id, banned_id):
if len(user_id) != len(banned_id):
return False
for i in range(len(user_id)):
if banned_id[i] == '*':
continue
if user_id[i] != banned_id[i]:
return False
return True
def solution(user_id, ba... | hammii/Algorithm | Programmers_python/불량_사용자.py | 불량_사용자.py | py | 816 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "itertools.product",
"line_number": 27,
"usage_type": "call"
}
] |
30003306612 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Description:
# @File: create_dict.py
# @Project: ip_nlp
# @Author: Yiheng
# @Email: GuoYiheng89@gmail.com
# @Time: 9/16/2019 11:38
import re
from segmenter import segment
from utils import file_utils
brackets_pattern = re.compile(r'\(.*\)')
character_pattern = re.com... | zhenxun815/ip_nlp | src/segmenter/create_dict.py | create_dict.py | py | 3,601 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 18,
... |
24746747979 | # -*- coding: utf-8 -*-
import json
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.conf import settings
from www.misc.decorators import staff_required, common_ajax_response, verify_permission
from www.mi... | lantianlz/zx | www/admin/views_toutiao_article.py | views_toutiao_article.py | py | 4,361 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "www.toutiao.interface.ArticleTypeBase",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.template.RequestContext",
"line_number": 19,
"usage_type... |
7807131958 | import typing
from metagame_balance.rpsfw.Rosters import RPSFWRoster
from metagame_balance.rpsfw.SoftmaxCompetitor import SoftmaxCompetitor
from metagame_balance.rpsfw.battle import RPSFWBattle
from metagame_balance.rpsfw.balance.Policy_Entropy_Meta import PolicyEntropyMetaData
from tqdm import tqdm
class RPSFWEcos... | nianticlabs/metagame-balance | src/metagame_balance/rpsfw/RPSFW_Ecosystem.py | RPSFW_Ecosystem.py | py | 1,402 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "metagame_balance.rpsfw.balance.Policy_Entropy_Meta.PolicyEntropyMetaData",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "metagame_balance.rpsfw.SoftmaxCompetitor.SoftmaxCompeti... |
20416337492 | import keras.backend as K
from klayers.transform import affine_transform, attention_transform, interpolate_gaussian
from klayers.transform import SpatialTransform
def rot_scale_matrix(angle, scale, trans):
import numpy as np
rot_mat = np.array([[np.cos(angle), -np.sin(angle)],
[np.sin(... | taimir/keras-layers | klayers/transform/spatial_transform_test.py | spatial_transform_test.py | py | 3,000 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 9,
"u... |
11260734261 | import pyttsx3
import datetime
mytime = datetime.datetime.now()
if int(mytime.hour) < 12:
print('Good morning')
engine = pyttsx3.init()
engine.setProperty('rate',130)
# engine.say('The quick brown fox jumped over the lazy dog.')
# voices = engine.getProperty('voices')
# for voice in voices:
# print("Voice:... | KryptonB/automation | voice test/voice.py | voice.py | py | 1,229 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pyttsx3.init",
"line_number": 9,
"usage_type": "call"
}
] |
26089022940 | from django.shortcuts import render
from crud import models
from django.http import HttpResponse,HttpResponseRedirect
from crud.forms import NewBookForm,SearchForm
def searchBook(request):
form =SearchForm()
res = render(request,'crud/search_book.html',{'form':form})
return res
def search(request):
f... | manisha2192/Book-Record-Management | crud/views.py | views.py | py | 2,071 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "crud.forms.SearchForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "crud.forms.SearchForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cru... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.