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
9731647108
#!/usr/bin/env python3 # GitHubScrap is a simple Python 3 script that automates GitHub OSINT during early stages of Red Team exercises # author - mamatb (t.me/m_amatb) # location - https://github.com/mamatb/GitHubScrap # style guide - https://google.github.io/styleguide/pyguide.html # TODO # # readme.md # randomize d...
mamatb/GitHubScrap
GitHubScrap.py
GitHubScrap.py
py
12,367
python
en
code
6
github-code
7
[ { "api_name": "sys.stderr", "line_number": 43, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 51, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 56, "usage_type": "attribute" }, { "api_name": "json.load", "line...
23684249485
import numpy as np import cv2 from keras.models import load_model ############################################# frameWidth = 640 # Resolución de la cámara frameHeight = 480 brightness = 180 umbral = 0.85 # Umbral font = cv2.FONT_HERSHEY_SIMPLEX #Tipo de fuente de la letra #Ejecutar la cámara cap = cv2.VideoCaptu...
IsmaelRH1807/ComputerVision_TrafficSignRecognition
Senales_test.py
Senales_test.py
py
2,483
python
es
code
0
github-code
7
[ { "api_name": "cv2.FONT_HERSHEY_SIMPLEX", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 23, "usage_type": "call" }, { "api_name":...
24518187148
# -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this source code package. # # import os from mpi4py import MPI if MPI.COMM_WORLD.Get_size() > 1: # pragma: no cover os.environ["OMP_NUM_THREADS"] = "1" os.environ["OPENBLAS_NUM_THREADS...
feelpp/mordicus
src/poc-1/src/Mordicus/Modules/Safran/Containers/Loadings/Temperature.py
Temperature.py
py
8,538
python
en
code
0
github-code
7
[ { "api_name": "mpi4py.MPI.COMM_WORLD.Get_size", "line_number": 10, "usage_type": "call" }, { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 10, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 10, "usage_type": "name" }, { "api_name": "...
188231977
# QuTiP Utility Functions # Dec 24, 2015 # Deepak Vaid import numpy as np import matplotlib.pyplot as plt from qutip import * try: from qutip import * except: raise NameError('QuTiP is not installed') def identityList(N = 1,dims = 2): '''Returns a list of N identity operators for a N site spin-system wit...
space-cadet/jupyter-notebooks
qutip_utils.py
qutip_utils.py
py
14,839
python
en
code
1
github-code
7
[ { "api_name": "numpy.sqrt", "line_number": 113, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 118, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 118, "usage_type": "attribute" }, { "api_name": "qutip.dag", "line_number": ...
8337140285
#!/usr/bin/env python3 import singer from singer import utils from tap_intercom.discover import discover from tap_intercom.sync import sync LOGGER = singer.get_logger() REQUIRED_CONFIG_KEYS = [ 'access_token', 'start_date', 'user_agent' ] def do_discover(): LOGGER.info('Starting discover') cat...
singer-io/tap-intercom
tap_intercom/__init__.py
__init__.py
py
981
python
en
code
12
github-code
7
[ { "api_name": "singer.get_logger", "line_number": 9, "usage_type": "call" }, { "api_name": "tap_intercom.discover.discover", "line_number": 20, "usage_type": "call" }, { "api_name": "singer.utils.parse_args", "line_number": 31, "usage_type": "call" }, { "api_name"...
38159367989
import tkinter as tk import numpy as np from keras.models import load_model # Constantes MIN_VALUE: float = 75000.0 MAX_VALUE: float = 7700000.0 def recover_value(v: float) -> float: return v * (MAX_VALUE - MIN_VALUE) + MIN_VALUE # Model model = load_model("model.h5") # Interface # Create the ...
KingOat/Linear-Regression-House-Price-Predictor-With-GUI
graphic_interface.py
graphic_interface.py
py
2,005
python
en
code
0
github-code
7
[ { "api_name": "keras.models.load_model", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 18, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 27, "usage_type": "call" }, { "api_name": "tkinter.Entry", ...
6803786489
import discord from discord.ext import commands from config import Config import random import os bot = commands.Bot(command_prefix='!') @bot.command(pass_context=True) async def greet(ctx): user = ctx.message.author.name await ctx.send(f'Hello {user}') @bot.command() async def users(ctx): listOfUsers = ...
Sakub/SkbDiscordBot
app.py
app.py
py
2,015
python
en
code
0
github-code
7
[ { "api_name": "discord.ext.commands.Bot", "line_number": 6, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "discord.utils.find", "line_number": 17, "usage_type": "call" }, { "api_name": "discor...
31570312574
import json import logging.config from functools import partial import traceback from pathlib import Path from pydicom import dcmread from pydicom.dataset import Dataset from pynetdicom import AE, StoragePresentationContexts, evt from pynetdicom import sop_class from database import MyPACSdatabase import adapter cl...
pyb0924/MyPACS
MyPACSServer/server.py
server.py
py
6,810
python
en
code
4
github-code
7
[ { "api_name": "pynetdicom.AE", "line_number": 16, "usage_type": "name" }, { "api_name": "json.load", "line_number": 23, "usage_type": "call" }, { "api_name": "pynetdicom.StoragePresentationContexts", "line_number": 29, "usage_type": "name" }, { "api_name": "pynetd...
70882954785
# A Python program to print topological sorting of a graph # using indegrees from collections import defaultdict # Class to represent a graph class Graph: def __init__(self, vertices): self.graph = defaultdict(list) # dictionary containing adjacency List self.V = vertices # No. of verti...
kalpak92/DataStructures_Algorithms
Graph Algorithms/Topological Sort/TopologicalSort.py
TopologicalSort.py
py
2,353
python
en
code
14
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" } ]
13793261912
""" Creates plots in matplotlib from reticulated input from R in order to make nice plots with good control. """ import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt import seaborn as sb from sklearn.preprocessing import scale import scripts.utils.helpers as hs def density_plot(...
BiomedicalMachineLearning/Medulloblastoma
scripts/X2_DEAnalysis/DE_figure_helpers.py
DE_figure_helpers.py
py
7,346
python
en
code
2
github-code
7
[ { "api_name": "matplotlib.rcParams.update", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 24, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 29, "usage_type": "call" }, { "ap...
9965192846
import logging from pathlib import Path from asr.datasets.custom_audio_dataset import CustomAudioDataset from asr.text_encoder.ctc_text_encoder import CTCTextEncoder from asr.utils.parse_config import ConfigParser logger = logging.getLogger(__name__) class CustomDirAudioDataset(CustomAudioDataset): def __init__...
khaykingleb/Automatic-Speech-Recognition
asr/datasets/custom_dir_audio_dataset.py
custom_dir_audio_dataset.py
py
1,333
python
en
code
3
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "asr.datasets.custom_audio_dataset.CustomAudioDataset", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { ...
42836425407
import copy from lib.membase.api.rest_client import RestConnection from pytests.eventing.eventing_base import EventingBaseTest from pytests.eventing.eventing_constants import HANDLER_CODE, HANDLER_CODE_CURL from lib.testconstants import STANDARD_BUCKET_PORT from lib.couchbase_helper.tuq_helper import N1QLHelper from s...
couchbaselabs/testrunner-py3
pytests/eventing/eventing_curl.py
eventing_curl.py
py
9,421
python
en
code
2
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "pytests.eventing.eventing_base.EventingBaseTest", "line_number": 15, "usage_type": "name" }, { "api_name": "lib.testconstants.STANDARD_BUCKET_PORT", "line_number": 30, "usage_type...
29039721920
from __future__ import annotations from aoc import * from typing import NamedTuple, Optional from itertools import combinations class Thing(NamedTuple): is_chip: bool element: str def as_generator(self): return Thing(False, self.element) if self.is_chip else self class ThingList(NamedTuple): ...
tkirill/adventofcode
2016/python/11_Radioisotope_Thermoelectric_Generators.py
11_Radioisotope_Thermoelectric_Generators.py
py
4,211
python
en
code
2
github-code
7
[ { "api_name": "typing.NamedTuple", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.NamedTuple", "line_number": 15, "usage_type": "name" }, { "api_name": "itertools.combinations", "line_number": 29, "usage_type": "call" }, { "api_name": "typing.Name...
74108084702
# -*- coding: utf-8 -*- """ Created on Tue Mar 17 17:47:31 2020 @author: hawki """ import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim xtrn = torch.FloatTensor([[73,80,75], [93,88,93], [89,91,90], ...
hawking74/Moning
Lab 04-1. Multi var. linear regression.py
Lab 04-1. Multi var. linear regression.py
py
1,727
python
en
code
0
github-code
7
[ { "api_name": "torch.FloatTensor", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.FloatTensor", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.zeros", "li...
42919481752
#!/usr/bin/env python # coding: utf-8 import os import codecs from setuptools import setup, find_packages import ibclient def parse_requirements(filename): with open(filename) as f: required = f.read().splitlines() return required long_desc = """ IBClient =============== A Pytho...
chrjxj/ibclient
setup.py
setup.py
py
1,413
python
en
code
2
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 22, "usage_type": "call" }, { "api_name": "ibclient.__version__", "line_number": 24, "usage_type": "attribute" }, { "api_name": "setuptools.find_packages", "line_number": 43, "usage_type": "call" } ]
7266921103
import copy import torch as th import numpy as np import torch.nn.functional as F from modules.mixers.dmaq_general import DMAQer from components.episode_buffer import EpisodeBatch from modules.mixers.dmaq_qatten import DMAQ_QattenMixer from torch.optim import RMSprop from torch.utils.data.sampler import BatchSampler, ...
lich14/CDS
CDS_GRF/learners/CDS_QPLEX.py
CDS_QPLEX.py
py
22,996
python
en
code
75
github-code
7
[ { "api_name": "modules.mixers.dmaq_general.DMAQer", "line_number": 26, "usage_type": "call" }, { "api_name": "modules.mixers.dmaq_qatten.DMAQ_QattenMixer", "line_number": 28, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 32, "usage_type": "call" ...
7046185133
import logging import os import numpy as np import torch import torch.optim as optim from torch.autograd import Variable from tqdm import tqdm import utils import model.crnn as crnn from model import data_loader from evaluate import evaluate import matplotlib.pyplot as plt import torch.nn as nn import pandas as pd ...
Saahil-Agr/ElNino-Forecasting
train.py
train.py
py
7,600
python
en
code
0
github-code
7
[ { "api_name": "model.crnn.train", "line_number": 22, "usage_type": "call" }, { "api_name": "model.crnn", "line_number": 22, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number": 28, "usage_type": "call" }, { "api_name": "model.crnn", "line_number":...
2291295499
"""Example of a TensorBoard dynamic plugin.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import mimetypes import os from tensorboard.plugins import base_plugin from werkzeug import wrappers class ReactPlugin(base_plugin.TBPlugin): """WebpackReact ...
stephanwlee/tensorboard-plugin-react-example
tensorboard_plugin_react/react_plugin.py
react_plugin.py
py
1,795
python
en
code
5
github-code
7
[ { "api_name": "tensorboard.plugins.base_plugin.TBPlugin", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorboard.plugins.base_plugin", "line_number": 13, "usage_type": "name" }, { "api_name": "mimetypes.guess_type", "line_number": 40, "usage_type": "ca...
37448621564
import pytest import abjad def test_get_duration_01(): """ Container duration in seconds equals sum of leaf durations in seconds. """ staff = abjad.Staff("c'8 d'8 e'8 f'8") mark = abjad.MetronomeMark(abjad.Duration(1, 4), 38) abjad.attach(mark, staff[0]) mark = abjad.MetronomeMark(abjad....
tastethewhip/abjad
tests/test_get_duration.py
test_get_duration.py
py
2,224
python
en
code
null
github-code
7
[ { "api_name": "abjad.Staff", "line_number": 11, "usage_type": "call" }, { "api_name": "abjad.MetronomeMark", "line_number": 12, "usage_type": "call" }, { "api_name": "abjad.Duration", "line_number": 12, "usage_type": "call" }, { "api_name": "abjad.attach", "li...
20571093508
import os import json import logging import opencryptobot.constants as con from argparse import ArgumentParser from opencryptobot.database import Database from opencryptobot.telegrambot import TelegramBot from opencryptobot.config import ConfigManager as Cfg from logging.handlers import TimedRotatingFileHandler clas...
Endogen/OpenCryptoBot
opencryptobot/start.py
start.py
py
5,296
python
en
code
89
github-code
7
[ { "api_name": "opencryptobot.config.ConfigManager", "line_number": 20, "usage_type": "call" }, { "api_name": "opencryptobot.database.Database", "line_number": 29, "usage_type": "call" }, { "api_name": "opencryptobot.telegrambot.TelegramBot", "line_number": 33, "usage_type...
42698998593
import json with open('Datasets/source-data.json') as aj: read_content = json.load(aj) save_data = [] def data_access(): question_access = read_content['results'] for question_data in question_access: #print(question_data) replies_access = question_data['replies'] for replies_dat...
yeja94/PythonExercises
data_access_json.py
data_access_json.py
py
666
python
en
code
0
github-code
7
[ { "api_name": "json.load", "line_number": 4, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 22, "usage_type": "call" } ]
32524697671
import matplotlib.pyplot as plt """ x = [24.45,44.45,47.36,51.795] y = [0.351,0.162,0.175,0.1076] plt.plot(x, y, label = "line 1") """ #neu x = [44.77,57.11,59.06,62.57] y = [0.351,0.162,0.175,0.1076] plt.plot(x, y, label = "Relationship GTM score and detection accuracy") x1 = [44.77,62.57] y1 = [0.35,0....
radtklau/Image-annotation-tooling-object-detection
HOTA_GTM.py
HOTA_GTM.py
py
894
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 15, "usage_type": "call" }, { "api_name": "matpl...
27586395672
#!/usr/bin/env python3 """Fetch RSS and post it to Slack channel. 2017/Sep/03 @ Zdenek Styblik <stybla@turnovfree.net> """ import argparse import logging import os import sys import time import traceback from typing import Dict, List, Tuple import rss2irc from slack import WebClient SLACK_BASE_URL = WebClient.BASE_U...
zstyblik/rss2irc
rss2slack.py
rss2slack.py
py
6,426
python
en
code
1
github-code
7
[ { "api_name": "slack.WebClient.BASE_URL", "line_number": 17, "usage_type": "attribute" }, { "api_name": "slack.WebClient", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Dic...
6836098830
#!/usr/bin/env python # coding=utf-8 #!C:\Python27\python.exe from k8s import Connection from kuby import Kuby import argparse class Main(): def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--server', required=True, ...
rocko83/terra
terra/src/main.py
main.py
py
1,627
python
en
code
0
github-code
7
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "kuby.Kuby", "line_number": 35, "usage_type": "call" }, { "api_name": "k8s.getPodLog", "line_number": 59, "usage_type": "call" }, { "api_name": "k8s.getPodContainers"...
34896037583
import connexion import six import random import logging from os import path from flask import g from flask import abort from datetime import datetime from coolname import RandomGenerator from playhouse.flask_utils import get_object_or_404 from coolname.loader import load_config import hashlib from config...
Kl0ven/rpg-api
rpg_api/controllers/lootbox_controller.py
lootbox_controller.py
py
3,028
python
en
code
0
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "rpg_api.models.database.database.atomic", "line_number": 35, "usage_type": "call" }, { "api_name": "rpg_api.models.database.database", "line_number": 35, "usage_type": "attribute"...
72411763422
import time import os from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium import webdriver from selenium.webdriver.common.by import By os.environ['PATH'] += r"C:/Users/ASUS/Documents/pyprojects/seleniumdrivers" url = "https://www.bbcg...
Woodenman23/RECIPE_BOOK
scraping/click.py
click.py
py
809
python
en
code
0
github-code
7
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 16, "usage_type": "name" }, { "api_name": "selenium...
3687739055
from functools import cache # iterative dp solution class Solution: def isInterleave(self, s1: str, s2: str, s3: str) -> bool: l1, l2 = len(s1), len(s2) if l1 + l2 != len(s3): return False if l2 > l1: s1, l1, s2, l2 = s2, l2, s1, l1 dp = [False] * (l2 + 1)...
Vskesha/learning-modules
leetcode_solutions/p97_interleaving_string.py
p97_interleaving_string.py
py
1,560
python
en
code
0
github-code
7
[ { "api_name": "functools.cache", "line_number": 38, "usage_type": "name" } ]
39650254814
import matplotlib.pyplot as plt import numpy as np import argparse import json ''' Given multiple benchmark data, compare them and plot the result ''' if __name__ == "__main__": benchmark_results = ["190225_lstm_sklearn_n_threads_1_tlimit_100.json", "190225_simple_sklearn_n_threads_1_tlimit_100.json"] re...
HazyResearch/d3m-model-search
Stanford-D3M-Full/apps/compare_benchmarks.py
compare_benchmarks.py
py
1,087
python
en
code
2
github-code
7
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "numpy.maximum....
32168695093
import argparse import os import utils.utils as utils import numpy as np from PIL import Image import shutil def save_files(dst_path,files): src_path = files['root'] file_type = files['file_type'] for file in files['files']: src_f = os.path.join(src_path,file) + '.' + file_type #img...
Cybonic/ortho-tools
pair_selection.py
pair_selection.py
py
2,653
python
en
code
0
github-code
7
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
38883795749
from setuptools import setup, find_packages with open("README.rst") as fp: long_description = fp.read() setup( name="pykube", version="0.12.0", description="Python client library for Kubernetes", long_description=long_description, author="Eldarion, Inc.", author_email="development@eldari...
mechaphish/pykube
setup.py
setup.py
py
842
python
en
code
1
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 26, "usage_type": "call" } ]
29299769653
from flask import Flask, render_template, request,jsonify import pickle from sklearn.preprocessing import LabelEncoder, StandardScaler app = Flask(__name__) model='' label_encoder_year='' label_encoder_count='' scaler='' # Load the trained model with open('./model.pkl', 'rb') as file: model = pickle.loa...
Be-anish/Mental-Fitness-Tracker
app.py
app.py
py
3,045
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 17, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 1...
2922323619
import unittest from models.base import Base from models.rectangle import Rectangle import io import sys """tests the subclass Rectangle""" class testRectangleClass(unittest.TestCase): """test whether the rectangle is an instance of the Base class""" def test_rect_instances(self): r1 = Rectangle(10, 2...
JuneMbuvi/alx-higher_level_programming
0x0C-python-almost_a_circle/tests/test_rectangle.py
test_rectangle.py
py
5,049
python
en
code
0
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.rectangle.Rectangle", "line_number": 12, "usage_type": "call" }, { "api_name": "models.base.Base", "line_number": 13, "usage_type": "argument" }, { "api_name": ...
20985030856
import os import time import copy import torch import torchvision import pandas as pd import numpy as np import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.utils.data import Dataset, DataLoader from torchvision import transforms, models, datasets import torch.nn.functional...
cwha0212/posenet_pkg
posenet_pkg/node_data_loader.py
node_data_loader.py
py
1,484
python
en
code
0
github-code
7
[ { "api_name": "torch.utils.data.Dataset", "line_number": 18, "usage_type": "name" }, { "api_name": "torchvision.transforms.Compose", "line_number": 50, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 50, "usage_type": "name" }, { "ap...
72859898142
import os.path as osp from PIL import Image from torch.utils.data import Dataset def read_image(img_path): """Keep reading image until succeed. This can avoid IOError incurred by heavy IO process.""" got_img = False if not osp.exists(img_path): raise IOError("{} does not exist".format(img_path...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/classification/ReidStrongBaseline/data/datasets/dataset_loader.py
dataset_loader.py
py
1,087
python
en
code
31
github-code
7
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": ...
2387613491
import sys import os from pyspark.sql import types as T from pyspark.sql import functions as F from pyspark.sql import SparkSession sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir)) from src.transform_api import configure, transform, Input, Output, DataType, SaveMode # sc...
kripso/climathon-fiit-re
src/data_processing/migrate_addresses_dateset.py
migrate_addresses_dateset.py
py
1,362
python
en
code
1
github-code
7
[ { "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": ...
33978938523
# -*- coding: utf-8 -*- import logging import signal import sys import codecs import os import mamonsu.lib.platform as platform from mamonsu.lib.parser import parse_args, print_total_help from mamonsu.lib.config import Config from mamonsu.lib.supervisor import Supervisor from mamonsu.lib.plugin import Plugin from mam...
gridl/mamonsu
mamonsu/lib/runner.py
runner.py
py
3,256
python
en
code
null
github-code
7
[ { "api_name": "logging.info", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 21, "usage_type": "call" }, { "api_name": "signal.signal", "line_number": 23, "usage_type": "call" }, { "api_name": "signal.SIGTERM", "line_number...
70723626465
import os import re import time from datetime import timedelta, timezone, datetime from flask_wtf.csrf import CSRFProtect from flask_cors import CORS from flask import Flask, render_template, request, jsonify, redirect, url_for, make_response from flask_jwt_extended import JWTManager, create_access_token, verify_jwt_...
GitYVR/yvrfob
app.py
app.py
py
9,867
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 23, "usage_type": "call" }, { "api_name": "flask_wtf.csrf.CSRFProtect", "line_number": 24, "usage_type": "call" }, { "api_name": "yvrfob.secrets.SECRET_KEY", "line_number": 28, "usage_type": "name" }, { "api_name": "date...
22202610850
from sklearn.decomposition import KernelPCA from sklearn.decomposition import PCA from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from matplotlib import pyplot class Decomposition: """ Constructor """ def __init__(self): self.lda = None self.kpca = None se...
efikalti/computational-intelligence
SVM/src/decomposition.py
decomposition.py
py
5,251
python
en
code
0
github-code
7
[ { "api_name": "sklearn.decomposition.KernelPCA", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.discriminant_analysis.LinearDiscriminantAnalysis", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.discriminant_analysis.LinearDiscriminantAnalysis...
2811856230
#import smtplib #my_email = "dimitrov22@yahoo.com" #password = "" #with smtplib.SMTP("smtp.mail.yahoo.com") as connection: #connection.starttls() #connection.login(user=my_email, password=password) #connection.sendmail(from_addr=my_email, #to_addrs="stefan.dimitrov.dimitrov@gmail.c...
StefanDimitrovDimitrov/100_days_Python
32-day - SMTP/Birthday Wisher (Day 32) start/main.py
main.py
py
564
python
en
code
1
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "call" } ]
12910016605
from setuptools import setup, find_packages import sys, os version = '0.1.4' setup(name='maclocate', version=version, description="Python interface to the SkyHook wireless API", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers...
iancmcc/maclocate
setup.py
setup.py
py
843
python
en
code
9
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 17, "usage_type": "call" } ]
30526412438
import sqlite3 # 전역 변수 선언 db, cur = None, None # 연결자, 커서를 저장하는 변수 초기화 # 테이블 삭제 def saveType(addTitle, addSec, addMsec, addtype): db = sqlite3.connect("./alarmDB") # db, sqlite 연결 cur = db.cursor() # db 명령어 연결 # db.execute("DROP TABLE studentTable") # 테이블 있는지 확인 cur.execute("...
olsi10/peo-ddeug
Normal/app.py
app.py
py
1,130
python
ko
code
0
github-code
7
[ { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 30, "usage_type": "call" } ]
37589136404
from numpy import zeros from numpy.random import random from numpy import column_stack from numpy import sort from numpy import cos from numpy import sin from numpy import pi from modules.helpers import random_points_in_circle TWOPI = 2*pi def get_rnd_circ(noise): def f(self): a = sort((random() + random(self...
maryannh/sand-creatures
modules/paths.py
paths.py
py
1,724
python
en
code
3
github-code
7
[ { "api_name": "numpy.pi", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.sort", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.column_stack", "lin...
26868932413
import logging from typing import Any, MutableMapping, Optional from cloudformation_cli_python_lib import ( Action, HandlerErrorCode, OperationStatus, ProgressEvent, Resource, SessionProxy, ) from datadog_api_client.v2 import ApiException from datadog_api_client.v2.api.downtimes_api import Down...
DataDog/datadog-cloudformation-resources
datadog-monitors-downtimeschedule-handler/src/datadog_monitors_downtimeschedule/handlers.py
handlers.py
py
16,674
python
en
code
47
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 77, "usage_type": "call" }, { "api_name": "cloudformation_cli_python_lib.Resource", "line_number": 81, "usage_type": "call" }, { "api_name": "models.ResourceModel", "line_number": 81, "usage_type": "argument" }, { ...
4394019927
import sys import json from api.delete_ocr_resource import DeleteUAIOcrResourceApi # usage: python create_async_toframe_job.py config_file='controller-config.json' def load_config(config_file): with open(config_file, 'r') as fp: config_params = json.loads(fp.read()) public_key = config_params['public_...
ucloud/uai-saas-sdk
uai-ocr-sdk/test/delete_ocr_resource.py
delete_ocr_resource.py
py
766
python
en
code
4
github-code
7
[ { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "api.delete_ocr_resource.DeleteU...
24197974782
import cv2 import numpy as np class Helper: """ Helper class for image operations. """ @staticmethod def apply_transparency_mask(image): """ Sets any black pixels to transparent. :param image: Image to set transparency :type image: numpy.ndarray ...
steelwalrus/tileset-cli
helper.py
helper.py
py
1,214
python
en
code
0
github-code
7
[ { "api_name": "cv2.split", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.merge", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.all", "line_number": 27, ...
38328297357
import numpy as np import scipy as sp import pandas as pd import matplotlib import matplotlib.pyplot as plt import seaborn as sns matplotlib.use('TkAgg') data = pd.read_csv('../data/2015.csv') fig, ax = plt.subplots() fig.patch.set_visible(False) ax.axis('off') # print(by_region) """ Question: What is most important ...
albertye1/np-sp-pd
happiness/src/most_related.py
most_related.py
py
885
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.use", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.py...
36738910857
import pickle, os from spectraclass.data.base import DataManager from spectraclass.data.base import ModeDataManager from spectraclass.model.labels import LabelsManager, lm from spectraclass.data.spatial.tile.manager import TileManager, tm from spectraclass.data.spatial.tile.tile import Block import xarray as xa, numpy ...
nasa-nccs-cds/spectraclass
spectraclass/test/samples_test.py
samples_test.py
py
2,191
python
en
code
4
github-code
7
[ { "api_name": "spectraclass.data.base.DataManager", "line_number": 12, "usage_type": "name" }, { "api_name": "spectraclass.data.base.DataManager.initialize", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 16, "usage_type": "c...
19547871309
from collections import Counter def solution(a): if len(a) < 4: return 0 counter = Counter(a) answer = 0 for x in counter.keys(): if counter[x] < answer: continue i = 0 cnt = 0 while i < len(a) - 1: if (a[i] == a[i + 1]) or (a[i] != x and ...
MinHoon-LEE/Ps_Sql
Programmers/Algorithm/Python/70130/70130.py
70130.py
py
482
python
en
code
2
github-code
7
[ { "api_name": "collections.Counter", "line_number": 6, "usage_type": "call" } ]
33766589977
import datetime from django.shortcuts import render, redirect from googleapiclient.discovery import build from smir.models import UserCredentials from .mqtt import client from .utils import refresh_token def index(request): if request.user.is_authenticated: try: UserCredentials.objects.get(u...
mahooly/Smart_Mirror
smir/views.py
views.py
py
2,229
python
en
code
0
github-code
7
[ { "api_name": "smir.models.UserCredentials.objects.get", "line_number": 14, "usage_type": "call" }, { "api_name": "smir.models.UserCredentials.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "smir.models.UserCredentials", "line_number": 14, "usage_...
17600168883
""" Author: Steve Resource: http://www.steves-internet-guide.com/client-connections-python-mqtt/ """ import time import json import sys import getopt import paho.mqtt.client as mqtt def test_latency(broker_name, port_num, TLS_service, path, QOS): mqttclient_log = True max_connection_time = 6 # if not conne...
ShiluYang96/Mqtt-file-transfer
mqtt_ping.py
mqtt_ping.py
py
6,968
python
en
code
2
github-code
7
[ { "api_name": "json.loads", "line_number": 57, "usage_type": "call" }, { "api_name": "paho.mqtt.client.Client", "line_number": 65, "usage_type": "attribute" }, { "api_name": "paho.mqtt.client", "line_number": 65, "usage_type": "name" }, { "api_name": "paho.mqtt.cl...
40949893349
#!/usr/bin/python3 # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np #讀取 訓練/驗證 資料 x_val = np.load('x_validation.npy') x_train = np.load('x_train.npy') y_val = np.load('y_validation.npy') y_train = np.load('y_train.npy') #增加一行1 對齊bias term x_val = np.concatenate((np.ones((x_val.shape[0], 1)), ...
YLTsai0609/Air_quality_project-with-pm25
pm25/model_selcetion.py
model_selcetion.py
py
1,199
python
en
code
0
github-code
7
[ { "api_name": "numpy.load", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 9, ...
73391440543
""" @Author Jordan Dubreuil 04/23/2023 Unit testing for Dequeque Abstract Data Type. """ from dequeue import * import unittest import io import sys from unittest.mock import patch class TestDequeque(unittest.TestCase): # Tests Display of Dequeque def test_display(self): my_instance = Dequeque() ...
jdubreuil00/FoundationsOfProgrammingJDubreuil
A6/test_dequeue.py
test_dequeue.py
py
1,564
python
en
code
0
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.stdout", "...
38558763053
import re from pathlib import Path regex = re.compile(r'(^---\n\n)', flags=re.M) for rmd_pth in Path().glob('*.Rmd'): contents = rmd_pth.read_text() if '_common.R' in contents: continue if regex.search(contents): contents = regex.sub("""\ --- ```{r setup, include=FALSE} source("_common.R"...
resampling-stats/throwaway-scripts
add_common.py
add_common.py
py
379
python
en
code
1
github-code
7
[ { "api_name": "re.compile", "line_number": 4, "usage_type": "call" }, { "api_name": "re.M", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" } ]
4167707596
""" homeassistant.components.alarm_control_panel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Component to interface with a alarm control panel. """ import logging import os from homeassistant.components import verisure from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_ALARM_TRIGGER, SERVICE_ALARM_DISA...
hcchu/home-assistant-clone
homeassistant/components/alarm_control_panel/__init__.py
__init__.py
py
4,052
python
en
code
1
github-code
7
[ { "api_name": "homeassistant.components.verisure.DISCOVER_SENSORS", "line_number": 24, "usage_type": "attribute" }, { "api_name": "homeassistant.components.verisure", "line_number": 24, "usage_type": "name" }, { "api_name": "homeassistant.const.SERVICE_ALARM_DISARM", "line_nu...
27675103805
from django.conf.urls import url from .views import ( InvoiceCreateAPIView, InvoiceListAPIView ) urlpatterns = [ url(r'^$', InvoiceListAPIView.as_view(), name='list-invoices'), url(r'^create-invoice/$', InvoiceCreateAPIView.as_view(), name='create-invoice'), ]
glosoftgroup/glosoftgroup-django-pos
saleor/api/invoice/urls.py
urls.py
py
295
python
en
code
1
github-code
7
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "views.InvoiceListAPIView.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "views.InvoiceListAPIView", "line_number": 10, "usage_type": "name" }, { "ap...
24682997971
__copyright__ = "Copyright (C) 2019 NXP Semiconductors" __license__ = "MIT" from django.contrib import admin from .models import ImageDatabase, LogsDatabase class Image(admin.ModelAdmin): fields = ( 'id', 'name', 'face', 'thumbnail' ) readonly_fields = ( 'id', ...
nxp-imx-support/eiq-heterogenous-cortexa
Recognition/admin.py
admin.py
py
736
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 20, "usage_type": "attribute" ...
24353822671
import copy import os from collections import OrderedDict from typing import TYPE_CHECKING, Any, Mapping, Optional, Union if TYPE_CHECKING: from ...processing_utils import ProcessorMixin from ...utils import TensorType from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig from .....
FMInference/FlexGen
benchmark/third_party/transformers/src/transformers/models/clip/configuration_clip.py
configuration_clip.py
py
16,463
python
en
code
8,687
github-code
7
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 7, "usage_type": "name" }, { "api_name": "utils.logging.get_logger", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.logging", "line_number": 16, "usage_type": "name" }, { "api_name": "configurat...
21096065836
""" Logging passed information to csv files format. Author: Nicoline Louise Thomsen """ import csv import datetime class Logger(): def __init__(self): time = str(datetime.datetime.now())[11:19] dateid = time.replace(':', '') # file_name = 'logs/data_' + dateid + '.csv' file_na...
Nthom18/EmbodiedAI_21
LEGO_AI/logger.py
logger.py
py
929
python
en
code
0
github-code
7
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "csv.writer", "line_number": 21, "usage_type": "call" } ]
7681396297
"""Design a stop watch 1. Track amount of time elapsed between presses enter key 2. With each key press starting a new 'lap' 3. Print lap number, total time and lap time 4. Thus do the following: Find current time and store it as timestamp and also start of each lap Keep a lap counter and incremen...
Maulik5041/Everyday-coding
Datetime/stopwatch.py
stopwatch.py
py
2,922
python
en
code
0
github-code
7
[ { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_number": 40, "usage_type": "call" }, { "api_name": "time.time", "line_number": 41, "usage_type": "call" }, { "api_name": "time.time", "line_number": 44, ...
23836441530
import torch import torch.nn as nn from layers import Embedding,Posting_embedding,Multihead_attention device = torch.device('cuda') class Encoder_Layer(nn.Module): def __init__(self,num_heads,emb_size): super(Encoder_Layer, self).__init__() self.emb_size = emb_size self.hidden=[4*emb_size...
swallown1/NoteOfPaper
OTHER/Transformer/code/transformer.py
transformer.py
py
4,808
python
en
code
0
github-code
7
[ { "api_name": "torch.device", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.ReLU", "line_num...
14400763439
# from django.contrib import admin from django.urls import path from django.conf.urls import include from django.contrib import admin from django.contrib.auth import get_user_model from rest_framework import routers, viewsets, serializers from board.views import ListViewSet, CardViewSet, CommentViewSet User = get_use...
mo7ammadSale7/api
project/urls.py
urls.py
py
971
python
en
code
0
github-code
7
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 10, "usage_type": "call" }, { "api_name": "rest_framework.serializers.HyperlinkedModelSerializer", "line_number": 13, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 13,...
74723668062
import regex from collections import defaultdict from itertools import chain from utils import parse_input def build_contains_dict(inputs): containers = defaultdict(list) reg = regex.compile("(?P<source_bag>.+) bags contain (?:(?P<dest_bag>.+?) bags*(?:, |\.))+") for entry in inputs: if "contain no...
alsyia/aoc2020
day_7_2.py
day_7_2.py
py
985
python
en
code
0
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" }, { "api_name": "regex.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.parse_input", "line_number": 26, "usage_type": "call" } ]
30458255763
import itertools as it EMPTY = -1 OUT_OF_BOARD = "." UP = 1 DOWN = 2 RIGHT = 3 LEFT = 4 ALL_DIRS = [ [-1, 0], [1, 0], [0, -1], [0, 1] ] OFFSET_TO_DIR = { (-1, 0): UP, (1, 0): DOWN, (0, 1): RIGHT, (0, -1): LEFT } class Board: def __init__(self): self.nums_height = 0 ...
paulinapp/SlitherlinkEtc
slither link/main/slith.py
slith.py
py
6,673
python
en
code
0
github-code
7
[ { "api_name": "itertools.product", "line_number": 77, "usage_type": "call" } ]
7781254483
import datetime from django.test import TestCase from financial_planning.factories import ( FinancialPlanningFactory, RegularCostFactory ) from patrimony.factories import ActiveFactory from protection.factories import ( PrivatePensionFactory, ProtectionManagerFactory, LifeInsuranceFactory, Emerg...
DreamRich/DreamRich
src/protection/tests.py
tests.py
py
18,172
python
en
code
3
github-code
7
[ { "api_name": "financial_planning.factories", "line_number": 24, "usage_type": "name" }, { "api_name": "financial_planning.factories.FinancialPlanningFactory", "line_number": 24, "usage_type": "call" }, { "api_name": "protection.factories.ProtectionManagerFactory", "line_numb...
24560788677
"""Wrapper around a Power BI endpoint.""" from __future__ import annotations import asyncio import logging import os from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union import aiohttp import requests from aiohttp import ServerTimeoutError from langchain_core.pydantic_v1 import BaseModel, Fiel...
langchain-ai/langchain
libs/community/langchain_community/utilities/powerbi.py
powerbi.py
py
11,246
python
en
code
68,990
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "typing.TYPE_CHECKING", "line_number": 19, "usage_type": "name" }, { "api_name": "langchain_core.pydan...
10142114203
import pytesseract from pytesseract import Output import numpy as np import cv2 import subprocess from table_detect import table_detect, colfilter, get_text, get_annotations_xlsx, find_table, find_below_table from pdf2image import convert_from_path,convert_from_bytes pytesseract.pytesseract.tesseract_cmd = 'C:\\Progr...
snitin08/prod_dist
prod_dist - Copy/receipt/text_extraction.py
text_extraction.py
py
2,094
python
en
code
0
github-code
7
[ { "api_name": "pytesseract.pytesseract", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pdf2image.convert_from_path", "line_number": 13, "usage_type": "call" }, { "api_name": "table_detect.get_annotations_xlsx", "line_number": 14, "usage_type": "call" },...
3280661267
# -*- coding: utf-8 -*- import utils import pandas from datetime import datetime def load_portfolio(date, price, length=10, by_day=False): if by_day: d = utils.to_format(utils.select_weekday(date, to_before=False)) else: d = utils.to_format(datetime(date.year, date.month, 1)) try: d...
webclinic017/stock_lib
portfolio/high_update.py
high_update.py
py
1,226
python
en
code
0
github-code
7
[ { "api_name": "utils.to_format", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.select_weekday", "line_number": 8, "usage_type": "call" }, { "api_name": "utils.to_format", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime"...
3937903528
from flask import Flask, render_template, request, redirect, url_for from flask_mysqldb import MySQL app = Flask(__name__,template_folder="templates") app.config['MYSQL_HOST'] = "localhost" app.config['MYSQL_USER'] = "root" app.config['MYSQL_PASSWORD'] = "" app.config['MYSQL_DB'] ="todoApp" todoApp = MySQL(app) @a...
Hamza-Ejaz/Aptech-Django-Course
flask-todo-app/app.py
app.py
py
1,605
python
en
code
0
github-code
7
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_mysqldb.MySQL", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.reques...
6039971808
from typing import Optional import click from rich.table import Table from _incydr_cli import console from _incydr_cli import logging_options from _incydr_cli import render from _incydr_cli.cmds.options.output_options import columns_option from _incydr_cli.cmds.options.output_options import single_format_option from ...
code42/incydr_python
src/_incydr_cli/cmds/alert_rules.py
alert_rules.py
py
6,793
python
en
code
6
github-code
7
[ { "api_name": "click.group", "line_number": 27, "usage_type": "call" }, { "api_name": "_incydr_cli.core.IncydrGroup", "line_number": 27, "usage_type": "name" }, { "api_name": "_incydr_cli.logging_options", "line_number": 28, "usage_type": "name" }, { "api_name": "...
25999481228
import sys import logging import argparse import os import shutil import importlib.util import torch import gym import copy from torch.utils.tensorboard import SummaryWriter from envs.model.agent import Agent from method.trainer import MPRLTrainer from method.memory import ReplayMemory from method.explorer import Expl...
BIT-MCS/GCRL-min-AoI
train_our_policy.py
train_our_policy.py
py
8,915
python
en
code
37
github-code
7
[ { "api_name": "torch.manual_seed", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cuda.manual_seed_all", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.se...
32307418303
# coding: utf-8 # In[1]: import pandas as pd import numpy as np from pathlib import Path import matplotlib from IPython.display import HTML import requests from datetime import datetime #### Import stations CSV # My first step is to find interesting stations and one of the requirements is to find some that have a...
jsanz/dataviz15
assignments/week03/EDA 2.py
EDA 2.py
py
11,320
python
en
code
0
github-code
7
[ { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 60, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 79, "usage_type": "call" }, { "api_name": "pandas.read_csv", "...
29559115250
""" script for training the MSG-GAN on given dataset """ # Set to True if using in SageMaker from torch.backends import cudnn import yaml import os import torch as th import numpy as np import argparse USE_SAGEMAKER = True # sagemaker_containers required to access SageMaker environment (SM_CHANNEL_TRAINING, etc.) #...
toufeeqahamedns/GeneratingHumanFaces
sourcecode/train_sagemaker.py
train_sagemaker.py
py
14,653
python
en
code
0
github-code
7
[ { "api_name": "torch.device", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.backends.c...
23207567949
import random import pygame.draw import math from src.projectile import CompanionProjectile from src.ai import AI class World: def __init__(self, assets, dev_view=False): self.enemies = [] self.players = [] self.projectiles = [] self.assets = assets self.enemies_projecti...
sandromund/pygame_roguelike
src/world.py
world.py
py
9,034
python
en
code
0
github-code
7
[ { "api_name": "src.ai.AI", "line_number": 22, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 38, "usage_type": "call" }, { "api_name": "src.projectile.CompanionProjectile", "line_number": 39, "usage_type": "call" }, { "api_name": "pygame.dra...
35557207310
from django.urls import path from AppBash.views import login, vendedor, ventas, mediosDePago, articulo, cliente from AppBash.views import plantilla1 urlpatterns = [ path("login/", login, name="Login"), path("vendedor/", vendedor, name="Vendedor"), path("ventas/", ventas, name="Ventas"), path("mediosdep...
cristian0717/Bash
AppBash/urls.py
urls.py
py
488
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "AppBash.views.login", "line_number": 6, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "AppBash.views....
17005111209
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np import pymysql # 操作mysql的模块 import openpyxl # xlsx格式对应的操作模块 import time import math from datetime import datetime import csv import os import pandas import re import argparse import sys from sklearn.impute import SimpleImputer ...
WangLab-SINH/CohortClock
Server/dotplot.py
dotplot.py
py
7,043
python
en
code
0
github-code
7
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 18, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 19, "usage_type": "attribute" }, { ...
15709260284
from skimage import io import sys first = io.imread(sys.argv[1]) second = io.imread(sys.argv[2]) if(len(first) != len(second) or len(first[0]) != len(second[0])): print("Not the same size.") sys.exit() for i in range(len(first)): for j in range(len(first[i])): print(first[i][j]) if(first[i][...
Nicetiesniceties/ntucsie-Computer-Vision1
img_compare.py
img_compare.py
py
428
python
en
code
3
github-code
7
[ { "api_name": "skimage.io.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 3, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 3, "usage_type": "attribute" }, { "api_name": "skimage.io.imread", "line...
72853227102
import pytest import torch from mmcv.utils.parrots_wrapper import _BatchNorm from mmseg.models.backbones.hrnet import HRModule, HRNet from mmseg.models.backbones.resnet import BasicBlock, Bottleneck @pytest.mark.parametrize('block', [BasicBlock, Bottleneck]) def test_hrmodule(block): # Test multiscale forward ...
Ascend/ModelZoo-PyTorch
PyTorch/built-in/cv/semantic_segmentation/BiseNetV1_for_PyTorch/tests/test_models/test_backbones/test_hrnet.py
test_hrnet.py
py
4,218
python
en
code
31
github-code
7
[ { "api_name": "mmseg.models.backbones.hrnet.HRModule", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.S...
18756236586
import asyncio import curses from curses import textpad, ascii import datetime class Prompt(): def __init__(self, prompt_string='> '): self.screen = curses.initscr() curses.noecho() curses.cbreak() self.prompt_string = prompt_string self.output_window = None self.pro...
falicius/PythonProject
anothertest.py
anothertest.py
py
3,111
python
en
code
0
github-code
7
[ { "api_name": "curses.initscr", "line_number": 8, "usage_type": "call" }, { "api_name": "curses.noecho", "line_number": 9, "usage_type": "call" }, { "api_name": "curses.cbreak", "line_number": 10, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", ...
11499133220
from flask import Flask, request, send_file, render_template, jsonify from time import sleep, time from queue import Queue import pandas as pd import threading import pickle from geobr import read_municipality, read_municipal_seat from os import path import uuid import sys import subprocess from os.path import exists, ...
vss-2/Lineu
Lineu.py
Lineu.py
py
17,673
python
pt
code
0
github-code
7
[ { "api_name": "sys.setrecursionlimit", "line_number": 16, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 19, "usage_type": "call" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "l...
11616045908
from pprint import pprint import json json_files = open("task5_data.json", "r") files = json.load(json_files) json_files.close() def analyse_movies_genre(): list1 = [] for movie in files: for genre in movie["genre"]: list1.append(genre) temp = set(list1) movie_gen...
tushar19970/Web_Scraping-using-Python
task11.py
task11.py
py
603
python
en
code
1
github-code
7
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 19, "usage_type": "call" } ]
14839558987
# CONQUEST:GO # https://github.com/Kandru/conquest-go # author: Karl-Martin Minkner # website: https://gameshare.community import pymysql import uuid from queue import Queue from threading import Lock from listeners.tick import GameThread from conquest.debug import msg class mysql: def __init__(self): self.socket =...
Kandru/conquest-go
conquest/mysql.py
mysql.py
py
2,195
python
en
code
1
github-code
7
[ { "api_name": "queue.Queue", "line_number": 17, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 18, "usage_type": "call" }, { "api_name": "listeners.tick.GameThread", "line_number": 20, "usage_type": "call" }, { "api_name": "pymysql.connect"...
28291086904
import setuptools # https://packaging.python.org/tutorials/packaging-projects/ with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="mathfn", # Replace with your own username version="0.0.1", url='git@github.com:NandaCj/private-packages.git', author="Nanda", ...
NandaCj/private-packages
setup.py
setup.py
py
724
python
en
code
0
github-code
7
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 17, "usage_type": "call" } ]
5993523574
from django.urls import path from .views import GetIdealUser, UserDetailAPI,RegisterUserAPIView urlpatterns = [ path('register',RegisterUserAPIView.as_view()), path("get-details",UserDetailAPI.as_view()), # need Authentication path("ideal/user/",GetIdealUser.as_view(), name="get-ideal-user"), ]
paras1244/Ideal_user_manager
api/urls.py
urls.py
py
312
python
en
code
0
github-code
7
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "views.RegisterUserAPIView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "views.RegisterUserAPIView", "line_number": 7, "usage_type": "name" }, { "api_nam...
40508262538
"""Regression tests for bug fixes, needing the full stack running.""" import logging import time from pathlib import Path import pytest import requests logger = logging.getLogger(__name__) TEST_VIDEO = str( ( Path(__file__).parent / "test_data" / "test-abbor-small[2021-01-02_00-00-00]-000...
tomrtk/fish-code
tests/integration/test_regression.py
test_regression.py
py
2,307
python
en
code
12
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.post", "line...
42054867282
# -- Import packages --------------------------------------------------------------------------------------------------- from collections import OrderedDict import os import json import numpy as np class Diagnostics: """ Diagnostics for an episode. """ def __init__(self, runs): self.d = Order...
mxhofer/OrgSim-RL
dyna-q/utils_diagnostics.py
utils_diagnostics.py
py
3,057
python
en
code
2
github-code
7
[ { "api_name": "collections.OrderedDict", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 43, "usage_type": "call" }, { "api_name": "collectio...
4168482316
""" tests.test_component_device_tracker ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the device tracker compoments. """ # pylint: disable=protected-access,too-many-public-methods import unittest from unittest.mock import patch from datetime import datetime, timedelta import os from homeassistant.config import load_yaml_...
hcchu/home-assistant-clone
tests/components/device_tracker/test_init.py
test_init.py
py
9,421
python
en
code
1
github-code
7
[ { "api_name": "unittest.TestCase", "line_number": 25, "usage_type": "attribute" }, { "api_name": "tests.common.get_test_home_assistant", "line_number": 30, "usage_type": "call" }, { "api_name": "homeassistant.components.device_tracker.YAML_DEVICES", "line_number": 31, "us...
73305031264
import subprocess import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns def get_gsea_enrichment(input_file, library, out_folder): """Runs GSEA based on input set of genes with associated logFC values using local jar file and gene set library (.gmt file) Pa...
datarail/msda
msda/gsea_tool.py
gsea_tool.py
py
6,441
python
en
code
1
github-code
7
[ { "api_name": "os.makedirs", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_...
17349724419
from keras.applications.inception_v3 import InceptionV3 from keras.preprocessing import image from keras.models import Model from keras.layers import Dense, GlobalAveragePooling2D from keras import backend as K from keras.optimizers import SGD, RMSprop, Adam train_data_dir = "/ebs/user05/data/train" validation_data_di...
bholligan/image_class
model_scripts/incepV3_filter.py
incepV3_filter.py
py
2,054
python
en
code
7
github-code
7
[ { "api_name": "keras.applications.inception_v3.InceptionV3", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.layers.GlobalAveragePooling2D", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 22, "usage_type": "ca...
21007973780
import functools from peewee import fn from playhouse.shortcuts import model_to_dict from nni.nas.benchmark.utils import load_benchmark from .schema import NdsTrialStats, NdsTrialConfig, proxy def query_nds_trial_stats(model_family, proposer, generator, model_spec, cell_spec, dataset, num_...
microsoft/nni
nni/nas/benchmark/nds/query.py
query.py
py
3,511
python
en
code
13,409
github-code
7
[ { "api_name": "schema.proxy.obj", "line_number": 47, "usage_type": "attribute" }, { "api_name": "schema.proxy", "line_number": 47, "usage_type": "name" }, { "api_name": "schema.proxy.initialize", "line_number": 48, "usage_type": "call" }, { "api_name": "schema.pro...
9679356194
from collections import defaultdict import sys import numpy as np import gffutils import pandas as pd def miso_exon_to_gencode_exon(exon): """Convert a single miso exon to gencode gffutils database exon id >>> # Skipped exon (SE) or Mutually exclusive exon (MXE) ID >>> miso_exon_to_gencode_exon('chr2:96...
YeoLab/gscripts
gscripts/miso/convert_ids.py
convert_ids.py
py
9,406
python
en
code
15
github-code
7
[ { "api_name": "collections.defaultdict", "line_number": 104, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 105, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 106, "usage_type": "call" }, { "api_na...
28832505842
import math import torch import torch.nn as nn import torch.nn.functional as F from fairseq import utils from fairseq.models import ( FairseqEncoder, ) from fairseq.modules import ( LayerNorm, PositionalEmbedding, SinusoidalPositionalEmbedding, ) from nonauto.model_utils import positional_encodings_li...
baoy-nlp/NAT-fairseq
nonauto/modules/encoder.py
encoder.py
py
8,066
python
en
code
4
github-code
7
[ { "api_name": "torch.nn.Module", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 23, "usage_type": "name" }, { "api_name": "nonauto.modules.blocks.SelfAttentionBlock", "line_number": 45, "usage_type": "call" }, { "api_name"...
72865630302
from typing import Optional, Tuple, Union import torch from torch import nn as nn from torch.autograd import Function from ..utils import ext_loader from .ball_query import ball_query from .knn import knn ext_module = ext_loader.load_ext( '_ext', ['group_points_forward', 'group_points_backward']) class QueryAn...
Ascend/ModelZoo-PyTorch
PyTorch/contrib/cv/semantic_segmentation/MMseg-swin/mmcv/mmcv/ops/group_points.py
group_points.py
py
8,547
python
en
code
31
github-code
7
[ { "api_name": "utils.ext_loader.load_ext", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.ext_loader", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch...
72685406944
import random from typing import List class Solution: def __init__(self, w: List[int]): self.total = sum(w) self.cumulative = [0] for val in w: self.cumulative.append(self.cumulative[-1] + val) def pickIndex(self) -> int: val = random.randint(0, self.total-1) ...
daviddwlee84/LeetCode
Python3/Design/RandomPickWithWeight/Naive528.py
Naive528.py
py
1,343
python
en
code
15
github-code
7
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 41, "usage_type": "name" } ]
12782919489
import hashlib import random import sqlite3 import emojis import logging logging.basicConfig( level=logging.INFO, format="%(asctime)s | %(name)s | %(levelname)s | %(" "message)s", handlers=[ logging.FileHandler("oi.log"), logging.StreamHandler() ] ) log = logging.getLogger...
rikingurditta/funnybot
oi_discord_bot/database.py
database.py
py
19,252
python
en
code
2
github-code
7
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.Stre...
33455190135
import torch import torch.nn as nn import numpy as np import sys sys.path.append("../../") from general.mutils import get_param_val, create_transformer_mask, create_channel_mask from layers.flows.flow_model import FlowModel from layers.flows.activation_normalization import ActNormFlow from layers.flows.permutation_...
phlippe/CategoricalNF
experiments/set_modeling/flow_model.py
flow_model.py
py
4,891
python
en
code
50
github-code
7
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "layers.flows.flow_model.FlowModel", "line_number": 16, "usage_type": "name" }, { "api_name": "layers....
30270407731
import tensorflow as tf import os import numpy as np import logging import io import PIL.Image import hashlib import random from object_detection.utils import dataset_util import cv2 as cv from utils.utils import read_config from object_detection.dataset_tools import tf_record_creation_util from object_detection.utils...
shivin101/Component-Detection
code/tf_record.py
tf_record.py
py
4,771
python
en
code
0
github-code
7
[ { "api_name": "utils.utils.read_config", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.app", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", ...
5182276154
from dataloader import preprocess from sklearn.svm import SVR from sklearn.model_selection import GridSearchCV import torch.nn as nn import torch import numpy as np def anomaly_score(z, x): """ Compute the anomaly score of a given data point. :param logvar: the log variance of the data point. ...
LHL3341/LSTM-VAE
anomaly_score.py
anomaly_score.py
py
1,922
python
en
code
0
github-code
7
[ { "api_name": "torch.nn.Softmax", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_numbe...
3287878475
import cv2 import numpy as np """ Manual filter parameters defination Images on Notion Hue -> pure spectrum colors ("cores do arco-iris") being red, orange, yellow, blue, green and violet, it goes from 0 to 360 (or 0 to 179) Saturation -> Intensity of the color (0 to 100%, or 0 to 255) Value -> Brightness (0 to 1...
CEFAST-Drone/OpenCV-tests
Basics/chapter 7 - Color Detection and Trackbars.py
chapter 7 - Color Detection and Trackbars.py
py
2,092
python
en
code
1
github-code
7
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.resizeWindow", "line_...
38951761346
import os import shutil from collections import namedtuple from autohdl import PREDEFINED_DIRS, FILE_USER_CFG, IGNORE_REPO_DIRS from autohdl import verilog import logging alog = logging.getLogger(__name__) def generate(path=''): # create dir structure # copy config file # return printable tree structure...
mgolokhov/autohdl
autohdl/structure.py
structure.py
py
3,505
python
en
code
1
github-code
7
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.exists", "l...
3777740928
### Homemade code from classes_arduino import tryexceptArduino from classes_colther import homingZabersConcu, moveAxisTo from classes_text import printme, scale_reponse, binary_response from classes_speech import say from rand_scaling import choosing_next_pos from local_functions import ( panicButton, iti_zaber...
sofiadepedro/MSci_lab_project
expt12_cold_scale/src_testing/def_show_anch.py
def_show_anch.py
py
10,185
python
en
code
0
github-code
7
[ { "api_name": "random.shuffle", "line_number": 66, "usage_type": "call" }, { "api_name": "classes_colther.homingZabersConcu", "line_number": 68, "usage_type": "call" }, { "api_name": "classes_colther.moveAxisTo", "line_number": 69, "usage_type": "call" }, { "api_n...