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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71897328507 | import os
import time
import psutil
def run_excel():
while True:
os.system(f'start excel possible_duplicate_people.xlsx')
while True:
time.sleep(1)
excel_running = False
for process in psutil.process_iter(attrs=['pid', 'name']):
if "EXCEL.EXE" in ... | FrontendPony/XML-parser | open_excel.py | open_excel.py | py | 550 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "psutil.process_iter",
"line_number": 11,
"usage_type": "call"
}
] |
11691605009 | import imp
import re
from PySide2.QtWidgets import QMainWindow
from PySide2.QtCore import Slot
from ui_mainwindow import Ui_MainWindow
from particulasact.particula import Particula
from particulasact.index import Nodo, Lista_ligada
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self)... | arturos8617/actividad06 | mainwindow.py | mainwindow.py | py | 2,290 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "PySide2.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "particulasact.index.Lista_ligada",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ui_mainwindow.Ui_MainWindow",
"line_number": 14,
"usage_type": "call"
},... |
72136709947 | #Plots
import re
import plotly.express as px
#DASHBOARD
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
import dash_table
from dash.exceptions import PreventUpdate
import tweepy
#####... | balasubramaniamniit/StockMarket-Insights | app.py | app.py | py | 30,384 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dash.Dash",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.themes",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "tweepy.OAuthHandler",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "t... |
43785018579 | from __future__ import print_function
import argparse
import sys
import rospy
import os
import numpy as np
from geometry_msgs.msg import Twist
import time
import cv2
import tensorflow as tf
pre_path = os.path.abspath('../')
sys.path.append(pre_path)
from utils import imagezmq
# ============================== Pretr... | KaiChen1008/Sim-to-Real-Virtual-Guidance-for-Robot-Navigation | control_policy_module/control_policy.py | control_policy.py | py | 3,752 | python | en | code | 72 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
23261593645 | import pygame
import math
import random
#CONST
SCREENWIDTH=1280
SCREENHEIGHT=720
# pygame setup
pygame.init()
screen = pygame.display.set_mode((SCREENWIDTH,SCREENHEIGHT))
clock = pygame.time.Clock()
running = True
dt = 0
FPS=60
pygame.display.set_caption('TANK')
#variables
x_target=[]
y_target=[]
checkVar =1
showHelp... | stefanstojkoviic/Tenkici | game.py | game.py | py | 8,210 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.time.C... |
27251458016 | """
文件名: Code/Chapter09/C05_FastText/main.py
创建时间: 2023/7/22 10:31 上午
作 者: @空字符
公众号: @月来客栈
知 乎: @月来客栈 https://www.zhihu.com/people/the_lastest
"""
import logging
from gensim.models import KeyedVectors
import fasttext
from fasttext.util import reduce_model
import sys
import os
sys.path.append('../../')
from utils impo... | moon-hotel/DeepLearningWithMe | Code/Chapter09/C05_FastText/main.py | main.py | py | 2,582 | python | en | code | 116 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.DATA_HOME",
"lin... |
3037264375 | import os
import numpy as np
import pandas as pd
from PIL import Image
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
from sklearn.manifold import TSNE
from sklearn.manifold import Isomap
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
from matplotlib import offsetbox
#direct... | estimatrixPipiatrix/decision-scientist | pythonCode/kmeans/kmeans_avatars.py | kmeans_avatars.py | py | 1,534 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.set",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
30789833021 | from django.contrib import messages
from django.shortcuts import render
import random
import smtplib
from.models import Onlinepayment,Offlinepayment,Onlineapproval,Offlineapproval,Send
def home(request):
return render(request,'f1.html')
def tv(request):
return render(request,'tv.html')
def mobile(request):
... | Nimishakc/NimishaFinal | eapp/views.py | views.py | py | 5,321 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
2668239466 | import multiprocessing
from time import ctime
def consumer(input_q):
print("Into consumer:",ctime())
while True:
# 处理项
item = input_q.get()
print ("pull",itemm,"out of q")#此处代替为有用的工作
input_q.tast_done()#发出信号通知任务完成
print("Out of consumer:",ctime())##此句末执行,因为q.join()信号后,主进程启动... | Sssssww/pycharm | 多线程/22.py | 22.py | py | 1,065 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.ctime",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.ctime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.ctime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.ctime",
"line_number": 20,
... |
10012294494 | #!/usr/bin/python
# coding=utf-8
import paramiko
import xlrd
import time
import os
import handle_file
server_info_list = handle_file.read_excel_xlsx('documents/server_info.xlsx', 'Sheet1')
Host = server_info_list[0][0]
Port = server_info_list[0][1]
Username = server_info_list[0][2]
Password = server_info_list[0][3]
d... | July666/python_workspace_component | main.py | main.py | py | 8,134 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "handle_file.read_excel_xlsx",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "paramiko.SSHClient",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "paramiko.AutoAddPolicy",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
26302348125 | import frappe, requests
from frappe.model.document import Document
class DjangoProperty(Document):
def db_insert(self):
d = self.get_valid_dict(convert_dates_to_str=True)
res = requests.post(f'{self.get_url()}/propertycreate/',
data=dict(d))
return res.json()
def load_from_db(self):
print(self.doctype, ... | mymi14s/estate_app | estate_app/estate_app/doctype/djangoproperty/djangoproperty.py | djangoproperty.py | py | 1,046 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "frappe.model.document.Document",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.post... |
13301338601 | from bson.objectid import ObjectId
from flask import Blueprint, jsonify
from assets.extensions import mongo
from assets.decors import errorhandler, tokenrequired
accounts = Blueprint("accounts", __name__, url_prefix="/accounts")
# STATUS
@accounts.route("/<account_id>/status", methods=["GET"])
@tokenrequired
@errorh... | TreyThomas93/tos-python-web-app-server | api/accounts/__init__.py | __init__.py | py | 1,434 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "assets.extensions.mongo.db.users.find_one",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "assets.extensions.mongo.db",
"line_number": 16,
"usage_type": "attribute"
},
... |
8384623961 | from __future__ import print_function
from __future__ import absolute_import
import sys
import math
import heapq
import gzip
import warnings
from xml.sax import handler, parse
from copy import copy
from collections import defaultdict
from itertools import chain
import sumolib
from . import lane, edge, netshiftadaptor,... | ngctnnnn/DRL_Traffic-Signal-Control | sumo-rl/sumo/tools/sumolib/net/__init__.py | __init__.py | py | 35,544 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "connection.Connection",
"line_number": 205,
"usage_type": "call"
},
{
"api_name": "connection.Connection",
"line_number": 215,
"usage_type": "call"
},
{
"api_name": "rtree.index.Index",
"line_number": 243,
"usage_type": "call"
},
{
"api_name": "rtre... |
42300472031 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 14 12:43:40 2019
@author: Minh
"""
import json
import requests
import tweepy
import base64
import sys
import time
import os
import csv
from AlarmDialogUtil import showAlertDialog
class TwitterMonitor():
twitter_public = twitter_private = access_tok... | BeePete/SBV1 | twitter_monitor.py | twitter_monitor.py | py | 2,214 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "tweepy.Stream",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tweepy.StreamListener",
... |
7261113141 | import matplotlib
matplotlib.use('TkAgg')
import cv2
import numpy as np
import time
from matplotlib import pyplot as plt
def main():
#img= cv2.imread('primeiroFrame.jpg',0)
img= cv2.imread('primeiroFrame.jpg',cv2.IMREAD_COLOR)
print(img.shape)
#nomaliza a imagem
img = histogramaNormalizadoColor(i... | felipemateus/vis-oCompEstudo | histogram.py | histogram.py | py | 5,685 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
... |
22425229606 | import typing
from pydantic import BaseModel, root_validator
from candid import CandidApiEnvironment
from candid.client import CandidApi, AsyncCandidApi
from candid.resources.auth.client import AuthClient, AsyncAuthClient
from candid.resources.auth.resources.v_2 import AuthGetTokenRequest
from candid.resources.billin... | candidhealth/candid-python | src/candid/candid_api_client.py | candid_api_client.py | py | 2,650 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "typing.O... |
31501456333 | from django.urls import path, include
from . import views
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path("", views.index, name='index'),
path("news/<int:id>/", views.see_full_news),
path("main_page/", views.main_page, name='main_page'),
path("dataselect/... | AlekseiMuryskin/SiteGS | gsras/urls.py | urls.py | py | 809 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
43243448951 | import logging
from functools import wraps
from io import BytesIO
from PIL import Image
try:
from PIL import ImageCms # pylint: disable=ungrouped-imports
except ImportError:
ImageCms = None
DEFAULT_SRGB_PROFILE = None
TRANSFORM_FLAGS = 0
else:
DEFAULT_SRGB_PROFILE = ImageCms.ImageCmsProfile(
... | thumbor/thumbor | thumbor/utils.py | utils.py | py | 4,272 | python | en | code | 9,707 | github-code | 6 | [
{
"api_name": "PIL.ImageCms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.ImageCms.ImageCmsProfile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.ImageCms",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PIL.ImageCms.cr... |
23391926789 | from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
import json
from pathlib import Path
from time import sleep
from selm.gales import settings
class Gale():
def __init_... | tyutltf/xaioliangzatan | selm/gales/gale.py | gale.py | py | 6,838 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 19,
"usage_type": "call"
},
{
"api... |
9202556126 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
def make_data_index(args, index):
'''
:param args:
:param index:
:return:
'''
# K is for K-fold cross-validation
# k is The k-th fold used for test
K = args.K_fold # Here, we don't use this because we use 10-fold cro... | SuperBruceJia/NLNet-IQA | Cross Database Evaluations/lib/make_index.py | make_index.py | py | 2,658 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 75,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number"... |
14471424043 | '''
There are N network nodes, labelled 1 to N.
Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the target node, and w is the time it takes for a signal to travel from source to target.
Now, we send a signal from a certain node K. How long will it take for ... | loganyu/leetcode | problems/743_network_delay_time.py | 743_network_delay_time.py | py | 3,027 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 86,
"usage_type": "call"
}
] |
31263506941 | from selenium import webdriver
from ordered_set import OrderedSet
import time
import os
import csv
os.system("cls")
f=open("99acres.csv","w",encoding='utf-8')
csv_writer= csv.writer(f)
csv_writer.writerow(['Project', 'specification', 'area','Value'])
driver = webdriver.Chrome('D:/virtualenvs_muthu/sele... | Muthu1612/Optimizing-real-estate-price-prediction-with-various-machine-learning-algorithms | Data extraction/extract_data.py | extract_data.py | py | 1,450 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
... |
18598085905 | from __future__ import annotations
from .base import BaseDAO
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from dto import PlayerDTO
class PlayerDAO(BaseDAO):
def create(self, data: PlayerDTO) -> None:
self._db_gateway.cursor.execute("INSERT INTO profiles (phone, username, description, age, ... | pyteacher123/py35-onl | sports_db_project/data_access/dao/player.py | player.py | py | 1,747 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "base.BaseDAO",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dto.PlayerDTO",
"line_number": 9,
"usage_type": "name"
}
] |
32149738267 | # Upload BOJ Gold-3 Topological Sorting & Graph 2252번 줄세우기
# https://velog.io/@kimdukbae/%EC%9C%84%EC%83%81-%EC%A0%95%EB%A0%AC-Topological-Sorting
# 참고 링크
from collections import deque
N, M = map(int,input().split())
graph = [ [] for _ in range(N+1)]
indegree = [0]*(N+1)
result = []
for i in range(M):
... | HS980924/Algorithm | src/14.그래프/B#2252_줄세우기.py | B#2252_줄세우기.py | py | 808 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 17,
"usage_type": "call"
}
] |
71992716667 | # -*- coding: utf-8 -*-
# python3
from loguru import logger
import time
import socket
import re
import psycopg2
from psycopg2 import Error
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
import time
logger.add("/var/log/cdr_collector/cdr_collector_{time:DD-MM-YYYY}.log",
format="{time:DD-MM-YYYY at HH... | jgnom/avaya_cdr_collector | main.py | main.py | py | 3,660 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "loguru.logger.add",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "socket.socket",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"l... |
6365552957 | import threading
from flask import Flask, jsonify, Response
import asyncio
from camera import Camera
from websocketServer import VideoWs
from flask_cors import CORS
from config import ip, http_port
from queue import Queue
app = Flask(__name__)
CORS(app)
camera = Camera()
event = threading.Event()
queue = Queue()
@a... | l5769389/py-vue-ws-camera | router.py | router.py | py | 1,400 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "camera.Camera",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line... |
43356641346 | #!/usr/bin/python3
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt
import sys
NUM_TRIAL = 2000
def calcPlotData(numSamplings, percentiles, dist):
plotXData = np.array([])
plotYData = np.array([])
for percentile in percentiles:
tmpPlotXData = np.array([])
tmpPlot... | peng225/blog | 230114/percentile.py | percentile.py | py | 2,211 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
12161841216 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 26 14:10:45 2021
@author: manssandsjo
"""
import matplotlib.animation as ani
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
lstm_lw = pd.read_pickle('./pickle_graphs/totValueLSTM_LW.pkl') #.to_numpy()
lstm_scm = pd.read_pick... | MansSandsjo/StockBot | src/Data/testGraphs.py | testGraphs.py | py | 1,267 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_pickle",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataF... |
21700191213 | # Reference : https://textgears.com/api/
import requests
text = input()
text = text.replace(' ','+')
url = "https://api.textgears.com/check.php?text=" + text + "&key=DEMO_KEY"
resp = requests.get(url)
resp = resp.json()
if resp['result']:
for err in resp['errors']:
print("Error at position : ",err['offset']+1)
... | kapoor-rakshit/pyfiddle | grammar.py | grammar.py | py | 475 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
}
] |
3668384154 | #!/usr/local/bin/python3
import boto3
networkAclId = 'acl-26cc1243'
ignoreEntries = [100, 32767]
session = boto3.Session()
client = session.client('ec2')
acls = client.describe_network_acls()
def getMaxOfRuleNumbers():
result = [0]
for acl in acls['NetworkAcls']:
if acl['NetworkAclId'] == netw... | debeando/MyScripts | aws/aws_network_acl_block_ip.py | aws_network_acl_block_ip.py | py | 1,606 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "boto3.Session",
"line_number": 8,
"usage_type": "call"
}
] |
44914350526 | #!/usr/bin/env python3
#/*
# Terminal User input
# Manual Mode where the coordinate and orientation variables are input
# Doesn't use accelerometer
#*/
# Import essential libraries
import requests #type: ignore
import numpy as np #type: ignore
import imutils #type: ignore
import time
import math
from datetime import ... | Quark3e/Chromebook-projects | projects/proj_Hexclaw/in rpi/Hexclaw_Main_2.py | Hexclaw_Main_2.py | py | 17,353 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "busio.I2C",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "board.SCL",
"line_number"... |
20955203674 | from selenium import webdriver
from selenium.webdriver.common.by import By
import time
# from selenium.webdriver.common.keys import Keys
# from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.support.ui import WebDriverWait
def Scrape(today):
# setup
chrome_options = webd... | colin-lankau/Crossword-Practice-Tool | Scrape.py | Scrape.py | py | 1,416 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 13,
"usage_type": "call"
},
{
"api... |
71750331067 | from flask import Flask, render_template, request, session, redirect, url_for
from flask_session import Session
import sqlite3
from ast import literal_eval
import datetime
app = Flask(__name__)
# Set the secret key to some random bytes. Keep this really secret!
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
@app.route('/... | mason-landry/lighttimer | lighttimer_app/app.py | app.py | py | 4,048 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.session.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_... |
8665774694 | import os
import json
from botocore.exceptions import ClientError
from unittest import TestCase
from unittest.mock import patch
from exceptions import YahooOauthError
from login_yahoo_authorization_url import LoginYahooAuthorizationUrl
class TestLoginYahooAuthorizationUrl(TestCase):
@classmethod
def setUpClas... | AlisProject/serverless-application | tests/handlers/login/yahoo/authorization_url/test_login_yahoo_authorization_url.py | test_login_yahoo_authorization_url.py | py | 2,213 | python | en | code | 54 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"l... |
72528403069 | import os, csv
from random import sample
import nltk as nlp
import pandas as pd
import matplotlib.pyplot as plt
sampleSize = 200
sampleTimes = 50
TTR = []
years =[]
# Iterate through word count/list file
with open('wordCountsNLTK.csv', 'r', encoding="ISO-8859-1") as csvFile:
reader = csv.reader(csvFile)
next(reader... | stkeller/Replication-Thesis | Code/LexicalTTRSampling.py | LexicalTTRSampling.py | py | 1,075 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "nltk.Counter",
"line_... |
23559591731 | import numpy as np
import matplotlib.pyplot as plt
N = 1000 #Nombre de tirages
X = np.random.rand(N) #Tirages independants de la loi uniforme sur [0,1]
#####################################
# But: calculer la suite des moyennes
# empiriques pour n de 1 a N
#####################################
## Calcul d... | FanJiang718/Courses-Exercises | MAP556/TP1/TP1 Python solutions-20181211/MAP556_PC1_Exo1_1_sol.py | MAP556_PC1_Exo1_1_sol.py | py | 1,073 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.rand",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line... |
73307642428 | import pandas as pd
import psycopg2 as ps
import datetime as dt
from datetime import datetime
from dateutil import tz
from config import POSTGRES_DBNAME, POSTGRES_PASSWORD, POSTGRES_USERNAME, POSTGRES_PORT, POSTGRES_ADDRESS, API_KEY
""" Functions for Flask App """
# dict with available exchange/trading pair for trade... | dbreddyAI/cryptolyticapp | api_source_code/Flask_App/utils.py | utils.py | py | 9,012 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "config.POSTGRES_ADDRESS",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "config.POSTGRES_PORT",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "config.POSTGRES_USERNAME",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": ... |
72931175228 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
#Leio os datasets e retiro o que preciso
df= pd.read_csv('DATASET_MobileRobotNav.csv', sep=';')
#Mostra a descrição do dataset (Média, Conta o número de tuplas, min, máx, etc)
print(df.describe())
#print(df)
#Sep... | jpavargasf/ML_RandomForest_ANN | Pedro/neural_network.py | neural_network.py | py | 1,716 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.neural_network.MLPRegressor",
"line_number": 37,
"usage_type": "call"
}... |
22449340075 | """
Реализация программу взаимодействия виджетов друг с другом:
Форма для приложения (ui/d_eventfilter_settings.ui)
Программа должна обладать следующим функционалом:
1. Добавить для dial возможность установки значений кнопками клавиатуры(+ и -),
выводить новые значения в консоль
2. Соединить между собой QDial, QS... | julsmi/DevPyQt | scripts/Практика 2/b_Самостоятельная + домашняя работа/d_eventfilter_settings.py | d_eventfilter_settings.py | py | 3,953 | python | ru | code | null | github-code | 6 | [
{
"api_name": "PySide6.QtWidgets.QWidget",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "PySide6.QtWidgets",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "PySide6.QtCore.QSettings",
"line_number": 31,
"usage_type": "call"
},
{
"api_nam... |
41550685644 | import os, sys, serial, time, traceback
from . codes import CMDTYPE, LEDTYPE, SPIChipsets, BufferChipsets
from . devices import Devices
from . import io
from .. channel_order import ChannelOrder
from .. driver_base import DriverBase
from ... util import exception, log, util
from ... drivers.return_codes import (
R... | ManiacalLabs/BiblioPixel | bibliopixel/drivers/serial/driver.py | driver.py | py | 7,526 | python | en | code | 263 | github-code | 6 | [
{
"api_name": "driver_base.DriverBase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "devices.Devices",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "codes.SPIChipsets",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "util.util.ge... |
34570396569 | from django import forms
from .models import Post, Comment, Category2
from treebeard.forms import movenodeform_factory, MoveNodeForm
# from markdownx.fields import MarkdownxFormField
class CategoryForm(MoveNodeForm):
class Meta:
model = Category2
exclude = ('sib_order', 'parent')
class Po... | MohammadGoodarzi/hamkav_core | HamkavBlog/forms.py | forms.py | py | 1,271 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "treebeard.forms.MoveNodeForm",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Category2",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name"... |
18100446664 | """
https://leetcode.com/problems/jump-game-iv/
1345. Jump Game IV
Given an array of integers arr, you are initially positioned at the first index of the array.
In one step you can jump from index i to index:
i + 1 where: i + 1 < arr.length.
i - 1 where: i - 1 >= 0.
j where: arr[i] == arr[j] and i != j.
Return the mi... | hirotake111/leetcode_diary | leetcode/1345/solution.py | solution.py | py | 2,162 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Deque",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "typing.DefaultDict",
"... |
35384638116 | from setuptools import setup
with open('README.md', 'r') as f:
readme = f.read()
if __name__ == '__main__':
setup(
name='youtube-dl-service',
version='0.0.2',
author='Dmitriy Pleshevskiy',
author_email='dmitriy@ideascup.me',
description='Using youtube-dl as service in... | pleshevskiy/youtube-dl-service | setup.py | setup.py | py | 655 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
}
] |
2298576928 | #!/usr/bin/env python
import sys
import logging
import time
import argparse
import pyBigWig
import math
import numpy as np
from sklearn import preprocessing
from MSTS.version import __version__
from MSTS.Parser.SimpleGffParser import SimpleGffParser
from MSTS.Db.FeatureDB import FeatureDB
from MSTS.Graphics import Gr... | nlapalu/MSTS | bin/MSTS_feature_phasogram.py | MSTS_feature_phasogram.py | py | 18,845 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.exp",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "numpy.nan",
"line_number": 94,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_numbe... |
16319784906 | """ZIP - Compactando / Descompactando arquivos"""
from zipfile import ZipFile
import os
""" Este módulo fornece ferramentas para:
criar, ler, escrever, adicionar, e listar um arquivo ZIP
-https://docs.python.org/pt-br/3/library/zipfile.html
"""
way = (r'C:\Users\Igor\Desktop\Estudos\Programação-em-Python'
r'\M... | igorfreits/Studies-Python | Udemy/4-Módulos-Python/aula 87 - ZIP.py | aula 87 - ZIP.py | py | 814 | python | pt | code | 1 | github-code | 6 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
3337691584 | '''
reres替换本地文件有问题 起一个端口用http试一试
'''
from flask import Flask
app = Flask(__name__)
@app.route("/udc.js")
def udc():
fill=open('/Users/xiaodu/Desktop/udc2.js','r',encoding='utf-8')
js_dt=fill.read()
return js_dt
if __name__ == '__main__':
app.run()
| zml1996/learn_record | myflask/file2link.py | file2link.py | py | 307 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
}
] |
74180016507 | import json
poptab = [ x.split(', ') for x in open('country-list.csv').read().split('\n')]
captab = [ x.split(', ') for x in open('country-capitals.csv').read().split('\n')]
flgtab = [ x.split(', ') for x in open('country-flags.csv').read().split('\n')]
curtab = [ x.split(', ') for x in open('country-currency.csv').re... | GnsP/countries | assemble.py | assemble.py | py | 1,156 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 26,
"usage_type": "call"
}
] |
73829652666 | import asyncio
import multiprocessing as mp
import os
import time
from bs4 import BeautifulSoup
from src.download_utils import download_page
class DownloadRepository:
def __init__(self, address: str):
self.files = []
self.address = address
self.queue = mp.Queue()
self.process = m... | FeltsAzn/TestTaskRadium | src/download_recursive.py | download_recursive.py | py | 3,102 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "multiprocessing.Queue",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "src.download... |
33526996747 | '''
测试预训练VGG文件,与CNN_DPL为同一预训练模型
'''
import torch as t
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
import data
from torchvision import transforms, datasets
import model
import warnings
warnings.filterwarnings('ignore')
batch_size = 128
test_dataset = datasets.ImageFolder(... | huifeidetiaotu96/CNN_DPL | test_VGG.py | test_VGG.py | py | 1,266 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchvision.datasets.ImageFolder",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.datasets",
"line_number": 15,
"usage_type": "name"
},
{
"api... |
27215468512 | # # Dependency for album cover download
# from urllib import request
#
# thumbnail_path = "https://i.ytimg.com/vi/uijHb5U1pD8/default.jpg"
# album_cover = request.urlretrieve(thumbnail_path, "albumcover.jpg")
import requests
f = open('image.jpg', 'wb')
f.write(requests.get('https://i.ytimg.com/vi/uijHb5U1pD8/default.j... | iostate/PythonProjects | DownloadMP4/open_image.py | open_image.py | py | 343 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
}
] |
44904287123 |
import torch
from experiment import Experiment, AutoDateSet, train, get_args
from model.Tree import Tree
from dataset.criteo import CriteoDataset
def get_model(args):
model = Tree(args)
return model
def get_dataset(args):
dataset = CriteoDataset(dataset_path=args.dataset_paths[0])
train_length = in... | Jarlene/Experiment | tree_main.py | tree_main.py | py | 1,237 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "model.Tree",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "model.Tree.Tree",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "model.Tree",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dataset.criteo",
"line_numb... |
39991774220 | import os
from glob import glob
from pathlib import Path
SOURCE_DIRECTORY = "CSVdatabases"
TARGET_DIRECTORY = "cleaned_databases"
CURRENT_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
DATABASES_FOLDER = f"{CURRENT_DIRECTORY}/{SOURCE_DIRECTORY}"
CLEANED_FOLDER = f"{CURRENT_DIRECTORY}/{TARGET_DIRECTORY}"
def... | DekunZhang/UCL_IFRC_IXN_PUBLIC | DesInventar/data_cleaner.py | data_cleaner.py | py | 1,417 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_numb... |
44900991873 |
import torch
import torch.nn as nn
from argparse import Namespace
from layers.Layers import DualAttenion, Transpose
class CARD(nn.Module):
def __init__(self, args: Namespace) -> None:
super(CARD, self).__init__()
self.patch_len = args.patch_len
self.stride = args.stride
self.embed... | Jarlene/AlgoRepo | models/ts/card.py | card.py | py | 3,357 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "argparse.Namespace",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
... |
10917250777 | from collections import namedtuple
from backend.DBEntry import DBEntry, to_db_obj_name
from backend.Ingredient import Ingredient
class Recipe(DBEntry):
"""A recipe of a dish. Consists of ingredients with optional amount (in optional units)."""
table_main = "recipes"
associations = [
("user_meals"... | Longneko/demo_food_app | backend/Recipe.py | Recipe.py | py | 10,035 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "backend.DBEntry.DBEntry",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "backend.Ingredient.Ingredient.from_db",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "backend.Ingredient.Ingredient",
"line_number": 50,
"usage_type": "name"
},... |
7035699251 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 21 13:24:47 2018
@author: kausic
"""
import os
import cv2
import numpy as np
from tqdm import tqdm
root="/home/kausic/Desktop/My_research/dataset/sunrgbd/SUNRGBD"
save_location="/home/kausic/ASU_MS/SML/project/sunrgbd_images/"
data_file=open(save_... | Bharathgc/Evaluating-Fusion-points-for-multi-stream-networks-handling-cross-modal-data | data_extractor_script.py | data_extractor_script.py | py | 1,306 | python | en | code | 11 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 24,
"usage... |
31454964996 | from typing import Any
from django.db.models import (
Model,
CharField,
ForeignKey,
BooleanField,
ManyToManyField,
UniqueConstraint,
DateTimeField,
CASCADE,
)
from abstracts.models import AbstractDateTime
from subjectss.models import Topic
from subjectss.models import Student
class Q... | NNaraB/education_site_back | apps/tests/models.py | models.py | py | 4,723 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "abstracts.models.AbstractDateTime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "abstracts.models.AbstractDateTime",
"line_number": 40,
"usage_type": "name"
... |
27132094648 | import logging
from operations.operation_manager import Operation
from operations import *
logging.config.fileConfig('/opt/TopPatch/conf/logging.config')
logger = logging.getLogger('rvapi')
#process that data!!
def process_queue_data(rqueue, queue_exists, agent_id,
username, customer_name, u... | SteelHouseLabs/vFense | tp/src/receiver/corehandler.py | corehandler.py | py | 837 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "logging.config.fileConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.config",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "operatio... |
16233043242 | from flask import Flask, url_for, request, json, session
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
import random
from passlib.hash import sha256_crypt
app = Flask(__name__)
app.secret_key = "alon"
app.config.from_object(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///site.db"
a... | nivschuman/QuizServer | main.py | main.py | py | 12,314 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.randint... |
42104820373 | from pyspark import SparkContext, SparkConf
from pyspark.sql import SparkSession
class Reporter(object):
def __init__(self, project, src_files, dst_table, keyfile, config):
self.project = project
self.src_files = src_files
self.dst_table = dst_table
self.keyfile = keyfile
self.driver = config.... | ubermen/anomaly_detector | estimator/reporter/engines.py | engines.py | py | 2,795 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.config",
"line_number": 56,
"usage_type": "call"
},
{
"ap... |
28204866764 | from automata.Automata import Automata
from tokenizer.Tokenizer import tokenizerSimple
'''
Leemos los datos necesarios para empezar a procesar el automata.
Tokenizamos las entradas para obtenerlas en forma de array.
'''
simbolos_entrada = tokenizerSimple(input("Simbolos de entrada >> "))
estados = tokenizerSimple(inp... | ephelsa/Teoria_Lenguaje | 1. Automata/proyecto/__init__.py | __init__.py | py | 799 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "tokenizer.Tokenizer.tokenizerSimple",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tokenizer.Tokenizer.tokenizerSimple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tokenizer.Tokenizer.tokenizerSimple",
"line_number": 11,
"usage_ty... |
39861129033 | """Imports xml statements from privatbank, optained via p24-cli.
See https://github.com/dimboknv/p24-cli
The xml format is identical to that of p24 merchant api.
"""
import datetime
from xml.etree import ElementTree as ET
import beangulp
import dateutil.parser
from beancount.core import data, flags
from beancount.c... | OSadovy/uabean | src/uabean/importers/privatbank_xml.py | privatbank_xml.py | py | 3,577 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "uabean.importers.mixins.IdentifyMixin",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "beangulp.Importer",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "beancount.core.flags.FLAG_OKAY",
"line_number": 20,
"usage_type": "attribute... |
34596295886 | import argparse
import itertools
import re
import sys
from typing import Optional
from graphviz import Digraph
import numpy as np
import wandb
from app.type import APPSProblem, Node
from app.const import (
CONCURRENCY_LIMIT,
DEFAULT_WANDB_PROJECT_NAME,
K,
NO_CUDA,
NUM_ROLLOUTS,
TERMINAL_TOKEN,... | cavaunpeu/mcts-llm-codegen | app/util.py | util.py | py | 4,017 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "app.const.TERMINAL_TOKEN",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "re.escape",
... |
70396698747 | import lcqp_manip
import casadi
import numpy as np
import lcqpow
# create the objects
box_ly = 0.15
vmax = 0.035
wmax = 0.035
box = lcqp_manip.Box(w=0.24, h=0.08, m=0.1, g=9.81, vmax=casadi.SX([vmax, vmax, wmax]))
gripper = lcqp_manip.Gripper(h=0.08, rmax=0.115, rmin=0, vmax=casadi.SX([vmax, vmax, wmax, vmax]))
groun... | omron-sinicx/lcqp | examples/pivot.py | pivot.py | py | 6,805 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "lcqp_manip.Box",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "casadi.SX",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lcqp_manip.Gripper",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "casadi.SX",
"line_num... |
349034442 | import pandas as pd
import numpy as np
from zipfile import ZipFile
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from pathlib import Path
import matplotlib.pyplot as plt
from keras.layers import Concatenate, Dense, Dropout
from keras.layers import Add, Activation, Lambda
from ... | wmcfarlan/health_recommender | src/helper/keras_class.py | keras_class.py | py | 3,069 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.keras.Model",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.layers.Embedding",
"line_number": 24,
"usage_type": "call"
},
{
"ap... |
37204907362 | # 打开数据库连接
import pymysql as pymysql
import math
EARTH_REDIUS = 6378.137
pi = 3.1415926
def rad(d):
return d * pi / 180.0
def getDistan(lat1, lng1, lat2, lng2):
radLat1 = rad(lat1)
radLat2 = rad(lat2)
a = radLat1 - radLat2
b = rad(lng1) - rad(lng2)
s = 2 * math.asin(math.sqrt(math.pow(math.sin(... | tangleibest/untitled | test/a.py | a.py | py | 1,444 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.asin",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 15,
"u... |
17451718192 | import numpy as np
import pandas as pd
from model_zoo.xgb import train_xgb
from model_zoo.catboost import train_catboost
from model_zoo.lgbm import train_lgbm
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import KFold
TRAIN_FCTS = {
"lgbm": train_lgbm,
"xgb": train_xgb,
"catboost":... | TheoViel/kaggle_foursquare | src/training/main_boosting.py | main_boosting.py | py | 3,551 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "model_zoo.lgbm.train_lgbm",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "model_zoo.xgb.train_xgb",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "model_zoo.catboost.train_catboost",
"line_number": 12,
"usage_type": "name"
},
{
... |
71578351547 | """ An example trainer for a simply policy gradient implementation. """
import time
import json
import torch
from torch.optim import Adam
import gym
from oxentiel import Oxentiel
from asta import dims, shapes
from vpg import (
get_action,
compute_policy_loss,
compute_value_loss,
finish,
ActorCri... | langfield/polstead | demos/vpg/primitive/trainer.py | trainer.py | py | 2,664 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "oxentiel.Oxentiel",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "gym.Env",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "gym.make",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "asta.shapes.OB",
"line_nu... |
32740927638 | #!/bin/python3
import re
import getopt, sys
from kazoo.client import KazooClient
import json
def getRollupRules(zookeeperHostsIn, zNodePath):
zk = KazooClient(hosts=zookeeperHostsIn);
zk.start();
result = {};
if zk.exists(zNodePath):
for zookeeperChild in zk.get_children(zNodePath):
... | ModdingFox/AutomaticDruidRollup | Zookeeper/Fetch_Druid_Rules.py | Fetch_Druid_Rules.py | py | 682 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "kazoo.client.KazooClient",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
}
] |
38049949342 | from gtts import gTTS
from pydub import AudioSegment
from pydub.playback import play
from screeninfo import get_monitors
import numpy as np
import cv2
import json
import tempfile
import os
import time
def get_screen_resolution(use_default):
if use_default:
return 640, 480 # Default resolution... | aman071/Smartphone-audio-cues-for-visually-impaired | audio_generation.py | audio_generation.py | py | 2,862 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "screeninfo.get_monitors",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "gtts.gTTS",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pydub.A... |
41137173523 | #to run, 'sudo python' then 'import gamepad' (this file), then 'gamepad.test()'
#to install pygame: apt-get install python-pygame
import pygame, time, serial, csv, motor_func, math
pygame.init()
j = pygame.joystick.Joystick(0)
j.init()
# This is for the output write (change it accordingly, i.e: /dev/ttyUSB0):
#outpu... | rsx-utoronto/galaxy | ground_station/main_ui/joystick.py | joystick.py | py | 1,815 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.joystick.Joystick",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.joystick",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.p... |
32108115946 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("orgs", "0014_auto_20150722_1419")]
operations = [
migrations.CreateModel(
name="Con... | rapidpro/ureport | ureport/contacts/migrations/0001_initial.py | 0001_initial.py | py | 990 | python | en | code | 23 | github-code | 6 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 11,
"usage_type": "call"
},
... |
39104149472 | from django.urls import path
from . import views
app_name = 'orders'
urlpatterns = [
path('checkout', views.checkout, name='checkout'),
path('order_details', views.order_detail, name='order_details'),
path('orders', views.orders, name='orders'),
path('create_order/', views.create_order, name='create_o... | suveydacan/book_shopping_microservice | MyProject/orders/urls.py | urls.py | py | 333 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
30763965983 | # Obj: Data persistance
# Opt1: External files
# Opt2: DB
# Procedure:
# Create the external file.
# Open the file
# Manipulate the file
# Close the file
from io import open
# First parameter file name, second parameter mode to open (read, write)
textFile = open('file.txt', 'w')
line = 'Great day to code Python \n... | Giorc93/PythonCourse | ExternalFiles/TextFiles/externalText.py | externalText.py | py | 1,508 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "io.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 39,
"usage_t... |
24348533870 | import shutil
import zipfile
import os
import sys
import warnings
from urllib.request import urlretrieve
from tqdm import tqdm
from zrp import about
# This is used to show progress when downloading.
# see here: https://github.com/tqdm/tqdm#hooks-and-callbacks
class TqdmUpTo(tqdm):
"""Provides `update_to(n)` which... | zestai/zrp | zrp/download.py | download.py | py | 9,695 | python | en | code | 25 | github-code | 6 | [
{
"api_name": "tqdm.tqdm",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlretrieve",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
29057620857 | #!/usr/bin/python3
"""
base module contains the Base class
"""
import json
class Base:
"""
Base class: manage id attribute in all the subclass
Attributes:
__nb_objects - class attribute initialized with 0
__init__ - class constructor
"""
__nb_objects = 0
def __init__(self, i... | ZIHCO/alx-higher_level_programming | 0x0C-python-almost_a_circle/models/base.py | base.py | py | 3,809 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 75,... |
13900998846 | from flask import Flask,render_template,request,send_file;
from flask_wtf import FlaskForm;
from wtforms import FileField,SubmitField;
import pandas as pd
import logging as logger
from werkzeug.utils import secure_filename
from openpyxl.styles import Border, Side, Alignment,PatternFill
from openpyxl.utils import get_co... | Swapnil-mindbrick-2022/reportgen | App.py | App.py | py | 18,656 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "wtforms.FileField",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "wtforms.SubmitField... |
11601984964 | import sqlite3
"""
Two functions to help the main.py functions to validate the reference variable.
"""
# Open the database and create a cursor
conn = sqlite3.connect("candidate.db")
c = conn.cursor()
""" **************************
Args - ref - str
Return - Bool
A validation function that takes the reference as a... | JohnEHughes/arctic_shores_test_v1 | validators.py | validators.py | py | 1,584 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
}
] |
27472315206 | from flask import Flask, request,jsonify
import util
from flask_cors import CORS
app= Flask(__name__)
CORS(app)
@app.route('/get_location_names',methods=['GET'])
def get_location_names():
response = jsonify({
'location': util.get_location()
})
response.headers.add('Access-Control-Allow-Or... | Shinchan3/Home_price_linear_regression | server/server.py | server.py | py | 922 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "util.get_location",
"line_... |
36356263355 | from PIL import ImageDraw
from configs.cfgs import args
def read_class_names(class_file_name):
'''loads class name from a file'''
names = {}
with open(class_file_name, 'r') as data:
for ID, name in enumerate(data):
names[ID] = name.strip('\n')
return names
def draw_boxes(img, box... | alexchungio/RetinaNet-Pytorch | utils/tools.py | tools.py | py | 1,245 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "configs.cfgs.args.classes",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "confi... |
44098268965 | import tensorflow as tf
import numpy as np
from typing import Union, Optional, Sequence
from pathlib import Path
from dui.datasets.hdf5datasetfactory import HDF5DatasetFactory
from dui.utils.signal import compress_db
from dui.layers.utils import get_channel_axis
def create_image_dataset(
path: Union[str, Pat... | dperdios/dui-ultrafast | dui/datasets/utils.py | utils.py | py | 6,117 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_nu... |
43332148964 | import logging
import json
import gzip
import ipaddress
import datetime
from c99api import EndpointClient
from typing import List, Dict, Optional
from os.path import exists
from pydantic import BaseModel
logger = logging.getLogger()
def enrich_object_c99(object, c99_key:str=""):
c99 = EndpointClient
c99.ke... | Magnus1990P/shodan_extractor | src/ShodanExtractor/common.py | common.py | py | 7,089 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "c99api.EndpointClient",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
2026787329 | import csv
import matplotlib.pyplot as plt
Zb = [[], []]
# with open('F:/zhengwangwork/test csv/4.csv','rb')as f:
# reader=csv.reader(f)
# for row in reader:
# print(row[0])
file = open('../gold.csv', 'r', encoding='UTF-8') # 打开csv文件
reader = csv.reader(file) # 读取csv文件
data = list(reader) # 将csv数据转化... | Nienter/mypy | personal/gold.py | gold.py | py | 775 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot... |
39824039269 | import random
import numpy as np
from scipy.stats import entropy
class CNF:
def __init__(self, path=None, clauses=None):
if path:
with open(path, 'r') as cnf:
formula = cnf.read()
formula = formula.split('\n')
start_index = 0
whil... | mosin26/master_thesis | cnf.py | cnf.py | py | 5,685 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "scipy.stats.entropy",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_... |
26703437835 | import argparse
from math import sqrt, floor, ceil
from os import listdir
import io
from Player import Player
import pygame
import time
from View import View
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import cv2
BUTTONPRESS_CSV = "buttonpress.csv"
GAME_CSV = "game.csv"
FACE_FILES = ["faces... | LanyK/TheAngerGames | bombangerman/client/GameReplay.py | GameReplay.py | py | 14,488 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "View.View",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"... |
34730801336 | import logging
import json
import os
import requests
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(inputPayload, context):
slack_link = os.environ['SLACK_URL']
try:
url = inputPayload['issue']['html_url']
except Exception as e:
logger.error(e)
# retu... | ByteOfKathy/esep-webhooks | lambda_function.py | lambda_function.py | py | 536 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"l... |
24860820161 | # -*- coding: utf-8 -*-
"""
Mini project 1
Dennis Brown, COMP6636, 03 MAR 2021
"""
import numpy as np
import copy
import matplotlib.pyplot as plt
def libsvm_scale_import(filename):
"""
Read data from a libsvm .scale file
"""
datafile = open(filename, 'r')
# First pass: get dimensions of data
... | dennisgbrown/classifiers-decision-trees-kNN-perceptron | MiniProj1.py | MiniProj1.py | py | 15,120 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"li... |
44343755795 | import sys
from itertools import combinations as comb
sys.stdin = open('input/20529.txt')
input = sys.stdin.readline
def d(A, B):
return sum([A[i] != B[i] for i in range(4)])
T = int(input())
for tc in range(T):
N = int(input())
mbti = input().split()
if len(mbti) > 32:
print(0)
else:
... | nayeonkinn/algorithm | baekjoon/[S1] 20529. 가장 가까운 세 사람의 심리적 거리.py | [S1] 20529. 가장 가까운 세 사람의 심리적 거리.py | py | 493 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "itertools.combinations",
"line_number": 17,
"usage_type": "call"
}
] |
71359830907 | from decimal import Decimal
import ffmpeg
import math
import gc
def get_aspect_ratio(width, height):
gcd = math.gcd(width, height)
lhs = int(width / gcd)
rhs = int(height / gcd)
return f"{lhs}x{rhs}"
def get_raw_duration(video):
duration_raw = None
# check framerate at index 0 and 1, because... | bennischober/MetaDataScraper | src/media/read_media.py | read_media.py | py | 3,958 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.gcd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ffmpeg.probe",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "gc.collect",
"line_number": ... |
5484857647 | import ROOT
import uproot
from hipe4ml.tree_handler import TreeHandler
import numpy as np
import argparse
import yaml
import sys
sys.path.append('utils')
import utils as utils
utils.set_style()
kBlueC = ROOT.TColor.GetColor('#1f78b4')
kOrangeC = ROOT.TColor.GetColor('#ff7f00')
ROOT.gROOT.SetBatch()
## create signa... | lbariogl/HyperRoutine | signal_extraction.py | signal_extraction.py | py | 16,102 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "utils.set_style",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ROOT.TColor.GetColor",
... |
2872283986 | import requests
import datetime as dt
from twilio.rest import Client
account_sid = 'Twilio_api_sid'
auth_token = 'twilio_auth_token'
STOCK = "TSLA"
COMPANY_NAME = "Tesla Inc"
stock_api_key = 'alpha_vantage_api_key'
news_api_key = 'news_api_key'
STOCK_ENDPOINT = "https://www.alphavantage.co/query"
NEWS_ENDPOINT = "h... | mgardner1011/UdemyProjects | Stock_news_alert/main.py | main.py | py | 2,383 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datet... |
15183195346 | #! usr/bin/env python
# -*- coding : utf-8 -*-
from skopt import gp_maximize
import numpy as np
from skopt.plots import plot_convergence
np.random.seed(123)
#%matplotlib inline
import matplotlib.pyplot as plt
noise_level = 0.1
def f(x, noise_level=noise_level):
return np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2)... | aggarwalpiush/Hyperparameter-Optimization-Tutorial | main.py | main.py | py | 2,364 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.tanh",
"line_nu... |
29246617685 | # from django.contrib import messages
from json import loads, dumps
from .models import Link
from django.db.models import Sum
from django.db import OperationalError
from tenacity import (retry, stop_after_attempt, wait_fixed,
retry_if_exception_type)
import random
import string
import datetime
fr... | RahulTandon1/cutshort | shortner/views.py | views.py | py | 4,216 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "da... |
41039653002 | from __future__ import annotations
import json
import atexit
import datetime
import functools
import logging
import multiprocessing
import os
import shutil
import signal
import socket
import subprocess
import tempfile
import threading
import time
import webbrowser
from collections import namedtuple
from contextlib imp... | vegaprotocol/vega-market-sim | vega_sim/null_service.py | null_service.py | py | 36,719 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"l... |
43079348194 | from typing import List
class Solution:
def factorial(self, n: int) -> int:
fact = 1
for i in range(1, n+1):
fact *= i
return fact
def combination(self, n: int, r: int) -> int:
return self.factorial(n) // (self.factorial(n-r) * self.factorial(r))
def generate... | devKhush/DSALeetCodeProblems_Python | Pascal's Triangle/GeneratePascalTriangle.py | GeneratePascalTriangle.py | py | 659 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
}
] |
73816585466 | from collections import defaultdict
from typing import ClassVar, Self
from discord import Message, Thread
from discord.errors import HTTPException
from pydis_core.utils import scheduling
from pydis_core.utils.logging import get_logger
import bot
from bot.constants import Channels
from bot.exts.filtering._filter_conte... | python-discord/bot | bot/exts/filtering/_settings_types/actions/remove_context.py | remove_context.py | py | 5,173 | python | en | code | 1,206 | github-code | 6 | [
{
"api_name": "pydis_core.utils.logging.get_logger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bot.exts.filtering._filter_context.FilterContext",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "discord.Message",
"line_number": 24,
"usage_type": "... |
5093704747 | """empty message
Revision ID: b3ff59df2833
Revises: fee4d1b1d192
Create Date: 2022-04-08 07:33:52.082355
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'b3ff59df2833'
down_revision = 'fee4d1b1d192'
branch_labels = None
depe... | sudiptob2/microserve-main | migrations/versions/b3ff59df2833_.py | b3ff59df2833_.py | py | 934 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "alembic.op.alter_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.dialects.mysql.VARCHAR",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "... |
42896269372 | import jax
import numpy as np
import numpy.testing as npt
import pytest
from matplotlib import pyplot as plt
from statsmodels.graphics.tsaplots import plot_acf
from .common import GaussianDistribution, FlatPotential, FlatUnivariatePotential, GaussianDynamics, lgssm_data, \
GaussianObservationPotential
from ..csmc ... | AdrienCorenflos/aux-ssm-samplers | aux_samplers/_primitives/test_csmc/test_csmc.py | test_csmc.py | py | 3,688 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "jax.config.update",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jax.config",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "jax.random.PRNGKey",... |
45364274546 | import pygame
from Game.Scenes.Scene import *
from Game.Shared import GameConstant
from Game import Highscore
class HighscoreScene(Scene):
def __init__(self, game):
super(HighscoreScene, self).__init__(game)
self.__highScoreSprite = pygame.transform.scale(pygame.image.load(GameConstant.... | grapeJUICE1/Grape-Bricks | Game/Scenes/HighScoreScene.py | HighScoreScene.py | py | 1,256 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "pygame.transform.scale",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.transform",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame... |
10423288883 | from __future__ import annotations
import pytest
from PySide6.QtCore import Qt
from randovania.game_description.db.configurable_node import ConfigurableNode
from randovania.game_description.db.dock_node import DockNode
from randovania.game_description.db.event_node import EventNode
from randovania.game_description.db... | randovania/randovania | test/gui/dialog/test_node_details_popup.py | test_node_details_popup.py | py | 4,199 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "randovania.gui.dialog.node_details_popup.NodeDetailsPopup",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 16,
"usage_type": "attribu... |
37198526566 | # _*_ coding: utf-8 _*_
# @author: anniequ
# @file: datapre.py
# @time: 2020/11/12 11:07
# @Software: PyCharm
import os
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
import torch
import torchvision.transforms as tfs
from torch.utils.data import DataLoader
from torch import nn
import torch.n... | Anniequ/FCNcopy | all.py | all.py | py | 16,271 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.seterr",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"lin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.