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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35414759397 | from image_quality_assessment import MSE, PSNR, SSIM, LPIPS_Score
import os
import csv
from PIL import Image
from utils import build_iqa_model
import torchvision.transforms as T
def save_metrics(hr, sr, psnr_model, ssim_model, lpips_model, device):
hr_tensor = T.ToTensor()(hr)
sr_tensor = T.ToTensor()(sr)
... | kimjy-st/AdaptiveSRGAN | github/save_metrics.py | save_metrics.py | py | 3,030 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 10,
"usage_type": "call"
},
{
... |
36262588213 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 7 21:37:25 2022
@author: Han
"""
import torch
import numpy as np
import pandas as pd
import warnings
import time
from utils import mapping, normalization
from ATCNN_model import ATCNN, switch, to_binary, ATCNN_9LiFi
warnings.filterwarnings("ignore")
# t... | HanJi-UCD/ATCNN | ATCNN_acc_test.py | ATCNN_acc_test.py | py | 6,470 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
... |
29317981995 | import matplotlib.pyplot as plt
xlabels = ['64', '128', '256', '512', '1024', '2048', '4096']
x = range(len(xlabels))
y = [0.0679, 0.0766, 0.0786, 0.0793, 0.0788, 0.076, 0.0688]
y1 = [0.0220, 0.02654, 0.02707, 0.02747, 0.02729, 0.02709, 0.0229]
coefficients = np.polyfit(x, y, 2) # 2表示2次项拟合
p = np.poly1d(coefficients... | Lisennlp/paxml_praxis | paxml/my_scripts/plot_example.py | plot_example.py | py | 1,344 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.annotate",
"line_number": 29,
"usage_type": "call"
},
{
"api_name"... |
7015619706 | import re
from mock import Mock, patch
from nose.tools import assert_equal
from nose.tools import assert_is_instance
from unittest import TestCase
from flask import request
from twilio import twiml
from strowger import switch
TEST_TWILIO_REQUEST_DATA = {
'From': '+14155551234',
'To': '+14158675309',
'Num... | skimbrel/strowger | tests/test_switch.py | test_switch.py | py | 4,458 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "mock.patch",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "mock.patch",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mock.Mock",
"line_number"... |
2011552662 | import datetime
import requests
from io import BytesIO
from PIL import Image, ImageEnhance
import discord
from discord.ext import commands
from lynxie.config import IMAGE_EXTENSIONS, IMAGE_OVERLAYS
from lynxie.utils import error_message
class Img(commands.Cog):
def __init__(self, bot):
self.bot = bot
... | Fluffy-Bean/Lynxie | Bot/lynxie/commands/image.py | image.py | py | 9,728 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "discord.Attachment",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_na... |
5306291392 | import urllib.parse
import requests
main_api = "https://www.mapquestapi.com/directions/v2/route?"
orig = "Rome, Italy"
dest = "Frascati, Italy"
key = "8qyd7dX1sai7AoMT2RmrXALq5a2T5u2a" #your own key
url = main_api + urllib.parse.urlencode({"key":key, "from":orig, "to":dest})
json_data = requests.get(url).json()
prin... | BenjamssOdisee/Devnet-Skills-2022-2023 | labs/devnet-src/mapquest/mapquest_parse-json_1.py | mapquest_parse-json_1.py | py | 334 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib.parse.parse.urlencode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "urllib.parse",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "reques... |
71823933475 | import re
from functools import reduce
from enum import Enum
class Error_ID(Enum):
OK = 0
ERR_EMPTY_INPUT = 1
ERR_INVALID_COMMAND = 2
ERR_INVALID_DOC_INDEX = 3
ERR_NO_DOC_ID = 4
ERR_NO_TOKENS = 5
ERR_KEY_NOT_FOUND_IN_DB = 6
ERR_DB_ENTRY = 7
ERR_TOKENS_NON_ALPHA = 8
ERR_EMPTY_DB = 9
ERR_NO_EXP = 1... | NAVEENMN/PersonalArchives | simple_sengine/utils.py | utils.py | py | 4,799 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "functools.reduce",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 150,
"usage_type": "call"
}
] |
28135008759 | from datetime import datetime
from mitmproxy.flow import Flow
class Intercept(object):
def __init__(self, flow: Flow, connection) -> None:
self.flow = flow
self.connection = connection
self.updated_at = datetime.now()
self.session_id = None
self.user_id = None
self.m... | tarnacious/debugproxy | proxyserver/intercept.py | intercept.py | py | 511 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "mitmproxy.flow.Flow",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.dat... |
42631149842 | import time
from threading import Thread
from tkinter import *
from PIL import Image,ImageTk
import cv2
class LiveCameraWindow(Frame):
def __init__(self, camera, parent):
self.lmain = None
self.window = None
self.parent = parent
self.camera = camera
self.test_frame = None
... | TIS2022-FMFI/spektroskop-mikroskop | gui_widgets/LiveCameraWindow.py | LiveCameraWindow.py | py | 1,654 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "cv2.cvtColor",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
... |
25695942727 | import os
import cv2
import numpy as np
import imutils
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
DATA = 'task-2'
BASE_FRAME = 'frame_0.jpg'
HSVLOW = tuple([17, 34, 146])
HSVHIGH = tuple([51, 217, 226])
area = []
table_centers = []
table_rectangles = []
counter_dict... | prasadsawant5/person-counter | main.py | main.py | py | 4,480 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.circle",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
... |
20910717859 | # -*- coding: utf-8 -*-
# DISCLAIMER
# This code file is forked and adapted from https://github.com/hwwang55/DKN/blob/master/src/main.py
#import libraries
import argparse
import numpy as np
# import custom code
from src.dkn_data_loader import load_data
from src.dkn import train, evaluate
from src.util.logger import... | andreeaiana/geneg_benchmarking | src/run_dkn.py | run_dkn.py | py | 1,767 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "src.util.logger.setup_logging",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "arg... |
27488738949 | import os
import json
import random
SPLIT_FILES = {
# 'train': ['train_data_1_train.json', 'train_data_2_train.json', 'train_data_3_train.json',
# 'train_data_4_train.json', 'train_data_5_train.json', 'train_data_6_train.json'],
# 'val': ['val_data_val.json'],
'test5': ['test_data_5_test.js... | FJsRepo/InfML-HDD | lib/datasets/HorizonSet.py | HorizonSet.py | py | 2,793 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
2990352123 | import numpy as np , pandas as pd
import csv
from math import sqrt
import sklearn.linear_model as lm
from sklearn.model_selection import KFold
from sklearn.metrics import mean_squared_error
#init
lamda_ = [.01, .1 , 1 , 10, 100]
RMSE = np.zeros(5)
data = pd.read_csv("train.csv").set_index("Id")
X = np.arra... | rafisondi/CourseProjects | Introduction to Machine Learning/Task 1/Task_1a/Task_1a.py | Task_1a.py | py | 994 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_... |
17407307596 | # -*- coding: utf-8 -*-
# Adam Thompson 2018
import yaml
import os
class ConfigReader:
def __init__(self, job_path):
"""Initialize configReader class with a path to the root of the job"""
self.job_path = job_path
self.ymlFileName = "config.yml"
self.configPath = os.path.join(self.job_path, self.ymlFileName)... | akoeste3dpu/projectLauncher | ConfigReader.py | ConfigReader.py | py | 3,199 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "yaml.safe_load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_n... |
40888234114 | import re
import sys
import string
from collections import Counter
punctuation_regex = re.compile("[" + re.escape(string.punctuation) + "]")
def extract_words(line):
no_punctuation = re.sub(punctuation_regex, "\n", line)
lowered = no_punctuation.lower()
return lowered.split()
def main():
counter = Counter()... | Mequrel/pjn | lab1/python.py | python.py | py | 577 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.escape",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "string.punctuation",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number":... |
19877897744 | import numpy as np
from random import random,randint,choice,uniform,shuffle,randrange
from operator import itemgetter
from collections import deque
def gnp(n,p):
a=[[0 for i in range(n)] for j in range(n)]
for i in range(1,n):
for j in range(i):
if(random()<=p):
a[... | plaskod/ok | Evocol/tabu.py | tabu.py | py | 6,584 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.random",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "random.randrange",
... |
38941150416 | import abc
from typing import (
Callable,
TypeVar,
Any,
NamedTuple,
Optional,
Union,
Set,
List,
Dict,
Type,
Tuple,
)
from livestatus import SiteId
from marshmallow import Schema # type: ignore[import]
from marshmallow.fields import ( # type: ignore[import]
List as MLis... | superbjorn09/checkmk | cmk/utils/bi/bi_lib.py | bi_lib.py | py | 15,623 | python | en | code | null | github-code | 1 | [
{
"api_name": "functools.partial",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "marshmallow.fields.List",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "functools.partial",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "marsh... |
41283279538 | from hypothesis import given
from hypothesis.strategies import lists, builds
from cim.collection_validator import validate_collection_unordered
from cim.iec61970.base.core.test_identified_object import identified_object_kwargs, verify_identified_object_constructor_default, \
verify_identified_object_constructor_kw... | zepben/evolve-sdk-python | test/cim/iec61970/base/core/test_sub_geographical_region.py | test_sub_geographical_region.py | py | 2,324 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "cim.iec61970.base.core.test_identified_object.identified_object_kwargs",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "hypothesis.strategies.builds",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "zepben.evolve.GeographicalRegion",
"line_... |
36368439793 | import json
import datetime
import matplotlib.pyplot as plt
import pytz
with open('/Users/decarlo/conda/steelyards/camera_garage.jsonl', 'r') as json_file:
json_list = list(json_file)
car_list = []
person_list = []
bike_list = []
t_list = []
tp_list = []
tb_list = []
for json_str in json_list:
result = js... | decarlof/steelyards | garage/garage.py | garage.py | py | 1,473 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "pyt... |
26663471242 | # pyright: reportMissingImports=false
import time
from threading import Thread
import numpy as np
import logging
import traceback
import ms5837
import os
import shlex # TODO pip3 install this if not default
import re
from datetime import datetime, timezone
logging.basicConfig(level=logging.DEBUG, filename="/home/pi/dat... | noahaosman/MeltStake | Operations.py | Operations.py | py | 12,508 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.sign",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"l... |
34837455714 | import argparse
import logging
import hashlib
import nltk
from nltk.corpus import stopwords
logging.basicConfig(level=logging.INFO)
from urllib.parse import urlparse
import pandas as pd
logger = logging.getLogger(__name__)
def main(filename):
logger.info('Starting cleanig process')
df = _read_data(filename)
... | crizleo/proceso_de_ETL | transform/news_paper_recipe.py | news_paper_recipe.py | py | 3,674 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
7572142954 | import logging
logging.basicConfig(level=logging.INFO, format='%(message)s')
def addition(x, y):
logging.info(f"Dodaję {x} i {y}")
return x + y
def subtraction(x, y):
logging.info(f"Odejmuję {y} od {x}")
return x - y
def multiplication(x, y):
logging.info(f"Mnożę {x} razy {y}")
return x *... | qrnik/Kodilla | 4.4zad_improved.py | 4.4zad_improved.py | py | 1,240 | python | pl | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.info",
"l... |
1039238635 | from torch import cuda
USE_CUDA = cuda.is_available()
LOAD_IMAGES_TO_MEMORY = False
# Files
CAPTIONS_DIR = '../data/coco/annotations/captions_{}2014.json'
KARPATHY_SPLIT_DIR = '../data/karpathy_splits/karpathy_{}_images.txt'
FEATURES_DIR = '../data/features/extracts/{}.npy'
CAPTION_VECTORS_DIR = '../data/caption_vecto... | chipbautista/295-deeprl-captioning | settings.py | settings.py | py | 1,419 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 2,
"usage_type": "name"
}
] |
32005544758 | import logging
import requests
import pandas as pd
from datetime import date
from datetime import datetime
def main():
logging.basicConfig(filename='app.log', filemode='a', format='%(asctime)s - %(message)s', level=logging.INFO)
df = pd.DataFrame(
columns=['district', 'city', 'county', 'instructional... | trackman1111/School-Opening-Scraper | illinois.py | illinois.py | py | 2,116 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",... |
24376449211 | #!/usr/bin/env python
# coding: utf-8
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from torch.utils.data import DataLoader
from torch.nn import Sequential, Conv2d,MaxPool2d,Flatten,Linear
import torchvision
import cv2... | faiimea/WDAD | PRP_demo/net/ty3.py | ty3.py | py | 8,545 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 30,
"usage_type": "call"
},
{
... |
1816097182 | # See readme.md for instructions on running this code.
import random
from typing import Any, Dict, List
from zulip_bots.lib import BotHandler, use_storage
class CodeExquisHandler:
def initialize(self, bot_handler: BotHandler) -> None:
storage = bot_handler.storage
if not storage.contains("line... | eviau/code-exquis | code_exquis.py | code_exquis.py | py | 7,354 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "zulip_bots.lib.BotHandler",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "zulip_bots.lib.BotHandler",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "typin... |
33516111574 | import json
from django.http import JsonResponse
from django.views import View
from django.db.models import Avg
from homes.models import Home
from users.models import User
from bookmarks.models import BookMark
from users.utils import ConfirmLogin
class BookmarkView(View):
@Co... | wecode-bootcamp-korea/15-2nd-CodeBnB-backend | bookmarks/views.py | views.py | py | 3,575 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.View",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "users.models.User.objects.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "users.models.User.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"ap... |
45645092924 | from celery import states
from celery.task import Task
from celery.exceptions import Ignore
from vigil.celery import app
class LambdaBotInsufficientFundsTask(Task):
"""
Pre-process data from Lambda Bot when reporting
insufficient funds to place total walls
"""
expected_data = {
'exchange'... | inuitwallet/vigil | vigil/tasks/preprocessors/lambdabot_insufficient_funds.py | lambdabot_insufficient_funds.py | py | 1,859 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "celery.task.Task",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "celery.states.FAILURE",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "celery.states",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "celery.excep... |
4533876898 | #references : https://youtu.be/pp61TbhJOTg
#ieee paper link : https://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=brain+tumor+detection&oq=brain+#d=gs_qabs&u=%23p%3DVe4XM0A9CzEJ
import os
import cv2
import tensorflow as tf
from tensorflow import keras
from PIL import Image
import numpy as np
import pandas a... | oskorp/_detANNFL_Brain_tumor | main.py | main.py | py | 4,050 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 27... |
17566582575 |
from rest_framework.test import APIClient
# import status_code
from rest_framework import status
import pytest
from model_bakery import baker as Baker
from store.models import Collection ,Product ,Cart
# THIS FIXTURE IS SPECIFIC TO THIS TEST FILE
# RETURN THE API CALL FUNCTION
@pytest.fixture
# we cant not take param... | md-armaan13/storefront | store/tests/test_products.py | test_products.py | py | 2,806 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pytest.fixture",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.status.HTTP_401_UNAUTHORIZED",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.status",
"line_number": 35,
"usage_type": "name"
},... |
12121070236 | import matplotlib.pyplot as plt
import numpy as np
# Datenfile erzeugen
data_x = np.linspace(0, 10, 50)
data_y = 10 * np.exp(-data_x)
np.savetxt("3.txt", np.column_stack([data_x, data_y]), header="x y")
x, y = np.genfromtxt("3.txt", unpack=True)
fig, (ax1, ax2) = plt.subplots(1, 2, layout="constrained")
ax1.plot(x,... | pep-dortmund/toolbox-workshop | exercises-toolbox/3-matplotlib/3/loesung.py | loesung.py | py | 492 | python | en | code | 25 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.savetxt",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.column_stack",
"line_nu... |
11631638088 | import flask
import json
import os
import alsaaudio
import mpv
import threading
import requests
import signal
import subprocess
app = flask.Flask(__name__, static_folder = '../gui/build/', static_url_path="/")
if os.environ.get('PIRADIO_DEV') is not None:
from flask_cors import CORS
CORS(app)
conf = json.loa... | titulebolide/Juicebox | api/app.py | app.py | py | 4,193 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask_cors.CORS",
"lin... |
37848324292 | import os
import re
from difflib import SequenceMatcher, get_close_matches
from typing import Tuple, Union
import pandas as pd
_src_path = os.path.dirname(__file__)
_data = pd.read_feather(os.path.join(_src_path, "data/state.ft"))
_states = list(_data["State"])
_data = pd.read_feather(os.path.join(_src_path, "data/... | sonesuke/nayose | nayose/address.py | address.py | py | 2,875 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_feather",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"li... |
1084288061 | #!/usr/bin/env python3
# Requires python3 >= 3.4, and stress-ng to be installed.
import subprocess
import sys
from statistics import stdev, mean
def measure():
time_seconds = float(str(subprocess.check_output("stress-ng -c2 --cpu-method ackermann --cpu-ops 10 | grep -o '[0-9][0-9\.]*s'", shell=True), encoding="utf... | nh2/linux-bad-core-scheduling-investigation | test.py | test.py | py | 645 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "subprocess.check_output",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "statistics.stdev",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.exit",
... |
41057279091 | import sys
import os
import shutil
import zipfile
from cx_Freeze import setup, Executable
APP_NAME = "MergeLogs"
# ビルドに含めるパッケージとモジュールを指定
packages = ['module']
includes = []
excludes = []
# 実行ファイルの設定
exe = Executable(
script='main.py', # 実行ファイルとなるスクリプト
targetName=(APP_NAME + '.exe'), # 出力ファイル名
base=Non... | pinfu-jp/MergeFilesByPython | setup.py | setup.py | py | 1,732 | python | ja | code | 2 | github-code | 1 | [
{
"api_name": "cx_Freeze.Executable",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.setup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
2359544342 | """Blackcap job POST route."""
from http import HTTPStatus
import json
from flask import make_response, request, Response
from pydantic import parse_obj_as, ValidationError
from sqlalchemy.exc import SQLAlchemyError
from blackcap.blocs.cluster import create_cluster
from blackcap.routes.cluster import cluster_bp
from... | EBI-Metagenomics/orchestra | blackcap/src/blackcap/routes/cluster/post.py | post.py | py | 2,203 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "blackcap.schemas.user.User",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pydantic.parse_obj_as",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "blackcap.schemas.api.cluster.post.ClusterPOSTRequest",
"line_number": 31,
"usage_type": ... |
20798577228 | """
File: logger.py
Modified by: Senthil Purushwalkam
Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514
Email: spurushw<at>andrew<dot>cmu<dot>edu
Github: https://github.com/senthilps8
Description:
"""
#import tensorflow as tf
from torch.autograd import Variable
import numpy as np
imp... | WeLoveKiraboshi/DeepTiltedDepthEstimation | utils/tb_logger.py | tb_logger.py | py | 5,043 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.makedirs",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number... |
31740308073 | import socket
import sys
import struct
import csv
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_PSS
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Hash import SHA256
# Sign message with private key
def sign_message(private_key, message):
h = SHA256.new(message)
signer = PKCS1_PSS.new(pr... | brdofparadise/SDM_project | Key-Distribution/test.py | test.py | py | 1,650 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Crypto.Hash.SHA256.new",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Crypto.Hash.SHA256",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "Crypto.Signature.PKCS1_PSS.new",
"line_number": 13,
"usage_type": "call"
},
{
"api_name... |
74631711073 |
#### Origin : https://www.topcoder.com/thrive/articles/web-crawler-in-python
import requests
import lxml
from bs4 import BeautifulSoup
from xlwt import *
url = "https://www.manchester.ac.uk/study/international/study-abroad-programmes/study-abroad/course-units/subject-list/"
headers = {
'User-Agent': 'Mozilla/5.0 ... | FreeX2020/Simple-Crawler | manchester - origin.py | manchester - origin.py | py | 1,126 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
}
] |
14472646619 | from datetime import datetime, timedelta
#Local imports
import dictionaries as D
import date_compute as Date
from markup import CC, exact_length, remove_chars
#Common objects
def_song_dict = D.default_song_dict #Dictionary for song data.
class Editable():
"""An abstract object that allows you to give it any ini... | Shaunticlair/Singsong | song_class.py | song_class.py | py | 13,195 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dictionaries.default_song_dict",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "date_compute.get_today",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "dictionaries.leveldict",
"line_number": 124,
"usage_type": "attribute"
},
... |
6604506908 | import os
import sys
import obonet
import numpy as np
import networkx as nx
from functools import reduce
from tempfile import gettempdir
from sklearn.preprocessing import MultiLabelBinarizer
from gensim.models.poincare import PoincareModel, PoincareKeyedVectors
go_graph = None
mfo, cco, bpo = None, None, None
dim... | yotamfr/prot2vec | src/python/geneontology.py | geneontology.py | py | 6,304 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "tempfile.gettempdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "obonet.read_obo",
... |
41440405122 | # 소가 길을 건너간 이유
'''
들어온 시간 순으로 정렬
queue에서 빨리 들어온 순으로 처리
가능한 케이스
아직 소가 입장하지 않았다면,
소가 입장하자마자 검사를 받을 수 있음
시간 = 소의 입장시간 + 검진에 걸리는 시간
소가 기다리는 상황이라면 (시간이 입장시간을 넘김 상황)
시간 = 시간 + 검진에 걸리는 시간
'''
from collections import deque
def solution(arr):
arr.sort()... | aszxvcb/TIL | BOJ/boj14469.py | boj14469.py | py | 938 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
}
] |
74540625312 | from ipywidgets import DOMWidget
from robotframework_interpreter import init_suite, execute, complete
from robotframework_interpreter.robot_version import ROBOT_MAJOR_VERSION
CELL1 = """\
*** Settings ***
Library Collections
"""
CELL2 = """\
*** Variables ***
${VARNAME} Hello
"""
CELL3 = """\
*** Keywords ***
... | jupyter-xeus/robotframework-interpreter | tests/test_interpreter.py | test_interpreter.py | py | 1,980 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "robotframework_interpreter.init_suite",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "robotframework_interpreter.execute",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "robotframework_interpreter.execute",
"line_number": 55,
"usage_t... |
4409617727 | """Plot graph out of given data."""
import matplotlib.pyplot as plt
def initGraph(x_axis, temperature, rainfall, title="Plot"):
"""Initialize graph to plot temperature and rainfall values."""
figure, temperature_axis = plt.subplots()
figure.canvas.set_window_title(title)
# axis for temperature data
... | rkleee/aragonit | weather/PlotGraph.py | PlotGraph.py | py | 1,104 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
}
] |
35021750476 | import requests
import json
from bs4 import BeautifulSoup as bs
import pandas as pd
from icalendar import Calendar, Event, vCalAddress, vText
import pytz
from datetime import date, datetime, timedelta
import os
from pathlib import Path
from dateutil.parser import parse
from dateutil import parser
from dateutil.relative... | amandakreider/Concert-Calendars | scripts/bowery.py | bowery.py | py | 4,033 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pytz.timezone",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "icalendar.Calendar",
... |
41541696976 | from django.conf.urls import url, include
from django.contrib import admin
from materias.views import criarUsuario
admin.autodiscover()
urlpatterns = [
url('admin/', admin.site.urls),
#Django Oauth Toolkit urls
#Urls do DOT para as operacoes de autenticacao e aplicacoes
url('o/', include('oauth2_prov... | LucasSSales/TestesDjango | apirest_v2/apirest_v2/urls.py | urls.py | py | 725 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name... |
3978633911 | #!/usr/bin/env python3
import json
import os
import sys
import re
from collections import defaultdict
def load_channel_history(basedir):
messages = defaultdict(list)
for root, dirs, files in os.walk(basedir):
_, dirname = os.path.split(root)
for fname in [fname for fname in files if fname.ends... | bruntonspall/slack-export-tools | find_message.py | find_message.py | py | 3,570 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
29995455881 | import os
import click
import pandas as pd
from sklearn.model_selection import train_test_split
@click.command("split_dataset")
@click.option("--input-dir")
@click.option("--output-dir")
@click.option("--val_size", default=0.2, help="share of validation dataset")
@click.option("--seed", default=42, help="random seed... | made-ml-in-prod-2021/garistvlad | airflow-dags/images/airflow-split-dataset/split_dataset.py | split_dataset.py | py | 1,546 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_... |
11825587184 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 12:39:12 2020
@author: petrapoklukar
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.init as init
class Downsample(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size):
super(Downsamp... | Francescoes/visual_planning | lsr_ltl/architectures/EncoderAPN_ConvNetMlp.py | EncoderAPN_ConvNetMlp.py | py | 11,416 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
36284436295 | import sys
from collections import deque
# sys.setrecursionlimit(10**6)
# sys.stdin = open("bj-solve\input.txt", 'r')
input = sys.stdin.readline
def bfs(start):
q = deque([start])
while q:
node = q.popleft()
visited[node] = 1
for i in edge[node]:
if not visit... | kyeong8/Algorithm | 백준/Gold/16940. BFS 스페셜 저지/BFS 스페셜 저지.py | BFS 스페셜 저지.py | py | 986 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
14830489425 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 8/15/18 4:51 PM
# @Author : bai yang
# @Site :
# @File : upload_view.py
# @Software: PyCharm
import hashlib
import os
from sanic.response import json
from sanic.views import HTTPMethodView
from article.settings import baseDir, imge_url
from PIL import I... | B9527/sannic_demo_objk | article/views/upload_view.py | upload_view.py | py | 2,445 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sanic.views.HTTPMethodView",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "sanic.response.json",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "sanic.response.json",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "ha... |
40508293126 | import openpyxl
import word_extractor
import sys
# from googletrans import Translator
class OutputExtractedWordToExcel (word_extractor.WordExtractorFromFolder):
# translator = Translator()
def __init__(self, src_folder, language, wb_output="", wb_reference=""):
super().__init__(src_folder, language)
... | acannie/word_extractor | output_to_excel.py | output_to_excel.py | py | 4,502 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "word_extractor.WordExtractorFromFolder",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 17,
"usage_type": "call"
},
... |
33010878632 | import threading
import socket
import json
import logging
import traceback
from json import JSONDecodeError
"""Object Request Broker
This module implements the infrastructure needed to transparently create
objects that communicate via networks. This infrastructure consists of:
-- Stub ::
Represents the imag... | seth-russell/Distributed-Lab4 | modules/Common/orb.py | orb.py | py | 8,712 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.debug",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 6... |
26363657121 | import cv2
import mediapipe
from datetime import datetime
cap = cv2.VideoCapture(0)
mp_hands = mediapipe.solutions.hands
hands = mp_hands.Hands()
mp_draw = mediapipe.solutions.drawing_utils
while True:
previous_timestamp = datetime.now()
iterate_index = 1
counter = 0
break
if not cap.isOpened():
pri... | WillCaton2350/Gesture-Tracking-opencv-python | hand_tracking/htm_import/main.py | main.py | py | 2,213 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datet... |
43177763226 | import uuid
import allure
import pytest
from base.api.base import BaseAPI
from base.api.users.mail_messages.mail_messages import get_mail_messages, get_mail_message, get_mail_messages_query
from models.users.mail_message import MailMessages
from parameters.api.users.mail_messages import mail_messages_methods
from set... | Nikita-Filonov/demo_auto_tests | tests/api/users/mail_messages/test_mail_messages.py | test_mail_messages.py | py | 3,423 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "base.api.base.BaseAPI",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "models.users.mail_message.MailMessages.manager",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "models.users.mail_message.MailMessages",
"line_number": 25,
"us... |
24423443513 | import keras
from keras.models import Sequential, Input, Model
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.layers.normalization import BatchNormalization
from keras.layers.advanced_activations import LeakyReLU
width = 256
train_X = train_X.reshape(-1, widt... | Dos98/Detecting-Malware-using-Ensemble-Method-based-on-DNN | CNN-with-dropout.py | CNN-with-dropout.py | py | 1,801 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "keras.models.Sequential",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "keras.layers.advanced_activations.LeakyReLU",
"line_number": 27,
"usage_type": "call"
},
... |
15405511813 | #!/usr/bin/env python3
"""
https://adventofcode.com/2015/day/17
"""
from itertools import combinations
import aoc
PUZZLE = aoc.Puzzle(day=17, year=2015)
TARGET = 150
def solve(part='a'):
"""Solve puzzle"""
containers = list(map(int, PUZZLE.input.splitlines()))
valid = []
for count in range(1, len(con... | trosine/advent-of-code | 2015/day17.py | day17.py | py | 634 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "aoc.Puzzle",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 17,
"usage_type": "call"
}
] |
71942638433 | from torch import nn
from torchvision.transforms import ToTensor
import torch
class LFIClassification(nn.Module):
def __init__(self):
super(LFIClassification, self).__init__()
self.linear_stack = nn.Sequential(
nn.Flatten(),
nn.Unflatten(1, torch.Size([3, 8*8, 376, 541])),
... | Zhicheng-Lu/LFI_classification | LFI_classification_model.py | LFI_classification_model.py | py | 1,345 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
29439933222 | # -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
import pymongo
import pandas as pd
myserver = "mongodb+srv://admin:1234@cluster0.7voii.gcp.mongodb.net/<dbname>?retryWrites=true&w=majority"
class Ui_Dialog(object):
def __init__(self):
self.login = False
def setupUi(self, Dialog):... | phongsmm/Revenue_Reporter | FirstPage.py | FirstPage.py | py | 12,026 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtGui.QIcon",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QGridLayout",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWid... |
71082068835 | import string
import random
import re
import datetime
from tornado_json.requesthandlers import APIHandler
from python_mysql_dbconfig import getconnection
class LinksAPIHandler(APIHandler):# pylint: disable=too-few-public-methods
__url_names__ = ["links"]
class GetLinks(LinksAPIHandler):# pylint:... | Evgen174/api | slink/api.py | api.py | py | 3,503 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tornado_json.requesthandlers.APIHandler",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "python_mysql_dbconfig.getconnection",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tornado_json.requesthandlers.APIHandler",
"line_number": 41,
... |
16950486496 | def nextUser(room):
# Libraries
from sys import path
path.append("/home/pi/autoBooker/")
import RGBreader
import selectDay
import sheets
import scan
import time
import random
import csv
from time import sleep
import pynput
from pynput.mouse import Button, Controller
... | eidetech/autoBooker | dualUserBooking.py | dualUserBooking.py | py | 7,068 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pynput.mouse.Controller",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pynput.mouse.Button.le... |
23328438834 | from face_shape_prediction import *
import os
from flask import Flask, request, render_template
UPLOAD_FOLDER = './upload'
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
@app.route('/', methods=['GET', 'POST'])
def upload_file():
if request.method == 'POST':
if 'file1' not in request.... | ACardenasSil/BarberRater | face_classifier/api.py | api.py | py | 692 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.request.file... |
5099777492 | import json
import logging
import random
import time
from threading import Thread, Event
from core.models import Module
class ModuleEmulator(object):
def __init__(self, mac, app, mqtt_client):
self.mqtt_client = mqtt_client
self.mac = mac
self.app = app
self.module_thread = None
... | brewmajsters/brewmaster-backend | mqtt/emulator/module_emulator.py | module_emulator.py | py | 3,575 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "threading.Event",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "threading.Thread"... |
17411958599 | import pandas as pd
import yfinance as yf
import plotly.graph_objects as go
stock = yf.Ticker('MSFT')
data = stock.history(period="100d")
data.to_csv('yahoo.csv')
df = pd.read_csv('yahoo.csv')
candlestick = go.Candlestick(x=df['Date'], open=df['Open'], high=df['High'], low=df['Low'], close=df['Close'])
fig = go.Figur... | keshavdalmia10/stonks_bot | chart.py | chart.py | py | 387 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yfinance.Ticker",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects.Candlestick",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "plotly... |
16005290351 | import subprocess
import struct, datetime
from subprocess import PIPE,Popen # used in screenSize and issueCMD
def convertBytes(inBytes):
"""
Routine to convert a given number of bytes into a more human readable form
Input : number of bytes
Output : returns a MB / GB / TB value for bytes
"""
bytes = ... | pcuzner/gluster-monitor | gtop_utils.py | gtop_utils.py | py | 2,297 | python | en | code | 21 | github-code | 1 | [
{
"api_name": "subprocess.Popen",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "struct.unpack",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
24525843835 | '''
add data to dataset
'''
import os
import re
import sys
import time
import fcntl
import datetime
import commands
import brokerage.broker
from dataservice import DynDataDistributer
from dataservice.MailUtils import MailUtils
from dataservice.Notifier import Notifier
from taskbuffer.JobSpec import JobSpec
from datas... | edquist/panda-server | pandaserver/dataservice/EventPicker.py | EventPicker.py | py | 12,282 | python | en | code | null | github-code | 1 | [
{
"api_name": "pandalogger.PandaLogger.PandaLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "dataservice.DynDataDistributer.initLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "dataservice.DynDataDistributer",
"line_number": 26,
"usage_... |
2440411216 |
#Churn analysis of bank leaving customer and we will calssify them
# Artificial Neural Network
# Installing Theano (Numerical based library (runs on cpu aswellas gpu))
# !pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
# Installing Tensorflow ()
# !Install Tensorflow from the website: https://... | awaisajaz1/Machine-Learning-Learning-Path | Machine Learning A-Z/Part 8 - Deep Learning/Section 39 - Artificial Neural Networks (ANN)/Artificial Neural Network.py | Artificial Neural Network.py | py | 5,678 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 46,
"usage_type": "call"
},
{
... |
4351575598 |
from dataclasses import dataclass
from typing import List, Optional, Tuple, Union
import numpy as np
import torch
from diffusers import DDIMScheduler
from diffusers.utils import BaseOutput
@dataclass
class NestedSchedulerOutput(BaseOutput):
"""
Output class for the scheduler's step function output.
Ar... | noamelata/NestedDiffusion | NestedScheduler.py | NestedScheduler.py | py | 8,833 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "diffusers.utils.BaseOutput",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.FloatTensor",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "tor... |
28102311716 | # -*- coding:utf-8 -*-
# @Time: 2020/4/28 14:12
# @Author: wenqin_zhu
# @File: table_list.py
# @Software: PyCharm
import time
from selenium.webdriver.common.by import By
from guard.pages.classes.basepage import BasePage
from guard.pages.components.dialog import DialogPage
from selenium.webdriver.support.wait import We... | qinwenzhu/real_project_for_web | guard/pages/components/table_list.py | table_list.py | py | 4,265 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "guard.pages.classes.basepage.BasePage",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.XPATH",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 20,
"us... |
5232865246 | from rest_framework.test import APITestCase
from django.urls import reverse
from faker import Faker
class TestSetup(APITestCase):
def setUp(self):
self.register_url = reverse('register')
self.login_url = reverse('login')
self.fake = Faker()
self.user_data = {
'titl... | bbrighttaer/adplisttest | authentication/tests/test_setup.py | test_setup.py | py | 840 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
10465751834 | import asyncio
from typing import List, Optional
from nonebot_plugin_datastore.db import get_engine
from sqlalchemy import ForeignKey, UniqueConstraint, select
from sqlalchemy.orm import Mapped, mapped_column, relationship, joinedload
from .user_sql import create_session, db
class Group(db.Model):
id: Mapped[in... | canxin121/nonebot_plugin_bind | nonebot_plugin_bind/group_sql.py | group_sql.py | py | 4,781 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "user_sql.db.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "user_sql.db",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.Mapped",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.o... |
15834305969 | """Classes for object detection."""
from __future__ import division
from __future__ import print_function
from collections import deque
import cv2
import numpy as np
from .utils import hsv_mask
class FieldFinder(object):
"""Finds the contour of the field."""
def __init__(self, hsv_lower, hsv_upper):
... | ltskv/kick-it | pykick/finders.py | finders.py | py | 10,452 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "cv2.cvtColor",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "utils.hsv_mask",... |
11867056225 | #! /usr/bin/env python
from kivy.app import App
from kivy.lang import Builder
import re
import os
from kivy.uix.screenmanager import ScreenManager
import bcitp.screens.templates.settings_template
from bcitp.utils.session_info import SessionHeader
from bcitp.screens.start_screen import StartScreen
from bcitp.scree... | rafaelmendes/BCItp | main.py | main.py | py | 3,255 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "kivy.lang.Builder.load_file",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "kivy.lang.Builder",
... |
26406716123 | from fastapi import APIRouter, Query
from app.database import player_helper, team_helper, team_info_helper, MONGO_DETAILS, client, players_table, player_images_table,teams_table, team_info_table
from motor import motor_asyncio
from motor.motor_asyncio import AsyncIOMotorCursor
router = APIRouter()
@router.get('/playe... | julianjohnson10/fast_api_project | backend/app/views.py | views.py | py | 2,214 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "fastapi.Query",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "motor.motor_asyncio.AsyncIOMotorCursor",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "... |
71721971875 | import torch
import torch.nn as nn
import numpy as np
import sys
import os
sys.path.append(os.path.join(os.getcwd(), "lib")) # HACK add the lib folder
# from models.backbone_module import Pointnet2Backbone
from lib.pointnet2.pointnet2_modules import PointnetSAModuleVotes, PointnetFPModule
from models.voting_module imp... | daveredrum/Scan2Cap | models/mask_votenet.py | mask_votenet.py | py | 10,906 | python | en | code | 89 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
30405433404 | # 1046. Last Stone Weight
# Easy
# You are given an array of integers stones where stones[i] is the weight of the ith stone.
# We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them together. Suppose the heaviest two stones have weights x and y with x <= y. The result of... | akarsh1995/advent-of-code | src/leetcode/lc_1046.py | lc_1046.py | py | 1,650 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 52,
"usage_type": "name"
}
] |
11875042834 | import os
import sys
from time import gmtime, strftime
from keras.models import load_model
from sklearn.metrics import precision_recall_fscore_support, mean_squared_error, average_precision_score
from math import sqrt
import numpy as np
import pandas as pd
import math
import keras.backend as K
dir_path = os.path.dirn... | tjcdev/sci-autoencoder | src/experiments/run_pop_test.py | run_pop_test.py | py | 3,038 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"... |
38885564257 | '''
@author: alec_host
'''
import sys
import uuid
import logging
import pytz
import datetime
from sqlalchemy import or_,desc
from sqlalchemy.orm import Session
from register_schema import CreateAndUpdateCustomerEntries
from register_model import CustomerEntriesDescription
import conn.config
sys.path.insert(0,conn.c... | alec-host/air_draw | register/register_crud.py | register_crud.py | py | 3,780 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.insert",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "conn.config.config",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "conn.config",
... |
39763685082 | from django.conf.urls import url, include
from Bo_yuan import api
urlpatterns = [
# API
# 对接微信登陆 返回openid session_key
url(r'^code2session$', api.Code2SessionAPIView.as_view()),
# 用户信息
url(r'^users$', api.UsersAPIView.as_view()),
url(r'^users/(?P<pk>\d+)/$', api.UserAPIView.as_view()),
#... | peikaiy/SecondCar | Bo_yuan/urls.py | urls.py | py | 2,664 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Bo_yuan.api.Code2SessionAPIView.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Bo_yuan.api.Code2SessionAPIView",
"line_number": 10,
"usage_type": "attribut... |
10935719042 | #coding=utf-8
from urllib import request
import re
import json
import time
#基本思路:使用regx处理request方式获取的页面context,然后将相关信息采用json dump/load的方式存取和读取,最后使用send_SMS发送到自己手机
#http://www.bjjtgl.gov.cn/zhuanti/10weihao/index.html
#todo refer to http://www.cnblogs.com/Lands-ljk/p/5467236.html ,and multi-thread etc...
#todo ,metho... | salanhess/interview | XianhaoRemind/0_regx_method.py | 0_regx_method.py | py | 4,108 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib.request.Request",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "urllib.r... |
41120373132 | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.runner import force_fp32, BaseModule, auto_fp16
from mmdet.models.builder import HEADS
from model import build_model
import math
class SiLogLoss(nn.Module):
def __init__(self, lambd=0.5):
super().__init__()
self.lambd = ... | paperwave/AiT | ait/code/model/depth/depth_head.py | depth_head.py | py | 3,729 | python | en | code | null | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.log",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.sqrt",
"line_number... |
7824817343 | # emacs: -*- mode: python-mode; py-indent-offset: 2; tab-width: 2; indent-tabs-mode: nil -*-
# ex: set sts=2 ts=2 sw=2 et:
""" A Neurosynth Dataset """
import logging
import re
import random
import os
import numpy as np
import pandas as pd
from scipy import sparse
import mappable
from neurosynth.base import mask, i... | jdnc/ml-project | neurosynth/neurosynth/base/dataset.py | dataset.py | py | 25,922 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "neurosynth.base.transformations.t88_to_mni",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "neurosynth.base.transformations",
"line_number": 71,
"usage_type": "name"
... |
27287325113 | """ Helper method to train AutoML model for image classification. """
from typing import Dict, Any
import cleanlab
from gluoncv.auto.data.dataset import ImageClassificationDataset
from autogluon.multimodal import MultiModalPredictor
def train(
dataset,
out_folder: str = "./model_training_run/",
hyperpara... | cleanlab/examples | active_learning_single_annotator/utils/model_training_autogluon.py | model_training_autogluon.py | py | 1,490 | python | en | code | 78 | github-code | 1 | [
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "autogluon.multimodal.MultiModalPredictor",
"line_number": 33,
"usage_type": "call"
}
] |
8767288609 |
import PySimpleGUI as sg
'''
sg.theme('DarkAmber') # Add a touch of color
# All the stuff inside your window.
layout = [ [sg.Text('Some text on Row 1')],
[sg.Text('Enter something on Row 2'), sg.InputText()],
[sg.Button('Ok'), sg.Button('Cancel')] ]
# Create the Window
window = sg.Window('W... | Xianzheng/smallProgram | selenium/simpleGUI.py | simpleGUI.py | py | 5,513 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PySimpleGUI.Text",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Output",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.F... |
34525437319 |
""" get_top_bottom_movies.py
Usage: get_top_bottom_movies
Return top and bottom 10 movies, by ratings.
"""
import sys
import imdb
i = imdb.IMDb()
top250 = i.get_top250_movies()
bottom100 = i.get_bottom100_movies()
out_encoding = sys.stdout.encoding or sys.getdefaultencoding()
for label, ml in [('top 10', top250[:10]... | oanadonose/ChatBot | get_top_bottom_movies.py | get_top_bottom_movies.py | py | 637 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "imdb.IMDb",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.getdefaultencoding",
"line_number": 12,
"usage_type": "call"
}
] |
6193431968 | #!/usr/bin/env python
# coding: utf-8
import sys
from PySide2.QtWidgets import QApplication, QVBoxLayout, QWidget
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
import matplotlib.pyplot as plt
im... | bitwalk123/PySide2_sample | qt_matplotlib.py | qt_matplotlib.py | py | 3,583 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "m... |
33243552872 | from celery.result import AsyncResult
from django.shortcuts import render
from django.views.decorators.http import require_GET, require_http_methods
from dnaStrings.forms import dnaStringSubmission
from dnaStrings.models import Tasks
from dnaStrings.tasks import findProtein
from django.contrib import messages
@requi... | chanana/gnkg | dnaStrings/views.py | views.py | py | 2,410 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dnaStrings.forms.dnaStringSubmission",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dnaStrings.tasks.findProtein.delay",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "dnaStrings.tasks.findProtein",
"line_number": 21,
"usage_type": "... |
74520864673 | from django.shortcuts import render, redirect
import random, datetime
# Create your views here.
def index(request):
if 'activities' not in request.session:
request.session['activities'] = []
if 'gold_count' not in request.session:
request.session['gold_count'] = 0
return render(request, 'gold/index.html')
def ... | CodingDojoOnline-Nov2016/wesHarper | python_stack/django/level1/ninja_gold/apps/gold/views.py | views.py | py | 1,547 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "random.randint"... |
27730473116 | import sys
sys.path.append('../')
from src.luscioustwitch import *
from src.luscioustwitch.events import *
import json
import unittest
class TestTwitchAPI(unittest.TestCase):
@classmethod
def setUpClass(self):
with open('../secrets.json', 'r') as f:
cred_json = json.load(f)
f.close()
self.api =... | charlie-coleman/luscioustwitch | test/twitch_api_test.py | twitch_api_test.py | py | 1,689 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"li... |
6930040041 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('main', views.main, name='main'),
path('resources', views.resources, name='resources'),
path('room', views.room, name='room'),
path('select-custom', views.select_custom, name='select_custom')... | david0han/fitting-room | finalproject/fittingroom/urls.py | urls.py | py | 464 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
30792750190 | from tkinter import *
import os
import ntpath
from pywidgets.tk.func import bind_all_childes
from pywidgets.tk.Lables.__origen import _EXPLORE
from pywidgets.tk.Verticle_Frame import VerticalScrolledFrame
from PIL import ImageTk,Image
FILE_PATH=os.path.dirname(__file__)
RIGHTARROW=Image.open(os.path.join(FILE_PATH,"i... | Emam546/pywidgets | pywidgets/tk/Lables/custom_viewer.py | custom_viewer.py | py | 6,951 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_num... |
30334769798 | #!/usr/bin/env python3
import requests
import sys
from bs4 import BeautifulSoup
class WrongNumberOfArgsError(Exception):
pass
class InfiniteLoopError(Exception):
pass
def to_snake_case(string):
return string \
.replace(',', '_') \
.replace('.', '_') \
.replace(' ', ... | RickBadKan/42-mini-piscina | list03/ex03/roads_to_philosophy.py | roads_to_philosophy.py | py | 2,141 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.HTTPError",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
... |
23908190149 | #!/usr/local/bin/python3
#
# Authors: Bobby Rathore (brathore), Neha Supe (nehasupe), Kelly Wheeler (kellwhee)
#
# Mountain ridge finder
# Based on skeleton code by D. Crandall, Oct 2019
from PIL import Image
import numpy as np
from scipy.ndimage import filters
import sys
import os
import imageio
class HMM:
def ... | bobbyrathoree/expectiminimax-board-game--finding-horizons | part2/mountain.py | mountain.py | py | 12,646 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.filters.sobel",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.fil... |
24047276596 | #!/usr/bin/python3
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from datetime import datetime
import weasyprint
import sh... | ebecz/NF-Errr | nfe.py | nfe.py | py | 4,614 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.support.ui.WebDriverWait",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.expected_conditions.presence_of_element_located",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support... |
28325791633 | # coding=utf-8
import os
import requests
from tqdm import tqdm
from mindsearch.utils.logger import Logger
logger = Logger(__name__).get_logger()
def download_url(url, save_path):
"""
Download file from remote `url` to local directory, the file will be named `path` locally.
"""
if os.path.dirname(save... | mindspore-lab/mindsearch | mindsearch/utils/data_utils.py | data_utils.py | py | 1,173 | python | en | code | 19 | github-code | 1 | [
{
"api_name": "mindsearch.utils.logger.Logger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.makedir... |
71419817633 | import numpy as np
import math
import h5py
import openpyxl
from scipy import signal as signal
import matplotlib.pyplot as plt
from sklearn.svm import SVC
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_score, recall_score
from sklearn.externals import joblib
import joblib
... | axk19970225/-old-version- | 13.svm预测炮,并分析.py | 13.svm预测炮,并分析.py | py | 11,295 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.ceil",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 75,
... |
3710535145 | import cv2
import numpy as np
from threading import Thread
import time
import argparse
#from gui import onmouse, updateGUI
from gui import gui, getPath
from VideoStream import VideoStream#, VideoSave
parser = argparse.ArgumentParser()
parser.add_argument('--resolution', help='Desired webcam resolution in WxH. If the w... | WilliamLin43/VideoSaveGUI | VideoSaveGUI_v1/camerasave2.py | camerasave2.py | py | 2,673 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.getTickFrequency",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "gui.gui"... |
72340295714 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
from django.conf import settings
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
... | zakvan2022/Betasmartz | notifications/migrations/0001_initial.py | 0001_initial.py | py | 2,234 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 14,
"usage_type": "ca... |
6423410824 | from PyQt5.QtWidgets import QMainWindow, QLabel
from PyQt5.QtCore import QPoint, Qt
from fuzzyclock import FuzzyClock
class SimpleFuzzyClockWindow(QMainWindow):
def __init__(self, fuzzy_clock=None, size=(190, 35)):
super().__init__()
if fuzzy_clock is None:
self.fuzzy_clock = FuzzyC... | mkardel/SimpleFuzzyClock | fuzzywindow.py | fuzzywindow.py | py | 1,437 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "fuzzyclock.FuzzyClock",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 17,
"usage_type": "call"
},
{
"api_... |
35706320325 | import os
import warnings
from abc import ABCMeta
from collections import namedtuple
import re
from .base import Operation, Bank, Account, Historic, Entity
class AxaBank(Bank):
def __init__(self):
super().__init__("Axa", "AXABBE22")
def __repr__(self):
return "{}()".format(self.__class__.__... | jm-begon/bank_analysis | bank_analysis/axa.py | axa.py | py | 6,722 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "base.Bank",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "base.Operation",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "abc.ABCMeta",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "base.Entity",
"line_number":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.