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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71621333475 | from ast import Try
from dataclasses import replace
from os import rename
import sys
import time
from unicodedata import decimal
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from seleniu... | luanlara/CasosDeTeste4Sem | Caso3/codigoTestado3.py | codigoTestado3.py | py | 5,806 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.expected_conditions.presence_of_element_located",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support... |
43502378799 | # -*- coding: utf-8 -*-
__author__ = 'apsmi'
import asynchat, socket, struct, pickle
IN_BUF_SIZE = 128 * (2**10) # размер входящего буфера сокета
OUT_BUF_SIZE = 128 * (2**10) # размер исходящего буфера сокета
LEN_TERM = 4
# сокет, принимающий соединение от клиентов
class Client(asynchat.async_chat):
def __in... | apsmi/PyTanks | client_player.py | client_player.py | py | 2,210 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "asynchat.async_chat",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "asynchat.async_chat.__init__",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "asynchat.async_chat",
"line_number": 15,
"usage_type": "attribute"
},
{
"ap... |
8431592570 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Модуль класса управления ресурсом проекта.
Описание ресурсного файла проекта информационной системы:
<имя файла> := *.pro
<описание проекта информационной системы> =
[
{<описание проекта текущей информационной системы>},
{<описание проекта импортируемой информаци... | XHermitOne/defis3 | ic/prj/PrjRes.py | PrjRes.py | py | 39,301 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "wx.GetTranslation",
"line_number": 90,
"usage_type": "attribute"
},
{
"api_name": "ic.interfaces.resManager.icResourceManagerInterface",
"line_number": 99,
"usage_type": "attribute"
},
{
"api_name": "ic.interfaces.resManager",
"line_number": 99,
"usage_type... |
41094600245 | # savers
from sqlalchemy import exc
from src import db_manager
def save_page_to_db(page):
try:
db_manager.session.add(page)
db_manager.session.commit()
except exc.SQLAlchemyError as e:
db_manager.handel_exception(e, True, 'save_page', page.url)
return True
def save_site_to_db(si... | lavrinec/GOV-Crawler | crawler/src/savers.py | savers.py | py | 1,893 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "src.db_manager.session.add",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.db_manager.session",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "src.db_manager",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sr... |
36224024372 | from pathlib import Path
import shelve
class PID():
P = Path('C:\\','Users','leouh', 'Documents', 'Rb_Controller')
def __init__(self):
with shelve.open('config') as config:
self.cfg = dict(config)
self.Ts = 1/self.cfg['freq']
if self.cfg['ki']:
self.taui = self.c... | leouhre/Rb_Controller | classes/pid.py | pid.py | py | 2,831 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "shelve.open",
"line_number": 7,
"usage_type": "call"
}
] |
75162791714 | # -*- coding: utf-8 -*-
# Automatic provisioning of wireguard keypair resources.
import nixops.util
import nixops.resources
import logging
from typing import Mapping, Optional, Sequence
logger = logging.getLogger(__name__)
class WgKeypairOptions(nixops.resources.ResourceOptions):
"""Definition of wireguard key... | input-output-hk/nixops-wg-links | nixops_wg_links/resources/wg_keypair.py | wg_keypair.py | py | 5,381 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nixops.util.resources",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "nixops.util",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Seque... |
70173697953 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse, codecs, sys
# Parseur de ligne de commande
parser = argparse.ArgumentParser(description="Sorts or inverts lines or characters from a file.")
parser.add_argument('-f', help="input file")
# seul -l ou -c est permis
lorc = parser.add_mutuall... | ndaoust/Z | scramble.py | scramble.py | py | 1,693 | python | fr | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_numb... |
4516929724 | # Проанализировать зарплаты КМДА csv файлы за 2019 год найти средние минимальные максимальные построить график
import matplotlib.pyplot as plt
def get_data(filename):
with open(filename, 'r', encoding='utf8') as file:
data = {}
file.readline()
for row in file:
row_array = row... | su1gen/python-homework | lesson05HW/kmda/__main__.py | __main__.py | py | 1,344 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matp... |
30375203012 | from fractions import Fraction
from wick.index import Idx
from wick.operator import FOperator, Tensor
from wick.expression import Term, Expression, AExpression
from wick.wick import apply_wick
from wick.convenience import E1, E2, commute
i = Idx(0, "occ")
a = Idx(0, "vir")
j = Idx(1, "occ")
b = Idx(1, "vir")
T1 = E1(... | awhite862/wick | examples/ccsd_1rdm.py | ccsd_1rdm.py | py | 1,831 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "wick.index.Idx",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wick.index.Idx",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "wick.index.Idx",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "wick.index.Idx",
"line... |
39998982074 | import unittest
import shutil
import tempfile
import os
import logging
logging.getLogger().setLevel(logging.ERROR)
import heppy.framework.context as context
if context.name != 'bare':
from simple_example_noindexing_cfg import config
from heppy.utils.debug_tree import create_tree, remove_tree
from heppy.fr... | cbernet/heppy | heppy/test/test_noindexing.py | test_noindexing.py | py | 2,161 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "heppy.framework.context.name",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "h... |
28840367023 | # this class is meant to create a menu floater that moves across the screen vertically and in random positions
#importing librairies
import copy
import random
import pygame
import TestTubeGame
class Menu_Floater:
def __init__(self,img, direction):
self.image = img
self.current_image = copy.cop... | MiracleSheep/Python_Pygame_TestTubeGame | menu_floater.py | menu_floater.py | py | 1,851 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "copy.copy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "TestTubeGame.WIDTH",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
... |
30209496323 | # LMGP Visualization
#
#
#
import numpy as np
import matplotlib.pyplot as plt
import torch
def plot_ls(model, constraints_flag = True):
#
# plot latent values
zeta = torch.tensor(model.zeta, dtype = torch.float64)
#A = model.nn_model.weight.detach()
perm = model.perm
levels = model.num_leve... | yiping514/LMGP | lmgp_pytorch/visual/plot_latenth_position.py | plot_latenth_position.py | py | 2,515 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.tensor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.float64",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.atan",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_n... |
4566035845 | from datetime import datetime, timedelta
import pandas as pd
from framework.configuration.configuration import Configuration
from framework.logger.providers import get_logger
from clients.azure_gateway_client import AzureGatewayClient
from clients.email_gateway_client import EmailGatewayClient
from domain.usage impor... | danleonard-nj/kube-tools-api | services/kube-tools/services/usage_service.py | usage_service.py | py | 3,969 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "framework.logger.providers.get_logger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "framework.configuration.configuration.Configuration",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "clients.email_gateway_client.EmailGatewayClient",
"... |
21448529472 | import datetime as dt
from dateutil import parser
import os
import pandas as pd
import numpy as np
from scipy import interpolate
from matplotlib import mlab
from selenium import webdriver
import bs4
from timeout import timeout
class DECStation:
def __init__(self, number, name, lon, lat):
self.number = ... | patrick-miller/forecastaer | main.py | main.py | py | 11,649 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.nan",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line... |
30874114710 | import requests
ship = "10/"
resp = requests.get("https://swapi.co/api/starships/"+ship)
print(resp.status_code)
data = resp.json()
print(str(data['name']))
print("Peliculas:")
for var in data['films']:
url = str(var)
pelis = requests.get(url)
pelis = pelis.json()
print(str(pelis['title'... | Pxncxke/millenium | api.py | api.py | py | 323 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
}
] |
32200653326 | #! /usr/bin/env python
import sys
import argparse
import csv
def main():
parser = argparse.ArgumentParser()
parser.add_argument('input', metavar='INPUT', type=argparse.FileType('rb'), help="csv file")
parser.add_argument('output', metavar='OUTPUT', type=argparse.FileType('wb'), help="yml file")
args... | pk-hack/CoilSnake | coilsnake/tools/csv2yml.py | csv2yml.py | py | 818 | python | en | code | 153 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "csv.reader... |
30807069231 | #!/usr/bin/env python
#
# A class to control mu-del converters
#
# Incomplete
# 7DEC11 - Kyle Eberhart
import telnetlib
import logging
from multiprocessing import Process
from multiprocessing import Queue as Q
import queue
import time
class ConvProcess(object):
'''
A converter controller that runs in ... | keberhart/mu_del_converters | MuDelconverter.py | MuDelconverter.py | py | 13,500 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "multiprocessing.Queue",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Queue",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "t... |
20491607874 | import torch
from torch import nn
import torch.nn.functional as F
class FastText(nn.Module):
def __init__(self, num_tags, vocab_size, embed_size, input_dropout_rate,
embed_type='rand', use_bigram=False, bigram_vocab_size=0, bigram_embed_size=0):
super(FastText, self).__init__()
se... | zerozzl/nlp_text_cla | fasttext/model.py | model.py | py | 2,103 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
16199796086 | import os
import time
import datetime
import subprocess
import yaml
import json
from cravat import admin_util as au
from cravat import ConfigLoader
import sys
import traceback
import shutil
from aiohttp import web
#from cryptography import fernet
#from aiohttp_session import get_session, new_session
impor... | pevs/open-cravat | cravat/websubmit/websubmit.py | websubmit.py | py | 26,894 | python | en | code | null | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cravat.admin_util.get_jobs_dir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "cravat.ad... |
935555272 | import functools
import logging
import time
def validate_command(command):
def actual_decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
if len(args) < 2:
logging.debug(f"{func.__name__} Error: not enough arguments")
return
... | CS4224-Claps/project | cockroachdb/utils/decorators.py | decorators.py | py | 1,236 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.debug",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_... |
24758047234 | import boto3
import logging
import os
import json
dynamodb_client = boto3.client('dynamodb', region_name="us-east-1")
sns_client = boto3.client('sns', region_name="us-east-1")
CUSTOMERS_TABLE_NAME = os.getenv('CUSTOMERS_TABLE', "functions_table")
SNS_TOPIC_ARN_FUNCTION_MODIFIED = "function_modified"
with_sns_msg = T... | dome9/protego-examples | proact/inputs/python_new_file_handler/python_new_file_handler.py | python_new_file_handler.py | py | 1,058 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 19,
... |
17890730091 | import sys
import os
from rich.pretty import pprint
from urllib.parse import quote_plus
from rich.table import Table
from rich.console import Console
from rich.prompt import IntPrompt, Prompt, Confirm
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../..")
from lib.submissions import get_submissions,... | willthbill/cfscripts | src/scripts/UnsolvedContestProblems/main.py | main.py | py | 4,947 | python | en | code | 2 | github-code | 1 | [
{
"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... |
5393022370 | import PySimpleGUI as sg
from Utility import PathDefs
NAME_SIZE = 20
def name(name):
dots = NAME_SIZE - len(name) - 2
return sg.Text(name + ' ' + '•' * dots, size=(NAME_SIZE, 1), justification='r', pad=(0, 0), font='Courier 10')
def create_rows(max_cost, max_mass, max_disp, max_time, cost_coef, mass_coef, ... | anikimmel/LMCOgui | Utility/row_utilities.py | row_utilities.py | py | 5,099 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PySimpleGUI.Text",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.ProgressBar",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.ProgressBar",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PySim... |
39117095073 | """
CS235 Homework 3
Aleksander Skjoelsvik
"""
from math import floor
from fractions import gcd
#Task 1:
"""
a:
4x = 2 (mod 11)
4x = 24 (mod 11)
x = 6 + 11Z
b:
x = 3 (mod 7)
x = 1 (mod 5)
x = 31 + 35Z
c:
x = 2 (mod p)
x = 4... | alekplay/schoolwork | CS235/hw3.py | hw3.py | py | 1,964 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fractions.gcd",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "fractions.gcd",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "fractions.gcd",
"line_number": 76,
"usage_type": "call"
}
] |
74069745633 | ### FUNCTIONS
import skimage
import numpy as np
from math import sqrt
from skimage.feature import blob_dog, blob_log
from PIL import Image
import torch
from torchvision import transforms
import matplotlib.pyplot as plt
import matplotlib
import cv2
import os
### 1 GET DISTANCE
def crop_x(image, x1=100,x2=250, y1=38... | AlmudenaBravoC/CAD-ultrasound-renal-diagnosis | TestImage/allProcess.py | allProcess.py | py | 6,977 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "skimage.color.rgb2gray",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "skimage.color",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "skimage.feature.blob_log",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "ma... |
30558238775 | import psycopg2
import json
from kafka import KafkaConsumer
class Consumer:
kafka_server = None
consumer = None
kafka_topic = None
db_config = None
db_conn = None
def __init__(self):
config = self.load_config()
self.kafka_server = config['credentials']['kafka']['uri']
s... | vladimir-kirillovskiy/website-monitoring | consumer.py | consumer.py | py | 2,947 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "kafka.KafkaConsumer",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line... |
42448765073 | import argparse
import glob
import json
import os
import sys
MIN_PYTHON = (3, 0)
if sys.version_info < MIN_PYTHON:
sys.exit("Python {}.{} or later is required.\n".format(*MIN_PYTHON))
parser = argparse.ArgumentParser()
parser.add_argument("input", help="input directory with files to annotate")
parser.add_argument... | iscoe/dragonfly | scripts/pack.py | pack.py | py | 1,916 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "sys.version_info",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
... |
9249662097 | import gym
# Set learning parameters
LEARNING_RATE = .8
DISCOUNT_FACTOR = .95
NUM_EPISODES = 2000
def state_to_scalar(state):
state_scalar = state.reshape(state.shape[0] * state.shape[1] * state.shape[2], 1)
return state_scalar
env = gym.make('SpaceInvaders-v0')
env.reset()
print('env.observation_space.n... | raphaelgodro/open-ai-trains | space_invaders.py | space_invaders.py | py | 1,080 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gym.make",
"line_number": 16,
"usage_type": "call"
}
] |
23163444909 | import pyaudio
import math
import struct
# Wut is diz??
Threshold = 10
SHORT_NORMALIZE = (1.0/32768.0)
swidth = 2
chunk = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
f_name_directory = r'audiofiles'
class Listener:
@staticmethod
def rms(frame):
count = len(frame) / swidth
format... | astuvan/av_generator | sound/react_to_sound/react_threshold.py | react_threshold.py | py | 1,392 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "struct.unpack",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pyaudio.PyAudio",
"li... |
35947581054 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
"""
This script is for plotting G1/G2/G4 data of calculated Symm-Func for
train and predict of Lammps-MD 1000K LC7
"""
def plotG(symdt, plttitle, plotfile, xlb, clr):
fig = plt.figure()
ax = fig.add_subplot(111)
plt.title(plttitle... | s-okugawa/HDNNP-tools | tools/Lmps-MD/plotSymF-TP2.py | plotSymF-TP2.py | py | 3,233 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ma... |
35162208747 | import sys
import atexit
import subprocess
import typing
class AutoPager:
def __init__(self, no_pager: bool = False, always: bool = False):
self.original_stdout = sys.stdout
self.always = always
self.no_pager = no_pager
if self.original_stdout.isatty():
self.process: t... | informationsea/cromwell-helpers | cromwellhelper/pager.py | pager.py | py | 751 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdout",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "subprocess.... |
72503316195 | import cv2
import numpy as np
from keras.models import load_model
model = load_model('CNNmodel.h5')
def prediction(pred):
return chr(pred + 65)
def keras_predict(model1, image):
data = np.asarray(image, dtype="int32")
pred_probab = model1.predict(data)[0]
pred_class = list(pred_probab).index(max(pr... | CharizmaticWizard/Sign-Language-Detection | capture.py | capture.py | py | 1,644 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "keras.models.load_model",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
... |
70205308194 | from dp import *
import pickle
from collections import defaultdict
from most_probable_sequence import most_probable_sequence
from utils import get_data
from rich import print
def load_weights(run_name, weights_root):
if run_name != None:
w = np.load(f"outputs/{run_name}/w.npy")
b = np.load(f"outpu... | yermandy/most-probable-sequence | inference.py | inference.py | py | 7,238 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "rich.print",
"line_... |
33286894157 | import sys
sys.path.insert(0, "../SymJAX")
from scipy.stats import kde, multivariate_normal
import cdd
import numpy as np
import itertools
from scipy.spatial import ConvexHull, Delaunay
from scipy.special import softmax
from numpy.linalg import lstsq
from tqdm import tqdm
import symjax as sj
import symjax.tensor as T
f... | RandallBalestriero/EMDGN | utils_old.py | utils_old.py | py | 15,737 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "numpy.concatenate",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",
"lin... |
40829037969 | from base64 import b64encode
from django import template
CSS_CLASS = 'dj-special-block'
KEY_PREFIX = 'dj-special-{}'
block_count = 0
register = template.Library()
class ShideNode(template.Node):
template = "<div class=\"%s\" id=\"{key_name}\"></div>"\
"<script>localStorage.setItem('{key_name}', ... | xfenix/django-search-hide | searchhide/templatetags/searchhide.py | searchhide.py | py | 1,199 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.template.Library",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.template.Node",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "djang... |
38975372598 | import shell_content
import os
import time
import signal
import subprocess
import numpy as np
import pydoop.hdfs as hdfs
import json
spark_conf_names = ['spark.default.parallelism', 'spark.driver.cores', 'spark.driver.memory',
'spark.driver.maxResultSize',
'spark.executor.instan... | TsinghuaDatabaseGroup/AI4DBCode | Spark-Tuning/prediction_nn/run_action.py | run_action.py | py | 8,108 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "shell_content.front",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "shell_content.rear",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "sub... |
15859503196 | from crypt import methods
from flask import Flask , render_template, request, make_response
from werkzeug.wrappers import Response
import os
from .healpers.CsvHealper import allowed_file, parse_user_file, generate_file
def create_app():
app = Flask(__name__)
app.secret_key = os.environ["Secret"]
return a... | Maminebouzid/flask_upload_csv | app/__init__.py | __init__.py | py | 2,028 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request.method... |
72133950755 | #!/usr/bin/python3
# 9-model_state_filter_a.py
"""Script that lists all State that contains the letter a
from the database hbtn_0e_6_usa
"""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from model_state import Base, State
from sys import argv
def firstState():
"""Prints first state... | jonseb974/holbertonschool-higher_level_programming | python-object_relational_mapping/9-model_state_filter_a.py | 9-model_state_filter_a.py | py | 804 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_numbe... |
17407487909 | import gtk
import thermo
class SteamSolver:
def __init__(self):
'''Initial window which has a combo box from which the user can choose either of temperature and pressure'''
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_size_request(500 , 500)
self.win... | MechCoder/Steam-Solver | Steamsolver.py | Steamsolver.py | py | 9,908 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gtk.Window",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "gtk.WINDOW_TOPLEVEL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "gtk.main_quit",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "gtk.STATE_NORM... |
19926976795 | import keras
from keras.datasets import mnist
from keras.models import load_model
def Getdata():
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train.reshape(x_train.shape[0], 28, 28, 1)
x_test = x_test.reshape(x_test.shape[0], 28, 28, 1)
x_train = x_train / 255
x_test = x_te... | Sun2018421/keras-Lenet-5 | getDataforEmbedded.py | getDataforEmbedded.py | py | 635 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "keras.utils.to_categorical",
"line_number": 13,
"usage_type": "call"
},
{
"api_... |
18900639652 | from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext
from .forms import Mp3DetailsForm
from gtts import gTTS
import os
import time
def index(request):
if request.method == 'POST':
context = RequestContext(request)
aform = Mp3Details... | me12722/text-to-speech | Text_to_Speech/tts/views.py | views.py | py | 1,449 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.template.RequestContext",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "forms.Mp3DetailsForm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os... |
6517886216 | #Tool check active subdomain from amass result
from concurrent.futures import ThreadPoolExecutor
import requests
from requests.exceptions import ConnectionError
import argparse
parser = argparse.ArgumentParser(description='Example argument parser')
parser.add_argument('--input_file','-i', help='path to input file')
p... | quangdaik2362001/simple_tool | is_live.py | is_live.py | py | 1,171 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.ConnectionError",
"line_number": 25,
"usage_type": "name"
},
{
"api_name"... |
72617146914 | #!/usr/bin/env python3
import re
import csv
import collections
def get_error_message_type(log):
if re.search(r"ERROR", log):
return "ERROR"
if re.search(r"INFO", log):
return "INFO"
def find_errors():
error_dict = {}
with open("syslog.log", "r") as logfile:
for ... | annie21409/google-python-professional | final_project/tickylog.py | tickylog.py | py | 2,178 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.search",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 19,
"u... |
26593044181 | """Backend functions for exporting data."""
import os
import boto3
import fsspec
import shutil
import logging
import warnings
import datetime
import xarray as xr
import pandas as pd
from importlib.metadata import version as _version
from botocore.exceptions import ClientError
from climakitae.util.utils import read_csv... | cal-adapt/climakitae | climakitae/core/data_export.py | data_export.py | py | 26,702 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "xarray.set_options",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "xarray.core",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "xarray.core",
"line_number": 103,
"usage_type": "attribute"
},
{
"api_name": "xarray.core",
... |
37210347927 | # Import os to set API key
import os
# Import OpenAI as main LLM service
from langchain.llms import OpenAI
from langchain.embeddings import OpenAIEmbeddings
# Bring in streamlit for UI/app interface
import streamlit as st
# Read the markdown content from a file
with open("styles.md", "r") as f:
markdown_content = ... | NikolaienkoIgor/RAGreport | app.py | app.py | py | 1,942 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.markdown",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "langchain.llms.OpenAI",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "langchain.em... |
4062645307 | # Powerful digit counts
# Problem 63
# The 5-digit number, 16807=7**5, is also a fifth power. Similarly, the 9-digit number, 134217728=8**9, is a ninth power.
# How many n-digit positive integers exist which are also an nth power?
# https://projecteuler.net/problem=63
import datetime
start_time = datetime.datetime.n... | IgorKon/ProjectEuler | 063.py | 063.py | py | 785 | 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.datetime.now",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "da... |
2284786552 | import os
from kivy.app import App
from kivy.core.window import Window
from kivy.metrics import dp
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from kivy.uix.image import Image
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.scrollview import ScrollView
class S... | petchorine/double_view | swipebtn_refresh_gallery.py | swipebtn_refresh_gallery.py | py | 2,874 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "kivy.uix.image.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "kivy.metrics.dp",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "kivy.uix.screenmanager.Screen",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "ki... |
16391999279 | from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QPushButton
from pizza.controller.ControllorePizza import ControllorePizza
class VistaEliminaPizza(QWidget):
def __init__(self, pizza, elimina_pizza, elimina_callback, parent=None):
super(VistaEliminaPizza, self).__init__(parent)
self.cont... | CappeXII/ing_software | pizza/view/VistaEliminaPizza.py | VistaEliminaPizza.py | py | 1,018 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pizza.controller.ControllorePizza.ControllorePizza",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pizza.controller.ControllorePizza",
"line_number": 9,
"usage_typ... |
38597169357 | #!/usr/bin/python3
import datetime, glob, os, subprocess, unittest
from slippi import Game, parse
from slippi.id import CSSCharacter, InGameCharacter, Item, Stage
from slippi.log import log
from slippi.metadata import Metadata
from slippi.event import Buttons, Direction, End, Frame, Position, Start, Triggers, Velocit... | hohav/py-slippi | test/replays.py | replays.py | py | 11,337 | python | en | code | 54 | github-code | 1 | [
{
"api_name": "slippi.event.Buttons.Physical",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "slippi.event.Buttons",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "slippi.event.Buttons.Logical",
"line_number": 14,
"usage_type": "attribute"
},
... |
5875820973 | import gc
import numpy as np
import pandas as pd
import tensorflow as tf
import os
import cv2
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.style.use("seaborn-v0_8")
from tqdm import tqdm
# pathlib to my loccal file
files = os.listdir("/home/michael/Desktop/archive/dataset/")
files
# initialisation of... | Bpdum/face_recogntion_tfModel_android_pycharm | main.py | main.py | py | 3,914 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.style.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.listdir",
... |
73501419235 | import logging
import boto3
class SESService():
def __init__(self):
self.client = boto3.client(
'ses',
aws_access_key_id="INPUT YOUR ACESS KEY FROM AWS",
aws_secret_access_key="INPUT YOUR SECRET ACESS KEY FROM AWS",
region_name="INPUT YOUR REGION",
)
... | vmakksimov/IM_System | services/ses.py | ses.py | py | 1,630 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 51,
"usage_type": "call"
}
] |
29835250163 | import cv2
from cv2 import VideoWriter_fourcc
import os
import numpy as np
from tqdm import tqdm
import skvideo.io
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='create videos based on images')
parser.add_argument('--img_path', '-in',
... | jjw-DL/Code_Analysis | detr4d/internal_code/create_video.py | create_video.py | py | 1,693 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
... |
74138069153 | import logging
from enum import Enum
from typing import Optional
import pandas as pd
from pandas import DataFrame
import config
from asseeibot import runtime_variables
from asseeibot.models.cache import Cache
from asseeibot.models.fuzzy_match import FuzzyMatch, MatchBasedOn
from asseeibot.models.ontology_dataframe im... | dpriskorn/asseeibot | asseeibot/models/match_cache.py | match_cache.py | py | 8,581 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "asseeibot.models.cache.Cache",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "pandas.DataF... |
73934613795 | import numpy as np
import cv2
import nibabel as nib
import os
import yaml
from pytorch_fid import fid_score
#from pytorch_lightning import metrics
import argparse
parser = argparse.ArgumentParser(description='Metrics Script')
parser.add_argument('--bodymask_path', type=str)
parser.add_argument('--real_slices_path',... | deltahue/DL-Project-2020 | contrastive-unpaired-translation-master/evaluate_metrics.py | evaluate_metrics.py | py | 6,275 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line... |
23167904841 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import namedtuple
import tensorflow as tf
import tensorflow.contrib.slim as slim
class Block(namedtuple('Block', ['scope', 'unit_fn', 'args'])):
"""A named tuple describing a ResNet bloc... | luckycallor/InsightFace-tensorflow | backbones/utils.py | utils.py | py | 4,551 | python | en | code | 246 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.contrib.slim.max_pool2d",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.contrib.slim",
"line_number": 25,
"usage_type": "name"
},
{
... |
21923155762 | #!/usr/bin/python
import json
import os
import sys
config = sys.argv[-1]
# load json content from config file
def load_json():
with open(config) as components:
return json.load(components)
json = load_json()
# helper function for creating folders
def create_folder(folder_name,prev = None):
if prev ... | faddalibrahim/scripts-and-utils | Python/react_component_generator/create.py | create.py | py | 1,563 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
... |
704734527 | __docformat__ = 'restructuredtext'
import sys
from zope import component
from zope.interface import implements
from zope.component.interfaces import ComponentLookupError
from zope.traversing.interfaces import IPathAdapter, ITraversable
from zope.traversing.interfaces import TraversalError
from zope.traversing.adapter... | displacedaussie/gae-zpt | zope/pagetemplate/engine.py | engine.py | py | 14,488 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "zope.traversing.adapters.traversePathElement",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "zope.security.proxy.ProxyFactory",
"line_number": 53,
"usage_type": "argument"
},
{
"api_name": "zope.tales.expressions.PathExpr",
"line_number": 55,
"u... |
41307675140 | '''
https://leetcode.com/problems/minimum-height-trees/description/
'''
from collections import defaultdict, deque
# there can only be at most two roots in MHT, which are the mid points of the longest path
# find leaves, remove leaves from neighbours
# keep doing as long as num of nodes is > 2
# ones remaining are t... | huiwenhw/interview-prep | leetcode_Python/graph_MinHeightTrees.py | graph_MinHeightTrees.py | py | 2,527 | python | en | code | 22 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 64,
"usage_type": "call"
},
{
"api_name"... |
16748849391 | from __future__ import annotations
import os
import typing as t
import logging
import pathlib
from typing import TYPE_CHECKING
import yaml
import pytest
import bentoml
from bentoml._internal.utils import bentoml_cattr
from bentoml._internal.models import ModelStore
from bentoml._internal.models import ModelContext
f... | almirb/BentoML | tests/conftest.py | conftest.py | py | 6,054 | python | en | code | null | github-code | 1 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "bentoml._internal.models.ModelContext",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "_pytest.python.Metafunc",
"line_number": 26,
"usage_type": "name"
},
{
... |
71634532833 | import json
import argparse
import shutil
import nbt
import os
def main():
parser = argparse.ArgumentParser(description='修改玩家座標')
parser.add_argument("username", help="Player name", type=str)
parser.add_argument("dim", help="Target dim", type=int)
parser.add_argument("x", help="Target x", type=float)... | danny50610/MCServerTool | ChangePlayerPos.py | ChangePlayerPos.py | py | 1,179 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
15746108853 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 24 11:26:01 2019
@author: soura
"""
import hashtag
import query
import username
import json
import decider
import pandas as pd
class Transfer:
def __init__(self):
self.file_mapping = {"query":"query_results.json", "username":"username_results.... | SaurabhRuikar/TwitterMining | control_transfer.py | control_transfer.py | py | 1,045 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "decider.Decider",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "query.fetch_queries",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "username.get_tweets",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "hashtag.get_t... |
72663761634 | import pandas as pd
import rpy2.robjects.packages as rpackages
from rpy2.robjects.vectors import StrVector
import xlsxwriter
def add_feature_metadata(df_target, df_feature_metadata, df_target_fn_col=None):
"""Adds feature metadata columns to df_target.
Args:
df_target - a DataFrame; must contain featu... | KnowEnG/platform | nest_py/lib_src/fst_pipeline/fst_utils.py | fst_utils.py | py | 4,881 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pandas.Series",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "xlsxwriter.Workbook",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "rpy2.robjects.packages.importr",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "rpy... |
26292649193 | """Management of per-player info."""
from functools import partial
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIntValidator, QPalette, QColor
from PyQt5.QtWidgets import (
QFormLayout,
QGroupBox,
QGridLayout,
QHBoxLayout,
QLabel,
QLineEdit,
QPushButton,
QWidget,
)
from table.s... | martinblake/pope-joan | table/player.py | player.py | py | 4,657 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QGroupBox",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.Qt.AlignCenter",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore.Qt",
"line_number": 27,
"usage_type": "name"
},
{
"api_na... |
13025816665 | import glob
import cv2
import pandas as pd
import openpyxl
from openpyxl.utils.dataframe import dataframe_to_rows
from skimage.metrics import structural_similarity as ssim
import os
import sys
def SearchExtFiles(fpath, ext, lst):
try:
flist = os.listdir(fpath)
except:
return
f... | siszero/TIL | Python/main.py | main.py | py | 3,313 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_num... |
14109182065 | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | jose-dom/bitcoin_forecasting | env/lib/python3.9/site-packages/holidays/countries/honduras.py | honduras.py | py | 5,085 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "holidays.holiday_base.HolidayBase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "holidays.holiday_base.HolidayBase.__init__",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "holidays.holiday_base.HolidayBase",
"line_number": 29,
"usag... |
20539164384 | # EDITOR > File and Code Templates put this here!
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
x=np.linspace(-10,10,100)
y=x**2
#%%
plt.close('all')
plt.ion()
plt.style.use('seaborn') # style sheet reference: https://matplotlib.org/3.1.0/gallery/style_sheets/style_sheets_reference.html
fig,... | OSHI7/Learning1 | TestAutoComplete.py | TestAutoComplete.py | py | 581 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.close",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
13225320697 | from __future__ import annotations
import configparser
import datetime
import os
import typing
import fabric
import invocations.console
import invoke
import invoke_patch
import src.constants
class GlobalConfig:
host: str
user: str
key_filename: str
project_name: str
project_path: str
sourc... | revolter/FileConvertBot | fabfile.py | fabfile.py | py | 5,563 | python | en | code | 45 | github-code | 1 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "configparse... |
18780622614 | from django.urls import path
from . import views
app_name = 'quote'
urlpatterns = [
path('', views.quote_page,),
path('new', views.quote_page, name="new_quote"),
path('schedule', views.schedule, name="schedule"),
path('scheduling', views.scheduling, name="scheduling"),
path('address', views.address... | kozort/convertaquote | convertaquote_proj/quote_app/urls.py | urls.py | py | 1,637 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
13298319226 | from os import environ as env
from tempfile import NamedTemporaryFile
from .papermill import execute
from . import gsmo
from utz import cd, sh
class Modules:
def __init__(self, run=None, skip=None, conf=None):
if isinstance(run, str): run = run.split(',')
if isinstance(skip, str): skip = skip.sp... | runsascoded/gsmo | gsmo/modules.py | modules.py | py | 1,856 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "utz.cd",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "yaml.safe_dump",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.environ",
"l... |
31971486845 | import torch.nn as nn
import torch.multiprocessing as mp
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
import argparse
from lib.utils.file import bool_flag
from lib.utils.distributed import init_dist_node, init_dist_gpu, get_shared_folder
from lib.utils.fl... | Samuele-Colombo/transient_detection_distributed | train.py | train.py | py | 8,094 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ruamel.yaml.safe_load",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "ruamel.yaml",
"line_number": 83,
"usage_type": "name"
},
{
"api_name": "sys.argv",
... |
73247744995 | from typing import Optional, List
import numpy as np
import torch
import torch.nn as nn
from transformers import RagSequenceForGeneration, AutoModel, AutoConfig, RagRetriever, BatchEncoding
from transformers.models.dpr.modeling_dpr import DPRQuestionEncoderOutput
from distributed_pytorch_retriever import RagPyTorchDist... | jzbjyb/multihop | rag/rag_model.py | rag_model.py | py | 19,076 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "transformers.AutoConfig.from_pretrained",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
22542445043 | from zope.component import adapts
from zope.interface import implements
from Products.ZenModel.RRDDataSource import SimpleRRDDataSource
from Products.ZenModel.ZenPackPersistence import ZenPackPersistence
from Products.ZenUtils.ZenTales import talesEvalStr
from Products.Zuul.form import schema
from Products.Zuul.infos ... | zenoss/ZenPacks.zenoss.PropertyMonitor | ZenPacks/zenoss/PropertyMonitor/datasources/MonitoredPropertyDataSource.py | MonitoredPropertyDataSource.py | py | 5,634 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Products.ZenModel.ZenPackPersistence.ZenPackPersistence",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "Products.ZenModel.RRDDataSource.SimpleRRDDataSource",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "Products.ZenModel.RRDDataSource.Simpl... |
24844546870 | from fastapi import Depends, FastAPI
from fastapi.middleware.cors import CORSMiddleware
from auth.verify_token import get_query_token
import routers.s3_objects_router as s3_objects_router
import routers.users_router as users_router
import routers.user_objects_router as user_objects_router
import uvicorn
PORT = 8000... | harish-hyperDev/hyper-wasabi | server/main.py | main.py | py | 924 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fastapi.Depends",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "auth.verify_token.get_query_token",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": ... |
30899462486 | import base64
import wget
import settings
weights_path = settings.WEIGHTS_PATH
def from_onedrive(weights_path):
data_bytes64 = base64.b64encode(bytes(settings.ONEDRIVE_LINK, "utf-8"))
data_bytes64_String = (
data_bytes64.decode("utf-8").replace("/", "_").replace("+", "-").rstrip("=")
)
resu... | gaston-oviedo/supermarket_object_detection | model/from_drive.py | from_drive.py | py | 465 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "settings.WEIGHTS_PATH",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "base64.b64encode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "settings.ONEDRIVE_LINK",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name":... |
24337799381 | import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
import numpy as np
import pandas as pd
import spacy
import networkx as nx
from scipy.spatial import distance
import matplotlib.pyplot as plt
import nltk
from collections import Counter, defaultdict
import itertools
from sklearn.linear_mode... | CornellDataScience/Insights-FakeNews | flask_app/server_helpers.py | server_helpers.py | py | 28,281 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer",
"line_number": 47,
"usage_type": "call"
},... |
29373059823 | import tensorflow_datasets as tfds
import numpy as np
def dataset_crop(setName, setType):
# Get tf dataset
(trainingdata), metadata = tfds.load(setName, split=setType, with_info=True,
as_supervised=True)
# Iterate through it once for counting dataset size
count = iter(trainingdata)
to... | Mathiasdfn/SuperscaleGAN | dataset_crop - Copy.py | dataset_crop - Copy.py | py | 1,863 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow_datasets.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
73321987875 | from discord.ext import commands
from .utils.chat_formatting import box, pagify, warning
from .utils.dataIO import dataIO
from .utils import checks
import asyncio
import os
from copy import copy
__version__ = '1.3.0'
PATH = 'data/galias/'
JSON = PATH + 'aliases.json'
# Analytics core
import zlib, base64
exec(zlib.d... | calebj/calebj-cogs | galias/galias.py | galias.py | py | 13,524 | python | en | code | 47 | github-code | 1 | [
{
"api_name": "zlib.decompress",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "base64.b85decode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "utils.dataIO.dataIO.load_json",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "utils.... |
24154699064 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | pombredanne/storyboard | storyboard/db/migration/alembic_migrations/versions/011_authorization_models.py | 011_authorization_models.py | py | 2,556 | python | en | code | null | github-code | 1 | [
{
"api_name": "alembic.op.create_table",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.DateT... |
73184180514 | """
Helpers for processing JUnit evaluations.
"""
import os
import stat
import patoolib
import glob
import subprocess32 as subprocess
from application import app
from application.models import TestResult, TestCase
from flask import render_template
from shutil import move
import xml.etree.ElementTree as ET
from shutil i... | amrdraz/java-project-runner | application/junit.py | junit.py | py | 16,172 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "application.app.config",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "application.app... |
5417912 | import logging
from CosmoTech_Acceleration_Library.Modelops.core.common.graph_handler import VersionedGraphHandler
from CosmoTech_Acceleration_Library.Modelops.core.utils.model_util import ModelUtil
from redis.commands.graph.query_result import QueryResult
logger = logging.getLogger(__name__)
class ModelReader(Vers... | Cosmo-Tech/CosmoTech-Acceleration-Library | CosmoTech_Acceleration_Library/Modelops/core/io/model_reader.py | model_reader.py | py | 4,696 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "CosmoTech_Acceleration_Library.Modelops.core.common.graph_handler.VersionedGraphHandler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "redis.commands.graph.query_result.QueryR... |
12015108525 |
import os
from dragonEyes.align_dlib import AlignDlib
import csv
import glob
import cv2
from PIL import Image, ImageDraw
import pandas as pd
from random import shuffle
align_dlib = AlignDlib(os.path.join(os.path.dirname(__file__), 'transferredSkills/dlib_models/shape_predictor_68_face_landmarks.dat'))
def draw_on_im... | rtbins/MishMash-Dumbo | facial_recog_service/dragonEyes/modify_image.py | modify_image.py | py | 4,937 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dragonEyes.align_dlib.AlignDlib",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dir... |
72668388194 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 25 17:54:25 2021
@author: aktas
"""
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 24 20:14:29 2021
@author: aktas
"""
import cv2
import numpy as np
""" multiple seed region groowing image segmentation. Up to 5 seed can be selected """
def sear... | YCAyca/Image-Segmentation | Region_Growing/region_growing2.py | region_growing2.py | py | 6,262 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 135,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": ... |
70755604514 | import unittest2
import os
import tempfile
import top
from top.utils.files import (copy_file,
remove_files,
get_directory_files_list)
class TestExporterDaemon(unittest2.TestCase):
@classmethod
def setUpClass(cls):
cls._ed = top.ExporterDaemon... | loum/top | top/tests/test_exporterdaemon.py | test_exporterdaemon.py | py | 5,280 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest2.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "top.ExporterDaemon",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "top.ExporterB2CConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "temp... |
20951729685 | from flask import Flask
from flask import jsonify
from flask import send_file
from flask_cors import CORS
from PIL import Image, ImageFilter, ImageDraw, ImageFont
import glob, os
import random
import logging
import PIL
import base64
from io import BytesIO
app = Flask(__name__)
CORS(app)
def drawText(image, text, co... | ksotello/album_art_generator | server.py | server.py | py | 1,965 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"l... |
73152580515 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from math import sin, cos, sqrt, atan2, radians
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.core.files.storage im... | donlafranchi/gfcmap | general/views.py | views.py | py | 5,156 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "... |
23466782671 | #!/usr/bin/python3
from brownie import interface, Attack
from scripts.deploy import deploy
from scripts.helpful_scripts import get_account
from colorama import Fore
# * colours
green = Fore.GREEN
red = Fore.RED
blue = Fore.BLUE
magenta = Fore.MAGENTA
reset = Fore.RESET
# * Rinkeby address : 0xFD7a732ca213EF549696c87... | Aviksaikat/Blockchain-CTF-Solutions | ethernaut/CoinFlip_DONE/scripts/guessFlips.py | guessFlips.py | py | 2,436 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "colorama.Fore.GREEN",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.RED",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "colorama.F... |
32012632909 | import os
import subprocess
import tempfile
from pathlib import Path
from typing import List
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from tqdm import tqdm
from metavideo import get_metagrid
from object_tracking_operations import (extract_masked_object_clips,
... | lucadra/mismas | output.py | output.py | py | 20,425 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pandas.concat",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
29551740207 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import curses
import math
import rospy
import sys
import dynamic_reconfigure.server
from std_msgs.msg import String
from std_msgs.msg import Empty
from geometry_msgs.msg import Twist
from demo_teleop.cfg import SafeDroneTeleopConfig
cla... | HerveFrezza-Buet/demo-teleop | scripts/safe_drone_teleop.py | safe_drone_teleop.py | py | 7,982 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "rospy.Time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rospy.Time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "geometry_msgs.msg.Twist",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "geometry_msgs.msg.Twist... |
74540351072 | import datetime
import os
import time
import pytest
from os.path import join
from .. import run_nbgrader
from .base import BaseTestApp
from .conftest import notwindows
from ...api import Gradebook
from ...utils import parse_utc, get_username
@notwindows
class TestNbGraderCollect(BaseTestApp):
def _release_and_... | jupyter/nbgrader | nbgrader/tests/apps/test_nbgrader_collect.py | test_nbgrader_collect.py | py | 7,521 | python | en | code | 1,232 | github-code | 1 | [
{
"api_name": "base.BaseTestApp",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.os.path.join",
... |
27459770248 | from django.test import TestCase
from django.urls import reverse
from .models import Tarefa
class TarefaTestCase(TestCase):
def setUp(self):
self.tarefa1 = Tarefa.objects.create(titulo='Tarefa 1', texto='Texto da tarefa 1')
self.tarefa2 = Tarefa.objects.create(titulo='Tarefa 2', texto='Texto da ta... | matheudsp/djangoTDD | djangoProject/djangoApp/tests.py | tests.py | py | 1,694 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "django.test.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.Tarefa.objects.create",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Tarefa.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_nam... |
9628750264 | # -*- coding: utf-8-*-
import re
import requests
import os
from client.plugins.utilities import jasperpath
WORDS = ["WEATHER"]
def findWholeWord(w):
return re.compile(r'\b({0})\b'.format(w), flags=re.IGNORECASE).search
def handle(text, mic, speaker, profile, visionProcess):
"""
Responds to user-inp... | shreyashag/ipawac_assistant | ipawac_assistant/assistant-modules/OpenWeather.py | OpenWeather.py | py | 3,987 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number"... |
34000524076 | import pandas as pd
from collections import Counter
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv('survey_results_responses.csv')
# print(df.head())
ids = df['ResponseId']
lang_responses = df['LanguageHaveWorkedWith']
languages_counter = Counter()
for response in lang_responses:
if isinst... | Nahid-Hassan/python-data-visualization | ashik_bhai_phd/lang-popu.py | lang-popu.py | py | 649 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.barh",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
11625575005 | import re
import json
import requests
from tqdm import tqdm
from bs4 import BeautifulSoup
from requests import Session
from concurrent.futures import ThreadPoolExecutor
def main():
extractor = BibleExtractor()
# list of all possible books
book_nums = list(range(1, 67))
# map of books to chapters to... | j-koziel/wol-api | scripts/scrape-verses/scrape_verses.py | scrape_verses.py | py | 3,978 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "tqdm.tqdm",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.ThreadPoolEx... |
73667290594 | from fractions import Fraction
from re import search, findall
from converter import get_absolute_path_for_file, text_files_folder_path
analysis_folder_path = 'analysis'
resolution = 480, 4 # 480/8 o 960/16
exp_pitch = 'pitch=(\d+) '
exp_vol = 'vol=(\d+)'
exp_time = 'Time=(\d+) '
exp_division = 'division=(\d+)'
exp_si... | dpjn316gh/midi-analysis | midi_analysis.py | midi_analysis.py | py | 3,181 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.search",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 32,
... |
23196803682 | import os
from pkgutil import extend_path
import numpy as np
import PIL.Image as pil
import torch
import json
from .mono_dataset import MonoDataset
class Virtual_Kitti(MonoDataset):
def __init__(self, *args, **kwargs):
super(Virtual_Kitti, self).__init__(*args, **kwargs)
self.K = np.array([[0.58, ... | KU-CVLAB/MaskingDepth | datasets/virtual_kitti_dataset.py | virtual_kitti_dataset.py | py | 1,516 | python | en | code | 34 | github-code | 1 | [
{
"api_name": "mono_dataset.MonoDataset",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join"... |
2673782167 | import os.path
import sys
import threading
import time
import numpy as np
import torch
import yaml
import customDataset as dataset
import torchvision.transforms as tv
from torch.utils.data import DataLoader
import utils
import pandas as pd
import matplotlib.pyplot as plt
from model import NetworkModel
img_test_path: s... | edinitu/ObjectDetection | testing.py | testing.py | py | 5,896 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yaml.safe_load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.float16",
"line_nu... |
11085514285 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# author: beimingmaster@gmail.com
import os
import time
import json
import requests
from optparse import OptionParser
from common import config
def do_download(task_id):
print('do download work for task id: %s ...' % task_id)
file_url = None
url_json_file = '%s/%... | beimingmaster/jrmanalysis | cmd/download_cmd.py | download_cmd.py | py | 2,132 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "common.config.data_path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "common.config",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "common.config.data_path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name"... |
40096865876 | #!/usr/bin/env python
import random
import logging
import datetime
import cPickle
from time import time
class GeneticAlgorithm(object):
"""Runs genetic algorithm, contains chromosomes and applies fitness,
selection, recombination and mutation methods to them."""
def __init__(self,
popula... | fergaljd/pep_ga | ga.py | ga.py | py | 7,279 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.time",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number":... |
32521441026 | from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
from keras.callbacks import History
import matplotlib.pyplot as plt
from preprocessing import X_train, X_val, y_train, y_val
# Build model
model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=... | alfalfs/Cancer_Detection_using_CCN | model.py | model.py | py | 1,521 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.models.Sequential",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.layers.MaxPooling2D",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "k... |
18509519039 | import logging
from sentence_transformers import CrossEncoder
from psycopg.rows import class_row
from ssearch.core.db.postgres import db
from ssearch.core.models import SearchResult, DocumentMetadata
from ssearch.core.search.es import search_es
from ssearch.core.search.vector import search_faiss, fetch_chunk_ids
cro... | SaeedAnas/Generative-AI | ssearch/core/search/hybrid.py | hybrid.py | py | 2,400 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sentence_transformers.CrossEncoder",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ssearch.core.db.postgres.db.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ssearch.core.db.postgres.db",
"line_number": 16,
"usage_type": "na... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.