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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11478947309 | from django.shortcuts import render
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import IsAuthenticated, IsAdminUser
from rest_framework.response import Response
#from .grupos import grupos
from base.models import Resource
from base.serializer import ResourceSeriali... | villalpe/musicodigo | backend/base/views/resource_views.py | resource_views.py | py | 2,184 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "base.models.Resource.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "base.models.Resource.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "base.models.Resource",
"line_number": 17,
"usage_type": "name"
},... |
12434074846 |
from __future__ import print_function
import sys
import os
import string
import re
import time
import subprocess
import logging
import libvirt
from libvirt import libvirtError
from xml.etree import ElementTree as ET
from fuelbench import config_manager
from fuelbench import utils
from fuelbench.settings import *
fro... | lenovo-thinkcloud/fuel-box | lib/fuelbench/providers/kvm.py | kvm.py | py | 13,867 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "fuelbench.config_manager.defaults",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "fuelbench.config_manager",
"line_number": 41,
"usage_type": "name"
},
{
"api_... |
40979227741 | from typing import List, Tuple, Optional
from collections import defaultdict,deque
from functools import cache
import heapq
from sortedcontainers import SortedDict,SortedList
class Solution:
def sumOfPower(self, nums: List[int]) -> int:
nums.sort()
ret = 0
b = 0
mod = 10**9+7
... | wherby/code | contest/00000c315d89/d104/q4/t4.py | t4.py | py | 507 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
}
] |
24955008031 | ################################################################################
#Michael Guerzhoy, 2016
#AlexNet implementation in TensorFlow, with weights
#Details:
#http://www.cs.toronto.edu/~guerzhoy/tf_alexnet/
#
#With code from https://github.com/ethereon/caffe-tensorflow
#Model from https://github.com/BVLC/caf... | jgranadof/JGF-DeepLearning | myalexnet.py | myalexnet.py | py | 9,652 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.random.random",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "scipy.misc.imread",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "tensorflow.pad",
... |
70952867105 | import requests
from json import dump
from json import loads
import time
import csv
import datetime
import os
# Variaveis globais:
qtd_dados = 1000
qtd_page = qtd_dados/10
qtd_max_buscas = 20
api_url_base = 'https://api.github.com/graphql'
headers = {
'Content-Type': 'application/json',
'Authorization': 'b... | LaercioNazareno/LaboratorioVI02 | Consulta.py | Consulta.py | py | 4,809 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": ... |
70075519904 | import tiktoken
def estimate_input_cost_optimized(model_name, token_count):
model_cost_dict = {
"gpt-3.5-turbo": 0.0015,
"gpt-3.5-turbo-16k": 0.003,
"gpt-4": 0.03,
}
try:
cost_per_1000_tokens = model_cost_dict[model_name]
except KeyError:
raise ValueError(f"The... | hassancs91/ChatGPT-MAX-3.0 | tokens_count.py | tokens_count.py | py | 623 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "tiktoken.encoding_for_model",
"line_number": 22,
"usage_type": "call"
}
] |
22683884213 | from django.shortcuts import render
from django.http import HttpResponsePermanentRedirect
from django.views.generic import View
from cmdb.forms.DomainNameForm import DomainNameSearchForm,DomainNameAddForm
from cmdb.models.DomainName import DomainName
from django.forms.models import model_to_dict
from django.core.urlres... | sxf123/sxf-devops | cmdb/views/DomainNameView.py | DomainNameView.py | py | 7,320 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "django.views.generic.View",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "cmdb.forms.DomainNameForm.DomainNameSearchForm",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cmdb.models.DomainName.DomainName.objects.all",
"line_number": 24,
... |
24677020791 | import torch.nn as nn
from torch.nn import init
import torch.nn.functional as F
import torch.nn.utils.spectral_norm as spectral_norm
from .normalization import SPADE
class BaseNetwork(nn.Module):
def __init__(self):
super(BaseNetwork, self).__init__()
def print_network(self):
if isinstance(se... | NVIDIA/UnsupervisedLandmarkLearning | models/generator.py | generator.py | py | 6,937 | python | en | code | 43 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.init.normal_",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.nn.init",
... |
30585632784 | # -*- coding: utf-8 -*-
import logging
from apscheduler.job import Job as APJob
from apscheduler.jobstores.base import BaseJobStore
from apscheduler.triggers.base import BaseTrigger
from apscheduler.triggers.cron import CronTrigger
from apscheduler.triggers.date import DateTrigger
from apscheduler.triggers.interval im... | beer-garden/beer-garden | src/app/beer_garden/db/mongo/jobstore.py | jobstore.py | py | 5,006 | python | en | code | 244 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "apscheduler.triggers.interval.IntervalTrigger",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "apscheduler.triggers.date.DateTrigger",
"line_number": 30,
"usage_type": ... |
14314349936 | import sisl
import sisl.viz
import numpy as np
from scipy import optimize
import matplotlib.pyplot as plt
from rotating_dnbp2 import torsion_angle
'''
Creation of dp_pp structure functionalized with two nitro groups, replacing the biphenyl bridges with
2,2'-dinitrobiphenyl, with different twist angles of the phenyl gr... | asierro/TFM_repo | sisl_plotly/rotating_dn_dppp/rotating_dn_dppp.py | rotating_dn_dppp.py | py | 9,989 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sisl.plot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.s... |
32891264065 | import os
from typing import Dict, List
import numpy as np
import scipy.sparse as sps
from recsys_framework.Data_manager.Utility import print_stat_datareader
from conferences.cikm.cfgan.our_implementation.constants import CFGANDatasetMode, CFGANBenchmarks
from conferences.cikm.cfgan.our_implementation.original.data i... | fernandobperezm/ecir-2022-an-evaluation-of-GAN-for-CF | evaluation-cfgan/conferences/cikm/cfgan/our_implementation/dataset_reader/CFGANDatasetReader.py | CFGANDatasetReader.py | py | 10,114 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "recsys_framework.Utils.conf_logging.get_logger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name":... |
14623129746 | import getopt
import sys
from loguru import logger
import colorama
import signal
from AnimeUnityEngine import scraper, logging_aux, res_obj_manipulator, jdownloader
import printer
config = {'crawl_path': None, 'download_path': None, 'print_level': 9, 'season': None, 'log_level': 'WARNING', 'file_log':False}
version = ... | ale-ben/AnimeUnityUI | main.py | main.py | py | 4,590 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.exit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "signal.signal",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "signal.SIGTERM",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "signal.signal",
"line_... |
30688923406 | import copy
from dataclasses import dataclass, field
from pathlib import Path
from typing import List, NamedTuple
FILE_DIR = Path(__file__).parent
def get_gamma(text: List[str]) -> List[int]:
gamma = [0] * len(text[0])
for line in text:
for ii, char in enumerate(line):
if bool(int(char)):... | razzlestorm/advent-of-code | 2021/python/dec03/solution.py | solution.py | py | 1,479 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 3... |
14195981955 | # from pudb import set_trace; set_trace()
from typing import List
class Solution:
def maxScore(self, cardPoints: List[int], k: int) -> int:
"""LeetCode 1423.
We start from taking all k elements from the front. Then we swap out
one from the front with one from the end. We do this until all... | FanchenBao/leetcode | 2021_05_challenge/05_11_2021.py | 05_11_2021.py | py | 1,522 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
20282416216 | import pytest
@pytest.fixture
def create_dict(app):
from app.main.config_helper import get_dict_by_name
obj = get_dict_by_name("Sample")
return obj
def test_add_word(create_dict):
init_len = len(create_dict)
create_dict.add_word('Москва', 12) # нет городов в словаре -> точная гарантия добавлени... | aalekseevx/hat | backend/tests/dictionary_test.py | dictionary_test.py | py | 3,422 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "app.main.config_helper.get_dict_by_name",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "app.main.config_helper.get_dict_instance_by_name",
"line_number": 43,
"usage_ty... |
35465325064 | import psycopg2
import postgres_creds as creds
commands = [
"""
CREATE TABLE IF NOT EXISTS covid_tracking.states (
state VARCHAR(2) PRIMARY KEY,
name VARCHAR(35)
)
""",
""" CREATE TABLE IF NOT EXISTS covid_tracking.states_daily (
date DATE PRIMARY KEY,
state ... | mlivingston40/covid-app | postgresMaster/createTables_covid_tracking.py | createTables_covid_tracking.py | py | 2,058 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "psycopg2.connect",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "postgres_creds.DATABASE",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "postgres_creds.USER",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name":... |
11022338635 | from PIL import Image
import numpy as np
import os
import prepare_patch as pp
from metrics import PSNRHVSM
from filters import dct_filter
dir = "/media/rostyslav/NewPart/work/ImageDatasets/TID2013/reference_images/"
list_file = os.listdir(path=dir)
print(list_file)
i = 0
while True:
prs_name = list_file[i].split(... | Lebedenko-A/DZZ_python | ind.py | ind.py | py | 1,499 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 2... |
13176006591 | from selenium.webdriver.common.by import By
# 启动浏览器信息
browser_data = {
'browser': 'chrome',
'driver_path': '../driver/chrome/chromedriver.exe',
'page_url_baidu': 'https://www.baidu.com',
'page_url_file': 'https://v.qq.com/x/cover/mzc00200uvgh0p1.html',
'info': [('useAutomationExtension', False), ("... | ZhenYun193/Selenium_For_Authentication | config/BroswerData.py | BroswerData.py | py | 3,617 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 18,
"us... |
24672396684 | import nltk
class Yngve_calculator():
def is_terminal(self,tree):
if type(tree[0]) is nltk.tree.ParentedTree:
return False
else:
return True
def count_rsibs(self,tree):
rsibs = 0
if tree.parent():
par = tree.parent()
numchildren = len(par)
posit = tree.parent_index()
rsibs = numchildren ... | SPOClab-ca/COVFEFE | utils/lexicosyntactic/yngve.py | yngve.py | py | 792 | python | en | code | 29 | github-code | 7 | [
{
"api_name": "nltk.tree",
"line_number": 6,
"usage_type": "attribute"
}
] |
28721411679 | from elasticsearch import Elasticsearch
import sys
doc_fetch_all= {
'size' : 10000,
'query': {
'match_all' : {}
}
}
class ES_ModelHelper:
def __init__(self,client_name):
self._es_host = {"host": "localhost", "port": 9200}
self._es = Elasticsearch(hosts=[self._es_host])
... | thameem786/POC_CODE | es_create.py | es_create.py | py | 4,060 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 89,
"usage_type": "call"
}
] |
74821435421 | import sqlite3
def person_dict(row):
c = {
'name': row[0],
'born': row[1],
'died': row[2],
}
return c
class Database:
def __init__(self, dat_file):
self.connection = sqlite3.connect(dat_file)
self.cursor = self.connection.cursor()
def close(self):
... | tkmk96/PV248 | 04/database.py | database.py | py | 3,806 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 15,
"usage_type": "call"
}
] |
10592073196 | from django.db import models
from glims.models import Lab, Project
from django.contrib.auth.models import Group
from django.utils._os import safe_join
import os
from django.db.models.signals import post_save, pre_save
import shutil
import urllib2
import json
from bioshare.utils import get_real_files, get_symlinks, remo... | amschaal/glims | bioshare/models.py | models.py | py | 5,995 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.db.models.OneToOneField",
"line_number": 16,
"usage_type": "call"
},
{
"api_n... |
28997744616 | import cv2
import numpy as np
def process_image_r(img):
img = np.asarray(img, dtype="float32")
img = cv2.resize(img, (540, 420))
# img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = img/255.0
img = np.reshape(img, (420, 540, 1))
return img
def process_image(img):
img = np.... | BashCache/Audiobook | frontend/deskewing.py | deskewing.py | py | 1,216 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.asarray",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number"... |
17678907880 | __author__ = 'Oliver Denninger'
from flask_restful import reqparse
from flask import request
import logging
from backports.functools_lru_cache import lru_cache
from hbp_nrp_backend.storage_client_api.StorageClient import StorageClient
logger = logging.getLogger("__main__")
class UserAuthentication(object):
"""
... | hmsgit/nrpbackend | hbp_nrp_backend/hbp_nrp_backend/__UserAuthentication.py | __UserAuthentication.py | py | 5,384 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "hbp_nrp_backend.storage_client_api.StorageClient.StorageClient",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 32,
... |
12954732566 | # -*- coding: UTF-8 -*-
"""
Original Author: ?
Contributors: ?
Purpose: Produce all pages directly related to classes.
"""
import os, json, sys, datetime, re
import lib.extractlib as lib
import lib.task as task
import lib.dungeon as dungeon
import lib.furniture as furniture
import lib.home as home
import lib.monster ... | Harrygiel/Arcanum_Wikifier | lib/tom_class.py | tom_class.py | py | 16,881 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "math.ceil",
"line_number": 133,
"usage_type": "call"
},
{
"api_name": "graphviz.Digraph",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": "lib.tom_class",
"line_number": 239,
"usage_type": "name"
},
{
"api_name": "lib.tom_class",
"line... |
73506191262 | # coding: utf-8
import pickle
from collections import OrderedDict
from scipy import io
import numpy as np
fname_dict_index_t = 'dict_index_t'
fname_matrix_x300 = 'matrix_x300'
fname_input = './wordsim353/combined.tab'
fname_output = 'combined_out.tab'
def cos_sim(vec_a, vec_b):
'''コサイン類似度の計算
ベクトルvec_a、vec_bのコサイン類似... | segavvy/nlp100_Python | 94/main.py | main.py | py | 1,421 | python | ja | code | 15 | github-code | 7 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.dot",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line... |
15882259567 | import requests
from datetime import datetime
from calendar import monthrange
from sys import exit
def mesAnterior(mes_atual):
m = mes_atual[-2:]
if m == '01':
a = mes_atual[:4]
a = int(a)
a -= 1
mes_anterior = str(a) + '-12'
else:
m = int(m)
m -=1
if... | raulguilherme-dev/dados-covid | func_covid.py | func_covid.py | py | 1,859 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.today",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "calendar.monthrange",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "request... |
29248465922 | '''
Title: Metropolis-Hastings Algorithm for generating Standard Gaussian RV's
The following code simulates Standard Normal RV's using the
method of Metropolis-Hastings Algorithm
The Gaussian distribution with sd = 3 was used as the proposal distribution
Will Daewook Kwon - will.dw.kwon@gmail.com
'''
import... | WillKwon/Bayesian_Statistics_Projects | MCMC_Gaussian.py | MCMC_Gaussian.py | py | 1,342 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.gauss",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm.pdf",
"l... |
73879007904 | import math
import torch
import torch.nn as nn
from models.transformer import TransformerEncoderLayerWithBN
from models.utils import clones
from core.config import config
class JustPool(nn.Module):
def __init__(self, cfg):
super(JustPool, self).__init__()
def forward(self, rcnn, query, rcnn_mask, ... | CFM-MSG/Code_LEORN | lib/models/frame_modules/object_frame_interaction.py | object_frame_interaction.py | py | 14,223 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.sum",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number"... |
8121811228 | # -*- coding: utf-8 -*-
import argparse
import os
import sys
from open_mysql_project import openproject
from telluric_auto import alternativequestion
if __name__ == '__main__':
parantdir = "/Users/hamano/DIB_analysis/DIB_pipeline_dir/"
parser = argparse.ArgumentParser()
parser.add_argument("objectid", ty... | SatoshiHamano/DIBanalyzer | change_object_name.py | change_object_name.py | py | 6,471 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "open_mysql_project.openproject",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tellu... |
26277826433 | import argparse
import math
import progressbar
import torch
from dataset import Seq2SeqDataset
from register import register
from train import shift_target_inputs_to_labels
DEVICE = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
def generate(args):
model_class, tokenizer_class = register(args.m... | znculee/finetune-transformers | generate.py | generate.py | py | 4,127 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "register.registe... |
37077646413 | import json
import requests
def addSite(nickname, url):
try:
collection_slug = url.split('/')[4]
apiUrl = "https://api.opensea.io/api/v1/collection/" + collection_slug
response = requests.request("GET", apiUrl)
info = json.loads(response.text)['collection']['primary_asset_contracts'][0]
name = in... | Son0-0/Opensea-Floor-Check | module/opensea_add.py | opensea_add.py | py | 758 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.request",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 29... |
72630509022 | import logging
import os
from unittest.mock import patch
import pytest
from client_auth import get_env_var, requests_client
from client_auth.utils import UnconfiguredEnvironment
ACCESS_TOKEN = (
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6I"
"kpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIy... | CroudTech/cc-python-client-auth | tests/test_client_auth.py | test_client_auth.py | py | 2,908 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pytest.fixture",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "client_auth.requests_cl... |
27771725919 | import json
import os
import random
import string
import tempfile
from googlecloudsdk.core import config
from googlecloudsdk.core import exceptions
from googlecloudsdk.core import log
from googlecloudsdk.core.docker import constants
from googlecloudsdk.core.docker import docker
MANIFEST_FORMAT = """\
computeMetadata... | twistedpair/google-cloud-sdk | google-cloud-sdk/lib/googlecloudsdk/core/docker/fake_metadata.py | fake_metadata.py | py | 3,808 | python | en | code | 55 | github-code | 7 | [
{
"api_name": "googlecloudsdk.core.config.CLOUDSDK_SCOPES",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "googlecloudsdk.core.config",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 65,
"usage_type": "call"
},
... |
18357185846 | # -*- coding: utf-8 -*-
"""
@author: Yifan Cheng, Skylar Du, Yashash Gaurav, Mark He
"""
# Importing required packages
import numpy as np
import pandas as pd
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
# Declaring global variables
bestcolleges_data_path = "bestcolleges_careers.csv"
bestcolleges_data = ... | junhuih/DFP-Project | bestcolleges_helper.py | bestcolleges_helper.py | py | 2,005 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fuzzywuzzy.process.extractOne",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "fuzzywuzzy.process",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "fuzz... |
14896293772 | from collections import deque
import copy
import sys
sys.setrecursionlimit(10000)
n, m = map(int, input().split())
ground = [list(map(int, sys.stdin.readline().split())) for _ in range(n)]
d = deque()
res = 0
dx = [1, 0, -1, 0]
dy = [0, -1, 0, 1]
def wall(s, l):
if l == 3:
virus()
return
else... | JiyuChoi/Algorithm-Study | 이코테/DFS BFS 문제/연구소.py | 연구소.py | py | 1,076 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "collections.dequ... |
70861239585 | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 6 22:45:46 2020
@author: wanglei
"""
#DBSCAN聚类模型在模拟blob数据集上的聚类实验
import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
from sklearn.datasets import make_blobs
import matplotlib.pyplot as plt
# 1. 获得数据集
n_samples = 750 #数量
X, y = make_blo... | topview2022/clustering | DBScan_cluster_on_blob.py | DBScan_cluster_on_blob.py | py | 2,364 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.datasets.make_blobs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.DBSCAN",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.silhouette_score",
"line_number": 34,
"usage_type": "call"
},
{
... |
35434656233 |
# Modules Loading
import pandas as pd
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
from app import app
import plotly.express as px
import dash_bootstrap_components as dbc
pd.options.mode.chained_assignment = None
# Da... | VinayakTekade/Global-Terrorism-Analytics | apps/map.py | map.py | py | 8,609 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.options",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.NavbarSimple",
"line_number": 56,
"usage_type": "call"
},
{
"api_na... |
14833302049 | from datetime import datetime, timedelta, date
import json
import operator
from itertools import groupby
import logging
line_emoji_map = {"Red": "🔴", "Green": "🟢", "Blue": "🔵", "Orange": "🟠"}
with open("stations.json", "r") as data_file:
stations = json.load(data_file)
def id_to_stop(line, id):
"""takes... | transitmatters/mbta-slow-zone-bot | utils.py | utils.py | py | 6,239 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "datetime.datet... |
32079965300 | from dataloader import read_bci_data, BCIDataset
from torchsummary import summary
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
def get_activation_op(activation_type):
if activation_type == 'ELU':
return nn.ELU()
... | thethongngu/deep-learning-practices | convnet/convnet.py | convnet.py | py | 8,822 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.ELU",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.LeakyReLU",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number"... |
29059442460 | import json
import random
from field_capture import db
from field_capture.models import Room, Player
from .exceptions import (MissTokenError, TwiceRolledDiceError,
MissTurnLastPersonError, GameDoesNotStartError)
class RoomManager:
def __init__(self, room_id=None):
self.room = Roo... | StoVictor/field_capture_game | services/web/field_capture/main/game_objects.py | game_objects.py | py | 16,082 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "field_capture.models.Room.query.filter_by",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "field_capture.models.Room.query",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "field_capture.models.Room",
"line_number": 12,
"usage_type... |
33737677854 | from dash import Dash, dcc, html, Input, Output, callback
import dash_bootstrap_components as dbc
app = Dash(external_stylesheets=[dbc.themes.COSMO])
server=app.server
rxn_temp = dcc.Input(value='', type='number',placeholder='temperature',max=300)
my_output = html.Div()
vial_vol = dcc.Input(value='', type='number',pl... | Nick-Mul/ExperimentalRiskAssesmentTool | era.py | era.py | py | 2,642 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dash.Dash",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.themes",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "dash.dcc.Input",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dash.dcc"... |
20687826208 | from enum import Enum
import logging
from typing import Dict
import numba
import numpy as np
from climate_indices import compute, eto, palmer, utils
# declare the names that should be included in the public API for this module
__all__ = ["pdsi", "percentage_of_normal", "pet", "scpdsi", "spei", "spi"]
# -----------... | monocongo/climate_indices | src/climate_indices/indices.py | indices.py | py | 27,162 | python | en | code | 307 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "climate_indices.utils.get_logger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "climate_indices.utils",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "logg... |
13102494121 | import requests
import logging
import urllib.parse
from config import APIKEY
def alert(url):
logging.basicConfig(level=logging.INFO, format='%(levelname)s - %(asctime)s - %(name)s - %(message)s')
sendMsg(url)
def test():
logging.basicConfig(level=logging.DEBUG, format='%(levelname)s - %(asctime)s - %(... | restkhz/kWordSentry | _serverChan.py | _serverChan.py | py | 873 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG... |
44025365060 | from typing import Any, Dict, List, Tuple, Union
import numpy as np
import torch
from torch import Tensor
from flash.core.data.base_viz import BaseVisualization
from flash.core.data.io.input import DataKeys
from flash.core.utilities.imports import _MATPLOTLIB_AVAILABLE, Image, requires
from flash.core.utilities.stage... | Lightning-Universe/lightning-flash | src/flash/image/segmentation/viz.py | viz.py | py | 3,827 | python | en | code | 1,717 | github-code | 7 | [
{
"api_name": "flash.core.utilities.imports._MATPLOTLIB_AVAILABLE",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flash.core.data.base_viz.BaseVisualization",
"line_number": 19,
"usa... |
2116891949 | from pathlib import Path
import pydicom as dicom
import numpy as np
import pandas as pd
import tensorly as tl
from tensorly.decomposition import parafac, tucker, partial_tucker
from joblib import Parallel, delayed
import argparse
import tensorflow as tf
from scipy.linalg import pinv, svd
from scipy.sparse.linalg impo... | quinngroup/SciPy2019-demo | task.py | task.py | py | 6,540 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "pydicom.read_file",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_nu... |
38050444569 | try:
import os
import re
import sys
import requests
import validators
except ModuleNotFoundError:
print("[-] Requirements not satisfied!\n\trun 'pip install -r requirements.txt'\n\t\tOR\n\trun 'pip3 install -r requirements.txt'")
quit()
def print_docs():
docs = f"""
Documentation:
... | jmarcantony/Email-Phone-Scraper | main.py | main.py | py | 4,170 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.name",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": ... |
24924452466 | import matplotlib.pyplot as plt
import numpy as np
from matplotlib import gridspec
from odeModels.insuline.simulation1Day import simulation, pidC1
t, y = simulation([300, 300, 1400 - 300 - 300], [36.29, 86.88, 94.18], pidC1)
y = y + 10
step = 20
s = np.repeat(np.random.normal(y[::step, 0], 10), step)
minIndex = min(l... | simonesilvetti/pyCheck | nfm/grafici/glucoseFreeBar.py | glucoseFreeBar.py | py | 994 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "odeModels.insuline.simulation1Day.simulation",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "odeModels.insuline.simulation1Day.pidC1",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "numpy.repeat",
"line_number": 10,
"usage_type": "c... |
40453849275 | import os
import numpy as np
import matplotlib.pyplot as plt
import malmoenv
import argparse
from pathlib import Path
import time
from PIL import Image
from stable_baselines3.common import results_plotter
from stable_baselines3.common.monitor import Monitor
from stable_baselines3.common.results_plotter import load_res... | chemgymrl/block_malmo | MalmoEnv/run.py | run.py | py | 5,422 | python | en | code | null | github-code | 7 | [
{
"api_name": "stable_baselines3.common.callbacks.BaseCallback",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_nam... |
6687051307 | """Additional project metadata"""
# pylint: disable=invalid-name
from importlib import metadata as _meta
try:
distribution = _meta.distribution(__name__.split(".")[0])
except _meta.PackageNotFoundError: # pragma: no cover
raise RuntimeError("DoorPi was not properly installed") from None
project = "VoIP Door... | emphasize/DoorPi | doorpi/metadata.py | metadata.py | py | 1,447 | python | en | code | null | github-code | 7 | [
{
"api_name": "importlib.metadata.distribution",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "importlib.metadata",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "importlib.metadata.PackageNotFoundError",
"line_number": 8,
"usage_type": "attribute"
... |
30098403849 | # 최소비용 구하기 211005
"""
입력
첫째 줄에 도시의 개수 N(1 ≤ N ≤ 1,000)
둘째 줄에는 버스의 개수 M(1 ≤ M ≤ 100,000)
셋째 줄부터 M+2줄까지 다음과 같은 버스의 정보가 주어진다. 먼저 처음에는 그 버스의 출발 도시의 번호가 주어진다. 그리고 그 다음에는 도착지의 도시 번호가 주어지고 또 그 버스 비용이 주어진다. 버스 비용은 0보다 크거나 같고, 100,000보다 작은 정수이다.
그리고 M+3째 줄에는 우리가 구하고자 하는 구간 출발점의 도시번호와 도착점의 도시번호가 주어진다. 출발점에서 도착점을 갈 수 있는 경우만 입력으로... | FrancisJeon/Baekjoon-python | BOJ_01916.py | BOJ_01916.py | py | 2,830 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "sys.stdin",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",... |
26801286841 | import base64
import hashlib
from django.http import HttpResponseRedirect
from django.shortcuts import render,redirect
from .models import Family
from django.views.decorators.csrf import csrf_exempt
from django.db.models import Q
from .forms import UploadFileForm
from django.core.files import File
from django.core.file... | qbang/pocket-money | morae/views.py | views.py | py | 3,004 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Family.objects.all",
"line_number": 25,
"usage_type": "call"
},
{
"api_nam... |
21724578961 | from django.db import models
from multiselectfield import MultiSelectField
class EnquiryData(models.Model):
name=models.CharField(max_length=100)
email=models.EmailField(max_length=100)
mobile=models.BigIntegerField()
COURSES_CHOICES=(
('python','PYTHON'),
('django','DJANGO'),
('... | ramana1024/sample | enquiryformproject/enquiryformapp/models.py | models.py | py | 1,138 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "... |
74737066144 | import cv2
import mediapipe as mp
import numpy as np
import time
#ML solution provided by mediapipe for detecting face mesh
mp_face_mesh = mp.solutions.face_mesh
#need confidence score higher than 0.5 to detect face
#and mesh from frame to frame
face_mesh = mp_face_mesh.FaceMesh(min_detection_confidence=0.... | tsoprano/head-pose-estimation | poseEst.py | poseEst.py | py | 7,078 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "mediapipe.solutions",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_nam... |
24361620926 | from tkinter import *
import requests
from tkinter import messagebox
def clearAll() :
fromField.delete(0, END)
toField.delete(0, END)
amountField.delete(0, END)
finField.delete(0, END)
def checkError() :
if (fromField.get() == "" or toField.get() == "" or amountField.get() == "") :
messagebo... | ozanakinci/CurrencyExchange | main.py | main.py | py | 2,286 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.messagebox.showerror",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
}
] |
38273878602 | """
Tests for plotting operations
"""
import itertools
import os
import shutil
import sys
import tempfile
import unittest
from contextlib import contextmanager
from unittest import TestCase
import numpy as np
import pandas as pd
import xarray as xr
from cate.core.op import OP_REGISTRY
from cate.ops.plot import plot,... | TonioF/cate | test/ops/test_plot.py | test_plot.py | py | 9,862 | python | en | code | null | github-code | 7 | [
{
"api_name": "itertools.count",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
19808010508 | import pytest
from rhoknp import Morpheme
from kwja.utils.word_normalization import (
MorphemeDenormalizer,
MorphemeNormalizer,
get_normalized,
get_word_norm_op_tags,
)
wellformed_list = [
("なぁ", ["K", "S"], "なあ"),
("なー", ["K", "D"], "な"),
("な〜", ["K", "D"], "な"),
("おっ", ["K", "D"], "お... | ku-nlp/kwja | tests/utils/test_word_normalization.py | test_word_normalization.py | py | 5,263 | python | ko | code | 113 | github-code | 7 | [
{
"api_name": "kwja.utils.word_normalization.get_normalized",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 74,
"usage_type": "attribute"
},
{
... |
9980012055 | from chip8_machine import Chip8Machine
import pytest
import numpy
TEST_SIZE = 50
machine = Chip8Machine()
@pytest.fixture
def sprite1():
return numpy.array([0xAA, 0x55])
@pytest.fixture
def valid_memory_addresses():
return numpy.random.randint(0x0, 0x1000, size=TEST_SIZE)
def test_screen(sprite1):
x = 7
y = 5
... | Emfz/Chip8EmulatorV2 | test_chip8_machine.py | test_chip8_machine.py | py | 2,497 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "chip8_machine.Chip8Machine",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.random... |
28325785212 | from django.shortcuts import render
from comentarios.models import Comentarios
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
from django.views import generic
from comentarios.forms import ComentariosCreateForm
from django.urls import reverse_lazy
from django.contrib.auth.mixins import ... | Gabriellopess/DJANGO | comentarios/views.py | views.py | py | 1,350 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "comentarios.models.Comentarios",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.mixins.LoginRequiredMixin",
"line_number": 19,
"usage_ty... |
70150177822 | from __future__ import print_function
import numpy as np
import cv2
IMAGE_SIZE = 224
RED_MEAN = 123.68
GREEN_MEAN = 116.779
BLUE_MEAN = 103.939
def load_image(image_path):
image = cv2.imread(image_path)
shorter_dimension = np.min(image.shape[:2])
width_offet = (image.shape[0] - shorter_dimensi... | EelaiWind/dl_hw2_vgg19net | part1/utils.py | utils.py | py | 1,238 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 17,
... |
71040029983 | # pylint: disable=too-many-lines
import copy
import logging
import os
import pickle
import shutil
import time
import uuid
from functools import partial
from pathlib import Path
from typing import (
Callable,
Dict,
FrozenSet,
Iterable,
List,
Optional,
Type,
TYPE_CHECKI... | golemfactory/clay | golem/task/taskmanager.py | taskmanager.py | py | 53,888 | python | en | code | 2,915 | github-code | 7 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "golem.task.taskbase.TaskEventListener",
"line_number": 87,
"usage_type": "name"
},
{
"api_... |
1974217036 | from .functions import *
from common.types import *
from common.utils import Singleton
from camera.assets import cameraStoreConfig
import os
import json
import shutil
import subprocess
from pathlib import Path
from datetime import datetime
from typing import Dict
from PIL import Image as PILImage
from picamera2 imp... | YeongRoYun/BearTeam | service/backend/camera/utils/mycamera.py | mycamera.py | py | 4,302 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "common.utils.Singleton",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "picame... |
12734655445 | # -*- coding: utf-8 -*-
##############################################################################
# Author:QQ173782910
##############################################################################
import traceback
import time
import random
from basic.JD_TOOL import robot_bugerror
from basic.DB_TOOL import DB_pg3... | mn3711698/wrobot | run_task.py | run_task.py | py | 10,740 | python | en | code | 19 | github-code | 7 | [
{
"api_name": "function_scheduling_distributed_framework.patch_frame_config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dbconfig.host",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "dbconfig.port",
"line_number": 17,
"usage_type": "name"
},
... |
634979015 | """ View module for handling requests for categories """
from rest_framework.status import HTTP_404_NOT_FOUND
from rareserverapi.models.category import Category
from rest_framework import status
from rareserverapi.models.rareuser import RareUser
from django.core.exceptions import ValidationError
from django.http impor... | NSS-Day-Cohort-42/Rare-API-TalkingHeads | rareserverapi/views/post.py | post.py | py | 8,230 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "rest_framework.viewsets.ViewSet",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "rareserverapi.models.Post",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "rareserverapi.models.category.Category.objects.get",
"line_number": 28,
"usage_... |
71039986783 | from typing import List
import golem.model
def _repository_from_image_name(image_name: str) -> str:
return image_name.rsplit('/', maxsplit=1)[0]
class Whitelist:
@staticmethod
def get_all() -> List[str]:
return [
whitelisted.repository for whitelisted in
golem.model.Doc... | golemfactory/clay | golem/envs/docker/whitelist.py | whitelist.py | py | 1,491 | python | en | code | 2,915 | github-code | 7 | [
{
"api_name": "golem.model.model.DockerWhitelist.select",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "golem.model.model",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "golem.model",
"line_number": 16,
"usage_type": "name"
},
{
"api_n... |
41498456923 | import os
import time
import re
import cv2
import numpy as np
import dicttoxml
import xmltodict
import json # to convect collection.OrderedDict() to dict()
import lxml.etree as etree # for xml pretty_print
"""
Need: pip3 install dicttoxml xmltodict (very small and download soon)
Reference: cricket_007, https://stac... | Yonv1943/Python | Plan/DEMO-tensorflow_xml.py | DEMO-tensorflow_xml.py | py | 5,013 | python | en | code | 619 | github-code | 7 | [
{
"api_name": "dicttoxml.dicttoxml",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lxml.etree.tostring",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "lxml.etree.fromstr... |
24017265961 | import itertools
import dask_image.ndinterp
import pytest
import xarray
from multiscale_spatial_image import MultiscaleSpatialImage
from spatial_image import SpatialImage
from spatialdata._utils import unpad_raster
from spatialdata.models import get_model
from spatialdata.transformations import Affine
from xarray impo... | scverse/spatialdata | tests/utils/test_element_utils.py | test_element_utils.py | py | 2,633 | python | en | code | 113 | github-code | 7 | [
{
"api_name": "xarray.DataArray",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "spatialdata.transformations.Affine",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dask_image.ndinterp.ndinterp.affine_transform",
"line_number": 28,
"usage_type": "cal... |
245652569 | import dolfinx
import ufl
from mpi4py import MPI
import numpy as np
import os
from scipy.interpolate import interp1d
from Utilities import linstep, project
class Pretreatment:
def __init__(self, verbose, show_plots):
self._init_constants()
self.verbose = verbose
self.show_plots = show_... | NREL/VirtualEngineering | pretreatment_model/dolfinx/Pretreatment.py | Pretreatment.py | py | 25,709 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
40130312211 | import pandas as pd
from datetime import datetime
import re
import PySimpleGUI as sg
import math
import perfonitor.inputs as inputs
import numpy as np
import os
import openpyxl
import sys
# <editor-fold desc="Corrections">
def correct_incidents_irradiance_for_overlapping_parents(incidents, irradiance, ... | rbentoalves/perfonitor | data_treatment.py | data_treatment.py | py | 69,790 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.isnull",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "datetime.d... |
42054340098 | import os
import gc
import math
import numpy as np
import cv2
import imageio
import tensorflow as tf
import matplotlib.pyplot as plt
from PIL import Image
from random import choice
from tensorflow.keras.utils import Sequence
from tensorflow.keras import backend as K
from losses import psnr2 as psnr
class DataLoader... | jlfilho/VSRGAN-keras | libs/util.py | util.py | py | 16,116 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tensorflow.keras.utils.Sequence",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PIL.Image.NEAREST",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "PIL.... |
28559847499 | from k64_pll_calculator import PLLSolver
from k64_pll_calculator.scripts.cli import get_verbosity_level
from unittest import TestCase
from z3 import *
class TestCLI(TestCase):
def test_get_verbosity_level(self):
import logging
assert (get_verbosity_level(0) == logging.CRITICAL)
assert (get... | cwoodall/k64-pll-calculator | k64_pll_calculator/tests.py | tests.py | py | 2,238 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "k64_pll_calculator.scripts.cli.get_verbosity_level",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.CRITICAL",
"line_number": 10,
"usage_type": "attribute"
},
... |
39983613156 | import warnings
import numpy as np
import pandas as pd
import torch
from sklearn.model_selection import StratifiedKFold
from keras.preprocessing.text import Tokenizer
from infer import roberta_infer, cnn_infer
from train import train_model, train_model2
from model import MyRobertaModel, MyCNN
from settings import SPLIT... | Harahan/tweet-sentiment-extraction | code/main.py | main.py | py | 3,627 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "util.seed_everything",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "train.dr... |
40054908918 | from pyasn1.compat.octets import octs2str
from pyasn1.type import univ
from pysnmp.proto import rfc1902
from agentcluster.grammar import abstract
class SapGrammar(abstract.AbstractGrammar):
tagMap = {
'Counter': rfc1902.Counter32,
'Gauge': rfc1902.Gauge32,
'Integer': rfc1902.Integer32,
... | GillesBouissac/agentcluster | agentcluster/grammar/sap.py | sap.py | py | 1,287 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "agentcluster.grammar.abstract.AbstractGrammar",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "agentcluster.grammar.abstract",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pysnmp.proto.rfc1902.Counter32",
"line_number": 8,
"usage_... |
39650416214 | import os
import unittest
import shutil
import utils.utils
import utils.train_utils
import executors.NistSaverExecutor
import executors.Executor
from multiprocessing import Process, Queue, JoinableQueue
from queue import Empty
class SimpleRandomSklearnExecutorTest(unittest.TestCase):
def test_saver_executor(self... | HazyResearch/d3m-model-search | Stanford-D3M-Full/tests/unit_tests/executor/test_NistSaverExecutor.py | test_NistSaverExecutor.py | py | 2,190 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.JoinableQueue",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "multiprocessing.JoinableQueue",
"line_number": 18,
"usage_type": "call"
},
{
... |
25110358367 | import itertools
def win(current_game):
def all_same(l):
if l.count(l[0])== len(l) and l[0] != 0:
return True
else:
return False
#Horizontal
for row in current_game:
print(row)
if all_same(row):
print(f"Player{row[0]} is th... | amitdharamsi/Python | TicTacToe.py | TicTacToe.py | py | 3,275 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.cycle",
"line_number": 79,
"usage_type": "call"
}
] |
4151726304 | import pandas as pd
import pymysql
import json
import configparser
import boto3
import io
import mysql.connector
from sqlalchemy import create_engine
from datetime import datetime,date, timedelta
def lambda_handler(event, context):
archived_date = (pd.datetime.now() - pd.Timedelta(days=2)).date().... | indraNeel177/AWS_lambda_backup | lambda_oregon/Turnaround_daily_to_reporting_db.py | Turnaround_daily_to_reporting_db.py | py | 9,286 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.datetime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.Timedelta",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "boto3.resou... |
33660824499 | import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import torchvision.transforms as T
from torch.utils.data import DataLoader
import pytorch_lightning as pl
from utils.classifier import PL_model
def prob_heatmap_tensor(img_tensor, patch_classifier,mean_=0.2939,std_=0.2694,
... | sposso/nonuniform-sampling- | utils/deformation.py | deformation.py | py | 6,132 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Unfold",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.no_grad",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_... |
25775119237 | from math import floor
import os
import pandas as pd
import numpy as np
import cv2
import torch
from torch.utils.data import Dataset
class xRaysDataset(Dataset):
# Change these percentages if needed.
# If train=True I'll take the first 90% images of each label.
# If train=False I'll take the last 10% ima... | ManosL/XRay-Lung-Disease-Detection | code/xRaysDataset.py | xRaysDataset.py | py | 3,597 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
... |
12823538483 | import argparse
import os
import torch
import yaml
import torch.nn as nn
import torch.multiprocessing as mp
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DistributedSampler, DataLoader
from torch.distributed import init_process_group
from torch.nn.parallel import DistributedD... | keonlee9420/PortaSpeech | train.py | train.py | py | 9,979 | python | en | code | 310 | github-code | 7 | [
{
"api_name": "torch.backends",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "torch.distributed.init_process_group",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": ... |
36754768406 | # python中@staticmethod方法,类似于C++中的static,
# 方便将外部函数集成到类体中,
# 主要是可以在不实例化类的情况下直接访问该方法,
# 如果你去掉staticmethod,
# 在方法中加self也可以通过实例化访问方法也是可以集成。
# Python 为弱类型语言,可以调用typing 进行数据类型强调和注释
# https://docs.python.org/zh-cn/3/library/typing.html
from typing import Callable, Optional, List
import torch
import torch.nn as nn
from torc... | TatteredCollector/mobilenet | model/MobileNetV3.py | MobileNetV3.py | py | 12,290 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Sequential",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
... |
72073069342 | from tkinter import *
import tkinter.messagebox as tmsg
import sys
import time
from datetime import datetime,date,timedelta
todays_date=date.today()
dt=datetime.now()
from db import fetchData,insertData,updateBook,returnUpdateBook
from studentdb import insertStudentData,fetchStudentData,updateStudentData,returnStudentB... | namanbansal102/LibraryManagement | main.py | main.py | py | 10,770 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.date.today",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
28407803316 | from django.db import models
from common.models import BaseModel, BaseCatalog
class Organization(BaseModel):
name = models.CharField(
max_length=1000,
verbose_name="Название организации"
)
co_organizations = models.ManyToManyField(
'organizations.Organization',
blank=True,
... | Eldary89/structure_of_organizations | organizations/models.py | models.py | py | 545 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "common.models.BaseModel",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "djan... |
21946880707 | """Miscellaneous analyses of EEG data."""
# %%
# Imports
import numpy as np
import pandas as pd
from config import ANALYSIS_DIR_LOCAL, BAD_SUBJS
# %%
# Settings
analysis_dir = ANALYSIS_DIR_LOCAL
# %%
# File paths
dropped_epochs = analysis_dir / "derived_data" / "dropped_epochs.tsv"
bad_channels_template = (
an... | sappelhoff/ecomp_analysis | eeg_misc.py | eeg_misc.py | py | 1,267 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "config.ANALYSIS_DIR_LOCAL",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "config.BAD_SUBJS... |
72853776862 | from transformers import AutoModel, AutoTokenizer
import streamlit as st
from streamlit_chat import message
st.set_page_config(
page_title="ChatGLM-6b 演示",
page_icon=":robot:"
)
@st.cache_resource
def get_model():
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
... | Ascend/ModelZoo-PyTorch | PyTorch/built-in/foundation/ChatGLM-6B/web_demo2.py | web_demo2.py | py | 2,191 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 14,
"usage_type": "name"
... |
27287332326 | from django.db import models
from django.contrib.auth.models import User
from items.models import Item
class MessageModel(models.Model):
sender = models.ForeignKey(User, on_delete=models.CASCADE, related_name="sender")
receiver = models.ForeignKey(User, on_delete=models.CASCADE, related_name="receiver")
... | iamlucasmateo/django-simple-market | Puddle/puddle/message/models.py | models.py | py | 888 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
11355527570 | import os
import laspy
import numpy as np
import pyfor
import geopandas as gpd
import pandas as pd
import laxpy
from shapely.geometry import Polygon
from joblib import Parallel, delayed
class CloudDataFrame(gpd.GeoDataFrame):
"""
Implements a data frame structure for processing and managing multiple :class:`.... | brycefrank/pyfor | pyfor/collection.py | collection.py | py | 14,482 | python | en | code | 86 | github-code | 7 | [
{
"api_name": "geopandas.GeoDataFrame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
1895499509 | import sha, shelve, time, Cookie, os, sqlite3, json, sys
from uuid import uuid4
from Curl import Curl
from ConfigParser import ConfigParser
from datetime import datetime, date
class SqliteSession():
sql_create_tbl = (
"""
CREATE TABLE IF NOT EXISTS session
(
access_token TEXT,
... | pinxli/align-python-library-version1 | Align/SqliteSession.py | SqliteSession.py | py | 2,444 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number... |
33668066123 | import pandas as pd
from config import config
def build_trainset(path1, path2):
df = pd.read_csv(path1, encoding='utf-8')
text_series, response_series = [], []
for i in range(df.shape[0]):
text = '<start> ' + str(df.loc[i]['Question']) + str(df.loc[i]['Dialogue']) + ' <end>'
response = '<s... | Youngyangi/AutoMaster--Neural-Abstractive-Summarization | utilities/Build_Dataset.py | Build_Dataset.py | py | 643 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.config.train_seg_path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "con... |
38427052633 | from typing import List, Optional, Union
def iteratio_and_run_out(left_len, right_len):
if left_len > right_len:
iterate_until = right_len
run_out_value = False
elif left_len < right_len:
iterate_until = left_len
run_out_value = True
else:
iterate_until = right_len
... | Skylake-dev/aoc22 | 13/common.py | common.py | py | 2,315 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
71589855585 | import os
import subprocess
import sys
import tarfile
import zipfile
def main():
try:
archive_content, archive_format = sys.argv[1:]
except ValueError:
sys.stdout.write(f"usage: {sys.argv[0]} src|mac|win zip|gz|bz2\n")
sys.exit(64)
try:
tag = subprocess.check_output(
... | arescentral/antares | scripts/dist.py | dist.py | py | 3,371 | python | en | code | 97 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.write",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_n... |
21539410172 |
# import asyncio
# from copra.websocket import Channel, Client
# loop = asyncio.get_event_loop()
# channel = Channel('user', 'LTC-USD')
# ws = Client(loop, channel, auth=True, key=KEY, secret=SECRET, passphrase=PASSPHRASE)
# try:
# loop.run_forever()
# except KeyboardInterrupt:
# loop.run_until_complete(w... | ralphamale/crypto | main.py | main.py | py | 874 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "autobahn.asyncio.websocket.WebSocketClientFactory",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "copra.websocket.Channel",
"line_number": 35,
"usage_type": "call... |
72225433183 | from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from .models import Item, Love, Comment
# global variable setup here for flag
user_item_flag, love_item_flag = False, False
preview_index = None
category_type = None
category_list = [
'衣物服飾', '鞋子', '電... | KoKoLates/trading-platform-website | market/views.py | views.py | py | 6,627 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Item.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Item.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name... |
23808885168 | """
Created on Jan 10, 2018
@author: Tony Kuzola
"""
import random
import os
import sys
from pathlib import Path
import tkinter as tk
from tkinter import messagebox
import json
from PIL import ImageTk, Image, ExifTags
class RightClickMenu(tk.Frame): # pylint: disable=too-many-ancestors
"""Class defining popup m... | TKuzola/pictureflipper | picture_flipper.py | picture_flipper.py | py | 9,621 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.Frame",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame.__init__",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "tkinter.... |
1946063501 | from collections import namedtuple
import csv
import os
from os.path import join
import shutil
import time
import click
import pyimagediet.process as process
CONFIGURE_HELP = '''\
Inspect and print configuration customisation for your environment.'''
Stats = namedtuple('Stats', ['filename', 'orig_size', 'time', 'new... | samastur/compression_tests | squeeze/squeeze.py | squeeze.py | py | 3,303 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_... |
10233568773 | import tensorflow as tf
tf.compat.v1.disable_eager_execution()
import os
import functools
import numpy as np
import time
from tqdm import tqdm
from tensorflow.python.ops import array_ops
import tensorflow_gan as tfgan2
tfgan = tfgan2
import sys
config = tf.compat.v1.ConfigProto()
config.gpu_options.per_process_gpu_memo... | ambekarsameer96/SKDCGN | Baseline_code/TinyGAN_updated_1000_classes/inception_tf.py | inception_tf.py | py | 3,171 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "tensorflow.compat.v1.disable_eager_execution",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 12,
"usage_type": "ca... |
15805048494 | #!/usr/bin/env python
'''
CREATED:2014-01-17 16:30:07 by Brian McFee <brm2132@columbia.edu>
Compute hierarchical segmentation evaluation metrics
Usage:
./segment_hier_eval.py -r TRUTH_LEVEL1.TXT [TRUTH_LEVEL2.TXT ...] \
-e PREDICTION_LEVEL1.TXT [PREDICTION_LEVEL2.TXT ...] \
... | craffel/mir_evaluators | segment_hier_eval.py | segment_hier_eval.py | py | 3,231 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "mir_eval.io.load_labeled_intervals",
"line_number": 77,
"usage_type": "call"
},
{
"api_name... |
25472577536 |
import os
#os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import retro
import random
import gym
import math
import numpy as np
import random
import time
import cv2
from matplotlib import pyplot as plt
from keras.optimizers import Adam
from keras.optimizers import SGD
from collections import deque
from keras.models import l... | marisarze/SonicTH_ai | SonicTh_light.py | SonicTh_light.py | py | 22,605 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "keras.backend.set_epsilon",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "keras.backend.set_floatx",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "kera... |
3465682158 | import find_mxnet
import mxnet as mx
import logging
import argparse
import os
import train_model
# don't use -n and -s, which are resevered for the distributed training
parser = argparse.ArgumentParser(description='train an image classifer on imagenet')
mutually_exclusive_parser_group = parser.add_mutually_exclusive_g... | fumanne/mxnet | example/image-classification/train_imagenet.py | train_imagenet.py | py | 5,654 | python | en | code | null | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "mxnet.io.DataIter",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "nump... |
1340506784 | import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from bs4 import BeautifulSoup
from indeed import indeed
driverlink="/home/sanju/Downloads/chromedriver"
service=Service(executable_path=driverlink)
baseurl="https://www.linkedin.com"
driver=webdriver.Chrome(service=ser... | author-sanjay/linkedinbot | main.py | main.py | py | 3,715 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{... |
25665880932 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0019_article_imgname'),
]
operations = [
migrations.RemoveField(
model_name='article',
name=... | 31nov/reform | main/migrations/0020_remove_article_imgname.py | 0020_remove_article_imgname.py | py | 348 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RemoveField",
"line_number": 14,
"usage_type": "call"
},
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.