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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
36127467524 | import json
from typing import Dict
from kafka import KafkaConsumer
from main import StationStatus, Station
station_status = dict()
if __name__ == '__main__':
consumer = KafkaConsumer(
'city_bike_topic',
bootstrap_servers = ['localhost:9092'],
auto_offset_reset='earliest',
... | Kelvingandhi/kafka_sample | city_bike_consumer.py | city_bike_consumer.py | py | 1,167 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "kafka.KafkaConsumer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "main.StationStatus",
"line_number": 32,
"usage_type": "call"
}
] |
41272460993 | from imutils import paths
import face_recognition
import os
from shutil import copy
from PIL import Image, ImageDraw
from tkinter import Tk
from tkinter.filedialog import askopenfilename
Tk().withdraw()
filename = askopenfilename()
obama = face_recognition.load_image_file(filename)
folder = 'obama'
obamaface_encodi... | SankojuRamesh/face_recognation | fr.py | fr.py | py | 1,295 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tkinter.Tk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "face_recognition.load_image_file",
"line_number": 12,
"usage_type": "call"
},
{
"ap... |
31792102222 | # coding:utf-8
import sys
import window
from PyQt5.QtWidgets import QApplication, QDialog
from PyQt5.QtGui import QIcon
from PyQt5 import QtCore
# import pymysql
import threading
import pymysql
path = "./"
class Controller:
def __init__(self):
pass
def show_login(self):
self.login = Login... | northboat/Aides | app/app.py | app.py | py | 3,509 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "threading.Thread",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "shadow.shadow",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QDialog",
... |
37407108595 | from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from sklearn.ensemble import RandomForestClassifier
import xgboost as xgb
from sklearn.linear_model import LinearRegression
# dummy data
X, y = make_classificatio... | HyperionDevBootcamps/C4_DS_lecture_examples | Lecture code/Machine Learning/Decision Trees/Ensemble.py | Ensemble.py | py | 1,443 | python | en | code | 37 | github-code | 36 | [
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 17,
"... |
28834678402 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 11 14:34:04 2015
@author: 89965
fonctions de structurelles diverses
"""
import os
import re
import logging
import subprocess
from collections import defaultdict
import psutil
import pyetl.formats.formats as F
import pyetl.formats.mdbaccess as DB
from .outils import charg... | klix2/mapper0_8 | pyetl/moteur/fonctions/traitement_divers.py | traitement_divers.py | py | 26,649 | python | fr | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "outils.charge_mapping",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "outils.remap",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "outils.prepare_e... |
13536005652 | from lib import setter, getter, io_tools
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--config", type = str, help = "path to campaigns config json file")
parser.add_argument("--PU", type = str, help = "name of the pileup sample to set sitewhitelist for")
parser.add_argument("--sites", type ... | tyjyang/CampaignManager | scripts/set-sitewhitelist-for-PU.py | set-sitewhitelist-for-PU.py | py | 712 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "lib.io_tools.import_jsonfile_as_OrderedDict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "lib.io_tools",
"line_number": 10,
"usage_type": "name"
},
{
"a... |
30722724901 | #programmers_단어 변환
#=== import module ===#
from collections import deque
#=== variable declare ===#
#=== Function define ===#
def solution(begin, target, words):
if target not in words: return 0; #불가능한 경우
queue = deque();
queue.append([begin,0]); #current, visited
level = 0;
succeed = False;
while qu... | Hoony0321/Algorithm | 2022_02/26/programmers_단어 변환.py | programmers_단어 변환.py | py | 1,080 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 11,
"usage_type": "call"
}
] |
3918203704 | import re
import os
import string
import shutil
import tempfile
import fontforge
import argparse
from string import Template
from pathlib import Path
from bs4 import BeautifulSoup
from bs4.formatter import XMLFormatter
class Colors:
OK = '\033[92m'
INFO = '\033[94m'
WARN = '\033[93m'
FAIL = '\033[91m'... | 10f7c7/hershey2TTF | test.py | test.py | py | 11,054 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
71960799785 | import gluonbook as gb
from mxnet.gluon import data as gdata
import sys
import time
import matplotlib.pyplot as plt
mnist_train = gdata.vision.FashionMNIST(train=True)
mnist_test = gdata.vision.FashionMNIST(train=False)
# 训练集和测试集中每个类别的图像分别为6000, 1000, 因此len(mnist_train)=60000, len(mnist_test) = 10000
print(len(mnist... | fulinli/DeepLearning_MXNet | Fashion-MNIST.py | Fashion-MNIST.py | py | 3,590 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "mxnet.gluon.data.vision.FashionMNIST",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mxnet.gluon.data.vision",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "mxnet.gluon.data",
"line_number": 8,
"usage_type": "name"
},
{
"a... |
5940101912 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
import pickle
import configparser
import copy
import subprocess
from distutils.util import strtobool
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
from torch.cuda.amp import autocast, GradScaler
# from AutoE... | MDIFS/DeepKoopmanDynamicalFSI | mpc.py | mpc.py | py | 8,203 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.manual_seed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.manu... |
70110044584 | from django.contrib.auth import get_user_model
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.utils.translation import gettext_lazy as _
from library_test_project.users.models import ScoreAbs
User = get_user_model()
class Author(models.Model):
na... | Bakdolot/library_test_project | library_test_project/library/models.py | models.py | py | 1,968 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.db.models.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 11,
"usage_type": "name"
},
{
"ap... |
33167135913 | from collections import Counter
from contextlib import contextmanager, asynccontextmanager
import logging
import time
logger = logging.getLogger(__name__)
class TimingStats(Counter):
def __init__(self, verbose: bool = False):
super().__init__()
self.verbose = verbose
@contextmanager
def ... | andrew-landers-by/luman-1584-blob-timeout | luman_1584/timing.py | timing.py | py | 915 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "time.monotonic",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.monotonic",
... |
14191916255 | # TODO: prevent utf-8 encoding errors in CSVs
# TODO: add a progress bar for all timed processes
# TODO: Maintain History of organizations analyzed
# TODO: Show time taken to scrape and analyze (tock - tick)
#Importing Libraries
import contextlib
import csv
import json
import os
import re
import time
import warnings
f... | HighnessAtharva/CRIF-Hackathon-2023 | SCRAPER.py | SCRAPER.py | py | 17,393 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "warnings.simplefilter",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "contextlib.suppress",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "trafilatura.fetch_url",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "trafi... |
1750954085 | from ex2_utils import *
import matplotlib.pyplot as plt
from random import randrange
import numpy as np
import cv2
def presentation(plots, titles):
n = len(plots)
if n == 1:
plt.imshow(plots[0], cmap='gray')
plt.title(titles[0])
plt.show()
return
if n == 2... | MoriyaBitton/Ex2_Convolution_and_Edge_Detection | ex2_main.py | ex2_main.py | py | 5,008 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.title",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ma... |
39472170581 | from flask import request
from werkzeug.exceptions import NotFound, BadRequest, Conflict
from db import db
from managers.brand import BrandManager
from managers.category import CategoryManager
from models import BrandModel, CategoryModel
from models.enums import GenderType
from models.products import ProductsModel, P... | a-angeliev/Shoecommerce | server/managers/products.py | products.py | py | 9,324 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "werkzeug.exceptions.NotFound",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "werkzeug.exceptions.NotFound",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "werkzeug.exceptions.BadRequest",
"line_number": 26,
"usage_type": "call"
},
... |
73683828585 | from typing import Optional, Tuple
import numpy as np
import torch
from pytorch_lightning import LightningDataModule
from torch.utils.data import DataLoader, Dataset
from src.datamodules.components.diarization_dataset import (
DiarizationDataset,
DiarizationDatasetforInfer,
)
def collate_fn(batch):
ys, ... | DaseiNaN/Speech-Diarization | src/datamodules/diarization_datamodule.py | diarization_datamodule.py | py | 4,687 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.pad",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 19,
... |
34866939002 | import math
from src.getTickers import *
from src.importData import *
from backtrader.indicators import ema
import datetime
GOINGDOWN_DAYS = 60
def hasNotIncreaseTooMuch(datahigh,datalow):
heighest=0
lowest=10000
for i in range(-5, 0):
heighest = max(heighest, datahigh[i])
lowest = min(low... | lumeng3/luluquant | src/strategy/goingDown.py | goingDown.py | py | 2,672 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "datetime.date",
"line_number": 49,
"usage_type": "call"
}
] |
21694318257 | import os
import numpy as np
import matplotlib.pyplot as plt
import re
from io import StringIO
from skimage.external.tifffile import imsave
from scipy.interpolate import griddata
from scipy.signal import medfilt
def GetChunkFromTextFile(FileName, StartStr, StopStr, skip_header=0, skip_footer=0, LastHit=True, DataType... | ZGainsforth/QEScripts | Wannier/ReadXSFVolume.py | ReadXSFVolume.py | py | 6,099 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.float",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number"... |
14722446132 | from pycorenlp import StanfordCoreNLP
import os, json, sys
#os.chdir("C:/Program Files/stanford-corenlp-4.2.2")
#os.system("java -mx5g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -timeout 10000")
nlp = StanfordCoreNLP('http://localhost:9000')
annotators = "ssplit,ner,depparse"
ner_keys = ["PERSO... | gaelix98/progetto-fdsml | codici aggiunti/bio_nlp.py | bio_nlp.py | py | 4,109 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pycorenlp.StanfordCoreNLP",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_n... |
30820901838 | #Extracts second-column values from .dat files and prints them out, comma-separated, so they can be used as a colormap in VARNA
#It'll do this for all .dat files you have in your directory. If you don't want this feature just comment out everything with read_files in it
#and unindent as needed.
#I also plot out the va... | gwlilabmit/Ram_Y_complex | paired_prob/plot_dat.py | plot_dat.py | py | 7,427 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "glob.glob",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 73,
... |
30380624251 | import os
from datetime import timedelta
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
... | Lord-sarcastic/quiz | backend/settings.py | settings.py | py | 4,013 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"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": "os.environ.get",
"line... |
22772365443 | from tkinter import*
from tkinter import ttk, messagebox
import datetime as dt
import openpyxl
import pandas as pd
import os
import csv
class dataEntry:
def __init__(self,root):
self.root = root
self.root.title("Quality tracker")
self.root.geometry("1000x800+0+0")
self.ro... | muttas/my-projects | BusinessReviews_audit_form.py | BusinessReviews_audit_form.py | py | 8,340 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getlogin",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "tkinter.ttk.... |
4728646967 | import time
from io import BytesIO
from typing import List
import pandas as pd
from matplotlib import pyplot as plt
from pandas import DataFrame
from svglib.svglib import svg2rlg
from evaluate.EvaluateCore import PartAngle
import seaborn as sns
plt.rcParams['font.sans-serif'] = ['SimHei'] # 中文字体设置-黑体
plt.rcParams['... | spianmo/GaitStudio | evaluate/ReportModuleBuilder.py | ReportModuleBuilder.py | py | 8,394 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 14,
"usage_type": "attribute"
},
{
... |
25049652193 | import numpy as np
import torch
from skimage.metrics import peak_signal_noise_ratio,structural_similarity
import natsort
import cv2
import os
from tqdm import tqdm
def tensor2im(input_image, imtype=np.uint8):
if isinstance(input_image, torch.Tensor):
image_tensor = input_image.data
else:
return... | Jintopia/Hint-based-Colorization | utils.py | utils.py | py | 1,302 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.uint8",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.tile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_n... |
18694607794 | # -*- coding: utf-8 -*-
"""
Functions to interact with the realsense recordings for HPPD project
"""
#%% imports
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import cv2
import pyrealsense2 as rs
import mediapipe
import sys
import keyboard
import os
import csv
import datetime
import time
... | mmtlab/wheelchair_contact_detection | hppdWC/bagRS.py | bagRS.py | py | 43,231 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.ceil",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.pipeline",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.config",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.c... |
24680745592 | import base64
def e5(m): # base64
s = base64.b64decode(m)
s = s.decode()
return s
def e4(m, k=13): # Caesar shift cipher
m = m.lower()
s = ""
for i in range(len(m)):
s += chr((ord(m[i]) - k - 97) % 26 + 97)
return s
def e2(m, k): # Vigenere cipher
m = m... | SudeshGowda/Systems-recruitment-task | Decoder.py | Decoder.py | py | 2,373 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "base64.b64decode",
"line_number": 5,
"usage_type": "call"
}
] |
6554339298 | from __future__ import annotations
# IMPORTS
# =======>
# noinspection PyUnresolvedReferences
import typing
import pegen.parser as pegen
# EXPORTS
# =======>
__all__ = [
'memoize',
'memoize_left_rec',
]
# MAIN CONTENT
# ============>
if typing.TYPE_CHECKING:
from pegen.parser import Parser
F = typing.... | ButterSus/KiwiPreview | frontend/parser/memoizetools.py | memoizetools.py | py | 1,460 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "typing.TypeVar",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "typing.... |
7822082403 | # 풀이 중도 포기 (2/1 이어서 시도)
from collections import deque
from sys import stdin
input = stdin.readline
def dfs(h, w):
queue = deque([h, w])
visited[h, w] = True
for i, j in li[h]:
if not visited[j]:
pass
h, w = map(int, input().split())
li = []
res = 0
max = 0
# 육지 바다 정보 입력
for _ in r... | Drizzle03/baekjoon_coding | 20230131/2589_Backtracking.py | 2589_Backtracking.py | py | 646 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdin.readline",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 9,
"usage_type": "call"
}
] |
14059339607 | from utils import WordEmbeddingUtil, TextUtil
from config import Config
import numpy as np
import torch
word2vec_util = None
text_cnn_model = torch.load('../pretrained/text_cnn_static.h5')
def static_text_cnn_word2vec_predict(sentence):
global word2vec_util, text_cnn_model
if word2vec_util is None:
w... | miyazawatomoka/QIQC | script/predict.py | predict.py | py | 1,148 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.WordEmbeddingUtil",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.TextUtil",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"l... |
37489105113 | import struct
import utils
from random import randint
from binascii import hexlify
from abci import ABCIServer
from abci import BaseApplication
from abci import ResponseInfo
from abci import ResponseQuery
from abci import ResponseInitChain
from abci import ResponseCheckTx
from abci import ResponseDeliverTx
from abci... | SoftblocksCo/Simple_coin | application.py | application.py | py | 3,914 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "abci.BaseApplication",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "utils.read_conf",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "utils.DatabaseProvider",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "abci.Resp... |
39056231859 | from numpy import genfromtxt,where,zeros,nan,ones
from glob import glob
from obspy.core.util.geodetics import gps2DistAzimuth
from matplotlib import pyplot as plt
from obspy import read
from obspy.core import UTCDateTime
from datetime import timedelta
lonepi=-122.3174
latepi=38.2118
time_epi=UTCDateTime('2014-08-24T10... | Ogweno/mylife | Napa_stuff/plot_PGD.py | plot_PGD.py | py | 2,500 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "obspy.core.UTCDateTime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.genf... |
3738842637 | import pandas as pd
from bs4 import BeautifulSoup as bs
from splinter import Browser
def init_browser():
executable_path = {"executable_path": "chromedriver.exe"}
return Browser("chrome", **executable_path)
mars_dict = {}
#NASA Mars News
def scrape_mars_news():
try:
browser = init_browser()
... | williamsit/Homework | Mission_To_Mars/scrape_mars.py | scrape_mars.py | py | 4,587 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "splinter.Browser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup... |
16103607796 | import imp
from multiprocessing.spawn import import_main_path
from django.shortcuts import render
from student.models.students import Student
def index(request):
if request.method == "POST":
name = request.POST.get("name")
adm = request.POST.get("adm")
print(name)
print(adm)
... | Python-Guruz/CRUD-DEMO | student/views/students.py | students.py | py | 612 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "student.models.students",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "student.models.students.Student",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "student.models.students.save",
"line_number": 14,
"usage_type": "call"
},
{
... |
32523088106 | import os
from flask import Flask, jsonify, request, send_from_directory, Blueprint
from flask_restful import Api
from werkzeug.utils import secure_filename
from resources.invoice import InvoicesResource, InvoiceResource, MarkDigitizedInvoice
# from config import UPLOAD_FOLDER
UPLOAD_FOLDER = "./uploads/"
ALLOWED_EXT... | KetanSingh11/Python_Assignment_-_Plate_IQ | plateiq_app/app.py | app.py | py | 2,447 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.send_from_directory... |
36558187570 | import heapq
from typing import List
def topKFrequent(nums: List[int], k: int) -> List[int]: # Verified on Leetcode
frequencies = {}
for num in nums:
if num not in frequencies:
frequencies[num] = 1
else:
frequencies[num] += 1
temp = []
for num, f in frequencies... | InderdeepSync/grokking-coding-interview | top_k_elements/top_k_frequent_elements.py | top_k_frequent_elements.py | py | 646 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "heapq.heapify",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "heapq.heapreplace",
"line_number": 22,
"usage_type": "call"
}
] |
3272420780 | import json
import re
import requests
from django.contrib.auth import login
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.db import IntegrityError
from django.http import HttpResponse
from django.shortcuts import render, redirect
from . import models
OW_API_... | ysyesilyurt/WeatherApp | WeatherApp/views.py | views.py | py | 9,163 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "requests... |
4435033563 |
import requests
from currency_codes import CURRENCIES
API_KEY = '82e68121413a404dc85fd537'
def get_rate(currency):
url = f"https://v6.exchangerate-api.com/v6/{API_KEY}/pair/{currency}/UZS"
try:
response = requests.get(url)
rate = response.json()['conversion_rate']
except:
rate = False
return rate
de... | otabek-usmonov/uzs-exchangerate-bot | currency_rate_info.py | currency_rate_info.py | py | 921 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "currency_codes.CURRENCIES",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "currency_codes.CURRENCIES",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "curr... |
27115300498 | from django.shortcuts import render, redirect
from application.models import *
# Create your views here.
def index(request):
context= {
'Users': User.objects.all()
}
return render(request, 'index.html', context)
def submit_user(request):
User.objects.create(
first_name=request.POST['fn... | beattietrey/Coding-Dojo | python_stack/django/django_fullstack/assignments/users_with_templates/application/views.py | views.py | py | 468 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 18,
"usage_type": "call"
}
] |
25161970451 | import json
import logging
import requests
from dacite import from_dict
from typing import Any
from adyen_gift_card.api.adyen_notifications.request import NotificationRequestItem
from adyen_gift_card.infrastructure.newstore_client.client_response import NewStoreError
from newstore_common.json.multi_encoder import Mu... | NewStore/int-cinori | integrations/adyen_gift_card/adyen_gift_card/infrastructure/newstore_client/client.py | client.py | py | 1,368 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "adyen_gift_card.api.adyen_notifications.request.NotificationRequestItem",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 21,
"usage_type": "... |
74114165863 | import frappe
import os
import json
import sys
# bench execute mfi_customization.mfi.patch.migrate_patch.get_custom_role_permission
def get_custom_role_permission(site=None):
if sys.argv[2]=='--site':
os.system("bench --site {0} export-fixtures".format(sys.argv[3]))
else:
os.system("bench ex... | Bizmap-Technologies-Pvt-Ltd/mfi_customization- | mfi_customization/mfi/patch/migrate_patch.py | migrate_patch.py | py | 848 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 1... |
73857321062 | import numpy as np
from munch import DefaultMunch
from sklearn.model_selection import train_test_split
from tests import config_params, compas_dataset_class, compas_without_sensitive_attrs_dataset_class
from virny.utils.common_helpers import validate_config, confusion_matrix_metrics
def test_validate_config_true1(co... | DataResponsibly/Virny | tests/utils/test_common_helpers.py | test_common_helpers.py | py | 2,369 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "virny.utils.common_helpers.validate_config",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tests.config_params",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "munch.DefaultMunch.fromDict",
"line_number": 21,
"usage_type": "call"
... |
25719962431 | import nmap
import main
import xlsxwriter
nmScan = nmap.PortScanner()
def scan_ip(host):
nombre = main.checkoutput()
if nombre == "print":
print('Host : %s (%s)' % (host, nmScan[host].hostname()))
print('State : %s' % nmScan[host].state())
for proto in nmScan[host].all_protocols():
print('-------... | mepiadmw/PIA-Ciberseguridad | scan_ip.py | scan_ip.py | py | 1,175 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nmap.PortScanner",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "main.checkoutput",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "xlsxwriter.Workbook",
"line_number": 19,
"usage_type": "call"
}
] |
30326229759 | import pandas as pd
import numpy as np
from statsmodels.stats.outliers_influence import variance_inflation_factor
def forward_delete_corr(data):
# 计算相关系数矩阵
corr = data.corr().abs()
# 选取相关系数矩阵的上三角部分
upper = corr.where(np.triu(np.ones(corr.shape), k=1).astype(bool))
# 找出相关系数大于0.7的变量并添加到待删除列表中
to... | Whale-lyi/simple-predict | filter.py | filter.py | py | 1,753 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.triu",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "statsmodels.stats.outliers_inf... |
22778807898 | import copy
import numpy as np
import random
from collections import defaultdict
from torch.utils.data.sampler import Sampler
class RandomClassSampler(Sampler):
"""Randomly samples N classes each with K instances to
form a minibatch of size N*K.
Modified from https://github.com/KaiyangZhou/deep-person-rei... | MaXuSun/domainext | domainext/data/samplers/random_class.py | random_class.py | py | 2,346 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "torch.utils.data.sampler.Sampler",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 40,
"usage_type": "call"
},
{
"a... |
44682923693 | from flask import Flask, render_template, request, session, url_for, redirect
from flask_sqlalchemy import SQLAlchemy
import wikipedia as wk
import random
import re
from retry import retry
from nltk.tokenize import sent_tokenize
import nltk
nltk.download('all')
#TODO - BETTER TEXT REPLACE HE/HER - WIKIPEDIA BETTER SEA... | Freskoko/WikipediaQuizFlask | app.py | app.py | py | 3,771 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.download",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "wikipedia.summary",
"line_... |
5940263315 | from functools import reduce
import math
import numpy as np
import torch
from torch import nn
from tqdm import tqdm
import torch.nn.functional as F
from model.layers import *
from model.losses import *
class GraphRecommender(nn.Module):
def __init__(self, opt, num_node, adj, len_session, n_train_sessions):
... | dbis-uibk/SPARE | model/recommender.py | recommender.py | py | 4,257 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
4509075711 | import cv2
import numpy as np
import depthai
import threading
import sys
import os
import time
# Global variables
selected_points = []
completed = False
# Global variables
dataset = "kitti"
img_size = [3, 352, 1216] # for kitti
frame = None
is_frame_available = False
stop_capture = threading.Event() # Event object to ... | surajiitd/jetson-documentation | model_compression/capture_dataset.py | capture_dataset.py | py | 11,499 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "threading.Event",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "depthai.Pipeline",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "depthai.ColorCameraProperties",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "d... |
35398028388 | from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from contextlib import contextmanager
import os
import pytest
from textwrap import dedent
from pants.base.address import SyntheticAddress, BuildFileAddress
from pants... | fakeNetflix/square-repo-pants | tests/python/pants_test/graph/test_build_graph.py | test_build_graph.py | py | 13,188 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pants_test.base_test.BaseTest",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pants.util.contextutil.temporary_dir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pants.base.build_root.BuildRoot",
"line_number": 28,
"usage_type": "ca... |
29326071622 | # coding=utf-8
import matplotlib.pyplot as plt
from gensim.models import Word2Vec
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import roc_curve, auc
import data_processing
import globe
import word2vec_gensim_train
# 读入数据
# pos_file_path = '/home/zhangxin/work/workplace_python/DeepNaturalLanguag... | STHSF/DeepNaturalLanguageProcessing | TextClassification/sentiment_analysis/sentiment_analysis_zh/word2vec_classify_run.py | word2vec_classify_run.py | py | 1,700 | python | en | code | 16 | github-code | 36 | [
{
"api_name": "data_processing.read_data",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "data_processing.data_split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "data_processing.text_clean",
"line_number": 23,
"usage_type": "call"
},
{
"a... |
35396901278 | from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from twitter.common.collections import OrderedSet
from twitter.common.dirutil.fileset import Fileset
from twitter.common.lang import Compatibility
def assert_list(obj... | fakeNetflix/square-repo-pants | src/python/pants/base/validation.py | validation.py | py | 1,754 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "twitter.common.lang.Compatibility.string",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "twitter.common.lang.Compatibility",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "twitter.common.dirutil.fileset.Fileset",
"line_number": 9,
... |
1478139833 | import sys
import os
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLineEdit, QLabel, QPushButton, QListView
from PyQt5.QtWidgets import QSizePolicy, QScrollArea, QCompleter, QHBoxLayout, QDialog
from PyQt5.QtCore import Qt, pyqtSlot, QModelIndex
from PyQt5.QtCore import QStandardPaths
import ... | Vivx701/Nighandu | nighandu_gui.py | nighandu_gui.py | py | 15,836 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "PyQt5.QtCore.QStandardPaths.writableLocation",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QStandardPaths",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QStandardPaths.HomeLocation",
"line_number": 13,
"u... |
6241769210 | """A simple simulation of wave packet.
Refer the details to the journal paper: PRA 45, 4734 (1992).
"""
from importlib.resources import path
import numpy as np
import pandas as pd
import xarray as xr
from . import rsc
from .electricfield import ElectricField
__all__ = ["predefined_target", "WavePacket"]
def prede... | DaehyunPY/FERMI_20149100 | Packages/simul2/wavepacket.py | wavepacket.py | py | 1,648 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "importlib.resources.path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "elec... |
31061019305 |
from ..utils import Object
class CancelUploadFile(Object):
"""
Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined
Attributes:
ID (:obj:`str`): ``CancelUploadFile``
Args:
file_id (:obj:`int`):
... | iTeam-co/pytglib | pytglib/api/functions/cancel_upload_file.py | cancel_upload_file.py | py | 735 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "utils.Object",
"line_number": 6,
"usage_type": "name"
}
] |
42850936844 | from django.urls import path
from . import views
urlpatterns = [
path('register/', views.registerPage, name='register'),
path('login/', views.loginPage, name='login'),
path('logout/', views.logoutUser, name='logout'),
path('event_create/', views.event_create, name='event_create'),
path('event_manag... | Barnacle322/esoapp | eventsmanager/eventcreation/urls.py | urls.py | py | 525 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"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",
... |
17754409752 | import tornado.ioloop
import tornado.web
import tornado.httpserver
import io
import os
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy import inspect
from sqla... | gbif/gbif-basemaps | polar-water-tiles/polar-water-preview/server_3575.py | server_3575.py | py | 6,778 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "yaml.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.inspect",
... |
29656137310 | import time
import tweepy
auth = tweepy.OAuthHandler('KINHgXqoSTS5ReyTnjXSYAA6w', 'ehCnMc37yfAf6PPdmzQMJM7pkUb5HYsnPfZw0vf5m9rxPNEbVm')
auth.set_access_token('1488729367346040833-mQJ2oNZDK0Rj49uLojV9WAYL4oURe0', '8zzRNCJ9sGxcnxJxgVEQkfNC7kWL12Akgpd2gdUt6REo3')
api = tweepy.API(auth)
user = api.me()
# public_tweets =... | giochoa/pythontest | twitterbot/tweety.py | tweety.py | py | 978 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tweepy.RateLimitError",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
... |
27698021659 | # -*- coding: utf-8 -*-#
'''
# Name: dnn_regression-keras
# Description:
# Author: super
# Date: 2020/6/2
'''
from HelperClass2.MnistImageDataReader import *
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
import os
os.environ['KMP_DUPLICATE... | Knowledge-Precipitation-Tribe/Neural-network | code/DNN/dnn_regression-keras.py | dnn_regression-keras.py | py | 1,937 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "keras.models.Sequential",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "keras.layers.Dense",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "keras.laye... |
4579701597 | from django.http import JsonResponse
from django.views.generic import View
from .models import Scraper
from .validators import currency_serializer, get_valid_data
class ScraperAPI(View):
def get(self, *args, **kwargs):
currencies = Scraper.objects.all()
data = {"scrapers": list(map(currency_seri... | chvilches/rg-corp | api/views.py | views.py | py | 2,052 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.views.generic.View",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Scraper.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Scraper.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"a... |
74784438504 | import torch
import torch.nn as nn
class MLP(nn.Module):
def __init__(self, input_dim : int, output_dim : int, hidden_dim : list,
num_layers:int, dropout_rate:float=0.):
super(MLP, self).__init__()
self.input_dim = input_dim
self.output_dim = output_dim
self.hidden... | GarfieldCK/AI-module | ai_modules/models/module.py | module.py | py | 1,034 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
27977418436 | #!/usr/bin/env python
import config
import json
import requests
import sys
"""
Copyright (c) 2020, Cisco Systems, Inc. and/or its affiliates
Creates webhooks in a repo upon release using
GitHub API v3 POST /repos/:owner/:repo/hooks
Requires a file with repo names, one per line,
and a personal access token with access... | justwriteclick/gh-webhooks | create_webhook.py | create_webhook.py | py | 3,009 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "requests.Session",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "requests.Request",
"... |
71903311144 | import torch.nn as nn
import torch
import torch.optim as optim
import numpy as np
from torch.utils.data import DataLoader
from prior_learning.toy_env.toyloader import toyenv_Dataset
size = 8
seq_len = 32
categories = 16
batch_size = 128
feature_dim = 16
features = np.random.random((categories, feature_dim))
train_load... | buoyancy99/sap | prior_learning/toy_env/train_toy.py | train_toy.py | py | 1,633 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "numpy.random.random",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pri... |
36622911721 | #"""Build and train for the AI Models."""
#imports
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import datetime
import os
from data_load import DataLoader
import numpy as np
import tensorflow as tf
model_name = ""
def reshape_function(d... | leahimJarun/SensoGripProjectAiModel | train.py | train.py | py | 18,429 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tensorflow.reshape",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.product",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.Sequential",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tensorfl... |
74031939303 | import json
import sys
import aes_functions
import rsa_functions
from exceptions.Exceptions import IncorrectData
from socket_class import SOCKET_SIMPLE_TCP
def receiveAESMessage(s):
return s.receive(), s.receive(), s.receive()
def checkMessageGCM(key, iv, cif, mac):
res = aes_functions.decipherAES_GCM(key,... | makrron/simplified-kerberos-protocol | p-b.py | p-b.py | py | 4,633 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aes_functions.decipherAES_GCM",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "socket_class.SOCKET_SIMPLE_TCP",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "rsa_functions.create_RSAKey",
"line_number": 37,
"usage_type": "call"
},
... |
32967623992 | from django import forms
from django.core.exceptions import ValidationError
from arcana_app.models import Driver, Truck, Trailer, Insurance, Freight
class DateInput(forms.DateInput):
input_type = 'date'
class TimeInput(forms.TimeInput):
input_type = 'time'
# class CheckboxInput(forms.CheckboxInput):
# ... | KamilNurzynski/Arcana | arcana_app/forms.py | forms.py | py | 2,848 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "django.forms.DateInput",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.forms.TimeInput",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "dj... |
70077253225 | from __future__ import print_function
import requests, lxml.html
headers = {'user-agent': 'taco'}
urls_to_check = [
'http://www.packtpub.com/application-development/python-data-structures-and-algorithm',
'https://www.packtpub.com/big-data-and-business-intelligence/learning-data-mining-python-second-edition',
... | chris-hamberg/scrapers | packt.py | packt.py | py | 1,212 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lxml.html.html.fromstring",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "lxml.html.html",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "lxml.html"... |
41709462249 | import unittest
import json
from django.test import TestCase
from datetime import datetime
from utente.models import Utente, Prodotto, ProdottoCarrello, Carrello, Pagamento, Ordine
from vetrine.models import Vetrina, VetrinaAmministratore, ResocontoVendite
# test della creazione di un utente e verifica del relativo c... | MattiaCani/Progetto-ISW | progettoISW/test_unitari/test_models_utente.py | test_models_utente.py | py | 3,801 | python | it | code | 1 | github-code | 36 | [
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utente.models",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "utente.models.Utente.objects.create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
31056930437 | import os.path
from flask import Flask
from flaskext.sqlalchemy import SQLAlchemy
CONFIG_FILEPATH = os.path.join(os.path.dirname(__file__), "../config.cfg")
def auto_register_modules(app):
"""Registers modules from :mod:`subleekr` to application."""
import subleekr
for modname in subleekr.__modules__:
... | sublee/subleekr | subleekr/app.py | app.py | py | 732 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.path.dirname",
"... |
71335938983 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def rightSideView(self, root: Optional[TreeNode]) -> List[int]:
height = 0
subtree = root
... | architjee/solutions | Leetcode/right side view of binary tree.py | right side view of binary tree.py | py | 932 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 18,
"usage_type": "call"
}
] |
2509822081 | # Iris Recognition
# 04. Module to match iris descriptions.
# Language: Python 3
import numpy
import cv2
ROTATIONS = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def _rotate_norm_image(image, rotation):
output = numpy.zeros(image.shape, image.dtype)
if rotation == 0:
... | EmmanuelOlofintuyi/Biometrics | Iris Recognition/d_match_iris.py | d_match_iris.py | py | 1,516 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.bitwise_and",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.bitwise_xor",
"line_num... |
3112497590 | #!/usr/bin/env python3.7
import argparse
import json
import sys
def matches(parts, subject):
if len(parts) == 0:
yield subject
return
part, *rest = parts
# If we're extracting something from `subject`, and `subject` is neither a
# list nor a dict, then there's nothing to extract. W... | dgoffredo/jex | src/jex.py | jex.py | py | 2,192 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 78,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line... |
246221889 | import datetime
import pandas as pd
from helper.fetch import Fetch
from helper.dynamic_scrape import DynamicScrape
from helper.property_helper import PropertyHelper
class Dhalia(object):
source = 'Dhalia'
columns = [
'Reference', 'Town', 'Type', 'Stage',
'Bedrooms', 'Bathrooms',
'Tot... | brandonabela/Malta-Property-Analysis | src/export/dhalia.py | dhalia.py | py | 5,369 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "helper.fetch.Fetch.load_proxies",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "helper.fetch.Fetch",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "h... |
70656671785 | """
Some of code was taken from https://pytorch.org/vision/stable/_modules/torchvision/models/resnet.html
"""
import torch
from torch import Tensor, nn
from typing import Optional, List
from torchvision.models import resnet18
def conv3x3(input_size: int, output_size: int, stride: int = 1) -> nn.Conv2d:
return nn... | timtibilov/AttentionOCR | src/model/cnn.py | cnn.py | py | 4,622 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_nu... |
74678278503 | from django.contrib.auth.decorators import permission_required , login_required
from django.shortcuts import render , redirect , get_object_or_404,HttpResponseRedirect , HttpResponse
from form_1.forms import Form1Form
from form_1.models import Form1
from giris.views import login_view
from .models import Form3 as Form3... | orhunakar01/hekimbey01 | form3/views.py | views.py | py | 3,907 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "models.Form3.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Form3.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "models.Form3",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "model... |
18845748066 | import os,sys,shutil,multiprocessing
sys.path.append("..")
from base.get_config import MyConfig as myconfig
pid=multiprocessing.current_process().pid#获取pid进程编号
folderpath=myconfig("project","project_path").value+myconfig("project","data_path").value
def folder_create(path=None):
if path:
path=path
else:
path=fo... | cainiaosun/study | 测试/自动化合并/autotest/base/web_ui/running_folder.py | running_folder.py | py | 1,130 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.current_process",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "base.get_c... |
154684037 | from django.urls import path
from home import views
urlpatterns = [
path('sign', views.sign, name='sign'),
path('', views.loginp, name='loginp'),
path('logoutp', views.logoutp, name='logoutp'),
path('base', views.base, name='base'),
path('mainhome', views.mainhome, name='home'),
# path('account... | Atharv4507/SP | home/urls.py | urls.py | py | 768 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "home.views.sign",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "home.views",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
... |
42243134200 | import sys, time, itertools
import dill as pickle
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as interp
import scipy.stats as stats
import scipy.optimize as opti
import bead_util as bu
import calib_util as cal
import transfer_func_util as tf
import configuration as config
import war... | charlesblakemore/opt_lev_analysis | scripts/mod_grav/old/alpha_lambda_from_timedomain_fit.py | alpha_lambda_from_timedomain_fit.py | py | 30,732 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "numpy.load",
... |
42130961103 | from beautifultable import BeautifulTable
from Contact_new import Contact
class InMemoryImpl:
contact_list = []
@classmethod
def addContact(cls):
name = input("enter name: ")
email = input("enter email: ")
mobile = input("enter mobile: ")
address = input("enter address:... | adityaKoteCoder/codex | Contactbook/inmemory.py | inmemory.py | py | 3,251 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Contact_new.Contact",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "beautifultable.BeautifulTable",
"line_number": 91,
"usage_type": "call"
}
] |
34222277716 | # -*- coding: utf-8 -*-
import logging
import xml.sax
import slpyser.xmlparser.handlers as handlers
from slpyser.model.abap_objects.AbapDictionary import AbapDictionary
from slpyser.model.abap_objects.AbapMessageClass import AbapMessageClass
from slpyser.model.abap_objects.AbapTextPool import AbapTextElement
class ... | thalesvb/slpyser | slpyser/xmlparser/SAPLinkContentHandle.py | SAPLinkContentHandle.py | py | 10,301 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "xml.sax.sax",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "xml.sax",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "xml.sax.sax.ContentHandler... |
17116817824 | import sys
import argparse
import os
import math
from ROOT import TCanvas, TColor, TGaxis, TH1F, TPad, TString, TFile, TH1, THStack, gROOT, TStyle, TAttFill, TLegend, TGraphAsymmErrors, TLine
from ROOT import kBlack, kBlue, kRed, kCyan, kViolet, kGreen, kOrange, kGray, kPink, kTRUE
from ROOT import Double
from ROOT imp... | BinghuanLi/post_tWIHEP | plotters/make_systHists.py | make_systHists.py | py | 11,190 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ROOT.gROOT.SetBatch",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ROOT.gROOT",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "ROOT.gROOT.Reset",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ROOT.gROOT",
"lin... |
13653886738 | import matplotlib.pyplot as plt
def main():
filename = input('Enter a file name: ')
X = [0,1,2,3,4,5]
Y=[0.78,0.92,0.91,0.88,0.88,0.89]
#plt.ylabel('Generation with best result')
plt.ylabel('Accuracy of result')
plt.plot(X,Y)
plt.xlabel('Degree of polynomial')
plt.... | agatachamula/genetic-algorthm | graphs.py | graphs.py | py | 422 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.ylabel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mat... |
29725189606 | import pandas as pd
import numpy as np
def iat_get_dscore_each_stim(df,subject,rt,block,condition,stimulus,cond1,cond2,blocks,weighted):
'''
Take all relevant columns and produce a D score for each stimulus (i.e. word).
08-2017
Alexander Millner <alexmillner@gmail.com
'''
idx=pd.IndexSli... | amillner/pyiat | pyiat/pyiat.py | pyiat.py | py | 32,040 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas.IndexSlice",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.IndexSlice",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "pandas.concat",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "pandas.In... |
37290685399 | from django.shortcuts import render,redirect
from django.template.context_processors import csrf
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from utilities import utility_functions
from django.contrib.auth.decorators import login_required
from django.http import HttpResp... | bitapardaz/bitasync | payment/views.py | views.py | py | 6,561 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bitasync_site.models.Data_Transfer_Plan.objects.all",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "bitasync_site.models.Data_Transfer_Plan.objects",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "bitasync_site.models.Data_Transfer_Plan"... |
73421338023 |
import sys
import json
import buildCNNModel as cnn
from loadutils import retrieve_model, loadProcessedData, saveDevPredictionsData
from evaluation_helper import convert_raw_y_pred, get_f1, get_precision, get_recall
import numpy as np
def printUsage():
print("USAGE:\n\ntrain a CNN model")
print("All training d... | Chucooleg/CapsNet_for_NER | code/trainCNNModel.py | trainCNNModel.py | py | 3,296 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_numbe... |
41644824235 | from pathlib import Path
import string
import unicodedata
import time
import torch
import torch.nn as nn
import numpy as np
from torch.optim import Adam
def find_files(path, pattern):
return Path(path).glob(pattern)
names_dir = './datasets/data/names'
pat = '*.txt'
print(list(find_files(names_dir, p... | sbl1996/pytorch-snippets | char_lstm.py | char_lstm.py | py | 4,373 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "string.ascii_letters",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "unicodedata.normalize",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "unicoded... |
32694277113 | import forecast
import send_sms
from datetime import datetime
# Since the api call is made at 6:00 AM, hourly_forecast[0] is 6 AM
def main():
startTimes = [8, 8, 8, 8, 8]
endTimes = [18, 16, 18, 18, 10]
date = datetime.today()
dayOfWeek = date.weekday()
message = ""
phone_number = "+19257877379... | kailashbaas/Weather-SMS | main.py | main.py | py | 1,681 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "forecast.get_hourly_forecast",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "... |
34535894055 | #!/usr/bin/python
# open a microphone in pyAudio and get its FFT spectrum
import pyaudio
import numpy as np
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
INPUT_BLOCK_TIME = 0.08
GLIDING_DIVIDER = 4
INPUT_FRAMES_PER_BLOCK = int(RATE*INPUT_BLOCK_TIME/GLIDING_DIVIDER)
soundtype = np.dtype([('l',np.int16),('r',... | maralorn/pythonlights | sound.py | sound.py | py | 1,790 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.dtype",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.int16",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pyaudio.PyAudio",
... |
9571225314 | from wq.db import rest
from .models import Site, AssessmentType, Assessment, Map
from .serializers import AssessmentTypeSerializer, AssessmentSerializer, MapSerializer
from django.conf import settings
rest.router.register_model(
Site,
fields="__all__",
cache="none",
map=[{
'mode': 'list',
... | erikriver/disasters | db/assessments/rest.py | rest.py | py | 1,386 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "wq.db.rest.router.register_model",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.Site",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "wq.db.rest.router",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "... |
7706234863 | from pathlib import Path
from ruamel.yaml import YAML
yaml = YAML()
def get_tasks_files():
matches = []
matches.extend(list(Path(".").rglob("tasks/*.yaml")))
matches.extend(list(Path(".").rglob("tasks/*.yml")))
matches.extend(list(Path(".").rglob("handlers/*.yaml")))
matches.extend(list(Path(".")... | jonsible/iac | find_modules.py | find_modules.py | py | 1,795 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "ruamel.yaml.YAML",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_num... |
10227649807 | """The page module holds the Page class for the web page factory"""
from pathlib import Path
from typing import List
from factory.elements import Element
class Page:
"""Page class holds elements of a web page"""
def __init__(self, name: str, route: str, elements: List[Element]) -> None:
"""Create t... | brianjstroh/bstroh | factory/page.py | page.py | py | 1,113 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "factory.elements.Element",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
769348877 | from get_notes import get_notes
from model import create_network
import pandas as pd
import numpy
import json
from keras.utils import np_utils
from keras.callbacks import ModelCheckpoint
def train_network():
notes = get_notes()
with open("data/notes.json", "w") as filename:
json.dump(notes, filenam... | tanelxen/riff-composer | train.py | train.py | py | 3,628 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "get_notes.get_notes",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_... |
29935238101 | import numpy as np
import matplotlib.pyplot as plt
import json
import matplotlib as mpl
import matplotlib.cm as cm
import cmocean
from colormaputil import truncate_colormap
def getMaxBracket(minYear, maxYear, data):
curMax = 0
for year in range(minYear, maxYear):
ranges = data[str(year)]['ranges']
... | rosslh/Historical-Tax-Rate-Visualizor | plot.py | plot.py | py | 2,244 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors.Normalize",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "colorma... |
16049471546 | import subprocess
import os
import logging
import platform
from tqdm import tqdm
from ffcuesplitter.exceptions import FFMpegError, FFCueSplitterError
from ffcuesplitter.utils import makeoutputdirs, Popen
if not platform.system() == 'Windows':
import shlex
class FFMpeg:
"""
FFMpeg is the base class interf... | jeanslack/FFcuesplitter | ffcuesplitter/ffmpeg.py | ffmpeg.py | py | 8,582 | python | en | code | 21 | github-code | 36 | [
{
"api_name": "platform.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "ffcuesplitter.exceptions... |
2265860444 | import os
import sys
import importlib
import pkgutil
from contextlib import contextmanager
from typing import TypeVar, Union, Generator
from pathlib import Path
PathType = Union[os.PathLike, str]
T = TypeVar("T")
ContextManagerFunctionReturnType = Generator[T, None, None]
class cached_property(object):
""" A prop... | BorealisAI/DT-Fixup | spider/semparser/common/utils.py | utils.py | py | 2,616 | python | en | code | 15 | github-code | 36 | [
{
"api_name": "typing.Union",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "os.PathLike",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "typing.TypeVar",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.Generator",
"li... |
34014676895 | from flask import Flask, request, abort, render_template, make_response
import json, requests
from StringIO import StringIO
from time import sleep
try:
from metatool import metatool
except ImportError:
import metatool
try:
from metatool import viz
except ImportError:
import viz
try:
from metatool... | CottageLabs/metatool | metatool/web.py | web.py | py | 3,276 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "config.BASE_URL",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "flask.request.... |
1938073175 | from pathlib import Path
import json
from .util import filter_fields
def KMANGLED_encode(
data, sort_keys=False, indent=None, ignore_private=False, ignore_none=False
):
return json.dumps(
filter_fields(data, ignore_private, ignore_none),
sort_keys=sort_keys,
indent=indent,
)
def... | kcl-lang/kcl-py | kclvm/compiler/extension/builtin/system_module/json.py | json.py | py | 652 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "util.filter_fields",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_num... |
27876220800 | # Core Pkgs
import streamlit as st
#Other Pkgs
#EDA Pkgs
import pandas as pd
import codecs
from pandas_profiling import ProfileReport
#Component Pkgs
import streamlit.components.v1 as components #v1 is version1 : If new features are added, then it will not break your app
from streamlit_pandas_profiling import st_pro... | yashpupneja/StreamAI | DS_pandas_profiling.py | DS_pandas_profiling.py | py | 2,412 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "codecs.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "streamlit.components.v1.html",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "streamlit.components.v1",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "stre... |
36619014009 | # pylint: disable=not-callable, no-member, invalid-name, line-too-long, wildcard-import, unused-wildcard-import, missing-docstring
import torch
import e3nn.point.data_helpers as dh
from e3nn import rs
import numpy as np
torch.set_default_dtype(torch.float64)
def test_data_helpers():
N = 7
lattice = torch.ran... | clementbernardd/ares_fork | lib/ares/e3nn_ares/tests/point/data_helpers_test.py | data_helpers_test.py | py | 3,520 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.set_default_dtype",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.float64",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.randn",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.randn",
... |
25163452547 | #!/usr/bin/env python
import typer
import logging
import os
# logging.basicConfig(level=logging.INFO, format="%(asctime)s %(filename)s: %(levelname)6s %(message)s")
#
# LOG = logging.getLogger(__name__)
from easul.driver import MemoryDriver
app = typer.Typer(help="EASUL tools to manage and extend the abilities of th... | rcfgroup/easul | manage.py | manage.py | py | 1,926 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typer.Typer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "easul.util.create_package_class",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "easul.driver.MemoryDriver.from_reference",
"line_number": 20,
"usage_type": "call"
},
{
... |
31948081711 | import requests
import streamlit as st
st.title("Weather Report ☁️")
def kelvin_to_celsius(kelvin):
return kelvin - 273.15
def kelvin_to_fahrenheit(kelvin):
return (kelvin - 273.15) * 9/5 + 32
def get_wind_direction(degrees):
directions = ["North", "North-East", "East", "South-East", "South"... | Yashwanth-2701/Weather-Report | app.py | app.py | py | 2,512 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.title",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "streamlit.text_input",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "streamlit.button",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
43570030497 | import warnings
from pymysql.tests import base
import pymysql.cursors
class CursorTest(base.PyMySQLTestCase):
def setUp(self):
super(CursorTest, self).setUp()
conn = self.connections[0]
self.safe_create_table(
conn,
"test", "create table test (data varchar(10))",
... | PyMySQL/Tornado-MySQL | tornado_mysql/tests/test_cursor.py | test_cursor.py | py | 1,959 | python | en | code | 408 | github-code | 36 | [
{
"api_name": "pymysql.tests.base.PyMySQLTestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pymysql.tests.base",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pymysql.tests.connect",
"line_number": 20,
"usage_type": "call"
},
{
"ap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.