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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14351239029 | import requests, uuid, json, argparse, sys
import langcodes
# This is for the safety of the key
from config import AZURE_KEY
# Add your key and endpoint
key = AZURE_KEY
endpoint = "https://api.cognitive.microsofttranslator.com"
# Creating an argument parser
parser = argparse.ArgumentParser(description="Tranlate text... | SonuLohani-1/MyTranslator | project.py | project.py | py | 1,972 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "config.AZURE_KEY",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "langcodes.find",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
... |
1498857319 | #!/usr/bin/env python3
# dpw@Darryls-iMac.localdomain
# 2023-03-25 22:51:18
#
def dms2dd(d, m, s):
return d + m / 60 + s / 3600
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description="Enter an angle in degrees, minutes and seconds"
)
parser.add_argument... | darrylwest/python-play | maths/dms2dd.py | dms2dd.py | py | 645 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
}
] |
14204687745 | from django.shortcuts import render,redirect
from django.http import HttpResponse
from .models import Income, Expense
from .forms import Update_E,Update_I
def Index(request):
income = Income.objects.all()
expense = Expense.objects.all()
return render(request, "index.html", {'income': income, 'expe... | Gomolemo-M-Motlhamme/Finance-IO | Finance_IO/Index/views.py | views.py | py | 1,900 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Income.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.Income.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.Income",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "model... |
11036914150 | from PIL import Image
import glob
import os
frontPicPaths = glob.glob(os.getcwd() + '/**/front.png', recursive=True)
backPicPaths = glob.glob(os.getcwd() + '/**/back.png', recursive=True)
files = frontPicPaths + backPicPaths
print(files)
for f in files:
try:
im = Image.open(f)
# rearrage t... | tshadowknight/proto_crystal | gfx/pokemon/swapPal.py | swapPal.py | py | 1,183 | python | en | code | 17 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 6,
"usa... |
14839102625 | """
Section 1
Multithreading - Thread(1) - Basic
Keyword - Threading basic
"""
import logging
import threading
import time
# ์ค๋ ๋ ์คํ ํจ์
def thread_func(name):
logging.info(f"Sub-Thread {name}: starting")
time.sleep(3)
logging.info(f"Sub-Thread {name}: finishing")
# ๋ฉ์ธ ์์ญ
if __name__ == "__main__":
#... | taxijjang/develop_study | ๊ณ ์๊ฐ ๋๋ ํ์ด์ฌ/py_ad_1_3.py | py_ad_1_3.py | py | 929 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_... |
40926512907 | #!/usr/bin/env python
import argparse
import os
import subprocess
def main():
# arguments
parser = argparse.ArgumentParser()
parser.add_argument('-top_dir', help='top level directory of chromo grouped mafs', required=True)
parser.add_argument('-ref', help='Reference species name', required=True)
... | henryjuho/sal_enhancers | genome_alignment/roast_fish.py | roast_fish.py | py | 1,545 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
35577719590 | # Program for Connection Setup
# Depreciated
raise DeprecationWarning
import os
from Crypto.PublicKey import RSA
from Crypto import Random
import hashlib
from Crypto.Cipher import PKCS1_OAEP, AES
import select
from TSE import tse
from Flags import flags
from Chromos import Chromos
o = Chromos()
class Connection():... | devanshshukla99/Juno-ReDesign-Sockets-Communication | Connection/connection.py | connection.py | py | 6,157 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Chromos.Chromos",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "Crypto.Random.new",
"... |
15518284763 | import requests
from common import URL, GRAPHQL_URL, graph_query
def test_check_introspect_fields():
fields = ['pastes', 'paste', 'systemUpdate', 'systemDiagnostics', 'systemDebug', 'systemHealth', 'users', 'readAndBurn', 'search', 'audits', 'deleteAllPastes', 'me']
r = requests.get(URL + '/difficulty/easy')
... | dolevf/Damn-Vulnerable-GraphQL-Application | tests/test_introspect.py | test_introspect.py | py | 1,842 | python | en | code | 1,367 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "common.URL",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "common.graph_query",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "common.GRAPHQL_URL",
"li... |
70737356834 | import paho.mqtt.client as mqtt
import json
from influxdb import InfluxDBClient
server = "54.87.52.22"
def on_connect(client, userdata, flags, rc):
print("Connected with RC : " + str(rc))
client.subscribe("cpu/2016146022/evt/light")
def on_message(client, userdata, msg):
print(msg.topic + " " + msg.payl... | ChanWhanPark/IoT_Basic | 20201123_12์ฃผ์ฐจ/sub_lab3.py | sub_lab3.py | py | 1,002 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "influxdb.InfluxDBClient",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client.Client",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client",
"line_number": 36,
"usage_type": "name"
}
] |
73944562912 | import enum
import geomdl
import math
import numpy as np
import pybullet as p
import scipy.optimize
from sklearn.decomposition import PCA
import torch
import pytorch_kinematics as pk
from scipy.spatial.transform import Rotation as R
def fibonacci_sphere(samples=1):
points = []
phi = math.pi * (3. - math.sqrt... | Ericcsr/synthesize_pregrasp | utils/math_utils.py | math_utils.py | py | 18,341 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "math.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 24,
... |
38267722193 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 1 00:29:59 2023
@author: 16692
"""
from sqlalchemy import Column, Integer, String, DateTime, Text
from sqlalchemy.orm import declarative_base
from datetime import datetime
Base = declarative_base()
class User(Base):
__tablename__ = "users"
user_id = Column(Int... | saurabhsathe/eikontx-backend-swe2 | database_ops/users.py | users.py | py | 903 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.orm.declarative_base",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "... |
39587395835 | import time
import torch
import random
import numpy as np
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from tqdm import tqdm, trange
from torchtext import data
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
from transformers import XLMRobertaModel
... | PrasannaKumaran/ECMAG---An-Ensemble-Framework-for-Sentiment-Analysis-in-Code-Mixed-Data | main.py | main.py | py | 7,944 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.seed",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
... |
41004428752 | """
This module defines input sets for CP2K and is a work in progress. The structure/philosophy
of this module is based on the Vasp input sets in Pymatgen. These sets are meant to contain
tested parameters that will result in successful, reproducible, consistent calculations without
need for intervention 99% of the tim... | jsyony37/pymatgen | pymatgen/io/cp2k/sets.py | sets.py | py | 48,957 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "pymatgen.io.cp2k.inputs.Cp2kInput",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 90,
"usage_type": "name"
},
{
"api_name": "pymatgen.... |
2481003217 | import numpy as np
import pandas as pd
import networkx as nx
import sys
def main(argv):
if len(argv) != 1:
raise ValueError("Must pass in graph representation input")
df = pd.read_csv(argv[0], sep="\t")
assert len(df.index) > 0
DEBUG = False
G = nx.from_pandas_edgelist(
df,
"... | FelixHohne/cuda_shortest_paths | src/correct.py | correct.py | py | 1,032 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "networkx.from_pandas_edgelist",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "networkx.shortest_path_length",
"line_number": 28,
"usage_type": "call"
},
{
"api_n... |
2229652486 | from sys import argv
from stenograpi import Stenograpi
from argparse import ArgumentParser
def parse_args(args):
parser = ArgumentParser(prog='stenograpi.py',
description='Document your HTTP API automatically through tests.')
parser.add_argument('hostname', type=str, help='hostname... | michaelmcmillan/Stenograpi | src/main.py | main.py | py | 849 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "stenograpi.Stenograpi",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "stenograpi.list... |
27800773574 | import numpy as np
import matplotlib.pyplot as plt
import math
def quad2(x_o=[-9.0,9.0],a=2.0,eta=0.1,threshold=0.01,maxiter=1000,alpha=0,anim = 1):
it = 0
x1 = np.linspace(-10,10,21)
x2 = np.linspace(-10,10,21)
[X,Y] = np.meshgrid(x1,x2)
Y = (a*X**2+Y**2)/2
plt.clf()
pl... | Alexandre425/aa | lab2/part3.py | part3.py | py | 1,763 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.clf",
... |
11297389625 | """
Author: Emanuele Albini
Adapter from a counterfactual method to background generator.
"""
from typing import Union
import numpy as np
from ..base import (BaseBackgroundGenerator, BackgroundGenerator, CounterfactualMethod, MultipleCounterfactualMethod,
ListOf2DArrays)
from ..utils impo... | jpmorganchase/cf-shap | src/cfshap/background/counterfactual_adapter.py | counterfactual_adapter.py | py | 2,612 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "base.BaseBackgroundGenerator",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "base.BackgroundGenerator",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "base.CounterfactualMethod",
"line_number": 24,
"usage_type": "name"
},
{
"a... |
38247937244 |
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
import gif
import matplotlib.animation as animation
train = np.loadtxt('data/click.csv', delimiter=',', dtype='int', skiprows=1)
train_x = train[:, 0]
train_y = train[:, 1]
mu = train_x.mean()
sigma = train_x.std()
# zscore... | Achuan-2/machine_learning_record | 01_regression/regression1_linear.py | regression1_linear.py | py | 3,310 | python | zh | code | 2 | github-code | 1 | [
{
"api_name": "numpy.loadtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number":... |
30344410584 | # This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O... | sathwikgs/Superres_GAN | first_gan.py | first_gan.py | py | 8,621 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 46,
... |
71526899233 | # -*- coding: utf-8 -*-
"""{{ cookiecutter.repo_name }} URL Configuration
https://docs.djangoproject.com/en/1.8/topics/http/urls/
"""
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.s... | athomasoriginal/starterkit-wagtail | {{cookiecutter.repo_name}}/src/config/urls.py | urls.py | py | 2,192 | python | en | code | 52 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.views.defaults.server_error",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.url",
"line_number": 32,
"usage_type": "call"
},
{
"api_... |
22918921227 | import zipfile
import os
import torchvision.transforms as transforms
# once the images are loaded, how do we pre-process them before being passed into the network
# by default, we resize the images to 64 x 64 in size
# and normalize them to mean = 0 and standard-deviation = 1 based on statistics collected from
# the ... | bastiendechamps/MVA_ORCV | A3_DECHAMPS_Bastien/data.py | data.py | py | 1,504 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 15,
"usage_type": "call"
},
{
... |
38420721323 | from django.contrib.auth.models import User
from django.db import models
class Location(models.Model):
name = models.CharField(max_length=255)
world = models.CharField(max_length=255)
description = models.TextField()
image = models.ImageField(upload_to='photos/')
author = models.ForeignKey(User, o... | asylburkitbayev/rickmorty | main/models.py | models.py | py | 1,656 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
644470377 | import aiohttp
import asyncio
import json
from . import errors
async def json_or_text(response):
text = await response.text(encoding="utf-8")
try:
if "application/json" in response.headers["Content-Type"]:
return json.loads(text)
except KeyError:
# Thanks Cloudflare
pa... | Snaptraks/aiotenor | aiotenor/http.py | http.py | py | 3,424 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 69,
"usage_type": "call"
}
] |
21103763023 | from typing import Dict, List, Union, Tuple
from urllib.parse import urljoin
import requests
from PIL import Image
from bs4 import BeautifulSoup
from email_validator import validate_email, EmailNotValidError
from plan_ilan.data_mining.staff.lookup_parameters import StaffLookup, StaffLookupAnswer
from plan_ilan.apps.w... | matanm28/PlanIlan | plan_ilan/data_mining/staff/staff_crawler.py | staff_crawler.py | py | 4,615 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Union",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "plan_ilan.apps.web_site.models.DepartmentEnum",
"line_number": 16,
"usage_type": "name"
},
{
"api_name":... |
24418281496 | import qiskit as qk
from qiskit import QuantumProgram
qp = QuantumProgram()
qr = qp.create_quantum_register('qr', 2)
cr = qp.create_classical_register('cr',2)
qc = qp.create_circuit('qc', [qr], [cr])
circuit = qp.get_circuit('qc')
quantum_r = qp.get_quantum_register('qr')
classical_r = qp.get_classical_register('cr')
... | zillerium/shoro | test1.py | test1.py | py | 697 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "qiskit.QuantumProgram",
"line_number": 4,
"usage_type": "call"
}
] |
39549222223 | import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeautifulSoup
import csv
import random
linkas = input("Autopliuso masinu linkas: ")
def randomlaikas():
_sleep = random.randint(3,10)
time.sleep(_slee... | erikonasz/APliusTel | main.py | main.py | py | 2,286 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdrive... |
29309465531 | from io import BytesIO
import re
import sys
import requests
import img2pdf
import PyPDF4
from rich.console import Console
from rich.progress import track
console = Console()
INPUT_SESSION = console.input("๐ช Your '_reader_session' key: ")
ENDPOINT_SCUOLABOOK = "https://webapp.scuolabook.it/books"
HEADER = {'X-Reques... | alessionossa/Scuolabook-Downloader-2 | download.py | download.py | py | 5,967 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "rich.console.Console",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_n... |
28201890311 | import json
import logging
import os
import random
import re
import time
from datetime import datetime
import boto3
import requests
from dateutil import tz
from dateutil.parser import parse
from selectolax.parser import HTMLParser
from utils import headers
logger = logging.getLogger()
logger.setLevel(logging.INFO)
d... | miztch/sasha | functions/sasha/index.py | index.py | py | 5,239 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "boto3.resource",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"... |
37573481705 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 25 19:52:38 2021
@author: Eliu
"""
#pip install keyboard
import keyboard
from time import sleep
def free_fire(cx, cy, w):
res_x = 640
res_y = 480
time_release = 0.1
sleep(0.001)
no_move = w/3 #Divisor hace efecto en la sensibilidad
if cx>(r... | EliuPineda/FreeFire_Sensor | FreeSensor.py | FreeSensor.py | py | 1,438 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keyboard.press",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "keyboard.press_and_release",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keyboard.press",... |
13720433941 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 18 08:53:40 2020
@author: Mathew
"""
# These are the packages we are using.
from skimage.io import imread
import matplotlib.pyplot as plt
from skimage import filters,measure
image=imread("/Users/Mathew/Desktop/Axioscan/apt.tif")
# This is jus... | orie1876/axioscan | Quick_Anal.py | Quick_Anal.py | py | 2,970 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "skimage.io.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotl... |
27076133308 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, BLOB, DateTime
base = declarative_base()
class ConfigNmap(base):
__tablename__ = 'config_nmap'
id = Column(Integer, primary_key=True)
property = Column(String(255), nullable=False)
value = Column(S... | Annihilat0r/JP-python | nmaper_jp/tables_config.py | tables_config.py | py | 842 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 9,
"usage_type": "argument"
},
{
... |
71491666593 | import os
import tensorflow as tf
import time
import numpy as np
import data_loader
import matplotlib.pyplot as plt
from tqdm import trange
class DNN:
"""DNNๆจกๅ่ฎญ็ป"""
def __init__(self, path=None, sheet_name="Sheet2",
save_model_path="./model/model-1/", batch_size=32,
learning... | xucong053/Fault-Classification | main.py | main.py | py | 10,108 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tensorflow.Graph",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
... |
25885622776 | from pymongo import MongoClient
import requests
from watson_service import WatsonService
from data_service import DataService
def main():
data_service = DataService()
news_journals = data_service.get_known_online_news_journals()
news_journal_articles = []
for news_journal in news_journals:
... | Thaumat/AkashicRecords | gather-data.py | gather-data.py | py | 4,034 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "data_service.DataService",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "data_service.get_known_online_news_journals",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "data_service.get_articles_by_new_journal_over_timeframe",
"line_number":... |
42426607543 | from collections import deque
n=int(input())
sea=[list(map(int,input().split())) for _ in range(n)]
d=[(1,0),(-1,0),(0,1),(0,-1)]
def bfs(q,shark):
global cnt
checklist=[]
checkpoint=n**2
while q:
x,y,t=q.popleft()
if t>checkpoint:
sea[shark[0]][shark[1]]=0
c... | jhchoy00/baekjoon | 16236.py | 16236.py | py | 1,349 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 46,
"usage_type": "call"
}
] |
14282248517 | from flask import Flask
from app.extensions import db, migrate, login_manager
from app.user import user
def create_app():
app = Flask(__name__)
app.config.from_pyfile('config.py')
db.init_app(app)
migrate.init_app(app, db)
login_manager.init_app(app)
app.register_blueprint(user, url_prefix='... | saviogodinho2002/Programacao-Web-Flask | app/__init__.py | __init__.py | py | 344 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.extensions",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.extensions.config.from_pyfile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.extensi... |
20841732899 | from flask import Flask, jsonify, request, render_template
from datetime import datetime
from db import despesas, tipos_de_pagamento, categorias, Pagamento, Categoria
app = Flask(__name__)
# criar os tipos de pagamento // importada do banco de dados
# criar as categorias // importada do banco de dados
# pagina inici... | pachla/desafio-muralis | Muralis/app.py | app.py | py | 3,943 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "db.despesas",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today"... |
7443437305 | import pandas as pd
from tqdm import tqdm
import utilities as ut
import matplotlib.pyplot as plt
from sklearn.neural_network import MLPClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score
from sklearn.ensemb... | hilakatz/Extranodal-lymphoma-project | Extranodal_lymphoma_project.py | Extranodal_lymphoma_project.py | py | 13,919 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utilities.load_data_and_transform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utilities.draw_multiple_histograms",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "utilities.heatmap",
"line_number": 29,
"usage_type": "call"
},
{... |
24349070486 | from mxnet.gluon.data import dataset, DataLoader
import numpy as np
import mxnet.ndarray as ndarray
from utils.augmentations import *
class MyTransform:
def __init__(self, im, opts):
if opts.is_val:
transforms_list_idx = [0, 14, 1]
else:
transforms_list_idx = [0, ] + [opts.... | minhto2802/T2_ADC | ProstateSegmentation/utils/custom_dataset.py | custom_dataset.py | py | 3,802 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.choice",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "mxnet.gluon.data.dataset.Dataset",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_n... |
17646806271 |
import cv2
# haarcascade ๋ถ๋ฌ์ค๊ธฐ
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_eye.xml')
# ์ด๋ฏธ์ง ๋ถ๋ฌ์ค๊ธฐ
original_num = 2
img = cv2.imread(str(original_num)+'.jpg')
gray = cv2.cvtColor... | baecci/ALPHAGO_Project22 | test1.py | test1.py | py | 1,278 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.data",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.data",
... |
1527930933 | import logging
from metadrive.constants import Semantics
import math
from typing import List, Dict
from panda3d.bullet import BulletBoxShape, BulletGhostNode
from panda3d.core import Vec3, LQuaternionf, Vec4, TextureStage, RigidBodyCombiner, \
SamplerState, NodePath, Texture, Material
from metadrive.base_class.ba... | metadriverse/metadrive | metadrive/component/block/base_block.py | base_block.py | py | 15,032 | python | en | code | 471 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "metadrive.base_class.base_object.BaseObject",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "metadrive.constants.DrivableAreaProperty",
"line_number": 24,
"usage_type":... |
29480630063 | """
Digita endpoint.
You must declare environment variable DIGITA_URL to activate this plugin.
"""
import os
import json
import logging
import binascii
import dateutil
import pytz
from django.conf import settings
from django.conf.urls import url
from django.http import HttpResponse
from django.views.decorators.csrf ... | aapris/IoT-Web-Experiments | iotendpoints/endpoints/plugins/digita.py | digita.py | py | 9,963 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "endpoints.utils.get_setting",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "endpoints.utils.get_setting",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_nam... |
16957265295 | # -*- encoding: UTF-8 -*-
##############################################################################
from openerp import fields, api
from openerp.addons.field_secure import models # @UnresolvedImport
import logging
_logger = logging.getLogger(__name__)
AVAILABLE_PRIORITIES = [
('0', 'Bad'),
('1', 'Below... | TinPlusIT05/tms | project/tms_modules/model/hr/hr_applicant.py | hr_applicant.py | py | 11,774 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "openerp.addons.field_secure.models.SecureModel",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "openerp.addons.field_secure.models",
"line_number": 19,
"usage_type"... |
17341574832 | from pathlib import Path
from experimaestro.compat import cached_property
import importlib
import os
import hashlib
import logging
import inspect
import json
from experimaestro.mkdocs.metaloader import Module
import pkg_resources
from typing import Iterable, Iterator, List, Dict
from .utils import CachedFile, downloadU... | experimaestro/datamaestro | src/datamaestro/context.py | context.py | py | 13,210 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.environ",
"li... |
24613096759 | from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
MAN = "man"
WOMEN = "women"
SEX = [(MAN, MAN), (WOMEN, WOMEN)]
sex = models.CharField(max_length=6, choices=SEX, default=MAN)
class Meta:
verbose_name = "ะะพะปัะทะพะฒะฐัะตะปั"
verbo... | bazoy789/todolist | core/models.py | models.py | py | 408 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 10,
"usage_type": "name"
}
] |
1355144247 | #!/usr/bin/env python
"""
Measure phase ghosts by taking the ratio of the phase background to the frequency background.
"""
import sys
import nibabel
import argparse
import labels
import _utilities as util
import numpy
def nii_4d(in_nii):
pass
def cummean_nii(in_nii, scale=1, verbose=False):
# Read in NI... | kchawla-pi/tic_modules | ~archive/tools/cummean_nii.py | cummean_nii.py | py | 1,762 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.cumsum",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nibabel.Nifti1Image",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "nibabel.load... |
69795468514 |
debug_flag=True
import base64
import hmac
import secrets
import time
import traceback
import flask
from Application.Api.UserContext import UserContext
from Application.Util.ParamsBinder import bind_optional_params, bind_params
from Application.Api.ApiError import ApiError
from Application.App import A... | byldocoder/VK-Clone | Application/Api/ApiImp/Audios.py | Audios.py | py | 8,336 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Application.App.App.key",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "Application.App.App",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "base64.urlsafe_b64decode",
"line_number": 28,
"usage_type": "call"
},
{
"api_nam... |
33385668182 | import os
import random
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import load_iris, load_breast_cancer, load_wine, make_blobs
from sklearn.model_selection import train_test_split
project_dir = os.path.dirname(os.getcwd())
# This file describes utility functions for ... | WVLeeuw/BC_Unsupervised_FL | utils/data_utils.py | data_utils.py | py | 12,027 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_iris",
... |
33586487448 | import folium, pandas, ast
import json
# -*- coding: utf-8 -*-
locations_p = []
geos_p = []
files = 'tweets_#gopatriots.txt'
# get geo data only from rows with non-empty values
with open(files,'r') as ifile:
for line in ifile.readlines():
tweet = json.loads(line)
if tweet['tweet']['geo']... | qinyiyan/EE239AS | proj4/part6/map/map_patriot&hawks.py | map_patriot&hawks.py | py | 1,213 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "folium.Map",
"line_number": 30,
"usage_type": "call"
}
] |
35840992661 |
# coding: utf-8
# In[1]:
import requests
import json
from pprint import pprint
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# In[2]:
def view_imdb_data_votes(season_number,episode_number):
url="http://www.omdbapi.com/?t="
season="&Season="+str(season_number)
episode="&Episo... | totopi/Retro-Fireballs | Nikki/IMdb+Requests+for+project (2).py | IMdb+Requests+for+project (2).py | py | 9,697 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 186,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"l... |
10976806014 | import datetime
import calendar
import configparser
import os
class Utils:
@staticmethod
def get_business_date():
today = datetime.datetime.now()
if today.isoweekday() == 6 or today.isoweekday() == 7:
while today.isoweekday() == 6 or today.isoweekday() == 7:
one_day... | ZehanLi/Roboadvisor | src/Utils.py | Utils.py | py | 634 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "confi... |
35575769245 | from selenium.webdriver.common.by import By
from behave import given, when, then
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
ADD_TO_CART = (By.CSS_SELECTOR, "button[type='submit'].product-form__submit.button.button--secondary")
ADD_TO_CART_CONFIRM = (By.CSS_SELECTOR, "h3.lab... | brightihegworo/internship--project | features/steps/product_page.py | product_page.py | py | 1,159 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR",
"line_number":... |
34634869215 | from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.utils.functional import cached_property
from database.utils import translate_doc
from database.models.data_collections.data_collections import Collection
@translate_doc
... | CONABIO-audio/irekua | irekua/database/models/users/users.py | users.py | py | 2,397 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 25,
"usage_typ... |
19323504885 | """
Python3.6+ only
"""
import re
from pathlib import Path
from pie import *
class env(env):
@classmethod
def _parse_lines(cls,ls):
"""Parses lines and returns a dict."""
d={}
for i,l in enumerate(ls,1):
l=l.strip()
# skip blank lines and comments
... | bizcubed/intergov | pie_env_ext.py | pie_env_ext.py | py | 1,497 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.match",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.environ.keys",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number":... |
42320457538 | import h5py
import os
import shutil
import argparse
from genome import *
parser = argparse.ArgumentParser()
parser.add_argument("read_basedir", help="base directory of resquiggled fast5 files")
parser.add_argument("output_dir", help="directory to copy files to (must exist)")
parser.add_argument("reference", help="fast... | baklazan/thesis | filter_reads.py | filter_reads.py | py | 1,897 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
21104650721 | from flask import Flask
from flask_restful import Api
import logging as log
from api.config.apiconf import config
from api.views import VRStats,VRTopPlaces,\
VRClassifPlaces,VRClassifPlacesAccuracy,VRTop10Places
app = Flask(__name__)
ap = Api(app)
ap.add_resource(VRStats, '/api/stats')
ap.ad... | asiaat/mxresto | apirestful/main.py | main.py | py | 912 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "api.views.VRStats",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "api.views.VRTopPl... |
1474225083 | # Install Python Packages
#!pip install openai tiktoken
# Import Python Packages
import platform
import os
import openai
import tiktoken
import time
print('Python: ', platform.python_version())
# Count the Number of Tokens
def count_tokens(filename):
encoding = tiktoken.get_encoding("gpt2")
with open(filenam... | rayborg/textSummarize_GPT | recursiveSummaryLongFiles.py | recursiveSummaryLongFiles.py | py | 5,974 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "platform.python_version",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tiktoken.get_encoding",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tiktoken.get_encoding",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "t... |
1149116969 | from unittest.mock import MagicMock, patch
import torch.nn as nn
from mmcv.device.mlu import MLUDataParallel, MLUDistributedDataParallel
from mmcv.parallel import is_module_wrapper
from mmcv.utils import IS_MLU_AVAILABLE
def mock(*args, **kwargs):
pass
@patch('torch.distributed._broadcast_coalesced', mock)
@p... | rawalkhirodkar/egohumans | egohumans/external/mmcv/tests/test_device/test_mlu/test_mlu_parallel.py | test_mlu_parallel.py | py | 948 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
29522459651 | # Activate
# |- Linear
# |- ReLU
# |- Sigmoid
# |- Softmax
# |- Tanh
# Regularize
# |- L2
# |- Dropout
# Initialize (variance)
# |- Constant
# |- He
# |- Xavier
# Optimize
# |- EMA
# |- RMSprop
# |- Adam
# Normalization/ standardization
# Grad checking
import numpy as np
... | Duckchoy/AI-algos | ANN/utils.py | utils.py | py | 13,448 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.maximum",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.minimum",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": ... |
14351233649 | import requests, uuid, json, argparse, sys, os
import langcodes
def main():
# get credentials
credentials = get_Credentials()
key = credentials["key"]
endpoint = credentials["endpoint"]
location = credentials["location"]
# If program is run without any command-line arguments
if len(sys.arg... | SonuLohani-1/MyTranslator | functions.py | functions.py | py | 4,586 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
15828920588 | import numpy as np
import pandas as pd
from tabulate import tabulate
df = pd.read_excel('Database.xlsx')
df2 = pd.read_excel('Daftar Pickup.xlsx')
df_baru = df.dropna()
Harga = df_baru.drop('kode', axis =1)
Harga2 = df2.drop('No', axis =1)
#untuk fungsi cekKota dan ceKotaAsal, dilakukan pencarian apakah input ada di ... | yasminzulfa/22-TeamProject-Prokom | Modul.py | Modul.py | py | 3,063 | python | id | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_excel",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
16626978852 | # -----------------------------------------------------------
#Cafedev.vn - Kรชnh thรดng tin IT hร ng ฤแบงu Viแปt Nam
#@author cafedevn
#Contact: cafedevn@gmail.com
#Fanpage: https://www.facebook.com/cafedevn
#Group: https://www.facebook.com/groups/cafedev.vn/
#Instagram: https://instagram.com/cafedevn
#Twitter: https://twit... | Vantoancodegym/python_json_ex | 2 bt voi json/baitap doc json/read_json_file_thong_ke.py | read_json_file_thong_ke.py | py | 1,169 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
}
] |
2666099432 | '''Functions used in river_tracker1.py
Author: guangzhi XU (xugzhi1987@gmail.com; guangzhi.xu@outlook.com)
Update time: 2019-05-10 11:03:36.
'''
from __future__ import print_function
import numpy as np
import pandas as pd
import networkx as nx
from skimage import measure
from skimage import morphology
from scipy impo... | Clynie/AR_tracker | river_tracker1_funcs.py | river_tracker1_funcs.py | py | 40,512 | python | en | code | null | github-code | 1 | [
{
"api_name": "networkx.__version__",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "... |
41489295874 | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-01-17 19:53
import os
import tempfile
from typing import Iterable
import torch
from elit.utils.io_util import merge_files
from elit.utils.time_util import CountdownTimer
class FileCache(object):
def __init__(self, filename=None, delete=True) -> None:
... | emorynlp/seq2seq-corenlp | elit/common/cache.py | cache.py | py | 3,538 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
... |
18151751727 | import torch
from src.test_statistics import *
from src.utils import get_W_matrix,KMM_weights_for_W_matrix
from sklearn.preprocessing import KBinsDiscretizer
from sklearn.base import clone
import numpy as np
import random
import math
def get_binned_weights(weights, n_bins):
binner = KBinsDiscretizer(n_bins=n_bins... | Jakefawkes/DR_distributional_test | src/test.py | test.py | py | 8,221 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.preprocessing.KBinsDiscretizer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
38354447792 | '''module for building state machines to search through TokenSets'''
import re
from functools import reduce
from typing import List
import networkx as nx
from networkx.drawing.nx_agraph import to_agraph
import auto_types as T
import random
class Spec:
def __init__(self, name: str):
self.name = name
... | maxsun/SemanticScribe | AutoLang/automata.py | automata.py | py | 3,723 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "auto_types.TokenSetFast",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "functools.reduce",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "auto_types.TokenSetFast",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_na... |
14437464114 | from django.shortcuts import render,redirect
from .forms import UserCreateForm,SignUpForm
from django.contrib.auth.forms import UserCreationForm,AuthenticationForm
from django.contrib.auth import login,logout
# Create your views here.
def signup_view(request):
#get ์์ฒญ ์ HTML ์๋ต
if request.method=='GET':
... | Heeville/likelion_backend_lecture | liongram/accounts/views.py | views.py | py | 1,642 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "forms.SignUpForm",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "forms.SignUpForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shor... |
74913549472 | """"
Wrapper class for the FPDF.
Enables use of HTML.
@author Chase Fleming
4/23/17
"""
from fpdf import FPDF
from operator import itemgetter
title = "Participant Schedule"
def converter(interval):
times = {110.0: "10:00 am", 110.5: "10:30 am", 111.0: "11:00 am", 111.5: "11:30 am", 112.0: "12:00 pm",
... | cflemi12/NHFSchedule | sample/FPDFClass.py | FPDFClass.py | py | 3,708 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fpdf.FPDF",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "operator.itemgetter",
"line_number": 83,
"usage_type": "call"
}
] |
12656420663 | from textblob import TextBlob
import nltk
#nltk.download("stopwords") ##3 downloadsa file of common stop words
# only do this once
from nltk.corpus import stopwords
from pathlib import Path
import pandas as pd
stops = stopwords.words("english")
blob= TextBlob("Today is a beautiful day") ### we are going to use a l... | ericakaze/NLP | nlp_3.py | nlp_3.py | py | 2,610 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "textblob.TextBlob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "t... |
21889904761 | import os
import glob
import cv2 as cv
X_path = glob.glob(os.path.join('DiretorioEscolhido/NomePasta', '*'))
X = []
for f in X_path:
try:
cv.imwrite(f,cv.resize(cv.imread(f), (224, 224), interpolation=cv.INTER_AREA))
except:
print(f)
| GuilhermeNakahata/ResizeImage | main.py | main.py | py | 264 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.imwrite",
"line_number": 11,... |
25160202408 | import numpy as np
import plotly.offline as pyo
import plotly.graph_objs as go
np.random.seed(56)
# data
x_values = np.linspace(0,1,100)
y_values = np.random.randn(100)
# edited this to make a line chart
trace0 = go.Scatter(x=x_values, y=y_values+5,
mode='markers+lines',
... | eugeniosp3/udemy_plotly_course | linecharts_plotly.py | linecharts_plotly.py | py | 672 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
... |
8092338015 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""BMP ๅฎคๆธฉๆฐๅงใปใณใตใผ."""
import logging
from datetime import datetime
import Adafruit_BMP.BMP085 as BMP085
from db import MongoDB
class Bmp(MongoDB):
"""BMP180 IO."""
def __init__(self):
"""ใคใใทใฃใฉใคใถ."""
super().__init__()
# ใปใณใตใผ
sel... | akiraseto/airwatch | sensors/models/bmp.py | bmp.py | py | 1,152 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "db.MongoDB",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "Adafruit_BMP.BMP085.BMP085",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "Adafruit_BMP.BMP085",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime.da... |
2818687083 | from flask import current_app
from marshmallow import Schema, ValidationError, fields, validates_schema
from marshmallow.validate import Length
class CreateTaskSchema(Schema):
title = fields.Str(
required=True,
validate=Length(min=1),
)
description = fields.Str(required=True, validate=Leng... | sidddhesh100/factwise-assingment | schema/CreateTaskSchema.py | CreateTaskSchema.py | py | 1,036 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "marshmallow.Schema",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "marshmallow.fields.Str",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "marshmallow.fields",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "marshmallow... |
72856173474 | import unittest
import itertools
from bisect import bisect
import operator
import sys
if sys .version_info >=(3 ,):
xrange =range
class LebesgueSet (object ):
_inf =float ('infinity')# can be tested with math.isinf()
_minf =-_inf
UNION ,INTER ,XOR =range (3 )
def __init__ (self ,points ,left_infinite =... | heathkh/iwct | snap/deluge/lebesgueset.py | lebesgueset.py | py | 7,673 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "sys.version_info",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "bisect.bisect",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "itertools.groupby... |
30406506542 | import json
import torch
from torch.utils.data import Dataset
from transformers import GPT2LMHeadModel, GPT2Tokenizer, DataCollatorForLanguageModeling, Trainer, TrainingArguments
from data_preprocess import *
# Load the JSON file with prompt-completion pairs
with open("prompt_completion_pairs.json", "r") as json_file:... | namandua7/Training | GPT model/csv_GPT/fine_tuning.py | fine_tuning.py | py | 2,114 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "transformers.GPT2Tokenizer.from_pretrained",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "transformers.GPT2Tokenizer",
"line_number": 13,
"usage_type": "name"
},
{
"ap... |
43762004245 | import cv2
import numpy as np
import os
import uuid
import copy
def rotateImage(image, angle):
l = len(image.shape)
image_center = tuple(np.array(image.shape[:2]) / 2)
rot_mat = cv2.getRotationMatrix2D(image_center, angle, 1.0)
result = cv2.warpAffine(image, rot_mat, image.shape[:2], flags=cv2.INTER_L... | DREAMS-lab/mask_rcnn_pytorch | ndarray_augmentor.py | ndarray_augmentor.py | py | 7,082 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.getRotationMatrix2D",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.warpAffine",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_LINEAR",... |
28415632337 | import copy
from collections import defaultdict
from game_board import GameBoard
########################################################################################################################
# PUBLIC INTERFACE
#################################################################################################... | gondsm/sudoku | solvers.py | solvers.py | py | 8,668 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "copy.deepcopy",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 144,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 148,
"usage_type": "call"
}
] |
32054311947 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0004_auto_20151210_1426'),
]
operations = [
migrations.AlterModelOptions(
name='region',
... | djangoplicity/djangoplicity-contacts | djangoplicity/contacts/migrations/0005_auto_20151214_1357.py | 0005_auto_20151214_1357.py | py | 647 | python | en | code | 0 | github-code | 1 | [
{
"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.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
24993118256 | import sys
import numpy as np
from fractions import Fraction
if __name__ == "__main__":
readFile = open(sys.argv[1], "r")
writeFile = open("out.txt", "w")
numeroCasos = int(readFile.readline())
casoMinimo = int(sys.argv[2])
casoMaximo = int(sys.argv[3])
for _ in range(casoMinimo-1):
... | marc-gav/TuentiChallenge9 | Ch4/challenge4.py | challenge4.py | py | 967 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 6,
"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": "numpy.lcm.reduce",
"line... |
35938876208 | import numpy as np
import scipy.spatial
import itertools
from sklearn import metrics
def rand_score( X, labels_true, labels_pred ):
correct = 0
total = 0
arr2 = []
opop = len(X)
for i in range(opop):
arr2.append( i )
for index_combo in itertools.combinations(arr2, 2... | deepak0004/Assignments | 2014036_HW_1/my_kmeans.py | my_kmeans.py | py | 3,097 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.combinations",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_... |
73709085154 | import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegressionCV, LogisticRegression
from sklearn.model_selection import StratifiedKFold, RandomizedSearchCV
from sklearn.metrics i... | JuliCou/ML_3A_p2 | initial_predict.py | initial_predict.py | py | 15,151 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.flatnonzero",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.read... |
43200991376 | from jinja2 import Environment, FileSystemLoader
file_loader = FileSystemLoader('templates_dz')
env = Environment(loader=file_loader)
tm = env.get_template('main_dz.html')
msg = tm.render(title='ะะพะผะฐัะฝะตะต ะทะฐะดะฐะฝะธะต')
print(msg)
| Mil6734/git_class | Python2/dz40/dz40.py | dz40.py | py | 246 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"line_number": 4,
"usage_type": "call"
}
] |
74702175393 | from postgres import Postgres
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import json
import pandas
import os
import sys
from math import ceil
import argparse
parser = argparse.ArgumentParser()
# Run control arguments
parser.add_argument("--schema", type=str, help="The name of the schema", defaul... | carl24k/fight-churn | extras/metric-framework/py/metric_calc.py | metric_calc.py | py | 8,677 | python | en | code | 227 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "postgres.Postgres"... |
40872798888 | from flask import Flask, render_template , request
import numpy as np
from utils import CarPrice
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/valuation' , methods = ['POST','GET'])
def valuation():
if request.method == 'POST':
data = request.form.... | supriya-vedpathak/carpro | interface.py | interface.py | py | 1,115 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
40467668840 | import uuid
from teine import models, personality_operations
DEFAULT_SHOW_TITLE = 'My first show'
def get_by_id(show_id):
return models.Show.load(show_id)
def update(show_id, title='', author='', tagline='', description='',
show_hosts=[], image_id='', language='en-us'):
show = models.Show.load(s... | hirogwa/teine | teine/show_operations.py | show_operations.py | py | 1,419 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "teine.models.Show.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "teine.models.Show",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "teine.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "teine.models.... |
28437711680 | from azureml.core import Run
import pickle
import argparse
from sklearn import svm
from sklearn.metrics import accuracy_score
from sklearn.model_selection import cross_val_score
from dataloader import DataLoader
# model params
C = 0.025
kernel = "linear"
# cross validation params
cv = 5
def get_args():
parser ... | liupeirong/MLOpsManufacturing | samples/edge-inferencing-and-mlops/model/main.py | main.py | py | 2,029 | python | en | code | 21 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "azureml.core.Run.get_context",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "azureml.core.Run",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": ... |
7413718188 | from functools import partial
from typing import Callable, Dict, Tuple
import jax
import jax.numpy as jnp
from chex import dataclass, Array, Scalar, PRNGKey
from tensorflow_probability.substrates import jax as tfp
from ml4wifi.utils.wifi_specs import *
from ml4wifi.utils.measurement_manager import measurement_manager... | ml4wifi-devs/ftmrate | ml4wifi/envs/simple_wifi/ftmrate_sim.py | ftmrate_sim.py | py | 8,913 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "tensorflow_probability.substrates.jax.distributions",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tensorflow_probability.substrates.jax",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "tensorflow_probability.substrates.jax.bijectors",
... |
35349481168 | '''
asyncio task loop to validate ledger close time and UNL status
using keys stored in an exiting database.
'''
import asyncio
import logging
import supplemental_data.get_data
def sup_data_loop(settings):
'''
Run the .asyncio event loop.
:param settings: Configuration file
'''
loop = asyncio.get... | jscottbranson/xrpl-validation-tracker | xrpl_validation_tracker/supplemental_data/sd_loop.py | sd_loop.py | py | 805 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "supplemental_data.get_data.get_data.DomainVerification",
"line_number": 25,
"usage_type": "call"
},... |
7486582215 | from maya import cmds,mel
from PySide import QtGui
from .lib import qt
def cpy():
mel.eval("timeSliderCopyKey;")
def pst():
mel.eval("timeSliderPasteKey false;")
def dlt():
mel.eval("timeSliderClearKey;")
def cut():
mel.eval("timeSliderCutKey;")
class MainWindow(QtGui.QMainWindow):
def __init__... | Mocson/mocTools | pyTest/keyFrameBox.py | keyFrameBox.py | py | 1,299 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "maya.mel.eval",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "maya.mel",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "maya.mel.eval",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "maya.mel",
"line_number": 9,
... |
4346085126 | # Author: Xinshuo Weng
# email: xinshuo.weng@gmail.com
import numpy as np, os, matplotlib.pyplot as plt, colorsys, random, matplotlib.patches as patches
import matplotlib.collections as plycollections
from matplotlib.patches import Ellipse
from skimage.measure import find_contours
# from scipy.stats import norm, chi2
... | xinshuoweng/Xinshuo_PyToolbox | xinshuo_visualization/geometry_vis.py | geometry_vis.py | py | 29,886 | python | en | code | 61 | github-code | 1 | [
{
"api_name": "xinshuo_miscellaneous.islist",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "private.save_vis_close_helper",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "xinshuo_miscellaneous.isnparray",
"line_number": 42,
"usage_type": "call"
},... |
19752234298 | import json
import torch
from SAC.Agent import AgentV2
if __name__ == "__main__":
jsonFilePath = "./cfg/RealTrain.json"
with open(jsonFilePath) as file:
json_dict = json.load(file)
agentDict = json_dict['Agent']
x = AgentV2(agentDict)
rstate = torch.zeros((32, 8))
lidarpt = ... | seungju-mmc/SAC | agenttest.py | agenttest.py | py | 450 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "SAC.Agent.AgentV2",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_numbe... |
29343515477 | import common, sql
import os, json
import subprocess, shlex
from dateutil import parser as dt
import dateutil
import requests, json
import logging, coloredlogs
coloredlogs.install()
ecosystem = 'Composer'
from packaging import version as PythonVersion
def isValidVersion(v):
try:
v = PythonVersion.Version(v... | nasifimtiazohi/secrel | data_explore/composer.py | composer.py | py | 3,367 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "coloredlogs.install",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "packaging.version.Version",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "packaging.version",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "loggin... |
8691161609 | from typing import List
class Solution:
def firstMissingPositive(self, nums: List[int]) -> int:
n = len(nums)
if n == 0 or 1 not in nums:
return 1
i = 0
while i < n:
idx = nums[i] - 1
if 0 <= idx < n and nums[idx] != nums[i]:
nums... | songkuixi/LeetCode | Python/First Missing Positive.py | First Missing Positive.py | py | 507 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
15994920309 | import re
import collections
def mostCommon(paragraph, banned):
words = [word for word in re.sub(r'[^\w]', ' ', paragraph)
.lower().split()
if word not in banned]
counts = collections.Counter(words)
print(counts)
return counts.most_common(1)[0][0]
if __name__ == "__main__"... | Kynel/algorithm | python/๋ฌธ์์ด ์กฐ์/code/most_common.py | most_common.py | py | 458 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 10,
"usage_type": "call"
}
] |
23519662780 | import os
import logbook
import gossip
from .project import get_project
# from .celery_utils import celery_app
_logger = logbook.Logger(__name__)
_cached_app = None
_building = False
def build_app(*, use_cached=False, config_overrides=None):
from flask import Flask
global _cached_app # pylint: disable=g... | getweber/cob | cob/app.py | app.py | py | 1,246 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "logbook.Logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "project.get_project",
... |
73547403554 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Upsampler(nn.Module):
def __init__(self, in_channels=3, ngf=128):
super(Upsampler, self).__init__()
self.up = nn.Sequential(
nn.ConvTranspose2d(in_channels, ngf * 4, 4, 2, 1, bias=False),
nn.BatchNorm2... | julschoen/DC-VAE | vae.py | vae.py | py | 6,085 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
4444262235 | import numpy as np
from tqdm import tqdm
import networkx as nx
import scipy.sparse as sp
import dgl
import random
from time import time
from collections import defaultdict
import warnings
warnings.filterwarnings('ignore')
n_users = 0
n_items = 0
n_entities = 0
n_relations = 0
n_nodes = 0
train_user_set = defaultdict(... | gayeon603/kgin | utils/data_loader.py | data_loader.py | py | 7,149 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
4607138870 | import tkinter as tk
import tkinter.ttk as ttk
from tkinter import filedialog
from PIL import Image, ImageTk, ImageFile
import subprocess
import os
import json
from constants import *
from logic import get_page_maps
ImageFile.LOAD_TRUNCATED_IMAGES = True
class ToolBar(tk.Frame):
def __init__(self, master, vars... | BigShuang/ra3-map-browser | board.py | board.py | py | 15,216 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFile",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tkinter.Frame",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_nam... |
71458557795 | #!usr/bin/env python3
#Jacob Foppes Project 6 Game
#game like pokenmon where you go down differnent paths and can run into pokemon on the way.
# Uses random to randomly slect a pokemon from a list for you to fight
# you fight the poken nad it cna wither be cought or run away attacks are effective or ineffective
#... | jfoppes/week_6 | project_6.py | project_6.py | py | 17,314 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.flush",
"li... |
19121216961 | # hcm/util/file_utils.py
"""File utilities. """
import os
import sys
import logging
import pandas as pd
logger = logging.getLogger(__name__)
pd.set_option('display.width', 1000)
def days_suffix(obs_period):
return obs_period.replace('-', '_').replace(' ', '_')
def progress(count, total, status=''):
bar_len... | giorgio-o/hcm2 | util/file_utils.py | file_utils.py | py | 6,148 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"... |
13395702605 | """Remove order in shop product and replace with the unwieldy row/column again :/
Revision ID: 4f786f3c132b
Revises: 2d4ea6b57d6e
Create Date: 2016-03-20 07:11:09.422825
"""
# revision identifiers, used by Alembic.
revision = '4f786f3c132b'
down_revision = '2d4ea6b57d6e'
from alembic import op
import sqlalchemy as ... | fenriz07/flask-hippooks | migrations/versions/4f786f3c132b_.py | 4f786f3c132b_.py | py | 4,089 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "alembic.op.add_column",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.