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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42184453828 | """This file tests internal details of AndroidPlatform. These are not part of the public API,
and should not be accessed or relied upon by user code.
"""
import calendar
from contextlib import contextmanager
import imp
from importlib import import_module, metadata, reload, resources
import importlib.util
from importli... | nguyentiem/android_python_chaquopy | chaquopy-demo-master/app/src/main/python/chaquopy/test/test_android.py | test_android.py | py | 52,801 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "test_utils.API_LEVEL",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "com.chaquo.python.android.AndroidPlatform.ABI",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "com.chaquo.python.android.AndroidPlatform",
"line_number": 42,
"u... |
43177440426 | import uuid
from datetime import datetime
from models_manager import Field, Model
from settings import USERS_DB_NAME, DEFAULT_TENANT
from utils.utils import random_string
class MailMessages(Model):
SCOPE = [
{'name': 'MailMessage.Read', 'scope': None, 'scopeType': None},
{'name': 'MailMessage.De... | Nikita-Filonov/demo_auto_tests | models/users/mail_message.py | mail_message.py | py | 1,376 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "models_manager.Model",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "settings.USERS_DB_NAME",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "models_manager.Field",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "uuid... |
8526799740 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from lib.classes.weatherYahoo import WeatherYahoo
class Core(object):
_answer = []
_sqlo = None
_services = {
'tiempo': WeatherYahoo,
}
def __init__(self):
pass
def instanceServices(self, service, args=[]):
service = self._services[service]
obj = service(... | lodeale/botBuffyWebServices | lib/core/core.py | core.py | py | 787 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "lib.classes.weatherYahoo.WeatherYahoo",
"line_number": 10,
"usage_type": "name"
}
] |
36228793822 | import names # pip install names
import random
import csv
n_connections = 500
csvReader = csv.reader(open('sp500.csv'), delimiter=',', quotechar='"')
companies = [row[1] for row in csvReader]
with open('occupations.txt') as f:
occupations = f.read().splitlines()
def generate_fake_profile():
first_name = na... | mikhailklassen/Mining-the-Social-Web-3rd-Edition | notebooks/resources/ch04-linkedin/generate_fake_data.py | generate_fake_data.py | py | 1,088 | python | en | code | 890 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "names.get_first_name",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "names.get_last_name",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.choice",
... |
10009309944 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 25 21:59:10 2021
@author: lin.yang
"""
import os
current_path = os.getcwd()+'/'
import sys
sys.path.append(current_path)
import numpy as np
import math
import matplotlib.pyplot as plt
import myInput
import datetime
import multiprocessing as mp
cla... | Linwitness/VECTOR | PACKAGE_MP_Vertex.py | PACKAGE_MP_Vertex.py | py | 19,111 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_numbe... |
18681084368 | ## initial imports ------------------------------
import os, sys
assert sys.version_info.major >= 3
sys.path.append( os.environ['BK_LCTR__PROJECT_PATH'] )
from book_locator_app import settings_app # requires above path to be set
## rest of imports ------------------------------
import json, logging, pprint
import ... | Brown-University-Library/book_locator_project | book_locator_app/lib/index.py | index.py | py | 16,650 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.version_info",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"li... |
25647842830 | import mtcnn
import PIL.Image as Image
import numpy
import os
import json
from matplotlib import pyplot
import sklearn.svm
def LoadConfig(filePath):
with open(filePath, "r") as f:
return json.load(f)
def LoadImage(imagePath):
image = Image.open(imagePath)
image = image.convert('RGB')
return nu... | bk202/Project_Warden | util.py | util.py | py | 4,333 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.asarray",
"line_number":... |
27405007230 | import numpy as np
import math
import pydot # for visualizing the tree
# MCTS (Monte Carlo Tree Search) is an algorithms
# that plans ahead, estimating Q-values based on
# "rollouts", which are simulated episodes.
# This specific implementation is written for two-player
# zero-sum games, but should be generalized to... | CogitoNTNU/vicero | vicero/algorithms/mcts.py | mcts.py | py | 3,899 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "math.sqrt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 57,... |
6902620957 | import sys
import os
import numpy as np
import tensorflow as tf
import time
import datetime
from exploration.autoencoder import Autoencoder
def parse_record(record_bytes, obs_steps=4):
features = {
#'game_name' : tf.FixedLenFeature((), tf.string),
#'act_name' : tf.FixedLenFeature((), tf.str... | olegmyrk/retro-rl | autoencode.py | autoencode.py | py | 3,918 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.FixedLenFeature",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.string",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.parse_single_example",
"line_number": 19,
"usage_type": "call"
},
{
... |
71409538594 | # fight against a creature
import sys, ticker, pygametest, random, pygame
spk = pygametest.speak
c = ticker.Scheduler(0.001)
fps = 30
fpsClock = pygame.time.Clock()
class Creature:
"""Create mobs and players"""
def __init__(self, name, hp=10, strength=1, mob=True):
self.name = name
self.hp = hp
... | frastlin/Hero | tests/ticker_tests/game2.py | game2.py | py | 3,759 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygametest.speak",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "ticker.Scheduler",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.time",
... |
43771306259 | #!/usr/bin/env python
# Self contained script, based on Simon's script
# https://raw.githubusercontent.com/IDR/idr0052-walther-condensinmap/master/scripts/upload_and_create_rois.py
# and omero-roi package: https://github.com/ome/omero-rois
import os
import numpy as np
from PIL import Image, ImageSequence
import omero... | IDR/idr0101-payne-insitugenomeseq | scripts/seg_images_to_masks.py | seg_images_to_masks.py | py | 6,417 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "omero.model.MaskI",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "numpy.packbits",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "omero.rtypes.rdouble",... |
38895237497 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time # fo... | alec-horwitz/BlubeamDownloader | BluebeamDownloader.py | BluebeamDownloader.py | py | 19,705 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.sleep",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11... |
74391648354 | # -*- coding: utf-8 -*-
import requests
url = 'https://www.douban.com/'
#r = requests.get(url)
#print('code:', r.status_code)
#print('text: ', r.text)
#r_params = requests.get('https://www.douban.com/search', params = {'q': 'python', 'cat': '1001'})
#print('url:', r_params.url)
#print('code:', r_params.status_code)
#... | hello-wn/python-basic-scripts | 20180424/requests_samples.py | requests_samples.py | py | 1,073 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.post",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
}
] |
26104171645 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class Social(Model):
"""NOTE: This class is auto generated by the swagger code... | JakubKuderski/Programowanie_Zespolowe | server/swagger_server/models/social.py | social.py | py | 2,989 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "swagger_server.models.base_model_.Model",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "swagg... |
13181608112 | import argparse
import h2o
import mlflow
import sys
import os
from mlflow.tracking import MlflowClient
from h2o.automl import H2OAutoML, get_leaderboard
# Add the src directory to the system path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from utils import *
def main():
# Se... | gersongerardcruz/network_intrusion_detection | src/backend/train.py | train.py | py | 4,763 | python | en | code | 0 | 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.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
274105874 | import os
import re
import sys
import argparse
import logging
import shutil
from pathlib import Path
from collections import defaultdict
from multiprocessing import Process
from .codeql import build_codeql_db
from .analyzer import extract_function_pointers, extract_structs
from .instrumenter import instrument_library_... | untangle-tool/untangle | untangle/main.py | main.py | py | 14,169 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.getLogRecordFactory",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": ... |
22504290089 | import sys
from collections import deque
input = sys.stdin.readline
def target(lst):
lst.sort(key=lambda x: (x[2], x[0], x[1]))
return lst[0]
def help_mom():
global baby_shark
# arr에 아기 상어보다 작은 개체가 있는지
for i in range(N):
for j in range(N):
if arr[i][j] < baby... | Kminwo-o/BaekJoon-Algorithm | 백준/Gold/16236. 아기 상어/아기 상어.py | 아기 상어.py | py | 2,383 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 24,
"usage_type": "call"
}
] |
28822048293 | import os
import math
import pandas as pd
from scipy.stats import gmean
from tabulate import tabulate
from eval import *
'''
usage: python .\result.py > .\result.log
input: all log files
output: csv file that contains the evaluation results
'''
def format_integer(number):
if math.isnan(number):
return nu... | CactiLab/Sherloc-Cortex-M-CFVD | host_tools/evaluation/result.py | result.py | py | 28,369 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "math.isnan",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.path.getsize",
"line_nu... |
8650792697 | import pandas as pd
import numpy as np
import re
from stanfordcorenlp import StanfordCoreNLP
import os
import nltk
from nltk.corpus import stopwords
from keras.models import load_model
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from gensim.models import KeyedVe... | OmarMeriwani/Fake-Financial-News-Detection | Numbers Meaning/NumbersTitlesDataset.py | NumbersTitlesDataset.py | py | 9,012 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 19,
"usage_type": "name"
},
{
"api... |
23212413758 | #!/usr/bin/env python3
"""
plot_zoom_sequence.py
Plot a series of inset zoom images based on pre-computed images in .npz files.
"""
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as pl
import unyt
from plot_map import get_data, get_limits, plot_data_on_axis
## global parameters... | bwvdnbro/documentation | Visualisations/PlotMaps/plot_zoom_sequence.py | plot_zoom_sequence.py | py | 8,356 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "unyt.Mpc",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "unyt.Mpc",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "unyt.Mpc",
"line_numbe... |
13942092637 | from math import floor
from PIL import ImageFont, Image, ImageDraw
from io import BytesIO
import datetime
def AutoFont(font: ImageFont.FreeTypeFont, text: str, max_width: int,*, check) -> ImageFont.FreeTypeFont:
if isinstance(font, tuple):
font = ImageFont.truetype(*font)
while check(font.getsize(tex... | BooAngeldust/test_ | src/libs/utils.py | utils.py | py | 3,054 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.ImageFont.FreeTypeFont",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFont",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PIL.ImageFont.truetype",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL... |
12951494655 | import abc
import json
import urllib.parse
from typing import ClassVar, List
import aiohttp.web
import google.auth.transport.requests
import google.oauth2.id_token
import google_auth_oauthlib.flow
import msal
from gear.cloud_config import get_global_config
class FlowResult:
def __init__(self, login_id: str, ema... | wlu04/hail | auth/auth/flow.py | flow.py | py | 4,202 | python | en | code | null | github-code | 1 | [
{
"api_name": "abc.ABC",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.web.web",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.web... |
32869459782 | import json
from textwrap import dedent
import pendulum
from airflow import DAG
from airflow.operators.python import PythonOperator
with DAG(
'dh_print_dag_sample',
# [START default_args]
# These args will get passed on to each operator
# You can override them on a per-task basis during operator initi... | DennisHsu/AirFlow-dh-practice | printDag.py | printDag.py | py | 1,681 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "airflow.DAG",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pendulum.datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "airflow.operators.python.PythonOperator",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "... |
20639764825 | import cv2 as cv
import numpy as np
import sys
# 白黒に閾値処理するプログラム
def main():
# ファイルを読み込み
image_file = 'fig/ipad.png'
src = cv.imread(image_file, cv.IMREAD_COLOR)
# イメージを読み込めなかった場合
if image_file is None:
sys.exit("File not found.")
# グレースケール化
img_gray = cv.cvtColor(src, cv.COLOR_RGB2GR... | kengo-0805/origami | BW.py | BW.py | py | 2,091 | python | ja | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_COLOR",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_numb... |
2671355782 | # pylint: disable=no-self-use,invalid-name
import pytest
from allennlp.common import Params
from allennlp.common.util import ensure_list
from allennlp.data.dataset_readers import BabiReader
from allennlp.common.testing import AllenNlpTestCase
class TestBAbIReader:
@pytest.mark.parametrize('keep_sentences, lazy',... | dki-lab/GrailQA | allennlp/tests/data/dataset_readers/babi_reader_test.py | babi_reader_test.py | py | 1,273 | python | en | code | 89 | github-code | 1 | [
{
"api_name": "allennlp.data.dataset_readers.BabiReader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "allennlp.common.util.ensure_list",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "allennlp.common.testing.AllenNlpTestCase.FIXTURES_ROOT",
"line_numb... |
40926510217 | import argparse
import os
from qsub import q_write, q_sub
def main():
# arguments
parser = argparse.ArgumentParser()
parser.add_argument('-top_dir', help='top level directory of chromo grouped mafs', required=True)
parser.add_argument('-ref', help='Reference species name', required=True)
parser.a... | henryjuho/sal_enhancers | genome_alignment/roast_all.py | roast_all.py | py | 1,985 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "qsub.q_write",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "qsub.q_write",
"li... |
16080510727 | # Importing libraries
import pyautogui as notification
import schedule
import time
import os
from colorama import Fore, Style, init
# Initialization for the colorama lib
init(autoreset=True)
def script():
# Defining the alert function
def alert(message):
# Printing text on screen
print(Fore.GREEN + Style.BRIGH... | ArshansGithub/Science-Project | main.py | main.py | py | 2,947 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "colorama.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.GREEN",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "colorama.Style.BR... |
2559839049 | from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from azure.cognitiveservices.vision.computervision.models import OperationStatusCodes
from azure.cognitiveservices.vision.computervision.models import VisualFeatureTypes
from msrest.authentication import CognitiveServicesCredentials
from ar... | sarajk/invoice-fields-recognition-py | microsoft_computer_vision.py | microsoft_computer_vision.py | py | 2,387 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "azure.cognitiveservices.vision.... |
813232806 | import torch
from torch import nn
from torch.nn import functional as F
from torch.nn import init
import numpy as np
from pprint import pprint
from .Backbone import Backbone
from ..Component.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
BatchNorm2d = SynchronizedBatchNorm2d
BN_MOMENTUM = 0.01
class RGB2Dept... | Robert-xiaoqiang/DS-Net | sodpackage/architecture/RGB2DepthNet/RGB2DepthNet.py | RGB2DepthNet.py | py | 2,415 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "Component.sync_batchnorm.batchnorm.SynchronizedBatchNorm2d",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
... |
11313104428 | #!/usr/bin/env python
# -*- encoding: utf-8
import collections
from helpers import get_all_works, save_tally_to_path
if __name__ == '__main__':
tally_image = collections.Counter()
tally_presentation = collections.Counter()
tally_any = collections.Counter()
for work in get_all_works():
for i... | saltaf07/Public-Scripts | works_analysis/get_digitised_images_per_work_tally.py | get_digitised_images_per_work_tally.py | py | 1,505 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "helpers.g... |
2619331181 | from typing import Callable, Optional
from game_agent import GameAgent
from enum import Enum
class TurnContext:
def __init__(self, turn: int, game_manager, current_player: GameAgent, non_current_player: GameAgent, battle_gui):
self.turn = turn
self._game_manager = game_manager
self.current... | jgbakke/Sorcery | turn_context.py | turn_context.py | py | 1,715 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "game_agent.GameAgent",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "game_agent.GameAgent",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "game_agent.GameAgent",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "enum.En... |
39027133493 | from datetime import datetime
from functools import wraps
from random import randint
import os
from bcrypt import hashpw, gensalt, checkpw
from flask import Flask, abort, jsonify, request, send_from_directory
from flask_cors import CORS
from sqlalchemy import or_
from marshmallow import ValidationError
from jwt impor... | hammadfaisal/COP290_101_Switching_Protocols | backend/app/app.py | app.py | py | 26,917 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
41027401256 | import copy
import itertools
import logging
import os
from pathlib import Path
import html
import boto3
import time
import json
import gradio
import requests
import base64
from urllib.parse import urljoin
import gradio as gr
import utils
from aws_extension.auth_service.simple_cloud_auth import cloud_auth_manager
fr... | awslabs/stable-diffusion-aws-extension | aws_extension/sagemaker_ui.py | sagemaker_ui.py | py | 67,283 | python | en | code | 111 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "utils.LOGGING_LEVEL",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "utils.get_variable_from_json",
"line_number": 79,
"usage_type": "call"
},
{
"api_name"... |
40214052858 | import base64
import locale
import sys
"""
def encoder(content):
print('編碼類型:{:10}|{}'.format('default',content.encode()))
print('編碼類型:{:10}|{}'.format('UTF-8',content.encode(encoding='utf8')))
print('編碼類型:{:10}|{}'.format('UTF-16',content.encode(encoding='utf16')))
print('編碼類型:{:10}|{}'.format('UTF-32... | katmenminzer/-Pratice-PySet | 2.encoder.py | 2.encoder.py | py | 1,807 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "base64.b64decode",
"line_number": 49,
"usage_type": "call"
}
] |
32639198474 | from PIL import Image
import os, sys
def topng(path):
for dirpath, dirs, files in os.walk(path):
#ignore finished files
if "finished" in dirs:
dirs.remove("finished")
for file in files:
try:
imgpath = os.path.join(dirpath, file)
im = I... | sayidhe/image-compress-scale-transfrom | topng.py | topng.py | py | 902 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.walk",
"line_number": 5,
"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": "PIL.Image.open",
"line_number": ... |
27722012968 | import codecs
import os
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), "r", encoding="utf-8") as fp:
return fp.read()
def get_version(rel_path):... | wuhanstudio/whitebox-adversarial-toolbox | setup.py | setup.py | py | 2,007 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_... |
71496194593 | import math
import glob
import re
import os
import logging
import os
pat = os.getcwd()
pat = pat + '\word.txt'
kgram_len_lst = []
dct_lst = {}
filename_lst = []
path = os.getcwd()
'''
List of stop words inserted in a list.
'''
f = open(pat,'r')
stop_word = set(f.read().split())
f.close()
'''
To read files to creat... | yashwanth033/CSPP-1_project | Fingerprinting.py | Fingerprinting.py | py | 3,683 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 29,
... |
20353139946 | import json
import sys
import uuid
from dataclasses import dataclass
from datetime import date, datetime
from decimal import Decimal
from pathlib import Path
from typing import (
Any,
Dict,
FrozenSet,
Iterable,
Iterator,
List,
Mapping,
Optional,
Tuple,
Union,
)
from urllib.parse ... | delta-io/delta-rs | python/deltalake/writer.py | writer.py | py | 19,851 | python | en | code | 1,524 | github-code | 1 | [
{
"api_name": "sys.version_info",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pyarrow.__version__.split",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pyarrow.__version__",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name... |
11397836838 | from django.urls import path
from .views import (ShopIndexView, GroupsListView,
ProductDetailsView, ProductsListView,
OrdersListView, OrdersDetailsView,
CreateProductView, UpdateProductView,
DeleteProductView, CreateOrderView,
... | GlebSmor/skillbox | Python_Django/M_07_CBV/mysite/shopapp/urls.py | urls.py | py | 1,347 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "views.ShopIndexView.as_view",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "views.ShopIndexView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "djan... |
73059429473 | from dataclasses import dataclass
from datetime import datetime
from typing import Dict, Tuple
from vnpy.api.tap.vntap import (
AsyncDispatchException, CreateTapQuoteAPI,
FreeTapQuoteAPI, ITapQuoteAPINotify,
TapAPIApplicationInfo, TapAPIContract,
TapAPIQuotLoginRspInfo, TapAPIQuoteLoginAuth, TapAPIQuot... | AMAZED-FINTECH/vnpy-Amazed-Fintech | vnpy/gateway/tap/tap_gateway.py | tap_gateway.py | py | 26,233 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "vnpy.api.tap.vntap.TAPI_COMMODITY_TYPE_SPOT",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "vnpy.api.tap.vntap.TAPI_COMMODITY_TYPE_FUTURES",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "vnpy.api.tap.vntap.TAPI_COMMODITY_TYPE_OPTION",
"l... |
24010630821 | from skimage import io, img_as_float, filters, data, color
from sklearn.decomposition import PCA
from os import listdir
from os.path import isfile, join
import pandas as pd
import numpy as np
from PIL import Image
from sklearn.linear_model import LogisticRegression
from joblib import dump, load
test_true = "test_data... | Diadochokinetic/HackBay2019 | hail_model/train_model.py | train_model.py | py | 3,583 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_num... |
23033488402 | #!/usr/bin/env python2
import sys
import os
import capnp
from madara.knowledge import *
geo = capnp.load(os.environ["MADARA_ROOT"] + "/tests/capnfiles/Geo.capnp")
Any.register_int32("i32");
Any.register_class("Point", geo.Point)
Any.register_class("Pose", geo.Pose)
a = Any("i32")
a.assign(10);
print(a.to_integer(... | sawtoothgeek/madara | port/python/tests/test_any.py | test_any.py | py | 838 | python | en | code | null | github-code | 1 | [
{
"api_name": "capnp.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
}
] |
73811183074 | from django.shortcuts import render
from django.http import HttpResponse
from .models import Product,Comment,Favorite,User
import csv
import pandas as pd
import random
# Create your views here.
gender_list = ['M','W']
type_list = ['TOP','BOTTOM']
# 랜덤된 이미지를 보여준다
# 메인페이지
def index(request):
answer... | limjun92/team8_project | web/first_django/firstproject/firstapp/views.py | views.py | py | 2,495 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.DictReader",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render... |
73654172833 | import os
import json
from qgis.PyQt import QtWidgets, uic
from qgis.core import QgsProject
from qgis.PyQt.QtGui import QDesktopServices
from qgis.PyQt.QtCore import pyqtSignal, QUrl
from qgis.utils import iface
from .api import endpoints
from .utils import (
get_layer_config,
sdo_to_layer,
get_epsg_from... | danylaksono/GeoKKP-GIS | modules/import_wilayah_admin.py | import_wilayah_admin.py | py | 10,924 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "qgis.PyQt.uic.loadUiType",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "qgis.PyQt.uic",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"li... |
41004027942 | __author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyue@mit.edu"
__date__ = "Mar 18, 2012"
import os
import unittest
import warnings
from pymatgen.apps.borg.hive import VaspToComputedEntryDrone
from pymatgen.apps.bo... | jsyony37/pymatgen | pymatgen/apps/borg/tests/test_queen.py | test_queen.py | py | 1,076 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "warnings.simplefilter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "warnings.simplefilter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "py... |
15834327489 | import argparse
from .movements import NaoMover
from .utils import read_config
if __name__ == "__main__":
cfg = read_config()
parser = argparse.ArgumentParser()
parser.add_argument('yaw', type=float)
parser.add_argument('pitch', type=float)
parser.add_argument('speed', type=float, nargs='?', def... | ltskv/kick-it | pykick/setangles.py | setangles.py | py | 467 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "utils.read_config",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "movements.NaoMover",
"line_number": 16,
"usage_type": "call"
}
] |
38638907219 | """
'datadir' and 'plotdir' hold the location of my data and plots which is different on different systems, so it is
modified here rather than in each script individually.
"""
import os
import numpy as np
from metpy import constants
homepath = os.path.expanduser('~/Documents/meteorology/')
datadir = homepath + 'data... | leosaffin/scripts | myscripts/__init__.py | __init__.py | py | 723 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.expanduser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.deg2rad",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.deg2rad",
"li... |
13184674712 | from faker import Faker
from kafka import KafkaProducer
from time import sleep
from random import randint
import json
from dataclasses import dataclass, asdict
from typing import List
from datetime import datetime, timedelta
fake = Faker("en_GB")
total_riders = 0
total_time = 0
@dataclass
class Rider:
name: str... | GeorgeVince/streaming_producer_consumer | producer/producer.py | producer.py | py | 2,202 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "faker.Faker",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
21400079972 | from django.db.models import Q, Prefetch
from django.db.models.base import ModelBase
from service.models import Orders, OrderComments
def get_choices_from_query(model: ModelBase, filter_params: dict) -> list:
"""Return choices list for select widget from model by filter"""
query = model.objects.filter(**fil... | i1gr/django_proj_ignat | service/services.py | services.py | py | 2,357 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.base.ModelBase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "service.models.Orders",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "service.models.Orders.objects.filter",
"line_number": 49,
"usage_type": "call"
},
... |
41903459117 | """Holds the model for prediction
"""
import joblib
from util import fibonacci, get_logger
import numpy as np
import pandas as pd
from finta import TA
from sklearn.neighbors import KNeighborsRegressor
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.svm import... | ckinateder/blackswan-mini | src/model.py | model.py | py | 3,149 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "util.get_logger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsRegressor",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": ... |
18520736249 | import math
import numpy as np
import matplotlib.pyplot as plt
MTOM = 4000
MTOW = MTOM*9.81
dl = 1.15
M = 1
velocityTAS = 0
N = 2
B = 3
DL = np.arange(20, 100, 1)
r = np.sqrt(MTOM/(DL*2*math.pi))
c = 0.2358
omega = 85
def density(height):
temp = 288.15-0.0065*height
pressure = 101325*math.pow(temp/288.15,(... | kdally/hydrogen-aircraft-system-design | IterationTools/aerodynamics/DiskLoading.py | DiskLoading.py | py | 1,945 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.arange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "math.pow",
"line_number": 22... |
29825633413 | import re
import json
w = open("dic.txt", "w")
problem = []
index = 1
with open("fit.txt", "r") as f:
dic_list = []
dic = {}
pivot = None
for line in f.readlines():
new_line = re.sub(r'(?is)\[\[',' ',line)
new_line = re.sub(r'(?is)\]\]',' ',new_line)
new_line = re.sub(r'\]', ... | JishnuRamesh/MonashUnitGuideDataFetcher | test.py | test.py | py | 8,720 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 18,
"usage_type"... |
8092163165 | # Импортируем модуль для работы с win32api
import win32api
# Импортируем модуль для работы с pyqt5
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QPainter, QBrush
from PyQt5.QtCore import Qt, QThread
# Создаем класс для виджета с цветом
class ColorWidget(QWidget):
# Конструкто... | AkiraShiro/Color-with-system-language | main.py | main.py | py | 3,907 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.Qt.WA_TranslucentBackground",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore.Qt",
"line_number": 16,
"usage_type": "name"
},
{
... |
35315377250 | import os
import math
import numpy as np
import pandas as pd
from glob import glob
from datetime import datetime as dt, timedelta
from tensorflow.keras.models import Sequential, load_model
from tensorflow.keras.layers import Dense, Activation, LSTM
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint
... | TISKYIT/e_power_pred | pred_app/demand_pred.py | demand_pred.py | py | 3,313 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "datetime... |
32479719220 | import numpy as np
import torch
from numba import njit
def is_power2(num):
'checks if a number is a power of two'
return num != 0 and ((num & (num - 1)) == 0)
def fortran_reshape(x, shape, batch=True):
if batch:
return x.permute([0] + list(np.arange(1, len(x.shape))[::-1]))\
... | prs-eth/c-pic | utils/shape.py | shape.py | py | 4,630 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "numpy.arange",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_numbe... |
26484206776 | import unittest
import tempfile
import numpy
import os
from osgeo import gdal, ogr
from gdalhelpers.classes.DEM import DEM
from gdalhelpers.helpers import layer_helpers
RASTER_PATH = os.path.join(os.path.dirname(__file__), "..", "test_data", "dsm.tif")
POINTS_PATH = os.path.join(os.path.dirname(__file__), "..", "test_... | JanCaha/gdalhelpers | tests/classes/test_DEM.py | test_DEM.py | py | 4,627 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
195011804 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from collections import OrderedDict
from .. import backend as K
from ..layers.core import Layer, Merge, Siamese, SiameseHead
from six.moves import range
class Sequential(Layer):
'''
Simple linear stack of... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/mynameisfiber@keras/keras/layers/containers.py | containers.py | py | 16,375 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "layers.core.Layer",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "layers.core",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "six.moves.range",
"line_number": 130,
"usage_type": "call"
},
{
"api_name": "layers.core.Layer",
... |
36816273599 | from django.shortcuts import render
from django.http import HttpResponse
from json import dumps
from django.forms.models import model_to_dict
from models1.models import User
from django.core import serializers
from django.views.decorators.csrf import csrf_exempt
# Create your views here.
def get_user(request):
res... | rheno/Django-CRUID-to-JSON | models1/views.py | views.py | py | 3,682 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models1.models.User.objects.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models1.models.User.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "models1.models.User",
"line_number": 17,
"usage_type": "name"
},
{
... |
70270372835 | from django.apps import apps as django_apps
class RequisitionPanelError(Exception):
pass
class RequisitionPanelModelError(Exception):
pass
class InvalidProcessingProfile(Exception):
pass
class Names:
def __init__(self, name=None, alpha_code=None):
self.abbreviation = f'{name[0:2]}{name[... | botswana-harvard/edc-lab | edc_lab/lab/requisition_panel.py | requisition_panel.py | py | 3,490 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.apps.apps.get_model",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "django.apps.apps",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "django.apps.apps.get_model",
"line_number": 88,
"usage_type": "call"
},
{
"api_name":... |
27662251925 | # coding: utf-8
import re
from utils import url2filetype
from .base import BaseParser
__all__ = [
'PagesParser',
]
class PagesParser(BaseParser):
def parse(self):
file_type = url2filetype(self.article.url)
if not file_type:
return {'urls':[]}
pages = set([self.article.url])
prefix = self.article.url[:-... | endsh/haoku-open | kread/read/html/article1/pages.py | pages.py | py | 792 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "base.BaseParser",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "utils.url2filetype",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 19,
"usage_type": "call"
}
] |
16004047484 | # /nlp/preprocess.py
import nltk
import sys
import os
lib_directory = os.path.dirname(__file__)
print(lib_directory)
nltk.data.path.append(lib_directory + "/lib/corpora/")
# from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
import re
import numpy as np
import sys
INVALID_STRING = 'Er... | text-ninja/text-ninja | nlp/preprocess.py | preprocess.py | py | 2,918 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "nltk.data.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "nltk.data",
"line... |
31512597056 | def image_parse(match, model):
try:
image = model.image_set.get(shortuuid=match.group('shortuuid'))
except model.image_set.model.DoesNotExist:
image = None
return image
def image_sub(content, repl):
import re
IMAGE_RE = r'\[image (?P<shortuuid>[a-z\d]+)\]'
return re.sub(IMAG... | megaprojectske/megaprojects.co.ke-archive | megaprojects/core/utils.py | utils.py | py | 1,537 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.sub",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 27,
"usage_type": "call"
}
] |
20390686972 | import random
import numpy as np
import torch
from torch.backends import cudnn
# Random seed to maintain reproducible results
random.seed(0)
torch.manual_seed(0)
np.random.seed(0)
# Use GPU for training by default
device = torch.device("cuda") if torch.cuda.is_available() else "cpu"
# Turning on when the image size d... | HeGuannan-duludulu/IRSRGAN | irsrgan_config.py | irsrgan_config.py | py | 2,789 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
29668671915 | """
Knowledge-based Decision Support Systems
Natural Language Processing Basics 1
"""
from nltk import tokenize
from nltk import tag
from nltk import chunk
from nltk.stem import PorterStemmer, WordNetLemmatizer
from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.corpus import stopwords
from nltk imp... | tschibu/hslu-kbds-exercises | SW03_Natural_Language_Processing_Basics_1/NLP.py | NLP.py | py | 4,058 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.tokenize.sent_tokenize",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "nltk.tokenize",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "nltk.tokenize.word_tokenize",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": ... |
671095898 | from keras.models import Model
from keras.optimizers import SGD,Adam
from keras.layers import Input, Dense, Dropout, Flatten
from keras.layers.convolutional import Convolution1D, MaxPooling1D
def model(filter_kernels, dense_outputs, maxlen, vocab_size, nb_filter, mode='1mse', cat_output=1, optimizer='adam'):
prin... | snikolenko/char-level | crepe/py_crepe.py | py_crepe.py | py | 2,977 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.layers.Input",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.layers.convolutional.Convolution1D",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "keras.layers.convolutional.MaxPooling1D",
"line_number": 16,
"usage_type": "c... |
20380333160 | import time
import logging
import argparse
import curses
import operator
import numpy
from cv2 import VideoCapture
from networktables import NetworkTables
from grip import GripPipeline
URL = 'http://raspberrypi.local:1180/?action=stream'
TEAM_NUMBER = 3863
NT_SERVER = 'roboRIO-%s-FRC.local' % (TEAM_NUMBER)
NT_TABLE_N... | Pantherbotics/RobotVision | main.py | main.py | py | 5,224 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "networktables.NetworkTables.setTeam",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "networktables.NetworkTables",
"line_number": 31,
"usage_type": "name"
},
{
... |
1589566811 | """database_migrations
Revision ID: a7e31f3a9fe3
Revises:
Create Date: 2023-01-27 00:27:04.392742
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a7e31f3a9fe3'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands aut... | MbxrAteeq/ToDo-App | alembic/versions/a7e31f3a9fe3_database_migrations.py | a7e31f3a9fe3_database_migrations.py | py | 2,212 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
23807172670 | from django.http import JsonResponse
from django.shortcuts import render
# Create your views here.
from cart.models import ShoppingCart
from goods.models import Goods
def add_cart(request):
if request.method == 'POST':
# 接受商品和数量和价格
# 组装成存储商品的格式[goods_id,num,is_select]
# 组装多个商品... | lorrybz/fresh_shop_everyday | fresh_shop/cart/views.py | views.py | py | 6,155 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "goods.models",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "goods.... |
30643387941 | from .verificationError import *
from snappy.snap import t3mlite as t3m
from sage.all import vector, matrix, prod, exp, RealDoubleField, sqrt
import sage.all
__all__ = ['HyperbolicStructure']
class HyperbolicStructure:
def __init__(self, mcomplex, edge_lengths,
exact_edges = None, var_edges = N... | ekim1919/SnapPy | dev/vericlosed/hyperbolicStructure.py | hyperbolicStructure.py | py | 10,619 | python | en | code | null | github-code | 1 | [
{
"api_name": "snappy.snap.t3mlite.ZeroSubsimplices",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "snappy.snap.t3mlite",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "sage.all.matrix",
"line_number": 54,
"usage_type": "call"
},
{
"api... |
40010355396 | # Given a reference of a node in a connected undirected graph.
# Return a deep copy (clone) of the graph.
import collections
class Node:
def __init__(self, val = 0, neighbors = None):
self.val = val
self.neighbors = neighbors if neighbors is not None else []
def cloneGraph(node):
if not node:
... | wyy1234567/leetcode_problems | graph.py | graph.py | py | 725 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
30546496925 | '''The script will implement a Bloom filter.
Bloom filter will be loaded with values from rockyou.txt.
The software will automate the testing of values in test.txt.
The software will calculate and display statistics on true positive, true negative, false positive, and false negative for the test.txt based on the rockyo... | saminoorsyed/cyber_security | week3/programmingProject2/bloom_filter.py | bloom_filter.py | py | 7,989 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "array.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "hashlib.new",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 149,
"usage_type": "call"
}
] |
18420474569 | from cv2 import cv2
from pyzbar.pyzbar import decode
import time
cap = cv2.VideoCapture(0)
received_data = []
time_start = time.time()
while True:
_, frame = cap.read()
time_now = time.time()
if time_now > time_start+60:
if received_data == []:
break
time_st... | tirodkar79/QR-Scanner | qr_scanner.py | qr_scanner.py | py | 665 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cv2",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 11... |
43165897458 | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 2 20:45:19 2021
@author: ankon
"""
#%%Importing modules and the data
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from kneed import KneeLocator
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
from... | Ankon1708/TSFTask-2 | Task-2 Program.py | Task-2 Program.py | py | 3,003 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 48,
"usage_type": "call"
},
{
"api_n... |
15894564483 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# file: ppc_eprv3.py
# Dependencies
from model_rvrd_kepler import lnlike, lnprior, preprocess
import config
import numpy as np
import time
import datetime
import argparse
import pickle
import subprocess
import pdb
import os
# PolyChord imports
import PyPolyChord as PPC
fr... | nicochunger/RV_NestedSampling | src/real_data/ppc_harps.py | ppc_harps.py | py | 6,138 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "resource.setrlimit",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "resource.RLIMIT_STACK",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "resource.RLIM_INFINITY",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_nam... |
192978086 | import asyncio
from unittest.mock import patch, MagicMock
import pytest
from httpx import AsyncClient
from tests.data_test import Activate, ItemData
class TestItems:
ITEM_DATA = ItemData.DATA_LIST
ACTIVATE_DATA = Activate.DATA_LIST
@patch('app.routers.items.orders')
@patch('app.routers.items.databas... | Vadim-AM/Async_tests | tests/v1/test_items.py | test_items.py | py | 2,640 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tests.data_test.ItemData.DATA_LIST",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tests.data_test.ItemData",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tests.data_test.Activate.DATA_LIST",
"line_number": 11,
"usage_type": "a... |
6811634399 | import numpy as np
from utils.homography import RansacModel, make_homog, H_from_ransac
class Match(object):
def __init__(self, detector, img_left, img_right):
self.img_left = img_left
self.img_right = img_right
self.img_shape = img_left.shape
self.detector = detector
sel... | PonsletV/Structure-from-motion | Descriptors/matching.py | matching.py | py | 3,221 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "utils.homography.RansacModel",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "utils.homography.make_homog",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 96,
"usage_type": "call"
},
{
"api_name... |
19399647925 | from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QTextEdit
class Editor(QTextEdit):
def __init__(self, file, parent=None):
super(Editor, self).__init__(parent)
self.file = file
self.setReadOnly(True)
text = open(self.file).read()
self.setText(text)
layout_... | ovidiupop/drive_indexer | mymodules/EditorWidget.py | EditorWidget.py | py | 445 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QTextEdit",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QHBoxLayout",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 14,
"usage_type": "name"
}
] |
8266803345 | from PIL import Image
import dither
img = Image.open("kittensmall.png")
dither.floydDither(img,((0,0,0),(255,255,255)))
w = img.width
h = img.height
w += (w%2)
if h%3 != 0: h += (3-h%3)
print(w,h)
nimg = Image.new('RGB',(w,h),color=(255,255,255))
nimg.paste(img)
img = nimg.copy()
del nimg
grid = ... | matcool/random-scripts | imgtobraille.py | imgtobraille.py | py | 1,036 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "dither.floydDither",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
"line_nu... |
18772000988 | import json
from wsgiref.simple_server import make_server
import json
def home_view():
with open('wsgi/tmp.json', 'r', encoding='utf-8') as json_data:
data = json_data.read()
parsed_data = json.loads(data)
print(parsed_data)
text = json.dumps(parsed_data)
print(text)
... | MyodsOnline/python_files | Work/kuznecov_a/Lessons/server.py | server.py | py | 1,295 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "wsgiref.simple_server.make_server",
"line_number": 58,
"usage_type": "call"
}
] |
74830227553 | import os
import cv2
import torch
from nets.model import Model
from nets.yoloModel import YoloModel
from nets.yolo_loss import YOLOLoss
from utils import non_max_suppression
import numpy as np
os.environ["CUDA_VISIBLE_DEVICES"] = '0'
batch_size = 1
w, h = (416, 416)
# w, h = (640, 640)
anchors = [[10, 13], [16, 30], [... | lin001126/Hand-written-yolov3 | test.py | test.py | py | 4,234 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "nets.yoloMode... |
31469791084 | from collections import deque,defaultdict
import heapq
class Graph:
def __init__(self,V):
self.graph = defaultdict(set)
self.V = V
def add_edge(self,u,v,weight=1,directed = True):
self.graph[u].add((v,weight))
if not directed:
self.graph[v].add((u,weight))
def bfs(self,start):
visited = [False for _ i... | Ravi-Maurya/Competitive_Programming | Basics/Graph.py | Graph.py | py | 2,430 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "heapq.heap... |
30146488541 | #!/usr/bin/env python
# -*- coding: utf-8 *-*
import enum
import inspect
class Direction(enum.IntEnum):
NONE = 5
NW = 1
N = 2
NE = 3
E = 6
SE = 9
S = 8
SW = 7
W = 4
def dist_steps(pos1, pos2):
(x1, y1) = pos1
(x2, y2) = pos2
return max(abs(x1 - x2), abs(y1 - y2))
def which_way(pos, goal):
(x, y) = p... | r41d/pyants | ai.py | ai.py | py | 5,658 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.IntEnum",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "inspect.stack",
"line_number": 142,
"usage_type": "call"
},
{
"api_name": "inspect.stack",
"line_number": 149,
"usage_type": "call"
},
{
"api_name": "inspect.stack",
"l... |
11749355278 | from kivy.app import App
from kivy.core.window import Window
from kivy.uix.screenmanager import Screen, SlideTransition
class Options(Screen):
def detect(self):
Window.size=(800,600)
print("Emotion Detection")
self.manager.transition = SlideTransition(direction="right")
self.... | lordbeerus0505/EmotionDetection | Options.py | Options.py | py | 768 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "kivy.uix.screenmanager.Screen",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "kivy.core.window.Window.size",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "kivy.core.window.Window",
"line_number": 8,
"usage_type": "name"
},
{
... |
16558036935 | # https://www.hackerrank.com/contests/kakao-adtech-devday-1st-codejam/challenges/2022-12
# Solved Date: 22.04.14.
import sys
from collections import Counter
read = sys.stdin.readline
def calc_value(bid_floor, prices):
sum_price = 0
for price in prices:
if price < bid_floor:
continue
... | imn00133/algorithm | kakaoJam/3.optimize_bidfloor.py | 3.optimize_bidfloor.py | py | 1,129 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "collections.Counter",
"line_number": 31,
"usage_type": "call"
}
] |
11140863904 | import pytest
from flask import Flask
from flask.testing import FlaskClient
from unittest.mock import patch
from app import app
@pytest.fixture
def client() -> FlaskClient:
app.config["TESTING"] = True
with app.test_client() as client:
yield client
def test_chatbot(client: FlaskClient):
with patc... | TemitayoAfolabi/ChatBot | test.py | test.py | py | 1,050 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "app.app.config",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.app",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "app.app.test_client",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_n... |
6846867931 | # -*- encoding: utf-8 -*-
import cv2
import numpy as np
import scipy.interpolate
class Histogram1D :
def __init__(self) :
self.histSize = [256,]
self.hranges = [0.0, 256.0]
self.ranges = self.hranges
self.channels = list(range(1))
def getHistogram(self, image) :
if i... | tulare/smile-in-the-light | processors/utils.py | utils.py | py | 4,868 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.cvtColor",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cv2.calcHist",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
... |
42467786060 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import base64
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pandas as pd
import numpy as np
from datetime import datetime
from elasticsearch import Elasticsearch
from PIL import Image
from io import BytesIO
# In[2]:
es = Elasticsearch([{'ho... | cristianpazos9/Cristian_Manex_Reto07 | indexar_imagenes_reconocimiento.py | indexar_imagenes_reconocimiento.py | py | 4,345 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "PIL.Im... |
14965145273 | """my_controller_001 controller."""
# You may need to import some classes of the controller module. Ex:
# from controller import Robot, Motor, DistanceSensor
from deepbots.supervisor.controllers.robot_supervisor import RobotSupervisor
from utilities import normalizeToRange, plotData
from PPO_agent import PPOAgent, Tr... | LuranWang/hexapod-robot | my_controller_001.py | my_controller_001.py | py | 6,067 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "deepbots.supervisor.controllers.robot_supervisor.RobotSupervisor",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "gym.spaces.Box",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
}... |
71730049634 | from decimal import Decimal, InvalidOperation
from math import isinf
from pathlib import Path
from hyprfire_app.exceptions import TimestampException
MAX_TIMESTAMP = 32503680000
def validate_file_path(file_path):
"""
validate_file_path
A file path is valid if it points to an existing file
Parameter... | kshannoninnes/hyprfire | hyprfire_app/utils/validation.py | validation.py | py | 1,558 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "decimal.InvalidOperation",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "hyprfire_app.ex... |
30107513035 | from django.contrib import admin
from django.utils.html import format_html
from Bot.bot import bot
from Bot.models import TelegramUser
from WalletTransition.WalletRequest import cancel_buy_transition, cancel_sell_transition
from SiteSetting.SiteSettingRequest import point_fee
from WalletTransition.models import Transi... | MasoudHeidary/django-telegram-bot-trade | Point/admin.py | admin.py | py | 5,665 | python | fa | code | 0 | github-code | 1 | [
{
"api_name": "models.Point",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "Bot.bot.bot.deleteMessage",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "Bot.bot.bot",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "Bot.bot.bot.sendMe... |
5089361721 | import cv2
from PIL import Image
import easyocr
import numpy as np
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import aiocv
import matplotlib.pyplot as plt
# creating list
# creating numpy array
# path=_file_.split("\\")
# path.append("haarcascades")
# path=... | monalisa22/Smart_Pillars | ANPR.py | ANPR.py | py | 1,922 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line... |
31104160827 | import sys
import subprocess
import time
from datetime import timedelta
def run_blastx(dna_reads_path, protein_db_path, output_path, time_log_path):
"""
Run BLASTx to align DNA reads to a protein database and record the execution time.
Parameters:
dna_reads_path (str): Path to the DNA reads file.
... | khe9370/Computational_Genomics_Final_Project | simple_diamond/blastx.py | blastx.py | py | 1,637 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.monotonic",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.monotonic",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
... |
29865512662 | import torch
import tensorflow
from pytorch_pretrained_bert import BertTokenizer, BertModel, BertForMaskedLM
import os
import wget
import pandas as pd
from transformers import BertTokenizer
from sklearn.model_selection import train_test_split
# If there's a GPU available...
if torch.cuda.is_available():
# Tell... | joeljang/haaforchallenge2019 | evaluate.py | evaluate.py | py | 2,382 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda.devic... |
1646893490 | import asyncio
import os
import shutil
from typing import Dict, FrozenSet, List
from uuid import UUID
from ai.backend.common.types import BinarySize
from ai.backend.storage.abc import CAP_QUOTA, CAP_VFOLDER
from ..exception import ExecutionError
from ..types import FSUsage, Optional, VFolderCreationOptions
from ..vfs... | grosa1/backend.ai | src/ai/backend/storage/cephfs/__init__.py | __init__.py | py | 3,348 | python | en | code | null | github-code | 1 | [
{
"api_name": "asyncio.create_subprocess_shell",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "asyncio.subprocess",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "exception.ExecutionError",
"line_number": 21,
"usage_type": "call"
},
{
"... |
19136450354 | from bs4 import BeautifulSoup as BS
import re
from requests import get
def soupify_url(url):
request = request_url(url)
return BS(request.text,'html.parser')
def request_url_text(url):
return request_url(url).text
def request_url(url):
return get(url, timeout=60.0)
def json_url(url):
request = r... | patsmad/BMTTools | utils/url_tools.py | url_tools.py | py | 1,807 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 39,
"usage_type": "call"
}
] |
73771882595 | import os
import json
class CompitiObject:
"""
descrizione obj compiti
"datGiorno", "desMateria", "done", "desCompiti, "datCompiti", "id"
"""
daTenere=["datGiorno" ,"desMateria", "desCompiti" ,"datCompiti", "id"]
def __init__(self,fs,fh):
self.fs=fs
self.fh=fh
content=... | giospada/ScaricaCompiti | src/CompitiObject.py | CompitiObject.py | py | 916 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 33,
"usage_type": "call"
}
] |
34504178164 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
date = pd.read_csv('Distance.txt')
cabeza = date.columns.tolist()
head=int(cabeza[0])
plt.hist(datos, bins=10, edgecolor='black')
y= datos.max().max()
plt.xlim(0, y+0.01)
print(datos.max().max())
plt.xlabel('Valores')
plt.ylabel('Frecuencia')
plt... | ALdoMartineCh16/La_maldicion_de_la_dimensionalidad | histograma.py | histograma.py | py | 407 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
17610685125 | import pandas as pd
import numpy as np
from sklearn.metrics import f1_score
import matplotlib.pyplot as plt
from sklearn.model_selection import cross_validate,KFold
import path
from typing import Callable
DATA_DIR=path.Path("../data/")
ARTIFACT_DIR=path.Path("../artifacts/")
def evaluate(y_test,pred):
return f1_sc... | rajagurunath/avp_loan | scripts/evaluate.py | evaluate.py | py | 1,152 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "path.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "path.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.f1_score",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"l... |
1585741629 | from typing import Optional
from decimal import Decimal
from validator_collection import validators
from highcharts_core.metaclasses import HighchartsMeta
class LinkOptions(HighchartsMeta):
"""Link style options."""
def __init__(self, **kwargs):
self._color = None
self._dash_style = None
... | highcharts-for-python/highcharts-core | highcharts_core/options/plot_options/link.py | link.py | py | 2,114 | python | en | code | 40 | github-code | 1 | [
{
"api_name": "highcharts_core.metaclasses.HighchartsMeta",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "validator_collection.validators.string",
"line_number": 31,
"usage_type": "call... |
4759169692 | import asyncio, time
from bleak import BleakClient
import config
globalData = bytearray()
globalDataLen = 0
# Called by COM notification
def callback(sender, data):
global globalData
global globalDataLen
# Did notification come from the right handle?
if sender == config.COM_CHAR_HANDLE:
... | Balu3142/playbrush | dataReader.py | dataReader.py | py | 3,309 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "config.COM_CHAR_HANDLE",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "config.COM_CHAR_HANDLE",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "config.COM_CHAR_HANDLE",
"line_number": 43,
"usage_type": "attribute"
},
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.