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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28552898211 | #-*-coding:utf-8-*-
import argparse
import pyspark
from pyspark.sql.types import IntegerType
from pyspark.sql.functions import *
from generic_utils import execute_compute_stats
def extract_tbau_documento(spark):
columns = [
col("DOCU_DK").alias("DOAT_DOCU_DK"),
col("DOCU_NR_EXTERNO").alias("DOAT_DOCU_NR_EXTE... | rhenanbartels/scripts-bda | extract_tbau/src/extractor.py | extractor.py | py | 25,402 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "pyspark.sql.types.IntegerType",
"line_number": 184,
"usage_type": "call"
},
{
"api_name": "generic_utils.execute_compute_stats",
"line_number": 503,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.session.SparkSession.builder.appName",
"line_number": 509,
... |
8161754177 | import multiprocessing
import time
def pro1(q):
# q에 데이터를 넣는다
for i in range(100):
q.put(str(i))
time.sleep(0.1)
def pro2(q):
# q에 데이터를 빼낸다
for i in range(100):
item = q.get()
print(item)
# JoinableQueue
q.task_done()
if __name__ == '__main__':
queu... | weatherbetter/levelup-python | multi_process/multiprocess_JoinableQueue.py | multiprocess_JoinableQueue.py | py | 540 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.sleep",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "multiprocessing.JoinableQueue",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "multi... |
15640198972 | from django.conf.urls import url,include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
url(r"^$", views.HomePage.as_view(), name="home"),
url(r"^index/$", views.TestPage.as_view(), name="test"),
url(... | itzikorfa/SE-Lite-Scrum | SE_Project_VerX/urls.py | urls.py | py | 1,153 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.c... |
38264973809 | import importlib
from copy import deepcopy
from os import path as osp
from collections import OrderedDict
from pyiqa.utils import get_root_logger, scandir
from pyiqa.utils.registry import ARCH_REGISTRY
from pyiqa.default_model_configs import DEFAULT_CONFIGS
__all__ = ['build_network', 'create_metric']
# automatical... | Sskun04085/IQA_PyTorch | pyiqa/archs/__init__.py | __init__.py | py | 1,637 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_... |
43587658067 | import json as _json
import re as _re
from typing import List as _List
from mitmproxy.http import HTTPFlow as _HTTPFlow
from mitmproxy.io import FlowReader as _FlowReader
from mitmproxy.io import FlowWriter as _FlowWriter
from mitmproxy.io import tnetstring as _tnetstring
from . import utils as _utils
# ---------- C... | PSS-Tools-Development/pss-api-parser | src/anonymize.py | anonymize.py | py | 5,070 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "re.Pattern",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "re.MULTILINE",
"lin... |
19279680101 | import datetime
import os
import tensorflow as tf
import numpy as np
class Runner(object):
def __init__(self, agent, env, train, load_path):
self.agent = agent
self.env = env
self.train = train # True: entrenar agente, False: se carga agente entrenado
self.episode = 1
se... | ericPrimelles/RLProject | runner.py | runner.py | py | 4,209 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.summary.create_file_writer",
"line_number": 20,
"usage_type": "call"
},
{
... |
15444060214 | #!/usr/bin/env python
from __future__ import print_function
import sys
import argparse
def parse_stdin(in_file):
d = {}
for line in in_file:
if ':' in line:
split = line.split(':')
stripped = [s.strip() for s in split]
#if len(stripped) > 2:
# print '... | amandasystems/cocp-automation-2017 | conductor/gather_stats.py | gather_stats.py | py | 1,288 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 45,
"usage_type": "attribute"
}
] |
21664219940 | """
Receive an image
- Global binarize image
- Find word (connected component RETR_BOUNDARY)
- Find Rectilinear Polygon
Return an list of points in order
"""
import cv2
import numpy as np
import sys
import matplotlib.pyplot as plt
PADDING = 2
def binarize(img):
gray = cv2.cv... | qcuong98/clabel | rectilinear_polygon.py | rectilinear_polygon.py | py | 3,815 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cv2.threshold",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY_... |
41573028205 | import logging
def get_logger():
"""Get logging."""
logging.getLogger('matplotlib.font_manager').setLevel(logging.WARNING)
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s: - %(message)s',
datefmt='%Y-%... | TitusWjt/class3 | utils/log.py | log.py | py | 474 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",... |
38799425699 | import discord
import bdg
import enum
import requests
import bs4
import datetime
class BrawlModes(enum.Enum):
BRAWLBALL = "brawlBall"
SOLOSHOWDOWN = "soloShowdown"
DUOSHOWDOWN = "duoShowdown"
GEMGRAB = "gemGrab"
BOUNTY = "bounty"
HOTZONE = "hotZone"
KNOCKOUT = "knockout"
HEIST = ... | DanielKMach/BotDusGuri | src/commands/utilities/brawlmeta.py | brawlmeta.py | py | 3,277 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "discord.app_commands",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "bdg.BotDusGuri",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "discord.I... |
20420839973 | # -*- coding: utf-8 -*-
from threading import Thread
import queue
import json
import os , sys
#导入requests库(请求和页面抓取)
import requests
#导入time库(设置抓取Sleep时间)
import time
#导入random库(生成乱序随机数)
import random
#导入正则库(从页面代码中提取信息)
import re
#导入数值计算库(常规计算)
import numpy as np
from PIL import Image
from wordcloud import WordCloud
#导... | ltzone/EE208Lab | jd_cmt_tags/_jd_cmt_TAGS.py | _jd_cmt_TAGS.py | py | 3,546 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "queue.Queue",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 1... |
74329032423 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Station',
... | opendata-stuttgart/metaEFA | meta_efa/main/migrations/0001_initial.py | 0001_initial.py | py | 1,045 | python | en | code | 33 | github-code | 36 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 15,
"usage_type": "call"
},
... |
37314300998 | # -*- coding:utf-8 -*-
from openpyxl import Workbook
from datetime import datetime
def write_excel(filename):
wb = Workbook() # load_work(filename)
ws = wb.create_sheet('sheet', 0)
wb.remove('sheet')
ws = wb.active # default Sheet
ws.title = 'Pi'
ws['A1'] = 3.1415926
ws['A2'] = datetime... | huazhicai/Demo | openpyxl/demo2.py | demo2.py | py | 580 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "openpyxl.Workbook",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
}
] |
43194848130 | import pickle as pkl
import numpy as np
from utils import clean_str
import scipy.sparse as sp
from tqdm import tqdm
from utils import clean_str
import torch
word_embeddings = dict()
with open('glove.840B.300d.txt', 'r') as f:
for line in f.readlines():
data = line.split(' ')
word_embedd... | MathIsAll/HDGCN-pytorch | build_fixed_graph.py | build_fixed_graph.py | py | 7,500 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "numpy.random.uniform",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "utils.clean_str",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.c... |
13442778323 | import os
import argparse
import tensorflow as tf
import numpy as np
from load import load_graph
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
"""
Adapted from https://gist.github.com/morgangiraud/4a062f31e8a7b71a030c2ced3277cc20#file-medium-tffreeze-3-py
"""
if __name__ == '__main__':
parser = argparse.ArgumentParse... | Yunski/nvidia-cnn | test_load.py | test_load.py | py | 961 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "load.load_graph",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.Ses... |
1812506827 | import os
import re
import torch
from PIL import Image
from torch.utils.data import Dataset
import torchvision.transforms as T
import utils
class MyDataset(Dataset):
def __init__(self, file_list: list, name2label, transform_flag=True):
self.file_list = file_list
self.name2label = name2label
... | newchexinyi/mobilefacenet | dataset.py | dataset.py | py | 1,225 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 16,
"usage_type": "name"
},
{
"ap... |
44265086055 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import pandas as pd
df = pd.read_csv("File.txt", sep=" ")
#print(df)
moviewriter = animation.FFMpegWriter( fps=60)
fig = plt.figure(figsize=(12, 6))
with moviewriter.saving(fig, 'myfile.mp4', dpi=100):
integration_time = ... | josephmckenna/2021_April_IOP_IntroductionToCpp_Part1 | extras/AnimateFigure.py | AnimateFigure.py | py | 1,004 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.animation.FFMpegWriter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.animation",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "m... |
38110745441 | import os
import shutil
from pathlib import Path
def checkPathExists(filePath):
if not (os.path.exists(filePath)):
errorMessage = f'File Path not found: {filePath}'
print(errorMessage)
raise FileNotFoundError(errorMessage)
def recreateFolderPath(filepath):
if not (os.path.exists(filepath)):
print(f'Cr... | ibaadaleem/filmDatabase | fileManagement.py | fileManagement.py | py | 1,354 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
40165431906 | # -*- encoding: utf-8 -*-
from django import template
from django.contrib import admin
from django.conf import settings
register = template.Library()
'''
templatetag, obtiene la configuración del menú
'''
def get_config_menu():
return Menu.get_menu(self)
register.filter('get_config_menu')
class Menu(object):
... | elmanos/vari | vari/localesapp/templatetags/menu.py | menu.py | py | 1,276 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "django.template.Library",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.conf.settings",
"line_number": 45,
"usage_type": "argument"
},
{
"api_name": "django... |
24951711823 | from flask import render_template, request, redirect
from app import app
from models.book import *
from models.book_list import book_list, add_new_book, delete_book
@app.route('/')
def index():
return render_template('index.html', book_list = book_list)
@app.route('/stock')
def display_stock():
return render_... | sshingler/Flask-library_homework | controllers/controller.py | controller.py | py | 1,287 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.render_template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.book_list.book_list",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.app.route",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "app.app",... |
19475555146 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, HttpResponse, redirect, get_object_or_404
from django.core.paginator import Paginator
from django.contrib.auth import authenticate, login, logout
from django.contrib import messages
from dj... | Asif-Biswas/instagram-clone | instagram2/views.py | views.py | py | 24,038 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.core.paginator.Paginator",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 22,
"usage_type": ... |
16821571488 | # Author: Bill Pengyuan Zhai. Harvard University. Yelin Group. Oct 2022
from Utils_torch_version import Network, get_nn_pairs, binary_basis, unpacknbits
import numpy as np
import matplotlib.pyplot as plt
from scipy import sparse
import scipy
import scipy.linalg
import qiskit
import time
import torch
import math
# try... | BILLYZZ/NFNet | Benchmark_torch_version_partial.py | Benchmark_torch_version_partial.py | py | 9,049 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "scipy.sparse.csr_matrix",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.sparse",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.csr_mat... |
13123666146 | #!/usr/bin/env python
# coding: utf-8
# # Finding appropriate parametric models
# - Code from: https://lifelines.readthedocs.io/en/latest/Examples.html
# In[1]:
# Imports
from lifelines import *
from lifelines.plotting import qq_plot
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seab... | mikkorekstad/M30-DV | Module C (Model Appropriateness)/Response Distributions.py | Response Distributions.py | py | 3,895 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "lifelines.utils.find_best_parametric_model",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.clf",
"line_number": 64,
"usage_type": "call"
},
{
"... |
16895923091 | from tkinter import Tk,Button,Label,Frame,Canvas,Entry,Text,StringVar, ttk, filedialog, messagebox
import pandas as pd
from pandas import datetime, read_csv
import numpy as np
import matplotlib as mp
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.figure impor... | FernandoLopezC/TSA | base.py | base.py | py | 19,718 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tkinter.Tk",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tkinter.Tk",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "tkinter.Tk.__init__",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_numb... |
30071209692 | # -*- coding: utf-8 -*-
""" This code is open-sourced software licensed under the MIT license"""
""" Copyright 2019 Marta Cortes, UbiComp - University of Oulu"""
""" Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to d... | CUTLER-H2020/DataCrawlers | Economic/antalya_econ_cityofantalya_cityzonepuplictransportationpasengernumber_monthly.py | antalya_econ_cityofantalya_cityzonepuplictransportationpasengernumber_monthly.py | py | 5,426 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "pandas.ExcelFile",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "pandas.DataFra... |
16127772066 | import cv2
import imageio
import pathlib
def fadeInGif(pathimg1, pathimg2, filegif, len=10, frames_per_second=2):
img1 = cv2.imread(pathimg1)
img2 = cv2.imread(pathimg2)
listimg = []
for seq in range(0,len):
fadein = seq/float(len)
dst = cv2.addWeighted(img1, 1-fadein, img2, fadein, 0... | doubsman/LedPanel64 | python_dev/TransitionGif.py | TransitionGif.py | py | 634 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.addWeighted",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": ... |
23297154753 | """
Series Meta Analysis.
Some day this will be either the parent class of TAM and Adoption, or at least used by them.
For now, needed to have the general class for use in integrations where it is sometimes used in unique ways.
Note, at this time, this class does *not* handle the interpolation, fitting, etc;
we will ne... | ProjectDrawdown/solutions | limbo/sma.py | sma.py | py | 6,839 | python | en | code | 203 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "typing.Dict",... |
8158020365 | import requests
import urllib
import json
import time
import pymysql
def get_latitude_longtitude(address):
address = urllib.parse.quote(address)
url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + address+"&key=AIzaSyAzA3f6KHEpViCBcLFSWS3a2ywVr3fCIvY"
while True:
res = requests.get... | NTUBimd1092/project-1 | python/GeoAPI.py | GeoAPI.py | py | 1,979 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.parse.quote",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"lin... |
28932021496 | from django.shortcuts import render, redirect
from models import Book
# Create your views here.
def index(request):
books = Book.objects.all;
context = {
'books': books
}
return render(request, 'app/index.html', context)
def process(request):
if request.method == "POST":
Book.objec... | melissaehong/AllProjects | Python/django/fullstackbooks/apps/app/views.py | views.py | py | 460 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "models.Book.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "models.Book",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Boo... |
3721701885 | import environ
from io import BytesIO
from PIL import Image, ImageFilter
env = environ.Env()
FILTERED_FILES = env('FILTERED_FILES', default='process_service/tmp/filtered')
def filter(file, filename, ext, method='blur', is_file=False):
filt = filt_obj.get(method, None)
Filter = getattr(ImageFilter, filt)
... | olacodes/prog-image | process_service/filtering/filter.py | filter.py | py | 875 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "environ.Env",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.ImageFilter",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_n... |
29719252617 | """
Day 9 part 2
"""
from utils import read_input
def find_window(opts, total):
window = []
for o in opts:
window.append(o)
while sum(window) > total:
window.pop(0)
if sum(window) == total:
return window
def find_missing(vals, pre):
idx = pre
while... | yknot/adventOfCode | 2020/09_02.py | 09_02.py | py | 975 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.read_input",
"line_number": 64,
"usage_type": "call"
}
] |
20832740847 | import awkward as ak
from pocket_coffea.lib.cut_definition import Cut
def dilepton(events, params, year, sample, **kwargs):
MET = events[params["METbranch"][year]]
# Masks for same-flavor (SF) and opposite-sign (OS)
SF = ((events.nMuonGood == 2) & (events.nElectronGood == 0)) | (
(events.nMuonGood ... | ryanm124/AnalysisConfigs | configs/ttHbb/custom_cut_functions.py | custom_cut_functions.py | py | 1,172 | python | en | code | null | github-code | 36 | [
{
"api_name": "awkward.firsts",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "awkward.where",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "awkward.is_none",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pocket_coffea.lib.cut_de... |
70846797543 | from pymongo import MongoClient
from datetime import datetime
import os, sys
sys.path.append(os.path.join(os.path.dirname(sys.path[0]), 'backend'))
import Model
import Repository as repo
def make_seats(secL, secH, rowL, rowH, seatL, seatH, secI=1, rowI=1, seatI=1):
seats = []
for sec in range(secL, secH, secI... | DannyBarbaro/SeatSwap | db_code/EventCreator.py | EventCreator.py | py | 1,618 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
4712176028 | import numpy as np
import os
import trimesh.points
from abc import ABC
from typing import List, Union
from dataclasses import dataclass
from OpenGL import GL as gl
from .renderable import Renderable
from .shaders.shader_loader import Shader
from ..camera.models import BaseCameraModel, StandardProjectionCameraModel
fro... | vguzov/cloudrender | cloudrender/render/pointcloud.py | pointcloud.py | py | 12,029 | python | en | code | 16 | github-code | 36 | [
{
"api_name": "renderable.Renderable",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
... |
72219406185 | import math
import os.path
from os.path import join
import random
import torch
from torch.utils.data import DataLoader, Dataset
from typing import Dict, AnyStr, Any
from torchvision.transforms import transforms
from .image_folder import is_image_file, make_dataset
from PIL import Image
import numpy as np
from PIL imp... | leelxh/Adaptive-Texture-Filtering-for-Single-Domain-Generalized-Segmentation | texture_filter/datasets/smoothing_dataset.py | smoothing_dataset.py | py | 1,899 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFile",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.transforms.Compose",
"line_number": 16,
"usage_type": "call... |
14487480169 | import urllib.request, urllib.parse
from difflib import SequenceMatcher
import json
from msvcrt import getch
serviceurl = 'http://www.omdbapi.com/?'
apikey = '&apikey='+'da05069b'
abv90=[]
def match(s1, s2):
s2p=s2[0:len(s1)]
s1p=''.join(d for d in s1 if d.isalnum())
s2p=''.join(d for d in s2p if d.isa... | souvikchakraborty98/QuickScripts | z_test_1.py | z_test_1.py | py | 1,554 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "difflib.SequenceMatcher",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse.urlencode",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse",
"line_number": 22,
"usage_type": "attribute"
},
{
"... |
12227662181 | #!/home/mcollier/miniconda3/bin/python
# -*- coding: utf-8 -*-
__author__ = "Matthew Collier"
__version__ = "0.5"
# Typical use cases:
#hf> /media/mcollier/ONYX/ONYX/W/portfolio/scripts/scan.py -v
#hf> /media/mcollier/ONYX/ONYX/W/portfolio/scripts/scan_db.py -s WMT
#hf> /media/mcollier/ONYX/ONYX/W/portfolio/scripts/sc... | mcStargazer/hf | scan_db.py | scan_db.py | py | 17,177 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"lin... |
42335398411 | import warnings
import torch
from mmdet.core import bbox2result
from ..builder import DETECTORS, build_backbone, build_head, build_neck
from .base import BaseDetector
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class TestGtDetector(SingleStageDetector):
"""Base class for single-sta... | mengqiDyangge/HierKD | mmdet/models/detectors/single_stage_test.py | single_stage_test.py | py | 1,754 | python | en | code | 32 | github-code | 36 | [
{
"api_name": "single_stage.SingleStageDetector",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "ipdb.set_trace",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "mmdet.core.bbox2result",
"line_number": 48,
"usage_type": "call"
},
{
"api_name":... |
35438464473 | from torch.utils.data import random_split
import torch
import argparse
import json
from pathlib import Path
from dataloader import SquadLocalContextContrastiveDataset, QuacLocalContextContrastiveDataset, get_quac_sets, get_squad_sets
from model import QClip
from trainer import Trainer
from tracker import WandBTracker
... | Veldrovive/QuestionContext | main.py | main.py | py | 10,429 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "config.Config",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "open_clip.create_model_and_transforms",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
12040540403 | import os, sys, logging, glob2, csv
import numpy as np
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
def create_directory(name):
"""
Create directory if not exists
Parameters
----------
name : string
name of the folder to be created
"""
try:
... | stannida/skill-embeddings | utils/helper_functions.py | helper_functions.py | py | 3,147 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_numb... |
37244411947 | # -*- coding: utf-8 -*-
"""
CAD120 data reader that is compatible with QSRlib.
:Author: Yiannis Gatsoulis <y.gatsoulis@leeds.ac.uk>
:Organization: University of Leeds
"""
from __future__ import print_function, division
import sys
import argparse
import timeit
import ConfigParser
import os
try:
import cPickle as p... | gatsoulis/strands_data_to_qsrlib | src/cad120/cad120_qsr_keeper.py | cad120_qsr_keeper.py | py | 4,946 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "timeit.default_timer",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "qsrlib.qsrlib",
... |
36289747092 | from kafka.producer import KafkaProducer
TOPIC_NAME = "kafka.client.tutorial" # producer는 생성한 레코드를 전송하기 위해 전송하고자 하는 토픽을 알고 있어야 한다.
BOOTSTRAP_SERVER_HOST = "kafka_tutorial:9092" # 전송하고자 하는 카프카 클러스터 서버의 host와 IP를 지정
KEY_SERIALIZER = str.encode
VALUE_SERIALIZER = str.encode
producer = KafkaProducer(
bootstrap_serve... | 2h-kim/kafka-personal-study | simple-kafka-producer/kafka-producer-key-value.py | kafka-producer-key-value.py | py | 833 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "kafka.producer.KafkaProducer",
"line_number": 9,
"usage_type": "call"
}
] |
12553211459 | import datetime
current_weight = 220
goal_weight = 180
average_lbs_week = 1.5
start_date = datetime.date.today()
print('Today\'s Date is: {:%B %d, %Y}'.format(start_date))
end_date = start_date
# print(end_date)
while current_weight > goal_weight:
end_date += datetime.timedelta(days=7)
current_weigh... | iampaavan/Pure_Python | Weekly_Goal.py | Weekly_Goal.py | py | 506 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "datetime.date.today",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 14,
"usage_type": "call"
}
] |
72549427943 | import traceback
from fastapi import HTTPException, Request
from fastapi.exceptions import RequestValidationError
from starlette.exceptions import HTTPException as StarletteHTTPException
from starlette.responses import JSONResponse
from tortoise.exceptions import IntegrityError
from config import config
from utils.pa... | OpenTreeHole/treehole_backend | utils/exceptions.py | exceptions.py | py | 1,981 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.patch.MyFastAPI.get_app",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.patch.MyFastAPI",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "fastapi.HTTPException",
"line_number": 15,
"usage_type": "name"
},
{
"api_nam... |
6703674654 | import os, shutil
from datetime import datetime, timedelta
from tkinter import *
import tkinter as tk
from tkinter import filedialog, messagebox, ttk
import sqlite3
def load_gui(self):
# GUI set up using tkinter.
self.lbl_origin = tk.Label(self.master, bg = "silver", text = "Origin directory:... | sajibhaskaran/Python_drills | PyDrill_db/modified_files_gui.py | modified_files_gui.py | py | 7,843 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tkinter.Label",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line... |
5462088920 | import cv2
import numpy as np
import logging
from skimage import io
import time
from multiprocessing import Lock
mutex = Lock()
class AClassify:
def __init__(self,uuid,net,image,s_client):
logging.debug("intialisation is requested")
self.url = s_client.generate_presigned_url(ClientMethod='get_objec... | gitibeyonde/pyms | lib/AnalyticsClassify.py | AnalyticsClassify.py | py | 1,480 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "multiprocessing.Lock",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "skimage.io",
... |
6999547749 | # Functions to calculate optical flow
import opyf
import utils
def analyze_frames(element):
dir = "/media/madziegielewska/Seagate Expansion Drive/Diploma-Project/"
analyzer = opyf.frameSequenceAnalyzer(f"{dir}Demo-App/static/segmentation_results/{element}")
num = analyzer.number_of_frames
utils.del... | mdziegielewska/Diploma-Project | Demo-App/opticalflow.py | opticalflow.py | py | 994 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "opyf.frameSequenceAnalyzer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.delete_files_in_directory",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.convert_frames_to_video",
"line_number": 23,
"usage_type": "call"
}
] |
16912146541 | """
Setup Module for Blob Creator
Author: Michael Kohlegger
Date: 2021-09
"""
import setuptools
with open("README.md", "r", encoding="utf8") as readme_file:
readme = readme_file.read()
with open('requirements.txt', "r", encoding="utf8") as requirement_file:
requirements = requirement_file.read().splitlines(... | mckoh/blob_creator | setup.py | setup.py | py | 1,076 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 34,
"usage_type": "call"
}
] |
28630475186 | from densefog import web
import flask # noqa
from icebox.model.iaas import image as image_model
def describe_images():
params = web.validate_request({
'type': 'object',
'properties': {
'limit': {
'type': 'integer',
'minimum': 1,
'maximu... | hashipod/icebox | core/icebox/api/public/image.py | image.py | py | 3,641 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "densefog.web.validate_request",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "densefog.web",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "icebox.model.iaas.image.IMAGE_STATUS_PENDING",
"line_number": 24,
"usage_type": "attribute"
},... |
43228825355 | # %%
from datasets import load_dataset
from transformers import AutoTokenizer, BertForSequenceClassification, TrainingArguments, Trainer
from transformers import pipeline
# %%
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
model = BertForSequenceClassification.from_pretrained("distilbert-base-unc... | NgThVinh/dsc_uit | main.py | main.py | py | 2,653 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "transformers.BertForSequenceClassification.from_pretrained",
"line_number... |
19544626210 | # pip install pipwin
# pip install pyaudio
import pyaudio
import wave
from datetime import datetime, timedelta
import numpy as np
from multiprocessing import shared_memory
def runCapture(recDevice, rec_controls_sm, saveFilesPath, SECONDS = 1):
rec_controls = rec_controls_sm.buf
p = pyaudio.PyAudi... | Richard-Kershner/Audio-Video-Screen-TimeStamp-Recorder | rec_audio.py | rec_audio.py | py | 4,034 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyaudio.PyAudio",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyaudio.paInt16",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.timestamp",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "date... |
28037620802 | from setuptools import find_packages, setup
# read the contents of README file
from os import path
from io import open # for Python 2 and 3 compatibility
# get __version__ from _version.py
ver_file = path.join('tensorpi', 'version.py')
with open(ver_file) as f:
exec(f.read())
this_directory = path.abspath(path.... | xinychen/TensorPi | setup.py | setup.py | py | 1,800 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "io.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 12,
... |
74792104104 | # this is not CURE, just heirarchical clustering
# this is used to practice making a clustering algorithm
import numpy as np
import matplotlib.pyplot as plt
import math
# a vertex is just an x position and a y position
# this makes is easier for grouping vertices together
# rather than having 2 arrays for the x and ... | AdamPoper/CPSC-480-CURE-Clustering | heirarchical_clustering.py | heirarchical_clustering.py | py | 9,062 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "math.sqrt",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
70987576744 | #!/usr/bin/python2.7
import rospy
from sensor_msgs.msg import Image
import cv2
from cv_bridge import CvBridge
bridge = CvBridge()
def show_webcam():
cam = cv2.VideoCapture(0)
if not cam.isOpened():
raise IOError("Cannot open webcam")
while True:
ret_val, img = cam.read()
cv2.imsh... | E-pep/HaldisBot | catkin_ws/src/Line_Follower_pkg/imgPub.py | imgPub.py | py | 924 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "cv_bridge.CvBridge",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line... |
28068881292 | from itertools import combinations
import sys
input = sys.stdin.readline
def solution(orders, course):
answer = {}
for n in course:
food = {}
for i in orders:
combi = list(combinations(sorted(i), n))
for i2 in combi:
try:
food[''.join(... | hwanginbeom/algorithm_study | 2.algorithm_test/21.08.22/21.08.22_gyeonghyeon.py | 21.08.22_gyeonghyeon.py | py | 726 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "itertools.combinations",
"line_number": 10,
"usage_type": "call"
}
] |
74457197862 | import json
import os
import sys
import time
from apscheduler.schedulers.blocking import BlockingScheduler
from public import redis_con,get_conn
from data_change import get_setting
# 将数据查询到redis中
def get_data():
con = get_conn()
cur = con.cursor()
sql = f"SELECT id,title,Ncontent from {get_setting()} wher... | AYongmengnan/zimeiti | zimeiti/get_data_redis.py | get_data_redis.py | py | 1,434 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "public.get_conn",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "data_change.get_setting",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "public.redis_con",... |
5808173653 | from datetime import datetime
class DateBuilder:
def __init__(self, raw_date: str):
self.raw_date = raw_date
def get_month(self):
months = {}
for i, m in enumerate(["january", "febuary", "march", "april", "may", "june", "july", "august", "september", "october", "november", "dec... | Vel4ta/Event_Manager | events/lib/DateBuilder.py | DateBuilder.py | py | 2,102 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "name"
}
] |
12248576934 | ######################################################################
# Script for processing Diss.
#
# (C) Christoph Schaller, BFH
######################################################################
import os
import sys
import math
import glob
import numpy as np
import fiona
from shapely.geometry import Point... | HAFL-WWI/FINTCH-publication-code | 2022-improving-local-maxima-idt/python/detection/Processing/fintch_processing_process_pub.py | fintch_processing_process_pub.py | py | 14,644 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_n... |
35681548851 | import os
import sys
import cv2
import time
import pickle
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.svm import SVC
from sklearn.metrics import confusion_matrix,accuracy_score,f1_score
def generate_pca_dataset(datapath):
time1 = time.clock()
folders = [
'00000001', '00... | pradyumnameena/COL774-Machine-Learning | Assignment-4/pca.py | pca.py | py | 9,783 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "time.clock",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.ravel",
"line_number": ... |
35376239294 | # time-dependent solutions for P_00(t), P_01(t), and P_10(t) and P_01(t)
# taken from Anderson 2017 Lecture Notes on Stochastic Processes with Applications in Biology
# P_00(t) is the chance of being in the inactive state at t=t, given being in the inactive state at t=0
# or P_00(t) = P(x_t = 0 | x_0 = 0) with x=0 is b... | resharp/scBurstSim | solution/nonstat_markov.py | nonstat_markov.py | py | 1,894 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "numpy.exp",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"l... |
15975975433 | # *-* coding: utf-8 *-*
"""
Created on sam 22 mai 2021 19:11:56 CEST
@author : vekemans
"""
import numpy as np
from numpy.fft import \
rfft,irfft,fftfreq,\
rfft2,irfft2,rfftfreq
from scipy import sparse
from scipy.interpolate import interp2d
import matplotlib
import matplotlib.pyplot as plt
nfig = 1
imp... | abbarn/lmeca2300 | project/pylib/convergence.py | convergence.py | py | 2,416 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.arange",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number":... |
38688339389 | import torch
from utils.metrics import AURC
import numpy as np
from utils.measures import MSP
def centralize(y:torch.tensor):
return y-(y.mean(-1).view(-1,1))
def p_norm(y:torch.tensor,p, eps:float = 1e-12):
if p is None or p == 0: return torch.ones(y.size(0),1,device=y.device)
else: return y.norm(p=p,dim=... | lfpc/pNormSoftmax | pNormSoftmax.py | pNormSoftmax.py | py | 3,632 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "torch.tensor",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.ones",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_... |
2356478535 | from __future__ import print_function
import argparse
import cgi
import locale
import os
import re
import sys
from .. import cli
from .. import hocr
from .. import ipc
from .. import logger
from .. import temporary
from .. import text_zones
from .. import unicode_support
from .. import utils
from .. import version
f... | jwilk-archive/ocrodjvu | lib/cli/djvu2hocr.py | djvu2hocr.py | py | 11,591 | python | en | code | 41 | github-code | 36 | [
{
"api_name": "locale.getpreferredencoding",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.SUPPRESS",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "text_zones.sexpr",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "t... |
15441316510 | """
Entity class for iDiamant.
"""
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN, NAME, VERSION, MANUFACTURER
class IdiamantEntity(CoordinatorEntity):
"""
The main iDiamant entity class.
"""
def __init__(self, coordinator, config_entry):
su... | clementprevot/home-assistant-idiamant | custom_components/idiamant/entity.py | entity.py | py | 1,067 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "homeassistant.helpers.update_coordinator.CoordinatorEntity",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "const.DOMAIN",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "const.MANUFACTURER",
"line_number": 35,
"usage_type": "name"
},... |
22354363555 | import datetime
import traceback
import typing
import humanfriendly
import mergedeep
import pytz
import sqlalchemy.orm
import mlrun.common.schemas
import mlrun.config
import mlrun.errors
import mlrun.utils
import mlrun.utils.helpers
import mlrun.utils.regex
import mlrun.utils.singleton
import server.api.crud
import s... | mlrun/mlrun | server/api/utils/projects/follower.py | follower.py | py | 18,072 | python | en | code | 1,129 | github-code | 36 | [
{
"api_name": "server.api.utils.projects.member.Member",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "server.api.utils.projects.member",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "mlrun.common.schemas.utils",
"line_number": 31,
"usage_type... |
17895276920 | from typing import Dict, Mapping, Sequence, Text, Union
import seqio
import tensorflow as tf
AUTOTUNE = tf.data.experimental.AUTOTUNE
NALUE_INPUT_NAME = 'sentence'
NALUE_OUTPUT_NAMES = ('vertical', 'domain', 'intent')
T5Text = Union[tf.Tensor, Text]
def toxic_comments_preprocessor_binary_classification(
datas... | google/uncertainty-baselines | baselines/t5/data/preprocessors.py | preprocessors.py | py | 11,183 | python | en | code | 1,305 | github-code | 36 | [
{
"api_name": "tensorflow.data",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tensorflow.Tensor",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "typing.Text",... |
17256388628 | execfile('simple_map.py')
def viterbi(states, piarr, trans_p, emit_p, obs):
# Initialize T1, which keep track of everything done so far
# T1 - probability of most likely path so far
T1 = [{}]
T2 = [{}]
# length of sequence
T = len(obs)
# init T1 for each state
for s in range(0, len(states)):
st = s... | abarciauskas-bgse/stochastic | project/viterbi.py | viterbi.py | py | 1,593 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dump",
"line_number": 51,
"usage_type": "call"
}
] |
29788651993 | from os.path import join, isdir
from os import listdir, mkdir
from importlib import import_module
NOTCODE_DIR = 'notcode'
if not isdir(NOTCODE_DIR):
mkdir(NOTCODE_DIR)
# read profile:
profiles = [x.rstrip('.py') for x in listdir('profiles') if x.endswith('.py')]
profile = None
if not profiles:
raise Exception... | ofek-b/vomBuch-insAnki | constants.py | constants.py | py | 774 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.isdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_n... |
20693896588 | #!/usr/bin/python
# -- coding: utf8 --
"""
Django settings for Russian Learner Corpus project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
import jso... | elmiram/russian_learner_corpus | heritage_corpus/settings.py | settings.py | py | 4,402 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
2114104151 | import aiohttp
import uvicorn
from fastapi import FastAPI
from fastapi import Request
from starlette.responses import Response
app = FastAPI(title="Yhop Proxy",
version="0.0.1",
openapi_url="/openapi.json", )
@app.route("/", methods=['HEAD', 'OPTION', 'GET', 'POST'])
async def proxy(reque... | sdliang1013/caul-proxy | src/caul_proxy/server_uvicorn.py | server_uvicorn.py | py | 1,038 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "fastapi.Request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "starlette.respon... |
17895997999 | import argparse
import time
from modulos.AOJApp import AOJ
from modulos.Acciones import Acciones
from modulos.BarraMenu import irA
from modulos.Cartas import EmitirCarta, BlanquearCarta
from modulos.ConsultaRespuesta import CR
from modulos.Reporte import Reporte
newInstance = AOJ()
app = newInstance.retornarAOJApp()
... | gameztoy/AOJ | scripts/Cartas/CPMB09_37_EditarCarta.py | CPMB09_37_EditarCarta.py | py | 1,569 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "modulos.AOJApp.AOJ",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "modulos.Reporte.Reporte",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "mo... |
9955744674 | #!/usr/bin/env python3
from PIL import ImageEnhance
from PIL import Image
def get_average_color(img):
img = Image.open('/home/pi/Desktop/img5.jpg')
img = img.resize((50,50))
#print(img.size)
img = img.crop((15, 15, 35, 35))
converter = ImageEnhance.Color(img)
img = converter.enhance(2.5)
#... | aparajitaghimire/Clueless-Recreated | Python Scripts/color_detect.py | color_detect.py | py | 787 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "PIL.Image.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PIL.ImageEnhance.Color",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.ImageEnhance",
... |
43143608911 | from rest_framework import serializers
from apps.categories.serializers import CategorySerializer
from apps.media.models import Image
from apps.media.serializers import ImageSerializer
from apps.products.models import Product, Variant
from apps.reviews.serializers import ReviewSerializer
class ProductSerializer(seria... | mushfiq1998/bkpe-multivendor-ecommerce | apps/products/serializers.py | serializers.py | py | 2,117 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.SerializerMethodField",
"line_number": 10... |
2954449489 | import argparse
import logging
def main(pretrained_graph_path, dataset_path):
from model import FacialRecognition
from dataloader import load_inception_graph
load_inception_graph(pretrained_graph_path)
model = FacialRecognition(dataset_path, 'test_set.csv')
model.train()
if __name__ == ... | josepdecid/IU-AdvancedMachineLearning | Labs/Lab3/main.py | main.py | py | 886 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dataloader.load_inception_graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "model.FacialRecognition",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "model.train",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ar... |
30064471237 | from aljoadmin.models import Comment
from django import forms
class CommentForm(forms.ModelForm):
content = forms.CharField(
widget=forms.Textarea(attrs={'style':'width:100%; height:80px;'}),
label=''
)
class Meta:
model = Comment
fields = ('content',) | 97kim/aljo | aljoadmin/forms.py | forms.py | py | 264 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.f... |
1544319051 | import json
import pandas as pd
# import file
print("reading actors.tsv")
actors_df = pd.read_csv('actors.tsv', sep='\t')
# drop unused columns
print("processing data")
actors_df = actors_df.drop(columns=['nconst', 'birthYear', 'primaryProfession', 'knownForTitles'])
actors_df['primaryName'] = actors_df['primaryName'... | stephanieyaur/gg-project | actors_modifier.py | actors_modifier.py | py | 742 | python | en | code | null | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
}
] |
37639995341 | from block import Block
from hashlib import sha256
from collections import deque
class Blockchain():
# Set the parameters for the blockchain
def __init__(self, block_size, genesis_block_secret):
self.block_size = block_size
self.genesis_block_hash = sha256(genesis_block_secret.encode('u... | ketanv3/blockchain-evm | blockchain.py | blockchain.py | py | 2,050 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "hashlib.sha256",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "block.Block",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "block.Block",
"line_n... |
41928732216 | from __future__ import absolute_import
import xadmin
from .models import UserSettings, Log
from xadmin import views
from xadmin.layout import *
from django.utils.translation import ugettext_lazy as _, ugettext
class BaseSetting(object):
enable_themes = True
use_bootswatch = True
xadmin.site.register(views... | SweetShance/rewardSystem | rewardSystem/extra_apps/xadmin/adminx.py | adminx.py | py | 3,368 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "xadmin.site.register",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "xadmin.site",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "xadmin.views.BaseAdminView",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": ... |
42491423724 | import pytest
from demo_app import create_app
from demo_app import db as _db
from demo_app.blog.models import Author, Category, Entry
@pytest.fixture(scope='session')
def app():
app = create_app('testing')
app_context = app.app_context()
app_context.push()
yield app
app_context.pop()
@pytest.f... | AlexPG/flask-demo-app | tests/conftest.py | conftest.py | py | 1,640 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "demo_app.create_app",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "demo_app.db.create_a... |
72240231143 | from datetime import datetime
from typing import Any, Dict, List
import jsonlines
from tinydb import TinyDB, where
from higgins import const
class DateTimeSerializer():
OBJ_CLASS = datetime # The class this serializer handles
def encode(self, obj):
return obj.strftime('%Y-%m-%dT%H:%M:%S')
def... | bfortuner/higgins | higgins/database/tiny.py | tiny.py | py | 2,550 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "higgin... |
7748613059 | from tensorflow.keras.preprocessing import image as imageprep
import os
import numpy as np
from PIL import Image
import json
import requests
from io import BytesIO
def image_to_np_array(img_path, image_size):
img = imageprep.load_img(img_path, target_size=(image_size, image_size))
img = imageprep.img_to_array... | cloudera/CML_AMP_Image_Analysis | lib/utils.py | utils.py | py | 1,813 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "tensorflow.keras.preprocessing.image.load_img",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.preprocessing.image",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.preprocessing.image.img_to_array",
"line_... |
13860968318 | import pygame
import assets
clock = pygame.time.Clock()
win = pygame.display.set_mode((1365, 768))
#=================ROW 1====================
button1 = assets.Button(0, 0, 452, 253, (12, 12, 12), "", (255, 255, 255))
button2 = assets.Button(455, 0, 452, 253, (12, 12, 12), "", (255, 255, 255))
button3 = assets.Butto... | tanmay440/Game-Hub-Mega | Tic Tack Toe/main.pyw | main.pyw | pyw | 3,872 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.time.Clock",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.displa... |
21548587442 | import pytest
from mixer.backend.django import mixer
from apps.edemocracia.models import EdemocraciaGA
from apps.edemocracia.tasks import (get_ga_edemocracia_daily,
get_ga_edemocracia_monthly,
get_ga_edemocracia_yearly,)
from django.db import Integ... | labhackercd/cpp-participacao-backend | src/apps/edemocracia/tests/test_analytics_edemocracia.py | test_analytics_edemocracia.py | py | 3,150 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "mixer.backend.django.mixer.blend",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "apps.edemocracia.models.EdemocraciaGA",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "mixer.backend.django.mixer",
"line_number": 14,
"usage_type": ... |
35909639327 | import pygame
import pytest
from scoreboard import Scoreboard
from settings import Settings
from game_stats import GameStats
@pytest.fixture
def scoreboard():
""" 创建一个新的 Scoreboard 实例 """
pygame.init()
ai_settings = Settings()
screen = pygame.display.set_mode((ai_settings.screen_width, ai_settings.sc... | shixiaoxiya/py_course_zly_ | Projects/project_code/third2_left _test/test_scoreboard.py | test_scoreboard.py | py | 1,852 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "settings.Settings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.display"... |
310628557 | import logging
import collections
import html
import gw2buildutil
from . import util as gw2util
logger = logging.getLogger(__name__)
PAGE_ID = 'build'
PAGE_ID_PREFIX = 'builds/'
PAGE_TITLE_PREFIX = 'Guild Wars 2 build: '
def build (gw2site):
textbody_renderer = gw2buildutil.textbody.Renderer(
gw2buildu... | ikn/ikn.org.uk | lib/iknsite/gw2/build.py | build.py | py | 1,379 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "gw2buildutil.textbody.Renderer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "gw2buildutil.textbody",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_na... |
34398257612 | import qrcode
data = "Winson is the goat no cappa"
img = qrcode.make(data)
qr = qrcode.QRCode(version = 1, box_size = 10, border = 5)
qr.add_data(data)
qr.make(fit=True)
img = qr.make_image(fill_color = 'red', back_color = 'white')
img.save('C:/Users/wilko/Desktop/python12projects/qrcode/qrcode.png') | Riamuwilko/python_beginner_projects | qrcode/main.py | main.py | py | 303 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "qrcode.make",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "qrcode.QRCode",
"line_number": 6,
"usage_type": "call"
}
] |
937990517 | import logging
from django.core.exceptions import ValidationError
from django import forms
from django.utils.translation import gettext as _
from custody.models import MultiSigAddress
from coldstoragetransfers.helpers.btc import BTCHelper
class MultiSigAddressForm(forms.ModelForm):
class Meta:
model = Mu... | chriscslaughter/nodestack | custody/forms.py | forms.py | py | 1,960 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "custody.models.MultiSigAddress",
"line_number": 12,
"usage_type": "name"
},
{
"api_name"... |
35493639057 | from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views import View
from main.models import *
from main.forms import *
from cart.forms import CartAddProductForm
def base_context(request):
context = dict()
context['user... | SwAsKk/Online_Shop_Django | main/views.py | views.py | py | 1,497 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cart.forms.CartAddProductForm",
"line_number": 35,
"usage_type": "call"
},
... |
31826733278 | import argparse
import pprint
import sys
from designspaceProblems import DesignSpaceChecker
def main(args=None):
parser = argparse.ArgumentParser(
description='Check designspace data.')
parser.add_argument(
'input_ds',
metavar='PATH',
help='path to designspace file',
t... | LettError/DesignspaceProblems | Lib/designspaceProblems/__main__.py | __main__.py | py | 542 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "designspaceProblems.DesignSpaceChecker",
"line_number": 18,
"usage_type": "call"
},
{
"a... |
37936099877 | import apache_beam as beam
with beam.Pipeline() as pipeline:
batches_with_keys = (
pipeline
| 'Create produce' >> beam.Create([
('spring', '🍓'),
('spring', '🥕'),
('spring', '🍆'),
('spring', '🍅'),
('summer', '🥕'),
('summer', '🍅'),
... | ezeparziale/apache-beam-start | examples/groupby_batches.py | groupby_batches.py | py | 529 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "apache_beam.Pipeline",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "apache_beam.Create",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "apache_beam.GroupIntoBatches",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ap... |
19450895845 | # -*- coding: utf-8 -*-
import os
import sys
import datetime
import struct
import wave
def argumentsparser():
usage = "Usage: python {} inputfile.kamata_programs".format(__file__)
arguments = sys.argv
if len(arguments) == 1 or len(arguments) > 2:
return usage
arguments.pop(0)
if not argumen... | amariichi/kamata2wav | kamata2wav.py | kamata2wav.py | py | 2,462 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.getsize",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_numbe... |
10353313162 | import streamlit as st
import pickle
model_random = pickle.load(open("model/forest.pkl", "rb"))
from utils import head, body
hasil = head()
if st.button("Submit"):
name, MDVP_FO,MDVP_FHI, MDVP_FloHz,MDVP_JitterPercent,MDVP_JitterAbs, MDVP_RAP, MDVP_PPQ,Jitter_DDP,MDVP_Shimmer,MDVP_ShimmerDb,Shimmer_APQ3, Shimmer... | FathanKhansaArby/FinalProject083 | app/main.py | main.py | py | 833 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pickle.load",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "utils.head",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.button",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.body",
"line_number": ... |
30898137207 | """
Graph implementation
class GraphMatrix - adjacency matrix
"""
from collections import deque
class GraphMatrix:
"""
Graph implementation using an adjacency matrix
[
[ ]
[ ]
[ ]
]
"""
def __init__(self, size: int):
""" Inits Graph class with optional graph_matrix "... | g-areth/algos | src/algorithms/datastructures/graphs/graph_adj_matrix.py | graph_adj_matrix.py | py | 3,053 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 57,
"usage_type": "call"
}
] |
5913567690 | import torch
from torch import optim, nn
import os
from tqdm.auto import tqdm
from model import *
from data import *
from torch.cuda.amp import autocast, GradScaler
from validate_and_test import *
def load_checkpointed_model_params(model, optimizer, resume_checkpoint):
checkpoint = torch.load(resume_checkpoint)
... | ParasharaRamesh/NUS-CS5242-Neural-Networks-and-Deep-Learning | Assignment 2 (Autoencoders & CNNs)/Question-5_CIFAR10/train.py | train.py | py | 8,557 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "model.load_state_dict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "model.train",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
29498462869 | from main import validate_amount_payment, define_amount_hour, get_amount_hour, read_data_file
from constant.days_info import list_days
import pytest
def test_validate_valid_line():
assert validate_amount_payment(
"THOMAS=MO08:00-12:00,TU10:00-13:00,TH01:00-04:00,SA14:00-18:00,SU20:00-23:00",
defin... | jefvasquezg/acme | test/test_main.py | test_main.py | py | 2,193 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "main.validate_amount_payment",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "main.define_amount_hour",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "constant.days_info.list_days",
"line_number": 9,
"usage_type": "argument"
},
{
... |
932629353 | import datetime
from neutron.common import rpc as proxy
from neutron.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class HeloAgentNotifyAPI(proxy.RpcProxy):
"""API for plugin to ping agent."""
BASE_RPC_API_VERSION = '1.0'
def __init__(self, topic=None, version=None):
... | CingHu/neutron-ustack | neutron/api/rpc/agentnotifiers/helo_rpc_agent_api.py | helo_rpc_agent_api.py | py | 1,219 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "neutron.openstack.common.log.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "neutron.openstack.common.log",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "neutron.common.rpc.RpcProxy",
"line_number": 10,
"usage_type": "attribu... |
451073459 | #!/usr/bin/python3
from .config_utils import get_base_config
from .log_utils import get_module_logger
import DNS
import os
import sys
import time
import validators
CDIR = os.path.dirname(os.path.realpath(__file__))
ROOTDIR = os.path.abspath(os.path.join(CDIR, os.pardir))
BASECONFIG = get_base_config(ROOTDIR)
LOGGI... | phage-nz/ph0neutria | core/dns_utils.py | dns_utils.py | py | 1,379 | python | en | code | 299 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"... |
40164893998 | from django.shortcuts import render
# Create your views here.
from django.views.decorators.csrf import csrf_exempt
from rest_framework.parsers import JSONParser
from django.http.response import JsonResponse
from djangoapi.models import Department,Employee
from djangoapi.serializers import DepartmentSerializer,Employe... | 00karina/FullStackApp | djangoapi/views.py | views.py | py | 1,633 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "djangoapi.models.Department.objects.all",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "djangoapi.models.Department.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "djangoapi.models.Department",
"line_number": 14,
"usage_... |
15478699282 | import os
import copy
import sys
import glog
import tifffile
try: from .tools import uity
except: from tools import uity
import numpy as np
from absl import flags, app
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import controller.processing
class TissueCut(object):
def __init__(self, gpu="-1", num... | BGIResearch/StereoCell | stereocell/segmentation/tissue.py | tissue.py | py | 2,701 | python | en | code | 18 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
3703533790 | from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from myapp.forms import MyModelForm
from myapp.models import MyModel
def form_request(request, url, template):
if request.method == 'POST':
form = MyModelForm(request.POST)
if form.is_valid():
... | msampaio/estudo_django | myapp/views.py | views.py | py | 1,153 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "myapp.forms.MyModelForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "myapp.models.MyModel.objects.create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "myapp.models.MyModel.objects",
"line_number": 12,
"usage_type": "attribute"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.