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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32545476270 | #!/usr/bin/env python3
import pandas as pd
import math
import numpy as np
from scipy.stats import entropy
from tqdm import tqdm
from scipy.spatial.distance import euclidean
from fastdtw import fastdtw
from evaluate import ACTIVITIES
import sys
import pickle
import os
def extractFeatures(x_axis, y_axis, z_axis, user)... | kennethtxytqw/Wharf-Experiments | feature_engineer.py | feature_engineer.py | py | 5,733 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.correlate",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.correlate",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.correlate",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line... |
22261025139 | from django.db import models
from django.db.models import Q
from users.models import User
class Schedule(models.Model):
statuses = (
('pending', 'Pending'),
('occupied', 'Occupied'),
)
status = models.CharField(
max_length=64,
choices=statuses,
default='pending'
... | GaneaFunpay/Dentist-booking | dentist_booking/booking/models/schedule.py | schedule.py | py | 647 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
24864353513 | import docker
import smtplib
import os
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from typing import Optional
RUNNING = "running"
containers = [
os.environ["WEB_MANAGER_CONTAINER_NAME"],
os.environ["SALT_API_CONTAINER_NAME"]
]
def is_container_running(container_name: ... | saltastroops/health-check | main.py | main.py | py | 2,314 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "docker.from_env",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "docker.errors",
"... |
32433714928 | import sys
import torch
import torch.nn.functional as F
import wandb
from tqdm import tqdm
from config import ParamConfig
from help_funcs_wandb import define_wandb_lr_metrics
class Trainer:
def __init__(self, device: str, model: torch.nn.Module, config: ParamConfig, train_loader,
optimizer, lr_s... | geyao1995/wandb_demo | trainer.py | trainer.py | py | 2,248 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "config.ParamConfig",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "config.epoch_total",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "help_funcs_w... |
8625942380 | #!/usr/bin/python3
# -*-coding:utf-8 -*-
import psycopg2
from helper import config, utils
from psycopg2 import pool
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
""" SQLHandler(데이터베이스 처리)
- postgresql 사용
- ThreadedConnectionPool 사용
- 참고 : https://pynative.com/psycopg2-python-postgresql-connect... | volt772/prooya | BE (Python)/database/sql.py | sql.py | py | 3,396 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT",
"line_number": 24,
"usage_type": "argument"
},
{
"api_name": "helper.config.get_config",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "helper.config",
"line_number": 41,
"usage_type": "name"
},
... |
15252805798 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: evan-gyy
import pandas as pd
import openpyxl
from openpyxl.styles import PatternFill, colors, Font
import traceback
import os
import gc
class LCStats:
def __init__(self):
self.file = ''
self.find_file('.xlsx', '.')
self.map = {}
... | evan-gyy/OrderStats | longchen/lc_stats.py | lc_stats.py | py | 4,506 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "pandas.isnull",
... |
5928224769 | import argparse
import glob
import logging
import os
from typing import Dict, Optional
import ocpmodels
"""
This script provides users with an automated way to download, preprocess (where
applicable), and organize data to readily be used by the existing config files.
"""
DOWNLOAD_LINKS_s2ef: Dict[str, Dict[str, str]... | Open-Catalyst-Project/ocp | scripts/download_data.py | download_data.py | py | 6,541 | python | en | code | 518 | github-code | 1 | [
{
"api_name": "typing.Dict",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "os.makedirs",
"line_numbe... |
37554850767 | import sys, pickle
from PySide2 import QtCore, QtGui, QtWidgets
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from ui_splash_screen import Ui_Splash_Screen
from ui_login import Ui_Login
from ui_test_screen import Ui_MainWindow
from main import Main
from user import User
splas... | hirokiyaginuma/scriptspinner-software | ScriptSpinner.py | ScriptSpinner.py | py | 2,369 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ui_test_screen.Ui_MainWindow",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ui_login.Ui_Login",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "main.Main",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "ui_splash_sc... |
29883473876 | import threading
import time
from typing import Optional, Any, TypeVar, Callable
import wx
from morphzero.core.common.matrix_board import MatrixBoardCoordinates
from morphzero.core.game import Player, State, Move
from morphzero.core.game_service import GameService, GameServiceListener
from morphzero.ui.common import ... | morph-dev/self-learning-ai | morphzero/ui/basegamepanel.py | basegamepanel.py | py | 5,976 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.TypeVar",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
26780954219 | import sys
import skimage
from skimage import io, filters, feature
import numpy as np
import math
import time
DEBUG = False
edges = skimage.io.imread(fname="edges.png", as_gray=True)
map = np.zeros(shape=(len(edges),len(edges[0]))).astype(int)
#Current group ID number
segment = 1
#Dictionary fo... | Sgordon4/ImgToTrack | OldInProgress/WorkingTwoPass.py | WorkingTwoPass.py | py | 12,420 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "skimage.io.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_n... |
7718670034 | import json
from sqlnet.lib.dbengine import DBEngine
import numpy as np
from tqdm import tqdm
import re
# pattern = re.compile(r'[-一二三四五六七八九十百千万亿年\d]{2,}|\d+')
def load_data(sql_paths, table_paths, use_small=False):
if not isinstance(sql_paths, list):
sql_paths = (sql_paths, )
if not isinstance(table... | HoratioJSY/NL2SQL_CN | sqlnet/utils.py | utils.py | py | 14,666 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 160,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 165,
... |
373923622 | from typing import Any, List
import vyper.utils as util
from vyper.ast.signatures.function_signature import FunctionSignature, VariableRecord
from vyper.exceptions import CompilerPanic
from vyper.old_codegen.context import Context
from vyper.old_codegen.expr import Expr
from vyper.old_codegen.function_definitions.util... | webanck/GigaVoxels | lib/python3.8/site-packages/vyper/old_codegen/function_definitions/external_function.py | external_function.py | py | 7,824 | python | en | code | 23 | github-code | 1 | [
{
"api_name": "vyper.old_codegen.types.types.BaseType",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "vyper.old_codegen.types.types.ByteArrayLike",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "vyper.old_codegen.types.types.ListType",
"line_num... |
6608870263 | #coding:utf-8
'''
Created on 2013-5-24
@author: shuangluo
'''
import json
from django.http import HttpResponse
from ldap.models import Module, BizGroup, BizSet, Machine
from ldap.utils import modules_for_user
def top_group(request):
tgSelect = []
tg = BizSet.objects.all()
for item in tg:
tgSelect... | no2key/ldap_management | ldap/ajax.py | ajax.py | py | 1,492 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ldap.models.BizSet.objects.all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "ldap.models.BizSet.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "ldap.models.BizSet",
"line_number": 15,
"usage_type": "name"
},
{
... |
4926506431 | #1
from openvino.inference_engine import IENetwork, IECore, IEPlugin
from time import time
import logging as log
class face_detection:
'''
Class for the Face Detection Model.
'''
def __init__(self, model_name, device='CPU', extensions=None):
self.model_name = model_name
model_weights = ... | pra-dan/Intel-EdgeAI-Nanodegree | starter/src/face_detection.py | face_detection.py | py | 1,940 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "openvino.inference_engine.IENetwork",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "openvino.i... |
21534189825 |
import pygame
pygame.init()
import random as rand
#screen
screen = pygame.display.set_mode((800,800))
pygame.display.set_caption("quiozz")
doExit = False
#outer
oX = 399
oY = 399
oR = 255
oG = 120
oB = 0
oRadius = 100
oThicc = 20
#inner
iX = 399
iY = 399
iR = 0
iG = 120
iB = 255
iRadius = 60
iThicc = 20
#middle
mX = 3... | SebastianStucklen/quizzzz2172023 | quizzzz2172023/quizzzz2172023.py | quizzzz2172023.py | py | 1,396 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
6742353274 | import math
import pylab
import itertools
import random
import random as rand
import numpy as np
import networkx as nx
from networkx.utils import powerlaw_sequence
import scipy.stats as stats
def buildConfigModelNetwork(degreeSequence):
MG = nx.MultiGraph()
iter = (sum(degreeSequence)/2)
print("Degre... | Dosclic98/Esame_Network_Science | configurationModel.py | configurationModel.py | py | 2,310 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "networkx.MultiGraph",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.rand... |
7981324402 | import time
import sys
import os
# force MAVLink 2.0
os.environ["MAVLINK20"] = "1"
# doc: https://mavlink.io/en/mavgen_python/
from pymavlink import mavutil
# Create a function to send RC values
# More information about Joystick channels
# here: https://www.ardusub.com/operators-manual/rc-input-and-outpu... | sslab-gatech/RoboFuzz | src/ros_to_mav.py | ros_to_mav.py | py | 5,941 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pymavlink.mavutil.mavlink_connection",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pymavlink.mavutil",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": ... |
40894326962 | # -*- coding: utf-8 -*-
'''---------------------------------------------------------------------------------------------------------------------------------------
version date author memo
----------------------------------------------------------------------------------------------------------------------------... | Why-Not-Sky/hunting | webTableCrawler/stockCrawler.py | stockCrawler.py | py | 4,823 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "webTableCrawler.webHtmlTableCrawler",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "utility.date_util.to_taiwan_date",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "utility.date_util",
"line_number": 37,
"usage_type": "name"
}... |
27052130514 | import mock
from dtat.models.player import Player
data1 = {
"status": "ok",
"result": [
{
"guild_id": "1",
"guild_name": "Testtttttt",
"level": 10
},
{
"guild_id": "2",
"guild_name": "testytesty",
"l... | deeptownadmintools/main-server | tests/00_integration/test_data_update_id.py | test_data_update_id.py | py | 3,152 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "dtat.models.player.Player.query.all",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "dtat.models.player.Player.query",
"line_number": 78,
"usage_type": "attribute"
},
{
"api_name": "dtat.models.player.Player",
"line_number": 78,
"usage_type": "na... |
26074180933 | #%% # 1
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import xgboost as xgb
from sklearn import linear_model
from sklearn.model_selection import ShuffleSplit, cross_val_score
from sklearn.cluster import MiniBatchKMeans
from sklearn.decomposition import PCA
from sklearn.model_selection import tr... | Sivaram46/NYC-taxi-trip-duration-prediction | taxi_trip_duration.py | taxi_trip_duration.py | py | 11,553 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime... |
29229830776 | from github import Github
import time
import schedule
import requests
import json
import logging
import os
logging.basicConfig(filename='debug.log', format='%(asctime)s %(levelname)-8s %(message)s',
level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S')
"""
GITHUB CREDENTIALS
"""
GITHUB_TOKEN = os.envir... | mukeshtiwari1987/ghub_watcher | gtoz.py | gtoz.py | py | 3,062 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
73403156193 | import webapp2
from twython import *
import json
TWITTER_APP_KEY = '' #supply the appropriate value
TWITTER_APP_KEY_SECRET = ''
TWITTER_ACCESS_TOKEN = ''
TWITTER_ACCESS_TOKEN_SECRET = ''
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
class GetTweets(webapp2.... | aneesh-neelam/TwitterSearch-GAE | main.py | main.py | py | 943 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "webapp2.RequestHandler",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "webapp2.RequestHandler",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "web... |
42468668289 | import cv2
import numpy as np
from matplotlib import pyplot as plt
def Thresholding():
img = cv2.imread('/home/mark/Desktop/gradient.png',0)
ret, thresh1 = cv2.threshold(img,127,255,cv2.THRESH_BINARY)
ret,thresh2 = cv2.threshold(img,127,255,cv2.THRESH_BINARY_INV)
ret,thresh3 = cv2.threshold(img,127,255... | olinrobotics/irl | irl_archive/Fall_2017/button_game/Practice/Image_Processing.py | Image_Processing.py | py | 3,235 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.threshold",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"lin... |
30560767372 | from enum import Enum
import glm
import numpy as np
import math
from Ray import *
class Plane():
def __init__(self,pointOnPlane = glm.vec3(0.0,0.0,0.0),normal = glm.vec3(0.0,-1.0,0.0) ):
self.pointOnPlane = pointOnPlane
self.normal = normal
# testpoint is glm.vec3
def isPointOnPla... | Gaterman007/PythonPyQt | src/Camera.py | Camera.py | py | 23,068 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "glm.vec3",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "glm.dot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "glm.abs",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "glm.dot",
"line_number": 23,
"usage_t... |
10389850703 | import matplotlib.pyplot as plt
import numpy as np
from math import factorial, sqrt
from scipy.misc import derivative
def f(x, l):
return (x ** 2 - 1) ** l
def der_f(x, l, m):
order = l + abs(m)
return derivative(f, x0=x, n=order, args=[l], order=2 * order + 1)
def calculate_func(theta, phi, l, m):
... | Mihinator3000/Group-Projects | Physics/Modeling5/main.py | main.py | py | 2,850 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scipy.misc.derivative",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.factorial",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_n... |
34000015765 | from collections import deque
import sys
sys.setrecursionlimit(10**8)
N, X, Y = map(int, input().split())
OXY = [list(map(int, input().split())) for _ in range(N)]
D_POS = [(1, 1), (0, 1), (-1, 1), (1, 0), (-1, 0), (0, -1)]
grid = [["." for _ in range(410)] for _ in range(410)]
grid[205+Y][205+X] = "G"
for ox, oy in... | yojiyama7/python_competitive_programming | atcoder/_old/past_3/g_.py | g_.py | py | 1,061 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
}
] |
8971658666 | from kafka import KafkaConsumer
from kpong.serde import ping_pong_deserializer
consumer = KafkaConsumer(
"pingpong",
group_id="kpong-1",
client_id="kpong",
bootstrap_servers='localhost:9092',
auto_offset_reset='earliest',
value_deserializer=ping_pong_deserializer
)
def consume_ping_pong():
... | apmaros/kpong | src/kpong/consumer.py | consumer.py | py | 446 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "kafka.KafkaConsumer",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "kpong.serde.ping_pong_deserializer",
"line_number": 11,
"usage_type": "name"
}
] |
42917236725 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
# from codecs import open
from os import path
# from agentml i... | rainyDayDevs/AgentML | setup.py | setup.py | py | 2,107 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_... |
42488837913 | from spylls.hunspell import Dictionary
import pandas as pd
import unidecode
if __name__ == '__main__':
target_length = 5
list_of_words = []
dictionary = Dictionary.from_files('/Users/aitoriraolagalarza/Desktop/pycharm_projects/wordle_dictionary_builder/data/hunspell-cat/catalan')
for word in dictiona... | aitirga/wordle_dictionary_builder | tasks/generate_catalan_dictionary/generate_catalan_dictionary.py | generate_catalan_dictionary.py | py | 713 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "spylls.hunspell.Dictionary.from_files",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "spylls.hunspell.Dictionary",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "unidecode.unidecode",
"line_number": 15,
"usage_type": "call"
},
{
... |
41277479802 | import pandas as pd
import plot_likert as plot_likert
import numpy as np
import matplotlib.pyplot as plt
import pylab as p
import streamlit as st
st.set_option('deprecation.showPyplotGlobalUse', False)
st.title('Visualisierung der Seminarevaluation')
st.text('Hier kannst du deine Seminarevaluation in Histogrammen anz... | larspelz/semev | webapp.py | webapp.py | py | 4,263 | python | de | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.set_option",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.text",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.file_upl... |
4313095146 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 16:45:32 2020
@author: hitar
"""
import collections
nums = [0,0,1]
c = 0
l = len(nums)
co = collections.Counter(nums)
for i in range(co[0]):
nums.remove(0)
for i in range(co[0]):
nums.append(0)
print(nums) | smarthitarth/python-scripts | MoveZeroes.py | MoveZeroes.py | py | 265 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 12,
"usage_type": "call"
}
] |
33764452546 | from easyprocess import EasyProcess
from pyvirtualdisplay.abstractdisplay import AbstractDisplay
import logging
log = logging.getLogger(__name__)
PROGRAM = 'Xvfb'
URL = None
PACKAGE = 'xvfb'
class XvfbDisplay(AbstractDisplay):
'''
Xvfb wrapper
Xvfb is an X server that can run on machines with no displa... | tawfiqul-islam/RM_DeepRL | venv/lib/python3.6/site-packages/pyvirtualdisplay/xvfb.py | xvfb.py | py | 1,872 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyvirtualdisplay.abstractdisplay.AbstractDisplay",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pyvirtualdisplay.abstractdisplay.AbstractDisplay.__init__",
"line_number": ... |
16817075767 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 15 04:18:20 2018
@author: sadievrenseker
"""
#1. kutuphaneler
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#2. Veri Onisleme
#2.1. Veri Yukleme
veriler = pd.read_csv('veriler.csv')
#encoder: Kategorik -> Numeric
ulke =... | erkanzileli/learning-ml | cokluveriler.py | cokluveriler.py | py | 1,789 | python | tr | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.OneHotEncoder",
"line_number": 26,
"usage_type": "call"
},
{... |
27833537769 | from pyzbar import pyzbar
import cv2
import time
import argparse
import keras_ocr
#
# import os
# os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
class NpImageBarcode:
def predict(self, path):
image = cv2.imread(path)
barcodes = pyzbar.decode(image)
if len(barcodes) == 0:
return None... | cyrilvincent/3CE | np_image_barcode.py | np_image_barcode.py | py | 1,182 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyzbar.pyzbar.decode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyzbar.pyzbar",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser... |
71936376673 | import json
import sys
from colorcet import bmw
import dask
import pandas as pd
import datashader as ds
from datashader import transfer_functions as tf
from datashader.utils import lnglat_to_meters as webm
from datashader_fix.tiles import render_tiles # use version of render tiles with this fix: https://github.com/hol... | tomwhite/inaturalist-datashader-map | generate_tiles.py | generate_tiles.py | py | 1,636 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "dask.config.set",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dask.config",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datashader.Canvas",
... |
34519823291 | from random import choice
from sys import argv
from base64 import b64encode
b = 22
def dwfregrgre(x, z):
wdef = []
for a in range(x, z + 1):
for i in range(2, a):
if (a % i) == 0:
break
else:
wdef.append(a)
return wdef
def sdsd(edefefef):
fv... | p4-team/ctf | 2017-10-06-klctf/bad_computations/crypt.py | crypt.py | py | 2,426 | python | en | code | 1,716 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 62,
"usage_type": "argument"
},
{
"api_name": "sys.argv",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number"... |
269449406 | from collections import defaultdict
import os
from pathlib import Path
from urllib.request import urlretrieve
import xml.etree.ElementTree as ET
# import the countries xml file
tmp = Path(os.getenv("TMP", "/tmp"))
countries = tmp / 'countries.xml'
if not countries.exists():
urlretrieve(
'https... | rhelmstedter/pybites | 190/income.py | income.py | py | 975 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlretrieve",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.defaultdi... |
38951988250 | from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
import os
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
basedir = os.path.abspath(os.path.dirname(__file__))
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
os.path.jo... | AgentIsaacson/rate-my-professor | app.py | app.py | py | 1,697 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
17561869695 | from fastapi import FastAPI
import random
from typing import Optional, List
from models import User, Gender, Role
from uuid import uuid4
app = FastAPI()
db: List[User] = [
User(
id=uuid4(),
first_name="Daniel",
last_name="Villery",
gender=Gender.male,
roles=[Role.user, Role... | villeryd/beatsAPI | main.py | main.py | py | 1,031 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.User",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.User",
"line_number":... |
36061072150 | import functools
import uuid
import datetime
from dataclasses import asdict
from flask import (
Blueprint,
current_app,
flash,
redirect,
render_template,
session,
url_for,
request,
)
from movie_library.forms import LoginForm, RegisterForm, MovieForm, ExtendedMovieForm
from movie_library... | ashereth/Movie-Watchlist | movie_library/routes.py | routes.py | py | 7,094 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.session.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
... |
20520643564 | import argparse
import os
import PyInstaller.building.makespec
import PyInstaller.log
try:
from argcomplete import autocomplete
except ImportError:
def autocomplete(parser):
return None
def generate_parser():
p = argparse.ArgumentParser()
PyInstaller.building.makespec.__add_options(p)
P... | pyinstaller/pyinstaller | PyInstaller/utils/cliutils/makespec.py | makespec.py | py | 1,049 | python | en | code | 10,769 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PyInstaller.building.makespec.building.makespec.__add_options",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PyInstaller.building.makespec.building",
"line_number":... |
35235288051 | __author__ = "Rohan Pandit"
from algo import algorithm, triTueAlgo, withDelay
import numpy as np
from time import time
from random import randint
from flask import Flask, abort, jsonify, request
from flask_cors import CORS
screenSize = 700
app = Flask(__name__)
CORS(app)
@app.route('/optimize_route', methods=['POS... | petrpan26/ShipDirect | server/salesman.py | salesman.py | py | 826 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
20128360861 | import pybg.ql
import pybg.curves as curves
import pybg.instruments.bulletbond as bb
import pybg.instruments.sinkingfundbond as sf
from pybg.enums import (
DayCounters, Frequencies, BusinessDayConventions, Calendars
)
from datetime import date
dt0 = date(2008, 9, 15)
print("\nSetting eval date: %s" %... | bondgeek/pybg | pybg_examples/demos/sinker.py | sinker.py | py | 2,295 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "datetime.date",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pybg.ql.ql.set_eval_date",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pybg.ql.ql",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pybg.ql",
... |
74807329952 | from playwright.sync_api import Playwright, sync_playwright
from main.pages.app import App
app = App()
def run(playwright: Playwright) -> None:
browser = playwright.chromium.launch(headless=False, slow_mo=1000)
context = browser.new_context()
page = context.new_page()
app.login_ui(page)
page.clos... | Lexamenrf44/ABarashkov_Python_Playwright_SauceDemo_project | main/specs/smoke/e2e.py | e2e.py | py | 424 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "main.pages.app.App",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "playwright.sync_api.Playwright",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "playwright.sync_api.chromium.launch",
"line_number": 8,
"usage_type": "call"
},
{
... |
38681629975 | import re
import itertools
import collections
reg = re.compile("(\\w+) would (\\w+) (\\d+) happiness units by sitting next to (\\w+).")
people = collections.defaultdict(dict)
arrangement_happiness = []
def parse_data(line):
match = re.match(reg, line)
if match:
attendee = match.group(1)
action = match.group(2)
... | nemo-0/advent-of-code | 2015/day13/solution.py | solution.py | py | 1,436 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
... |
28452183977 | from PIL import Image
from requests import get # to make GET request
from torch.utils.data import DataLoader
import codecs
import copy
import errno
import gzip
import hashlib
import numpy as np
import os
import os.path
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
import scip... | lokhande-vishnu/DeepHermites | Code/3-semisupervised_setting/aws_costestimates/epoch_measurements/norb/4hermites_v2l/lib/datasets/norb.py | norb.py | py | 5,587 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.path.expanduser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.... |
7300614348 | from http import HTTPStatus
from uuid import UUID
from fastapi import APIRouter, Depends, HTTPException
from core.constants.exception_details import GENRE_NOT_FOUND
from core.utils import verify_auth_tokens
from models.genre import Genre
from services.genre import GenreService, get_genre_service
router = APIRouter()... | Moralex45/middle-python | asyncapi-service/src/api/v1/genres.py | genres.py | py | 1,661 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "services.genre.GenreService",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "service... |
25463876505 | import unittest
import gflags as flags
import unittest as googletest
from closure_linter import errors
from closure_linter import runner
from closure_linter.common import erroraccumulator
flags.FLAGS.strict = True
class StrictTest(unittest.TestCase):
"""Tests scenarios where strict generates warnings."""
def ... | hanpfei/chromium-net | third_party/catapult/third_party/closure_linter/closure_linter/strict_test.py | strict_test.py | py | 1,225 | python | en | code | 289 | github-code | 1 | [
{
"api_name": "gflags.FLAGS",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "closure_linter.errors.FILE_DOES_NOT_PARSE",
"line_number": 28,
"usage_type": "attribute"
},
... |
14656758384 | from jax_sandbox.common.dataset import TransitionBatch
import jax
import jax.numpy as jnp
@jax.jit
def returns_to_go(batch: TransitionBatch, gamma: float = 1.0) -> jnp.ndarray:
'''
Computes returns to go, optionally discounted by gamma.
Rewards are of shape (B,).
'''
rewards = batch.rewards
... | dhruvsreenivas/jax_sandbox | jax_sandbox/policy_gradient/pg_utils.py | pg_utils.py | py | 491 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "jax_sandbox.common.dataset.TransitionBatch",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "jax.numpy.geomspace",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 15,
"usage_type": "name"
},
{
"api_name"... |
28106266111 | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0' #'3,2' #'3,2,1,0'
import numpy as np
import pickle
import cv2
import time
from timeit import default_timer as timer
# torch libs
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SequentialS... | shvetsiya/mask-rcnn | train.py | train.py | py | 14,440 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "common.RESULTS_DIR",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "tensorboardX.SummaryWriter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "common.I... |
1061377237 | import os
import pandas as pd
import numpy as np
from sklearn.impute import KNNImputer
from sklearn.preprocessing import OrdinalEncoder
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from imblearn.over_sampling import RandomOverSampler
import warnings
warnings.filterwarnings("ignor... | guptadikshant/DetectionOfThyroid | DataPreprocessing/data_preprocess.py | data_preprocess.py | py | 5,631 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join"... |
26407571543 | import discord
import logging
from dotenv import load_dotenv
import os
load_dotenv()
KEY = os.getenv('DISCORD_KEY')
#logging set up
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Forma... | julianjohnson10/Discord-Bot | DiscordBot.py | DiscordBot.py | py | 674 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"lin... |
210457700 | from django.shortcuts import render
from django.contrib import messages
from polls.forms import RegistrationForm
def index(request):
context_dict = {'form': None}
form = RegistrationForm()
if request.method == 'GET':
context_dict['form'] = form
elif request.method == 'POST':
form = Re... | slow999/DjangoAndReactComponentForm | polls/views.py | views.py | py | 704 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "polls.forms.RegistrationForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "polls.forms.RegistrationForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 18,
"usage_type": "call"
},
... |
27277520150 | #!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
from urllib.parse import urlparse
import sys
# crawling
def download_page(url):
resp = requests.get(url)
while resp.status_code != 200:
resp = requests.get(url)
return resp.text
def parse_html(url, html):
path = urlparse(url... | TeddyHartanto/searchreddit | search_engine.py | search_engine.py | py | 643 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
15189440155 | from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
from Orange.data import ContinuousVariable, Domain, Table, Variable
from Orange.misc.utils.embedder_utils import EmbedderCache
from Orange.util import dummy_callback
from orangecontrib.imageanalytics.local_embedder import LocalEmb... | biolab/orange3-imageanalytics | orangecontrib/imageanalytics/image_embedder.py | image_embedder.py | py | 11,435 | python | en | code | 32 | github-code | 1 | [
{
"api_name": "orangecontrib.imageanalytics.squeezenet_model.SqueezenetModel",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 126,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 126,
"usage_type": "name"
},
{... |
36159117274 | import os
import json
class Config:
@staticmethod
def getConfig(name: str):
fname = name
if not os.path.exists(fname):
return None
with open(fname, "r") as fp:
raw = fp.read()
return json.loads(raw)
@staticmethod
def saveConfig(name: st... | dhy2000/CO_Judger | configs/config.py | config.py | py | 1,085 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_numb... |
2422070701 | from tensorboard.backend.event_processing import event_accumulator
import matplotlib.pyplot as plt
from os import listdir
from os.path import isfile, join
import math
import numpy as np
import sys
import tuneConfigurations
import warnings
from ray.tune import Analysis
plt.rcParams['figure.dpi'] = 200
def plot(configs... | trianam/quantumNoiseClassification | funPlot.py | funPlot.py | py | 9,824 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 29,
"usage_type": "call"
},
{
"api_na... |
72989251553 | import cv2
import os
import numpy as np
import multiprocessing
from concurrent.futures import ThreadPoolExecutor
def apply_clahe(image):
lab = cv2.cvtColor(image, cv2.COLOR_BGR2LAB)
l, a, b = cv2.split(lab)
clahe = cv2.createCLAHE(clipLimit=4.0, tileGridSize=(8, 8))
cl = clahe.apply(l)
... | Muawizodux/Multi-class-Segmentation-and-Classification-for-Skin-Disease | pix2pix-GANs/Data-Preprocessing(Non-Melanoma).py | Data-Preprocessing(Non-Melanoma).py | py | 2,364 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2LAB",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.split",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.createCLAHE",
"li... |
13415632812 | import copy
from SPARQLWrapper import SPARQLWrapper, JSON
from slot_recognition import *
from SPARQL_generation import *
class QueryManager:
def __init__(self, verbose=False):
self.__conn = SPARQLWrapper(ENDPOINT_URL)
self.__verbose = verbose
def set_verbose(self, verbose):
... | btyu/R3K_KBQA | R3K-KBQA/query_management.py | query_management.py | py | 4,858 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "SPARQLWrapper.SPARQLWrapper",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "SPARQLWrapper.JSON",
"line_number": 101,
"usage_type": "name"
}
] |
36064808560 | import FeatureProject
from sklearn.linear_model import LogisticRegression
import os
import ROCX
from sklearn.model_selection import cross_val_score
from sklearn.metrics import classification_report, confusion_matrix
import pandas as pd
from sklearn.decomposition import PCA
import time
import numpy as np
'''进行模型的保存和加载''... | asd567/HC-MCI-AD-classification-ML | code/LogisticRegressionX.py | LogisticRegressionX.py | py | 9,482 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 29,
"usage_type": "call"
},
{
"api_n... |
5130228201 |
# coding: utf-8
# In[1]:
import shapefile
import matplotlib.pyplot as plt
import numpy as np
# In[16]:
import pandas as pd
path_to_netatmo_coords_df = (r'X:\hiwi\ElHachem\Prof_Bardossy\Extremes'
r'\NetAtmo_BW'
r'\rain_bw_1hour'
... | AbbasElHachem/extremes | _05_plot_ppt_dwd_netatmo_stations.py | _05_plot_ppt_dwd_netatmo_stations.py | py | 1,849 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ioff",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
13149683279 | from src.datamodules.common.generic_datamodule import GenericDatamodule
from src.utils.hydra import instantiate_delayed
import os
from torchvision.utils import save_image
import torch
from src.utils.audio import save_mp3_to_tensor
class AudioDataModule(GenericDatamodule):
def __init__(
self,
batch... | radziminski/audio-key-classification | src/datamodules/audio_datamodule.py | audio_datamodule.py | py | 4,037 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "src.datamodules.common.generic_datamodule.GenericDatamodule",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 58,
"usage_type": "attribute"
},
{... |
12060803554 | """
Hi, here's your problem today. This problem was recently asked by Microsoft:
Given the root of a binary tree, print its level-order traversal. For example:
1
/ \
2 3
/ \
4 5
The following tree should output 1, 2, 3, 4, 5.
class Node:
def __init__(self, val, left=None, right=None):
self.val = v... | winkitee/coding-interview-problems | 81-90/87_level_order_traversal_of_binary_tree.py | 87_level_order_traversal_of_binary_tree.py | py | 1,096 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 39,
"usage_type": "call"
}
] |
36510945058 | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from dao.character_dao import CharacterDao
from dao.weapon_dao import WeaponDao
class Genshin:
character_dao = None
weapon_dao = None
__instance = None
@staticmethod
def get_instance():
"""Static method access"""... | bemyXmas/genshin-dao | genshin.py | genshin.py | py | 1,161 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "dao.character_dao.CharacterDao",
"line_number": 27,
"usage_type": "call"
},
{
... |
32937853207 | import decimal
import re
import lxml.html
class Base(object):
fetched = False
def __init__(self, mal_id, mal):
self.mal_id = mal_id
self.mal = mal
def _get_url(self):
return self.base_url % self.mal_id
def fetch(self):
if not self.fetched:
return self.ma... | JohnDoee/web-parsers | myanimelist/malparser/base.py | base.py | py | 6,592 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "lxml.html.html.fromstring",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "lxml.html.html",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "lxml.html",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "re.findall",
... |
42603908137 | from django import forms
from .models import Post
from django.core.validators import FileExtensionValidator
class PostForm(forms.ModelForm):
thumbnail = forms.FileField(required=False, widget=forms.ClearableFileInput(attrs={'class': 'input'}))
video = forms.FileField(required=False, validators=[FileExtensionVa... | Varad-13/django-crowdfund | crowdfunding/forms.py | forms.py | py | 1,207 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.FileField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.f... |
23070045502 | import os
import time
from flask import Flask, render_template, request
from flask_socketio import SocketIO, emit, disconnect
from collections import deque
app = Flask(__name__)
# socket-io configure
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY")
socketio = SocketIO(app)
# in-memory data
USERS = {}
CHANNELS = ... | muedie/flack | application.py | application.py | py | 1,388 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.deque",
... |
19093601252 | import pygame
import config
from CentipedeComponent import CentipedeComponent
from Direction import Direction
from threading import Timer
from PendingMovement import PendingMovement
def backwards(dir):
if dir == Direction.up: return Direction.down
elif dir == Direction.right: return Direction.left
elif dir... | justinoboyle/learn-python | Centipede.py | Centipede.py | py | 3,265 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Direction.Direction.up",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "Direction.Direction",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "Direction.Direction.down",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_na... |
21749274335 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. _log
Basic stdout log classes: Error, Verbose and Warning.
**Content**
"""
# *credits*: `gjacopo <jacopo.grazzini@ec.europa.eu>`_
# *since*: Fri May 8 15:21:31 2020
... | eurostat/pyDatUtils | pydatutils/log.py | log.py | py | 9,469 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.exc_info",
"line_number": 163,
"usage_type": "call"
},
{
"api_name": "inspect.isclass",
"line_number": 165,
"usage_type": "call"
},
{
"api_name": "six.string_types",
"line_number": 241,
"usage_type": "attribute"
},
{
"api_name": "inspect.isclass... |
28151218606 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from ncar.items import NcarItem
class GetsomeSpider(CrawlSpider):
global li
li = list()
name = 'getsome'
allowed_domains = ['ncar.cc']
start_urls = ['http://bbs.ncar.c... | sv2sv/ncar | ncar/spiders/getsome.py | getsome.py | py | 1,337 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "scrapy.spiders.Rule",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.linkextractors.LinkExtractor",
"line_number": 16,
"usage_type": "call"
},
{
... |
32017566370 | from django.contrib.auth.models import User
from django.http import HttpResponse
from django.shortcuts import redirect, render
from .HospitalDBConnect import *
def home(request):
''' the home for hosptial admins '''
appt_count = view_appt_count()
doc_count = view_doc_count()
room_count = view_room_c... | yonathanF/Hospital_Management | HospitalManagement/Hospital/views.py | views.py | py | 6,376 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 42,
"usage_type": "call"
},
{
"api_nam... |
36502272504 | from __future__ import print_function
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torchv... | ppooiiuuyh/-PyTorch-implementations | DCGAN/train_and_valiate.py | train_and_valiate.py | py | 4,890 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "torch.nn.BCELoss",
"line_numbe... |
10823546127 | """ Python3: Save single page of pdf as a new pdf file """
import PyPDF2
# Initialize input pdf file
in_pdf = open(r'/path/to/input.pdf', 'rb')
pdf_reader = PyPDF2.PdfFileReader(in_pdf) # Reader element
pdf_writer = PyPDF2.PdfFileWriter() # Writer element
pdf_writer.addPage(pdf_reader.getPage(n)) # Ch... | CRTejaswi/Python3 | Text Processing/PyPDF2/1.py | 1.py | py | 502 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PyPDF2.PdfFileWriter",
"line_number": 6,
"usage_type": "call"
}
] |
73477199714 | import xml.etree.ElementTree as ET
import json
# Parse the KML file
tree = ET.parse('tests/places.kml')
# Get the root element
root = tree.getroot()
# Find all Placemark elements
placemarks = root.findall('.//{http://www.opengis.net/kml/2.2}Placemark')
# Loop through the placemarks and print the name and coordinate... | bipinkrish/campusmap | tests/places.py | places.py | py | 731 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "json.dump",
"line_number": 25,
"usage_type": "call"
}
] |
1704717638 | import itertools
def solution(users, emoticons):
answer = [0, 0]
sale = [10, 20, 30, 40]
sale_rate = list(itertools.product(sale, repeat=len(emoticons)))
for i in sale_rate:
plus = 0
earn_money = 0
for user in users:
rate, money = user
tmp = 0
... | SunghunKim98/Algorithm_Study | sprint10/KMS/실시간/이모티콘 할인행사.py | 이모티콘 할인행사.py | py | 839 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.product",
"line_number": 7,
"usage_type": "call"
}
] |
29728640167 | import numpy as np
from PIL import Image
from tqdm import tqdm
from modules.Zest.Zest_Network import Zest_Network
class Zest_ImageProcessing(Zest_Network):
square_size_HQ = 32
square_size_LQ = 16
def __init__(self, x, y) -> None:
super().__init__(x, y)
def process_image(self, image_path ... | XOYZ69/Zest | modules/Zest/Zest_ImageProcessing.py | Zest_ImageProcessing.py | py | 3,094 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "modules.Zest.Zest_Network.Zest_Network",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PIL.Im... |
25784868828 | from __future__ import print_function
import asyncio
import random
import threading
import time
import numpy as np
import websockets
from websocket import create_connection
from robot_dqnagent import DQNAgent
from robot_arena import Arena
class MSGWorker (threading.Thread):
def __init__(self):
self.coords ... | SundayLab/robot_dqn | robot_server_execute.py | robot_server_execute.py | py | 3,002 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "threading.Thread",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "robot_dqnagent.DQNAgent",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 26,
"usage_type": "call"
},
{
"api_name"... |
22254776273 | import math
from PyQt5.QtWidgets import QGraphicsView, QGraphicsLineItem, QApplication, QMenu, QAction
from PyQt5.QtGui import QColor, QBrush, QPen
from PyQt5.QtCore import pyqtSlot, QLineF, QRectF, QPoint, QPointF, Qt
from pyqtgraph import GraphicsLayoutWidget, PlotItem, ViewBox, GraphicsItem, GraphicsView, PlotDataIt... | mattgibbs/simui | steering/orbit_view.py | orbit_view.py | py | 10,566 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyqtgraph.GraphicsLayoutWidget",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "magnet_view.MagnetView",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "magnet_view.MagnetView",
"line_number": 28,
"usage_type": "call"
},
{
"api_... |
38127398338 | import requests
import discord
from webdriver import keep_alive
from bs4 import BeautifulSoup
import pandas as pd
from discord.ext import commands
bot = commands.Bot(command_prefix='!')
bot.remove_command("help")
@bot.event
async def on_ready():
await bot.change_presence(status=discord.Status.online, activity=disco... | mukuln-official/Target-and-walmart-stock-check | main.py | main.py | py | 6,458 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "discord.Status",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "disco... |
70122758115 | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | Lifanna/geology_proj | geology_proj/main/urls.py | urls.py | py | 5,981 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
37297581932 | from abc import ABC, abstractmethod
import json
import os
from datetime import datetime
import requests
from utils import get_USD_conversion_rate, get_from_and_up_salary
class JobSiteAPI(ABC):
@abstractmethod
def get_vacancies(self, filter_word):
pass
class HeadHunterAPI(JobSiteAPI):
def get_v... | SkyLanser/vacancy_parser | classes.py | classes.py | py | 7,485 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "abc.ABC",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number... |
37469284557 | import csv
import logging
import json
import math
import random
import re
import time
import urllib.request
from pathlib import Path
import sys
from bs4 import BeautifulSoup
import requests
import get_edgar.common.my_csv as mc
import get_edgar.common.utils as utils
logger = logging.getLogger(__name__)
EDGAR_PREFIX =... | linbaiwh/Get_EDGAR | get_edgar/extractor/fileinfo_extractor.py | fileinfo_extractor.py | py | 9,826 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "get_edgar.common.my_csv.multikeysort_int",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "get_edgar.common.my_csv",
"line_number": 38,
"usage_type": "name"
},
{
... |
74502512992 | from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, redirect, render
from .forms import CommentForm, PostForm
from .models import Follow, Group, Post, User
NUMBER_OF_POSTS: int = 10
def index(request):
template = '... | KseniyaGurevich/hw05_final | yatube/posts/views.py | views.py | py | 4,737 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "models.Post.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.c... |
6307202826 | import numpy as np
import torch
import torch.nn as nn
class RNNBaseSTFTMask(nn.Module):
def __init__(self,
num_spk=2,
audio_channels=2,
n_fft=512,
hop_length=256,
sample_rate=16000,
rnn_hidden=256,
rn... | ooshyun/Speech-Enhancement-Pytorch | src/model/stft_rnn.py | stft_rnn.py | py | 7,628 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.RNN",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number"... |
11831798394 | from flask import Flask
from flask import render_template,request
from pymongo import MongoClient
import json
from bson import json_util
from bson.json_util import dumps
app = Flask(__name__,template_folder='/home/sri/Downloads/AAL-94_dataset/AALtorch/template')
print(app)
MONGOD_HOST = 'localhost'
MONGOD_PORT = 27017... | srinidhi17/HealthMonitoring-System- | test.py | test.py | py | 1,299 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dumps",
... |
8607037151 |
import os
import pygame
from battle2.model import Direction
from battle2.model import State
import battle2.eventmanager as evm
SCREENWIDTH = 1600
SCREENHEIGHT = 800 # 1600, 800 # 1920, 1080
WINDOWWIDTH = 800
WINDOWHEIGHT = 600
WINDOWPOS = 100, 100
TILESIZE = 32
PLAYERLAYER = 2
GRIDLAYER = 4
FPS = 60
BLACK = p... | henkburgstra/pyRPG | battle2/view.py | view.py | py | 19,976 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.Color",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_numbe... |
72964937634 | #%%
import numpy as np
import pandas as pd
from pandas import DataFrame
from retrying import retry
import random
import pickle
class Player(object):
def __init__(self, name):
self.name=name
#%%
class CpuPlayer(Player):
taken_choice=[1,2,3]
def __init__(self,name='cpu',learning_mode=True, learning_rat... | CrystalWindSnake/Creative | python/rl_learning_stone/models.py | models.py | py | 3,830 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
6479965465 | from django.conf.urls import url
from ..views.oj import (SearchGroupByKeyWordAPI,
JoinGroupBySearchAPI,
GroupListAndDetailAPI,
HomeWorkListAndDetailAPI
)
urlpatterns = [
url(r"^search_group/?$", SearchGroupByKeyWordAPI... | PUANEY/OnlineJudge | groups/urls/oj.py | oj.py | py | 600 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.oj.SearchGroupByKeyWordAPI.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views.oj.SearchGroupByKeyWordAPI",
"line_number": 10,
"usage_type": "name"
... |
3194291784 | import bibtexparser
import re
import os
from os import path
if path.exists('mytitles.txt'):
os.remove('mytitles.txt')
with open('MyCollection.bib') as bibtex_file:
bib_database = bibtexparser.load(bibtex_file)
with open("mytitles.txt","a") as file1:
for entry in bib_database.entries:
title = entry[... | ShenWang9202/bibfileGenerator | getTitles.py | getTitles.py | py | 463 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.remove",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bibtexparser.load",
"line_number": ... |
43064648639 | from django.test import TestCase, tag
from django.urls.base import reverse
from edc_model_wrapper import ModelWrapper
from ..models import ActionItem, ActionType
from ..templatetags.action_item_extras import add_action_item_popover
from ..view_mixins import ActionItemViewMixin
from .models import SubjectIdentifierMode... | botswana-harvard/edc-action-item | edc_action_item/tests/test_view.py | test_view.py | py | 2,034 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "edc_model_wrapper.ModelWrapper",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.test.TestCase",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "models.ActionItem.subject_identifier_model",
"line_number": 18,
"usage_type": "attrib... |
71607967713 | from selenium import webdriver
import pandas as pd
from IPython.display import display
from selenium.webdriver.chrome.options import Options
# inicializa o programa sem aparecer na tela, em segundo plano
chrome_options = Options()
chrome_options.headless = True
# abre o navegador com as opções definidas acima
navegad... | jpc963/cotacao-e-automacao | main.py | main.py | py | 2,323 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
... |
75136158434 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import statistics as st
from math import pow
import math
import os
import numpy as np
from scipy.stats import norm
FILE_PATH=str(os.getcwd()) + '\Data\heart.csv'
df = pd.read_csv(FILE_PATH)
#list of all the column headings
col_heads = ... | hrishitchaudhuri/sds | scripts/normalisation.py | normalisation.py | py | 2,076 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number": 28,
... |
28323298008 | from glob import glob
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from langchain.llms import OpenAI
import os, sys, openai
from dotenv import load_dotenv
from langchain.tools import tool, Tool
from retrieval import Retrieval
from pyepsilla... | epsilla-cloud/app-gallery | documents-agent/docagent.py | docagent.py | py | 5,739 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "retrieval.Retrieval",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyepsilla.cloud.Client",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pyepsil... |
13617183674 | import os
from yt_dlp import YoutubeDL
def download_url(path,URL):
option = {
"outtmpl":f"{path}"+"%(title)s.%(ext)s"
}#パスは実行する環境に合わせて
URLs=[]
ydl = YoutubeDL(option)
URLs.append(URL)
result = ydl.download(URLs)
return f"{path}"+"%(title)s.%(ext)s"
download_url(os.getcwd(),f"https:/... | haru-mikann/DiscordBot | test.py | test.py | py | 429 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yt_dlp.YoutubeDL",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 13,
"usage_type": "call"
}
] |
16166429334 | # coding: utf-8
from abc import ABCMeta
import asyncio
import json
from aiohttp import web, MsgType
from bson import json_util
from django.conf import settings
from django.utils.timezone import now
from parkkeeper import models
from parkkeeper.event import async_recv_event, get_sub_socket
from parkkeeper.const import M... | telminov/django-park-keeper | parkkeeper/ws.py | ws.py | py | 8,471 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "aiohttp.web.Application",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "aiohttp.web",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.con... |
10557505124 |
# coding: utf-8
# In[34]:
#Mandelbrot fractal creation program
#e.g. complex fractal shapes with recursive detail at increasing magnifications
#code adapted from example found @ docs.scipy.org/doc/numpy/user/quickstart.html
import matplotlib.pyplot as plt
import numpy as np
def mbrot(h,w,maxit=125): #higher ite... | NathanNYC/Mandelbrot-Variations | Mbot.py.py | Mbot.py.py | py | 850 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.mgrid",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.conj",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
... |
7074745807 | from django.conf.urls import include
from utils.urls import cbv_url_helper as url
from . import views
urlpatterns = [
url(r'^$', views.SuperAdminHomeView),
url(r'^stats/$', views.StatsView),
url(r'^stats/initial/$', views.InitialStatsView),
url(r'^stats/get/$', views.GetStatsView),
url(r'^admins... | s3vdev/sxconsole-lite | sxconsole-lite/sxconsole/urls.py | urls.py | py | 502 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils.urls.cbv_url_helper",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.urls.cbv_url_helper",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.urls.cbv_url_helper",
"line_number": 10,
"usage_type": "call"
},
{
"api_n... |
74726242592 | import logging
from dataclasses import dataclass
from http import HTTPStatus
from paddington import (
Joint, Track, ErrorEvent, ErrorTypeSwitch, RouteNotFound, SequentialSwitch,
)
from web_framework.app import App, WsgiContext
from web_framework.rest_view import RestWheelSet, HttpResponse
from web_framework.wsgi_s... | Tishka17/paddington | examples/web_app/app.py | app.py | py | 2,384 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "paddington.ErrorTypeSwitch",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "paddington.SequentialSwitch",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "web_framework.wsgi_switch.WsgiSwitch",
"line_number": 13,
"usage_type": "call"
}... |
11732136587 | import keras
import numpy as np
from keras.layers import Input, Dense
from keras.models import Model
from keras.optimizers import Adam
from sklearn.cluster import KMeans
from keras.models import load_model
import csv
import sys
path_train = sys.argv[1]
path_test = sys.argv[2]
path_out = sys.argv[3]
def load_data():
... | hungchingliu/ML2018SPRING | hw4/autoencoder.py | autoencoder.py | py | 2,623 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
"line_numb... |
26297959246 | from kafka import KafkaProducer
import sys
msg = str(sys.argv[1])
def run():
try:
producer = KafkaProducer(
bootstrap_servers = ['localhost:9093','localhost:9094','localhost:9095']
)
def message() -> dict:
if msg[0] < "N":
partition = 0
... | fzayed/Project-Milestone-Group-11 | Lab 2/Ireni_100657302/kafka-python/producer.py | producer.py | py | 837 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "kafka.KafkaProducer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 43,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.