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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74872597664 | from simuload.arch.service import Service
import numpy as np
class Calculator:
def carga_consumo(self, carga_id: int):
consumo = np.zeros((24))
equipamentos = Service().consultar_equip_na_carga(carga_id)
for equip in equipamentos:
equip_id = equip[0]
equi... | jpcairesf/simuload | simuload/processors/calculator.py | calculator.py | py | 6,904 | python | pt | code | 1 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "simuload.arch.service.Service",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "simuload.arch.service.Service",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": ... |
9281895186 | import pandas as pd
import matplotlib.pyplot as plt
import sklearn.cluster as sk_cluster
object_sizes = pd.read_csv("data/object_sizes.csv")
X = object_sizes[["width", "height"]]
k_means_pp_model = sk_cluster.KMeans(n_clusters=5)
k_means_pp_model.fit(X)
object_classes = k_means_pp_model.predict(X)
plt.scatter(x=obj... | AndriiLatysh/ml_4 | 8_clustering/object_size_clustering.py | object_size_clustering.py | py | 577 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot... |
8313675419 | import numpy as np
import pylab as plt
import time
import random
from scipy.sparse.linalg import eigsh
from scipy.sparse.linalg import LinearOperator
np.set_printoptions(precision=5)
from scipy.optimize import curve_fit
f=1
g=1
class MPS:
def __init__(self,size,system_d,chi):
'''
... | ashodkh/Density-Matrix-Renormalization | DMRG clean.py | DMRG clean.py | py | 12,864 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.tensordot",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.tensordot",
... |
44387554730 | import os
from flask import Flask, render_template, request
from Reviewdata import *
app = Flask(__name__)
os.environ["DATABASE_URL"] = "postgres://ymjvjqxehzwaub:aadaba6ce5d972237f60a1343ab28645884515fee52b1d9aea95ab421a14537c@ec2-18-210-51-239.compute-1.amazonaws.com:5432/dbuaf71hle517p"
app.config["SQLALCHEMY_DATA... | vejjutejdeep/Project1 | create.py | create.py | py | 532 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
}
] |
74825116703 | import discord
from settings import help_cmds,bch_title,bch_desc,bch,bbh,bbh_desc,bbh_title,calch_title,calch_desc,calch,gh,gh_title,gh_desc,hm,hm_title,hm_desc,bchd_title,bchd_desc,bchd,bbhd,bbhd_desc,bbhd_title,calchd_title,calchd_desc,calchd,ghd,ghd_title,ghd_desc,dhm,dhm_title,dhm_desc,mch,mch_title,mch_desc,mchd,m... | akalmannakarmi/barterBot | help_.py | help_.py | py | 5,359 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "discord.Embed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "settings.bch_title",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "settings.bch_desc",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "discord.Color.red",
... |
9687498824 | import hashlib
import time
import urllib.request as urlrequest
import json
class RiskCheckDemo(object):
"""本接口的功能是智能风控明细数据查询,主要用于数据同步:从易盾拉取数据场景,以固定时间窗口拉取数据。
例如,每次查询1分钟前的数据,时间跨度也是1分钟,则可以按1分钟时间窗口,周期性滑动拉取数据。"""
API_URL = "http://ir-open.dun.163.com/v5/risk/detail"
def __init__(self, secret_id, secre... | yidun/irisk-openapi-demo | irisk-openapi-python-demo/v5/detail/RiskDetailDemo.py | RiskDetailDemo.py | py | 3,388 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "hashlib.md5",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_n... |
928931454 | from datetime import datetime
from typing import Any, Callable, Optional, TypeVar
from reactivex import Observable, abc, typing
from reactivex.disposable import CompositeDisposable
from reactivex.scheduler import TimeoutScheduler
_T = TypeVar("_T")
def skip_until_with_time_(
start_time: typing.AbsoluteOrRelativ... | ReactiveX/RxPY | reactivex/operators/_skipuntilwithtime.py | _skipuntilwithtime.py | py | 2,252 | python | en | code | 4,581 | github-code | 7 | [
{
"api_name": "typing.TypeVar",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "reactivex.typing.AbsoluteOrRelativeTime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "reactivex.typing",
"line_number": 12,
"usage_type": "name"
},
{
"api_n... |
3670049473 |
print("Import Sequence Initiated...")
import os
import librosa #for audio processing
#import IPython.display as ipd
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile #for audio processing
#print('A')
#print ('Hi')
#print ('Audio 1: Harshitha "a"')
#print ('Audio 2: Anant "a"'... | antgad/Speech_Therapy | audio.py | audio.py | py | 3,194 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "librosa.load",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "librosa.resample",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "librosa.load",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "librosa.resample",
"li... |
40472219232 | from flask import Flask, request, render_template, render_template_string, redirect
from schema_classes.tools_schema import PrepareRequestBase, PreparePOST400Response, PreparePOST200Response
from schema_classes.overview_schema import OverviewRequestBase, OverviewGET200Response
from schema_classes.grading_schema import ... | JulianSobott/exam_grader | frontend/main.py | main.py | py | 2,738 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
7530974248 | from pprint import pprint
from datetime import datetime
from apiclient.discovery import build
from apiclient.http import MediaFileUpload
from oauth2client.service_account import ServiceAccountCredentials
import config
import looter
def get_service(api_name, api_version, scopes, key_file_location):
"""Get a service... | seeker1983/instlooter-grab-latest | sheet.py | sheet.py | py | 2,719 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "apiclient.di... |
11262550404 | import jax
import flax
import jax.numpy as jnp
import numpy as np
from scipy import integrate
from models import utils as mutils
def get_div_fn(fn):
"""Create the divergence function of `fn` using the Hutchinson-Skilling trace estimator."""
def div_fn(x, t, eps):
grad_fn = lambda data: jnp.sum(fn(data, t) * ... | LuChengTHU/dpm-solver | examples/score_sde_jax/likelihood.py | likelihood.py | py | 4,688 | python | en | code | 1,241 | github-code | 7 | [
{
"api_name": "jax.numpy.sum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "jax.grad",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jax.numpy.sum",
"line_number": 1... |
37955065328 | """
Check symbols in watch list to make sure they are tradable, and get Smart Routing information.
Only common stocks in USD currency are selected.
"""
import sqlite3
from pprint import pprint
import threading
import time
from datetime import datetime
from ibapi.client import EClient
from ibapi.wrapper import EWrap... | jmnel/neuralsort | realtime/src/ibclient/check_symbols.py | check_symbols.py | py | 3,054 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "ibapi.wrapper.EWrapper",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "ibapi.client.EClient",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "ibapi.client.EClient.__init__",
"line_number": 32,
"usage_type": "call"
},
{
"api_nam... |
74879751904 | from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from django.conf import settings
# Create your models here.
class UserProfile(models.Model):
body_lean = 'Ecto'
body_healthy = 'Endo'
body_normal = 'Meso'
body_type_choices = [
(body_lean, 'Ec... | rishabh422tiwari/Gym-Tracker | base/models.py | models.py | py | 3,280 | python | en | code | 0 | github-code | 7 | [
{
"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": 18,
"usage_type": "call"
},
{
"api_name": ... |
71645559584 | #from re import S
from typing import Text
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route("/", methods=["GET", "POST"])
def index():
sistema = str(request.form.get("sistema"))
ip = str(request.form.get("ip"))
qm = str(request.form.get("qm"))
cpu = str(requ... | lhaislla/PSB | VM_web/VM_web/web.py | web.py | py | 871 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
73199861024 |
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException... | BahramJannesar/ArchdailyProjectDownloader | main.py | main.py | py | 5,419 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "selenium... |
24749435596 | import threading
from ..lib.drush import DrushAPI
from ..lib.thread_progress import ThreadProgress
import sublime
import sublime_plugin
class DrushUpdateDbCommand (sublime_plugin.WindowCommand):
"""
A command to invoke update-db.
"""
def run(self):
self.drush_api = DrushAPI(self.window.activ... | kostajh/subDrush | commands/drush_updatedb_command.py | drush_updatedb_command.py | py | 1,221 | python | en | code | 17 | github-code | 7 | [
{
"api_name": "sublime_plugin.WindowCommand",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "lib.drush.DrushAPI",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sublime.status_message",
"line_number": 18,
"usage_type": "call"
},
{
"api_na... |
8580114688 | import json
import base64
import logging
from util.lambda_utils import extract_data_from_log
from model.execution_log import ExecutionLog
logger = logging.getLogger(__name__)
class LambdaFunction:
""" Class representing AWS Lambda function """
def __init__(self, arn: str, lambda_client):
self.arn = ... | tawalaya/cat-sizer | model/lambda_function.py | lambda_function.py | py | 6,433 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": "util.lambda_utils.extr... |
42446291868 | import pytest
from mnamer.endpoints import tmdb_find, tmdb_movies, tmdb_search_movies
from mnamer.exceptions import MnamerException, MnamerNotFoundException
from mnamer.providers import Tmdb
from tests import JUNK_TEXT, RUSSIAN_LANG
pytestmark = [
pytest.mark.network,
pytest.mark.tmdb,
pytest.mark.flaky(r... | jkwill87/mnamer | tests/network/test_endpoints__tmdb.py | test_endpoints__tmdb.py | py | 5,030 | python | en | code | 663 | github-code | 7 | [
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.flaky",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
... |
4072107777 | from django.urls import path
from .views import *
urlpatterns = [
path('room/add', room_add),
path('reserve/add', reserve_add),
path('room/delete/<int:room_id>', room_delete),
path('reserve/delete/<int:booking_id>', reserve_delete),
path('rooms', get_all_room),
path('reserve', get_all_reserve),... | prostomusa/Hotel | room/urls.py | urls.py | py | 322 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
8672085786 | """
@Author: 邓润庭
@Date: 2021/3/19
"""
from typing import List
# 自底向上
def min_coin_num(coins: List, amount: int):
dp = [float("inf")] * (amount + 1)
dp[0] = 0
for n in range(amount + 1):
for coin in coins:
if coin <= n:
dp[n] = min(dp[n], dp[n - coin] + 1)
retur... | fadeawaylove/interview_mkdocs | code/algorithm/dp/05_coins03.py | 05_coins03.py | py | 421 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
}
] |
23025401238 | import spacy
import neuralcoref
nlp = spacy.load('en_core_web_sm')
neuralcoref.add_to_pipe(nlp)
def resolve_corefs(text):
doc = nlp(text)
text_revised=text
for i in range(len(doc._.coref_clusters)): #Coref clusters is a list of cluster objects
cluster = doc._.coref_cluste... | samemon/ClippyQA | coref_resolution/coref.py | coref.py | py | 1,385 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "spacy.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "neuralcoref.add_to_pipe",
"line_number": 5,
"usage_type": "call"
}
] |
9250839285 | from subprocess import PIPE, run
import time
import zmq
def listen():
ctx = zmq.Context()
sock = ctx.socket(zmq.REP)
sock.bind("tcp://*:8085")
print("Starting loop for OT2 internal listener...")
i = 1
while True:
msg = sock.recv_string()
print(msg)
i += 1
time.s... | shirleyzzr1/robot_Docker | ot2_docker/OT2_listener.py | OT2_listener.py | py | 1,061 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "zmq.Context",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "zmq.REP",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number":... |
37952773448 | import debugpy
from detector import *
debugpy.listen(5678);
print("Waiting for debugger to attach");
debugpy.wait_for_client();
#rules = load_definitions("./detector.json");
det=Detector("./detector.json");
rules=det.get_rules();
print(rules);
fields=rules['fields'];
print(fields);
print(fields[1]); | hfrvbjjtfvnjgfcvnj/crows_nest | test_detector.py | test_detector.py | py | 303 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "debugpy.listen",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "debugpy.wait_for_client",
"line_number": 7,
"usage_type": "call"
}
] |
40020713550 | #!/usr/bin/env python3
import sys
import datetime
import re
import os
import time
import json
import csv
import tempfile
import zipfile
import argparse
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
hmms_pattern = re.compile(
r"""
^(
(?P<L>L)|
(?P<yup>yup|yep)|
(?P<heh>he(h+))|
(?P<huh>hu(h+))|
(?... | Atli-A/Graphcord | graphcord.py | graphcord.py | py | 8,202 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "re.MULTILINE",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "re.VERBOSE",
"lin... |
37963961012 | import torch
device = 'cuda' if torch.cuda.is_available() else 'cpu'
LR = 1e-2
WORD_PAD = '<PAD>'
WORD_PAD_ID = 0
WORD_UNK = '<UNK>'
WORD_UNK_ID = 1
LABEL_O_ID = 0
LABEL_OTH_ID = 26
VOCAB_SIZE = 3000
VOCAB_PATH = './output/vocab.txt'
DEV_PATH = './input/data/ResumeNER/dev.char.bmes'
TRAIN_PATH = './input/data/Resume... | Sakurasilent/EmCRF | config.py | config.py | py | 706 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 3,
"usage_type": "attribute"
}
] |
25471692526 | """
This module contains various utility functions that are exposed to API users
"""
from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License... | Autodesk/molecular-design-toolkit | moldesign/tools/topology.py | topology.py | py | 7,884 | python | en | code | 161 | github-code | 7 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "moldesign.exceptions.UnhandledValenceError",
"line_number": 94,
"usage_type... |
29705300603 | import sqlite3
connection = sqlite3.connect('gfg.db')
cursor = connection.cursor()
#SQL command to create a table in the database
command = """
CREATE TABLE emp(
staff_number INTEGER PRIMARY KEY,
fname VARCHAR(20),
lname VARCHAR(30),
gender CHAR(1),
joining DATE
);
"""
cursor.execut... | KalinaRaycheva/Training | Python/03_Python_Libraries/Sqlite3/simple_table.py | simple_table.py | py | 707 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
44798239720 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="chartree",
version="0.1.0",
author="bsmrvl",
author_email="ben.j.somerville@icloud.com",
description="Grow trees",
long_description=long_description,
long_description_content_type=... | bsmrvl/chartree | setup.py | setup.py | py | 673 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
13282845166 | import asyncio
from copy import deepcopy
import time
import heapq
async def gather_transaction_batches(queue: dict, expected_batches: int, timeout=5):
# Wait until the queue is filled before starting timeout
while len(set(queue.keys())) == 0:
await asyncio.sleep(0)
# Now wait until the rest come ... | Lamden/cilantro-enterprise | cilantro_ee/nodes/delegate/work.py | work.py | py | 1,750 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "asyncio.sleep",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": ... |
46156482583 | import cv2
import numpy as np
import threading
import time
ROW=1080
COL=1920
hCOL=COL/2
gamma=5.0
w=640
h=512
l=h*gamma
boundary=[[0,w,ROW-h,ROW],[COL-w,COL,ROW-h,ROW]]
R=np.sqrt((l+h)**2+(0.5*w)**2)
Rmin=np.sqrt(l**2+(0.5*w)**2)
dr=(R-Rmin)/float(h)
w_o=int(0.5*w*R/np.sqrt((0.5*w)**2+l**2))
h_o=int(R-l)
amax=np.ar... | johnny-jiang-000/sector_undistortion | overlay.py | overlay.py | py | 7,081 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.sqrt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.arctan",
"line_number": 22... |
70927743904 | #!/usr/bin/env python
import sys
sys.path.append('Sublist3r')
import argparse, requests
import sublist3r
from colorama import Fore
from art import *
status_accepted = [200, 403, 402, 404, 503, 505]
basic_tests = [
".htaccess",
".htaccess~",
"htaccess",
"htaccess~",
"htaccess.txt",
"robots.txt... | ix-56h/Leecher | leecher.py | leecher.py | py | 3,309 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
14367466620 | from quart import Blueprint, jsonify
from typing import TYPE_CHECKING
from litecord.auth import admin_check
from litecord.schemas import validate, USER_UPDATE
from litecord.admin_schemas import USER_CREATE
from litecord.errors import BadRequest, NotFound
from litecord.utils import extract_limit
from litecord.blueprint... | dolfies/patchcord | litecord/blueprints/admin_api/users.py | users.py | py | 4,131 | python | en | code | 39 | github-code | 7 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "quart.Blueprint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "litecord.auth.admin_check",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "liteco... |
5431351326 | import logging
import random
from argparse import ArgumentParser
from itertools import chain
from pprint import pformat
import warnings
import tensorflow as tf
import torch
import torch.nn.functional as F
from transformers import OpenAIGPTLMHeadModel, OpenAIGPTTokenizer, GPT2LMHeadModel, GPT2Tokenizer
from train imp... | shresthakamal/transfer-transfo | interact.py | interact.py | py | 11,092 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.sort",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.topk",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "torch.sort",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "torch.cumsum",
"line_number": 47... |
25932842005 | from cgi import test
import os
import json
class Data:
def __init__(self, trainPath, testPath, valPath):
self.train = self.readFile(trainPath)
self.val = self.readFile(valPath)
self.test = self.readFile(testPath)
def readFile(self, path):
with open(os.path.join(os.getcwd(), pa... | nirbhaysinghnarang/ViterbiHMM | data.py | data.py | py | 376 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 1... |
9924124623 | #!/usr/bin/env python3
import os
import sys
import csv
import time
import json
import pprint
import socket
import argparse
HOSTNAME = "api.vndb.org"
PORT = 19534
BUFFER_SIZE = 2**12
class TCPSession:
def __init__(self, hostname, port, sock=None):
if sock is None:
self.sock = socket.socket(s... | ujtakk/vndb_fetcher | client.py | client.py | py | 5,188 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "socket.socket",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "socket.SHUT... |
42684424119 | # -*- coding: UTF-8 -*-
import logging
import requests
import json
import datetime;
from werkzeug.datastructures import Headers
LOG = logging.getLogger(__name__)
def matchmaker_request(url, token, method, content_type=None, accept=None, data=None):
"""Send a request to MatchMaker and return its response
Args... | Clinical-Genomics-Lund/scout | scout/utils/matchmaker.py | matchmaker.py | py | 2,458 | python | en | code | null | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "werkzeug.datastructures.Headers",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 32,
"usage_type": "call"
},
{
"api_name":... |
921412998 | # import datasets library
from datasets import load_dataset
# assign csv file to variable
data_files = "training.1600000.processed.noemoticon.csv"
# return csv file as DatasetDict
twitter_dataset = load_dataset("csv", data_files=data_files)
# remove unwanted columns from dataset
twitter_dataset = twitter_dataset.map... | Kwakzz/Sentiment-Analysis | code/preparing_twitter_dataset.py | preparing_twitter_dataset.py | py | 2,005 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datasets.load_dataset",
"line_number": 8,
"usage_type": "call"
}
] |
38287264034 | import pandas as pd
from sklearn import metrics
import numpy as np
import matplotlib.pyplot as plt
label_result = pd.read_csv('HW_AI/HW_Final/label.csv')
label_result = label_result.iloc[:,1]
label_result = label_result.to_numpy()
cpu_result = pd.read_csv('HW_AI/HW_Final/cpu.csv')
cpu_result = cpu_result.iloc[:,1]
cp... | eason1021/ml_mse_2020_Eason_Tseng | HW_Final/mutual_information.py | mutual_information.py | py | 1,248 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
... |
74472626784 | import requests
from haversine import haversine
from config import api_key, home
LOC_HOME = [float(x) for x in home.split(",")]
def get_loc_weather(loc):
degree_sign = "\N{DEGREE SIGN}"
condition_url = f"https://api.aerisapi.com/observations/{loc}?&format=json&filter=allstations&limit=1&{api_key}"
resp ... | GeoZac/weather_scripts | conditions.py | conditions.py | py | 1,965 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "config.home.split",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "config.home",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "config.api_key",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_n... |
19807690398 | import copy
import json
import logging
import random
import re
import shutil
from argparse import ArgumentParser
from pathlib import Path
from typing import Dict, List, Set
from jinf import Jinf
from rhoknp import Jumanpp, Morpheme, Sentence
from rhoknp.utils.reader import chunk_by_sentence
from tqdm import tqdm
from... | ku-nlp/kwja | scripts/preprocessors/preprocess_canon.py | preprocess_canon.py | py | 8,879 | python | en | code | 113 | github-code | 7 | [
{
"api_name": "kwja.utils.logging_util.filter_logs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_nam... |
28788709952 | from tkinter import Tk, filedialog
from datetime import datetime
import json
import os
import subprocess
import webbrowser
def runReport(Folders):
#create folder for new report
now = datetime.now()
current_time = now.strftime("%Y%m%d_%H%M%S")
f = open ('PyRep.json')
data = json.load (f)
f.clos... | AviAShkenazi/PyRep | PyRepJson.py | PyRepJson.py | py | 1,433 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"lin... |
70170885983 | #!/usr/bin/python
# -*- coding:utf-8 -*-
# 评分/评论页面
import json
import math
from django.http.response import HttpResponse, HttpResponseRedirect
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render
from GameModel.models import MagzineScores, Shelf, Magazines
from .... | shingler/gfweb | gfweb/comment.py | comment.py | py | 4,756 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "GameModel.models.Magazines.objects.filter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "GameModel.models.Magazines.objects",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "GameModel.models.Magazines",
"line_number": 20,
"usage_... |
12375400627 | import tkinter as tk
from tkinter import Label, StringVar
from datetime import datetime
from tkcalendar import Calendar # pip install tkcalendar
import tkinter.font as font
okno = tk.Tk()
# tytuł, rozmiar, blokada wielkości
okno.title("Zegar i kalendarz")
okno.geometry("400x400")
okno.minsize(400, 400)
okn... | TrinianGit/Python_2022-2023 | Zestaw8/zadanie3.py | zadanie3.py | py | 1,581 | python | pl | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.Tk",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tkinter.StringVar",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.font.Font",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tkinter.font",
"lin... |
40579542308 | import librosa
import matplotlib.pyplot as plt
# Video dosyasını yükle
filename = 'video.mp4'
y, sr = librosa.load(filename)
# Ses düzeylerini analiz et
melspec = librosa.feature.melspectrogram(y, sr=sr, n_mels=128)
# Konuşma olmadığı yerleri tespit et
silent_frames = librosa.util.find_silent_frames(melsp... | eskicaptan/husey-n | import librosa3333.py | import librosa3333.py | py | 586 | python | tr | code | 0 | github-code | 7 | [
{
"api_name": "librosa.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "librosa.feature.melspectrogram",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "librosa.feature",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "librosa... |
9873988402 | # from Post.decorators import unauthenticated_user
from copy import error
from django import db, http
from django.contrib.auth import login
from django.core.checks.messages import ERROR
from django.db.models import query
from django.db.models.query import QuerySet
from django.dispatch.dispatcher import NONE_ID
from dj... | giguerejatwit/whatstheword | accounts/views.py | views.py | py | 8,107 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "models.UserProfile.objects.get",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "models.UserProfile.objects",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "models.UserProfile",
"line_number": 70,
"usage_type": "name"
},
{
... |
71935529183 | import logging
import os
import re
from cros.factory.probe import function
from cros.factory.probe.lib import cached_probe_function
from cros.factory.test.utils import v4l2_utils
class GenericVideoFunction(cached_probe_function.GlobPathCachedProbeFunction):
"""Probe the generic video information."""
GLOB_PATH =... | arccode/factory | py/probe/functions/generic_video.py | generic_video.py | py | 1,927 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "cros.factory.probe.lib.cached_probe_function.GlobPathCachedProbeFunction",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cros.factory.probe.lib.cached_probe_function",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"l... |
46655098147 | # Databricks notebook source
usvisa = sqlContext.read.format("com.databricks.spark.csv").options(header='true').load("/FileStore/tables/us_perm_visas.csv")
usvisa.registerTempTable("usvisa")
usvisa.printSchema()
# COMMAND ----------
#Case Status
usvisa.select("case_status").distinct().show()
# COMMAND ----------
#M... | devashishdhiman/USA-permanent-visa- | Project BDM.py | Project BDM.py | py | 8,492 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyspark.sql.functions.col",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.functions",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.functions.col",
"line_number": 52,
"usage_type": "call"
},
{
"api_nam... |
12603052724 | #================How to Use==================#
"""
1 main Class
Indeed will do the necessary updates for indeed.
Import into shell and create an instance of Indeed to run.
This code definitely needs refactoring.
"""
class Indeed():
def __init__(self):
self.jobtitles,self.links,self.company,self.unique_ids... | rtanubra/jobseeker | jobseeker/indeed.py | indeed.py | py | 4,149 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "jobs.models.Job.objects.all",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "... |
3632524031 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
from numbers import Number
import six
import tldextract
from osxcollector.output_filters.summary_filters.summary import SummaryFilter
class HtmlSummaryFilter(SummaryFilter):
"""Prints the analysis ... | Yelp/osxcollector_output_filters | osxcollector/output_filters/summary_filters/html.py | html.py | py | 16,764 | python | en | code | 75 | github-code | 7 | [
{
"api_name": "osxcollector.output_filters.summary_filters.summary.SummaryFilter",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "tldextract.extract",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "sys.stderr.write",
"line_number": 85,
"usage_type": ... |
71176605343 | import rospy
from mrs_msgs.srv import *
from mrs_msgs.msg import *
from geometry_msgs.msg import *
from sensor_msgs.msg import *
from std_msgs.msg import *
from utils.functions.move_uav import go_to
from utils.classes.ReferencePublisher import ReferencePublisher
from utils.classes.Position_Command import Position_Info... | Luiz6ustav0/verlab | simulation/mrsGazeboPkg/scripts/utils/functions/fase2_utils.py | fase2_utils.py | py | 4,925 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.classes.ReferencePublisher.ReferencePublisher",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "utils.classes.Position_Command.Position_Info",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "utils.functions.move_uav.go_to",
"line_numbe... |
72788587743 | '''
Created on 13.08.2018
@author: larissa.hoefling@uni-tuebingen.de
-*- coding: utf-8 -*-
'''
import numpy as np
import matplotlib.pyplot as plt
from analysis.utils import smooth
from scipy.signal import periodogram
import pickle as pkl
import matplotlib as mpl
class Stimulus():
'''
########################... | lhoefling/rgc-elstim-modeling | src/analysis/stimulus.py | stimulus.py | py | 20,926 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "numpy.diff",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 135,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"lin... |
10119442883 | import akshare as ak
import matplotlib.pyplot as plt
from pylab import mpl
import pandas as pd
from jqdatasdk import *
import datetime
import time
def a():
print('aaa')
def b(fun):
fun
def timerFun(sched_Timer):
flag = 0
while True:
now = datetime.datetime.now().strftime('%Y%m%d%H%M... | Lancercxy/automatic_transaction | code/test.py | test.py | py | 5,979 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.time... |
34550353757 | import requests
from bs4 import BeautifulSoup
def get_win_data():
url = 'http://www.cwl.gov.cn/kjxx/ssq/kjgg/' # 您提供的网页 URL
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}
page = requests.get(url, headers=heade... | LambertKeith/utils | lottery_assistant/lottery_assistant/get_win_data.py | get_win_data.py | py | 748 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
}
] |
30606095614 | from sqlalchemy import create_engine
from sqlalchemy import Table,Column,String,MetaData
db_string = "postgresql+psycopg2://postgres:12345@localhost:5432/batch1db"
db = create_engine(db_string)
meta = MetaData(db)
film_table = Table(
'films_exp_d26',
meta,
Column('title',String),
Column('director',St... | souvikmondal01/Python-Winter-Training-2023 | day-14/sql_exp.py | sql_exp.py | py | 1,205 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy... |
36230552060 | # small script to visualize a random heat map from raw json data in .txt files
import json, sys, matplotlib.pyplot as plt
if len(sys.argv) != 5:
exit(
"[visualize_json_image] Error - missing arguments\n-> input file's path\n-> min index of image to save to output dir\n-> max index of image to save to outp... | spicytelescope/Taltech-ML-EB-Themal-Sensor | data/helpers/visualize_json_image.py | visualize_json_image.py | py | 1,667 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number"... |
71680522144 | """ Organize data"""
import numpy as np
from torch.utils.data import Dataset
class AbsDataset(Dataset):
"""Face Landmarks dataset."""
def __init__(self, flux_file, lbl_file, mode='train', transform=None, testing=False):
"""
Args:
flux_file (string): Path to the csv file with ann... | caiz12/Unet-abs | unetabs/absdataset.py | absdataset.py | py | 1,526 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_... |
41050902939 | import csv
import codecs
import calendar
from datetime import datetime, timedelta
from django.db import connection
from django.db.models import Q, Sum, Case, When, F
from django.utils import timezone
from django.http import HttpResponse
from django.utils.encoding import escape_uri_path
from dynaconf import settings as... | yiyuhao/FukuanUnion | payserver/padmin/query_manage/financial_query.py | financial_query.py | py | 22,881 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "django.utils.encoding.escape_uri_path",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "codecs.BOM_UTF8",
"line_number": 48,
"usage_type": "attribute"
},
{
... |
32011515562 | import os
import re
from graphviz import Digraph
import subprocess
EXCLUDED_DIRS = ['.vscode', 'extensions', '.git','main.dSYM','out']
EXCLUDED_FILE_TYPES = ['.png', '_png', '.txt', '.sh','.root','.xml','.pdf']
OUTPUT_FILE = "dep_tree.md"
def should_exclude_dir(dir_path):
for excluded_dir in EXCLUDED_DIRS:
... | jirahandler/susy_r21_ana_tools | get_script_dependencies.py | get_script_dependencies.py | py | 7,481 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.search",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": ... |
6564677826 | #!/usr/bin/env python3
import os
import sys
import subprocess
import tornado.ioloop
import tornado.web
import tornado.autoreload
import tornado.options
from tornado.log import enable_pretty_logging
PATH = os.path.abspath(os.path.dirname(__file__))
DOMAINS = {
'neutron-racer.herokuapp.com': 'Neutron-Racer',
'www... | pizzapanther/Neutron-Hub | server.py | server.py | py | 2,635 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tornado.ioloop.web",
... |
22181257719 |
"""
This code fits a logistic regression model to classify HHSTATE (state)
"""
import pandas as pd
from pathlib import Path
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
# here we load the data
file_path = Path("path to dataset.csv")
wwc = pd.read_csv(file_p... | eduardolopez13/IE496 | Codes/LogisticRegression.py | LogisticRegression.py | py | 1,468 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
18468656904 | # -*- coding:utf-8 -*-
from typing import List
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
if not nums: return 0
nums_len = len(nums)
l, r = 0, 0
while r < nums_len:
while r < nums_len and nums[r] == nums[l]:
r += 1
... | weizhixiaoyi/leetcode | array/26.删除排序数组中的重复项.py | 26.删除排序数组中的重复项.py | py | 574 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
21776512157 | from dataclasses import dataclass, replace
from typing import Sequence, TextIO, TypeAlias
import click
import sys
@click.group()
def main(): pass
@dataclass(frozen=True)
class Point:
x: int
y: int
Paper: TypeAlias = set[Point]
@dataclass
class Fold:
axis: str
value: int
def get_input(inp: Text... | dsimon96/AdventOfCode2021 | src/day13.py | day13.py | py | 1,711 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "click.group",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.TypeAlias",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "dataclasses.datacla... |
71358974943 | """
This module contains code to create a GUI that draws graphs of functions.
"""
from tkinter import *
from tkinter import messagebox
import tkinter.font as tkFont
import numpy as np
import tkinter as tk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
import re
d... | grzesiaaa/Python_TkinterProjects | DrawFunctions/draw_function.py | draw_function.py | py | 8,586 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.font.Font",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tkinter.font",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "tkinter.font.Font",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tkinter.font",
"... |
11232564883 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'qjyao'
__mail__ = 'yaoqijunmail@foxmail.com'
'''
description:
'''
from datetime import datetime, timedelta, timezone
def datetime_demo():
# # dt = datetime.now()
# dt = datetime(2015, 4, 19, 12, 20)
# print(dt, dt.timestamp())
# # datati... | LiveAlone/pythonFirst | basic/std_libs/std/datetime_demo.py | datetime_demo.py | py | 871 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.timezone",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
17428958309 | import psycopg2
import os
def create_table():
command = """create table wordle(
username VARCHAR(50),
score INT NOT NULL,
played_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
CHECK (score between 0 AND 6),
constraint pk_wordle PRIMARY KEY (username, played_at));
"""
conn = No... | arxxv/Wordlecord | db.py | db.py | py | 652 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.connect",
"line_number": 17,
"usage_type": "call"
}
] |
8756804650 | # Python script to detect Faces in an image and Drawing a rectangle around it
import cv2 as cv
# https://github.com/opencv/opencv/tree/master/data/haarcascades Github for haarcascade xml
face_cascade = cv.CascadeClassifier("haarcascades\haarcascade_frontalface_default.xml")
img = cv.imread('images\\face1.jpg')
# Con... | mannbajpai/python-openCV | Image-Face-Detection.py | Image-Face-Detection.py | py | 933 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
18419747180 | from blastp import obtain_seq, write_to_fasta
from Bio.Blast.Applications import NcbiblastpCommandline
from Bio.Blast import NCBIXML
from Bio import SeqIO
from io import StringIO
import numpy as np
import os
from sklearn.cluster import AgglomerativeClustering
from scipy.cluster.hierarchy import dendrogram, linkage
impo... | Wangzzzzzzzz/chain_cluster | cluster.py | cluster.py | py | 6,656 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "Bio.Blast.Applications.NcbiblastpCommandline",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "Bio.Blast.NCBIXML.parse",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Bio.Blast.NCBIXML",
"line_number": 19,
"usage_type": "name"
},
{... |
32184412678 | import pygame, math
from sprites import Icon
class Bouncer:
""" two torps following an orbital ellipse around an invisible mass """
def __init__(self, ex, ey, cx, cy, n1='torp-me.png', n2='torp-me.png'):
self.ex = ex
self.ey = ey
self.cx = cx
self.cy = cy
self.l = Icon(... | quozl/gytha | gytha/bouncer.py | bouncer.py | py | 968 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "sprites.Icon",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sprites.Icon",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 19,
... |
74010845343 | from webapp2 import Route
import views
import views_admin
routes = [
]
adminRoutes = [
Route('/image/upload/', views_admin.upload, 'image-upload'),
Route('/image/upload/url/', views_admin.upload_url, 'image-upload-url'),
Route('/image/delete/', views_admin.delete, 'image-delete'),
# ... | ashenwolf/skolltech | skollimages/__init__.py | __init__.py | py | 560 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "webapp2.Route",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "views_admin.upload",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "webapp2.Route",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "views_admin.uploa... |
70797785822 | import socket
import sys
import select
from multiprocessing import Process
import hashlib
import random
import re
locations = dict()
N = None
def lookup_finger_table(target_id, node_id, finger_table):
node_values = list(finger_table.values())
i = len(node_values) -1
while i != 0:
if node_id <=... | dandeeccastro/chord_simulation | client.py | client.py | py | 10,720 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "socket.socket",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "select.select",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "hashlib.sha1",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_nu... |
38581897050 | from transformers import BertForPreTraining, BertModel
import torch
from torch import nn
from torch.nn import BCELoss
class BertForClozeQA(BertForPreTraining):
def __init__(self, config):
super(BertForClozeQA, self).__init__(config)
self.bert = BertModel(config)
self.cloze_qa_outputs = n... | kiendang/bioread | src/bert-qa/modelling_cloze_qa.py | modelling_cloze_qa.py | py | 1,612 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "transformers.BertForPreTraining",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "transformers.BertModel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": ... |
27010184222 | import env
import uuid as ui
def check_performance(instance, route, simulations = 10 ** 4, flag = False):
"""
Check the performance of a route
"""
# Create average variables
avg_time = 0
avg_reward = 0
avg_penalty = 0
avg_feasibility = 0
counter = 0
while counter < simulations... | almeidawarley/tsp-competition | main.py | main.py | py | 2,996 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "uuid.uuid4",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "env.Env",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "env.Env",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "env.Env",
"line_number": 107,
"usa... |
1774664856 | from tkinter.constants import CENTER
import pyttsx3
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
import os
from wikipedia.wikipedia import languages
import tkinter as tk
import tkinter.font as tkf
import requests, json
from gnewsclient import gnewsclient
import cv2
import pyscreens... | parthgupta1208/VoiceCraft | friday.py | friday.py | py | 4,390 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "gnewsclient.gnewsclient.NewsClient",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "gnewsclient.gnewsclient",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "webbrowser.open",
"line_number": 33,
"usage_type": "call"
},
{
"api_na... |
30704678736 | # coding: utf-8
# science
import cv2
import numpy as np
import imutils
# python
from os import listdir
from os.path import isfile, join
import argparse
import sys, os
import shutil
# pptx
from pptx import Presentation
# helpers
def order_points(pts):
rect = np.zeros((4, 2), dtype="float32")
s = pts.sum(axis... | omegagussan/slidesFromImages | images2Slides.py | images2Slides.py | py | 4,532 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.argmin",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.diff",
"line_number":... |
13873978102 | from django.contrib import admin
from polls.models import Choice, Question
class ChoiceInline(admin.TabularInline):
"""
Create a inline representation to be used in QuestionAdmin.
"""
model = Choice
extra = 3
@admin.register(Question)
class QuestionAdmin(admin.ModelAdmin):
"""
Question Ad... | marcopuccio/mpbb | polls/admin.py | admin.py | py | 742 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.admin.TabularInline",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "polls.models.Choice",
"line_number": 9,
"usage_type": "name"
},
{
"api... |
2409534352 | import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets import QApplication, QMainWindow, QShortcut
class Ui_Output_Ui(QMainWindow):
resized = QtCore.pyqtSignal()
def __init__(self, icon_path=''):
super(Ui_Output_Ui, self).__init__()
if icon_path != '':... | Shoker2/TS2_ScreenTranslator | moduls/ScreenOutput.py | ScreenOutput.py | py | 1,808 | python | ru | code | 1 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.Q... |
26407288068 | import os
import tqdm
import yaml
import torch
import inspect
import datetime
import itertools
import numpy as np
import torch.nn as nn
import torch.optim as optim
from copy import deepcopy
from gym_unity.envs import UnityToGymWrapper
from torch.utils.tensorboard import SummaryWriter
from mlagents_envs.environment imp... | dogeplusplus/ball-balancer | algorithms/td3.py | td3.py | py | 9,177 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "copy.deepcopy",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "torch.util... |
7333178637 | from flask import request, render_template, session, abort
from flask import send_from_directory, url_for, redirect
from models.genero import Genero
class GeneroController():
def __init__(self):
pass
def index(self):
generos = Genero.all()
return render_template('generos/index.html',... | hugocontrera/Bookflix | Bookflix/bookflix/controllers/GeneroController.py | GeneroController.py | py | 1,922 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "models.genero.Genero.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.genero.Genero",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "f... |
73672301663 | import pytest
from y2021.day_1.main import InputNotArray, NotEnoughValues, depth_measure_with_window
from y2021.day_2.main import pilot_submarine_with_aim
def test_depth_measure_success():
input_ = ["forward 5", "down 5", "forward 8", "up 3", "down 8", "forward 2"]
assert pilot_submarine_with_aim(input_) ==... | bergran/advent-of-code | y2021/day_2/tests/test_puzzle_2.py | test_puzzle_2.py | py | 660 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "y2021.day_2.main.pilot_submarine_with_aim",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "y2021.day_1.main.NotEnoughValues",
"line_number": 16,
"usage_type": "argument"
... |
8825084770 | #The complete source code for mplwidget.py is:
# Python Qt5 bindings for GUI objects
from PyQt5 import QtGui, QtWidgets
# import the Qt5Agg FigureCanvas object, that binds Figure to
# Qt5Agg backend. It also inherits from QWidget
import matplotlib as MPL
MPL.use("Qt5Agg")
from matplotlib.backends.backend_qt5agg import... | MiRichter/OptiSim | ui/mplwidgetsimple.py | mplwidgetsimple.py | py | 1,904 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 27,
"usage_type": "attribute"
}... |
39962474984 | from pydub import AudioSegment
import glob
import sys
import os
# Glob module is used to find files in a directory.
# Sys module is used to access system parameters and methods.
# Os module is used to access operating system specific functions.
class Audio:
def __init__(self, infiles, dst):
self.combined ... | Vishuvrm/FileAutomation | FileAutomationGUI/audio.py | audio.py | py | 1,056 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pydub.AudioSegment.empty",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pydub.AudioSegment.from_mp3",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
35938705791 | import sys
from operator import itemgetter
import matplotlib
import matplotlib.pyplot as plt
from pymongo import MongoClient
client = MongoClient('mongodb://147.2.212.204:27017/')
prods = client.bz.prods
prod_all = [ 'SUSE Linux Enterprise Desktop 12',
'SUSE Linux Enterprise Desktop 11 SP3',
... | xjinGitty/scripts | bugzilla/script-zxd.py | script-zxd.py | py | 2,168 | python | en | code | null | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.getsizeof",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplotli... |
43823098431 | import os
from pytube import Playlist, YouTube
def download_video(url, folder, number_videos, skip_existing):
try:
if 'playlist' in url:
playlist = Playlist(url)
videos = playlist.video_urls
else:
videos = [url]
download_path = os.path.join(os.getcwd(),... | AbhishekBaiju/yt-dl-cmd | main.py | main.py | py | 1,776 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pytube.Playlist",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number... |
25608312246 | from behave import given, then, when, step
import requests
import subprocess
import json
import os
@step('Using "{server}" as endpoint')
def set_endpoint(context, server):
context.endpoint = server
@step('Working with "{mode}" mode')
def set_server_mode(context, mode):
context.mode = mode
context.endpo... | manon42bcn/myMock | tests/steps/steps.py | steps.py | py | 2,215 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "behave.step",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "behave.step",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
26659424459 | import numpy as np # check out how to install numpy
from utils import load, plot_sample
from PIL import Image
import matplotlib.pyplot as plt
from collections import Counter
def KNN_classify(k,X,training_data):
Xtrain = training_data[0]
Ytrain = training_data[1]
#open a dict to store the label of eachdat... | nadavo11/KNN | KNN_classify.py | KNN_classify.py | py | 943 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "collections.Counter",
"line_number": 31,
"usage_type": "call"
}
] |
75029367583 | from aocutils import get_raw
from collections import defaultdict, Counter
from math import ceil
def problem1():
return simulate(10)
def problem2():
return simulate(40)
def simulate(steps):
mapping, counts = parse_input()
for _ in range(steps):
counts = Counter({pair: sum(counts... | mason359/aoc2021 | day14.py | day14.py | py | 1,076 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.Counter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "aocutils.get_raw",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collecti... |
25196274188 | import torch
from torch.utils.data import Dataset
from PIL import Image
import numpy as np
from torchvision.transforms.functional import to_tensor
from pathlib import Path
def NormalizeData(data):
return (data - np.min(data)) / (np.max(data) - np.min(data))
def img_loader(path):
return Image.open(path).conver... | o-messai/Multi-score-SIQA | load_dataset.py | load_dataset.py | py | 5,518 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "numpy.min",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 12,
... |
16895402341 | # -*- coding: utf-8 -*-
"""
@authors: david candela & andreu giménez
"""
import os
import json
import duckdb
trusted_path = 'trusted/'
explotation_path = 'exploitation/'
def load_queries():
if not os.path.exists(explotation_path + "tables.json"):
print("No exploitation tables defined")
return {}
... | Littleote/data-management-backbone | exploitation.py | exploitation.py | py | 1,314 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "duckdb.connect",
"line_numb... |
26924838685 | import logging
import os
import pathlib
import time
import httpx
import regex
import yarl
from tqdm import tqdm
from ...config import FFMPEG_EXECUTABLE, FFMPEG_HLS, FFMPEG_SUBMERGE
from .content_mt import mimetypes
from .ffmpeg import FFMPEG_EXTENSIONS, ffmpeg_download, has_ffmpeg, merge_subtitles
from .hls import HL... | rares9301/ap0dl | ap0dl/core/codebase/downloader/handle.py | handle.py | py | 9,039 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "config.FFMPEG_EXECUTABLE",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "config.FFMPEG_EXECUTABLE",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "regex.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "yarl.... |
41076511735 | import json
import logging
from apiflask import abort, input
from ibm.auth import authenticate
from ibm.middleware import log_restore_activity
from ibm.models import (DisasterRecoveryBackup, IBMCloud, IBMImage, IBMKubernetesCluster, IBMSshKey, WorkflowRoot,
WorkflowsWorkspace, IBMSatel... | talha927/cloud-ibm-test | ibm/web/ibm/draas/restores/api.py | api.py | py | 11,272 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ibm.web.db.session.query",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ibm.models.DisasterRecoveryBackup",
"line_number": 29,
"usage_type": "argument"
},
{
"... |
6792456360 | import boto3
import sys
s3 = boto3.resource('s3')
for bucket_name in sys.argv[1:]:
bucket = s3.Bucket(bucket_name)
try:
resp = bucket.delete()
print(resp)
except Exception as e:
print(e) | Pawel22729/aws | python_aws/scripts/delete_bucket.py | delete_bucket.py | py | 222 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.resource",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
}
] |
8996045174 | import requests
from bs4 import BeautifulSoup
url = "https://yandex.ru/news/"
first_news_class = "news-card__annotation"
def parse():
response = str(requests.get(url=url).content.decode())
soup = BeautifulSoup(response[1 : len(response)-2], "html.parser")
tmp = soup.find('div', class_=first_news_class)
... | DEMIDOB/Dassie | builtin_skills/news_parse.py | news_parse.py | py | 569 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
}
] |
70934481825 | import duckdb
import os
# get all tables' row number of a database
def get_row_count(dir):
# connect to database with dir
con = duckdb.connect(dir)
cur = con.cursor()
# get all tables' name
cur.execute("SELECT name FROM sqlite_master WHERE type='table';")
tables = cur.fetchall()
with open... | UsamiRiko/Yanglin-Hu-cmu-95797-23m6 | scripts/dump_row_count.py | dump_row_count.py | py | 689 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "duckdb.connect",
"line_number": 7,
"usage_type": "call"
}
] |
71935803423 | import hashlib
import json
import os
_ENV_DIR = '/var/db/factory/umpire'
_CONFIG_PATH = os.path.join(_ENV_DIR, 'active_umpire.json')
def SaveNewActiveConfig(config):
"""Serialize and saves the configuration as new active config file."""
json_config = json.dumps(
config, indent=2, separators=(',', ': '), s... | arccode/factory | py/umpire/server/migrations/0014.py | 0014.py | py | 911 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 1... |
35701404849 | from datetime import datetime, timedelta
import numpy as np
import pytz, tzlocal
sind = lambda degrees: np.sin(np.deg2rad(degrees))
cosd = lambda degrees: np.cos(np.deg2rad(degrees))
arcsind = lambda ratio: np.rad2deg(np.arcsin(ratio))
arccosd = lambda ratio: np.rad2deg(np.arccos(ratio))
class SunAtLatLon():
def... | jjstrydom/solar_data_collection | sun/position.py | position.py | py | 1,832 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.sin",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.deg2rad",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.deg2rad",
"line_number": 6,
... |
41636112292 | import torch
import numpy as np
from matplotlib import pyplot as plt
path = "two-spiral traing data(update).txt"
def plot_data(data, ax, lw=0.5, clr0='b', clr1='r'):
ax.set_facecolor('darkgray')
idx1 = np.where(data[:, 2] == 1)[0]
ax.scatter(data[idx1, 0], data[idx1, 1], c=clr1, linewidths=lw)
idx0 =... | zixuan-chen/CS7327-033-M01-Project | hw1/utils.py | utils.py | py | 2,860 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "numpy.where",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_num... |
8028339201 | from typing import Any, Callable, Mapping, Optional, Union
import re
from speech.norm.num import (
digits_to_text,
float_to_text,
floats_to_text,
number_to_text,
numbers_to_text,
number_to_ordinal,
numbers_to_ordinal,
year_to_text,
years_to_text,
)
# Each voice module in the direc... | hrolfurinn/Greynir | speech/norm/__init__.py | __init__.py | py | 11,709 | python | en | code | null | github-code | 7 | [
{
"api_name": "re.sub",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.Mapping",
"line_number": 55... |
8611431667 | class Solution:
def findFrequentTreeSum(self, root: TreeNode) -> List[int]:
import collections
dict1 = collections.defaultdict(int)
if not root:
return []
def dfs(root):
if not root:
return 0
num = root.val + dfs(root.left) + dfs(root.right)
dict1[num] += 1
return num
dfs(root)
max... | CNXuPing/PythonLeedcode | leedcode-508.py | leedcode-508.py | py | 623 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 4,
"usage_type": "call"
}
] |
7586121882 | import os
from datetime import datetime
from pytorch_lightning.callbacks.progress import TQDMProgressBar
from pytorch_lightning.callbacks import ModelCheckpoint
from torchinfo import summary
import data
from models.ssgan import SSGAN
from models.cgan import CGAN
import pytorch_lightning as pl
def set_env():
# ... | jose-melo/deepl-breast-cancer | src/run_gan.py | run_gan.py | py | 1,156 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "data.BreastCa... |
74865068384 | import pyttsx3 as pt
import PyPDF2 as pdf
book = open('Notice.pdf', 'rb')
reader = pdf.PdfFileReader(book)
pages = reader.numPages
print(pages)
speaker = pt.init()
speed = speaker.getProperty("rate")
speaker.setProperty("rate", 150)
page = reader.getPage(0)
text = page.extractText()
speaker.say(text)
speaker.runA... | akashyadav24/Audio-Book | main.py | main.py | py | 328 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyttsx3.init",
"line_number": 11,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.