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
37013423876
#!/usr/bin/python3 """View for Users""" from api.v1.views import app_views from models import storage from flask import jsonify from models.user import User from flask import abort from flask import make_response from flask import request @app_views.route('/users', strict_slashes=False, methods=['GET']) def all_users...
kreywilo42/AirBnB_clone_V3
api/v1/views/users.py
users.py
py
2,635
python
en
code
1
github-code
18
[ { "api_name": "models.storage.all", "line_number": 15, "usage_type": "call" }, { "api_name": "models.user.User", "line_number": 15, "usage_type": "argument" }, { "api_name": "models.storage", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.jsonify"...
20000583359
__author__ = "David Moeljadi <davidmoeljadi@gmail.com>" __copyright__ = "Copyright 2016, barasa" __credits__ = [ "David Moeljadi" ] __license__ = "MIT" __version__ = "0.1" __maintainer__ = "David Moeljadi" __email__ = "<davidmoeljadi@gmail.com>" __status__ = "Prototype" ################################################...
neocl/barasa
setup.py
setup.py
py
1,878
python
en
code
9
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 24, "usage_type": "call" }, { "api_name": "io.open", "line_numb...
6564883570
from PIL import Image from pathlib import Path import matplotlib.pyplot as plt import numpy as np import torch import torchvision.transforms as T class AddGaussianNoise(object): # Custom class to add gaussian noise to input images as data augmentation def __init__(self, mean=0., std=1.): self.std = st...
lolzballs/mie429
training/transform_illustration_test_script.py
transform_illustration_test_script.py
py
3,365
python
en
code
3
github-code
18
[ { "api_name": "torch.randn", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 18, "usage_type": "call" }, { "api_name": "torchvision.transforms.functional.adjust_contrast", "line_number": 26, "usage_type": "call" }, { "api_nam...
70466906921
import matplotlib.pyplot as plt import numpy as np import os ErrorPermit = 1 MinimumSize = 4 class Tree(object): def __init__(self, separate_data=0, estimate_data=0, num=0,dl=0, dr=0): self.val = separate_data self.estimate = estimate_data self.leftChild = None self.rightChild = Non...
HawkTom/Basic-Machine-Learning-Algroithms
DecisionTree/RegressionTree.py
RegressionTree.py
py
5,356
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 125, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 125, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 128, "usage_type": "call" }, { "api_name": "numpy.array...
29895699945
from flask import Flask, redirect, send_file, request, jsonify from models import InstallID import requests import boto3 import random import string import botocore # Imports go here. app = Flask(__name__) # Defines the app. @app.route("/") def go_to_website(): """Returns to magiccap.me""" return redirect("h...
MagicCap/i.magiccap
main.py
main.py
py
2,580
python
en
code
1
github-code
18
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.headers", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flask.request",...
23906417629
from asyncio import gather, run, sleep from db import DB_CON, load_depth, load_tas from json import dumps, loads from os import walk from parsers import parse_depth, parse_depth_header, parse_tas, parse_tas_header, transform_tas, transform_depth from re import match from sys i...
toobrien/tick_db
etl.py
etl.py
py
4,097
python
en
code
11
github-code
18
[ { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "parsers.parse_tas_header", "line_number": 34, "usage_type": "call" }, { "api_name": "parsers.parse_tas", "line_number": 38, "usage_type": "call" }, { "api_name": "parsers.transfo...
26556242648
from datetime import datetime from PyQt5.QtWidgets import QLabel from tinydb import TinyDB, Query import app.LineMonitoring.app_provider.api.LastLog as LastLog from core.config.Config import sensor_db_path, time_format, sensor_table_name from core.model.DataType import sensor_new_log_data, sensor_activity_data...
siavashvampire/python
app/LineMonitoring/model/Sensor.py
Sensor.py
py
7,457
python
en
code
0
github-code
18
[ { "api_name": "app.LineMonitoring.app_provider.api.LastLog", "line_number": 30, "usage_type": "name" }, { "api_name": "core.model.DataType.sensor_new_log_data", "line_number": 37, "usage_type": "name" }, { "api_name": "core.model.DataType.sensor_activity_data", "line_number":...
16129086939
import tweepy # --------------------------------------------------------BUSHFRIES---------------------------------------------------- try: get_consumer_key = 'lZKHiGxzaac9eApuedZ8FuBlR' get_consumer_secret = 'QBo2RJob1Jz9QUg67S47cGPg3enQRwnQHii1r9Al1ikDxcQLG5' get_access_token = '834452681355882496-a...
coolcodehere/CoolBot
APIAccess.py
APIAccess.py
py
1,486
python
en
code
0
github-code
18
[ { "api_name": "tweepy.OAuthHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 14, "usage_type": "call" }, { "api_name": "tweepy.error", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tweepy.OAuthHandler"...
13404845936
# -*- coding: utf-8 -*- import re PUNKT = '.' UNK = '*' ALPHA = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя' ALPHABET = ALPHA + UNK + PUNKT EVAL_REPLACE_GROUPS = ['её'] PHONETIC_REPLACE_GROUPS = ['оая', 'пб', 'сзц', 'вф', 'кгх', 'тд', 'чжшщ', 'еыэий', 'лр', 'ую', 'ьъ', 'нм'] VOWELS = 'аоийеёэыуюя' ORDINALCARIDNAL2TEXT = {...
vadimkantorov/convasr
ru.py
ru.py
py
5,904
python
ru
code
19
github-code
18
[ { "api_name": "re.sub", "line_number": 234, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 241, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 247, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_numbe...
27613778397
#!/usr/bin/env python3 # rosetta LR with sample based (horizonal federated learning) import latticex.rosetta as rtt # difference from tensorflow import math import os import sys import csv import tensorflow as tf import numpy as np import pandas as pd import time import argparse from sklearn.metrics import roc_auc_sco...
LatticeX-Foundation/Rosetta
example/tutorials/code/rtt-ds-lr.py
rtt-ds-lr.py
py
5,234
python
en
code
544
github-code
18
[ { "api_name": "latticex.rosetta.activate", "line_number": 15, "usage_type": "call" }, { "api_name": "latticex.rosetta", "line_number": 15, "usage_type": "name" }, { "api_name": "latticex.rosetta.py_protocol_handler.get_party_id", "line_number": 16, "usage_type": "call" ...
72958895399
import warnings import numpy as np import pandas as pd from diffprivlib.mechanisms import Laplace from diffprivlib.mechanisms import Gaussian from diffprivlib.mechanisms import Geometric from diffprivlib.mechanisms import Binary from diffprivlib.mechanisms import Exponential, ExponentialCategorical import random import...
ajinkya-ch/DataDiP
noise_add.py
noise_add.py
py
3,791
python
en
code
0
github-code
18
[ { "api_name": "random.randint", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "diffprivlib.mechanisms.Laplace", "line_number": 39, "usage_type": "call" }, { "api_name": "diffpri...
23869615740
''' An asynchronous consumer for the RabbitMQ message queue. Input parameters: amqp_url: The URL of the RabbitMQ server. exchange: The exchange name. exchange_type: The exchange type, default is 'topic'. queue: The queue name. This consumer will only subscribe to the queue and wait for messages. Multipl...
yynil/MMFSTF
src/common/async_consumer.py
async_consumer.py
py
20,581
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 35, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 36, "usage_type": "attribute" }, { "api_name": "abc.ABC", "line_number": 38, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod",...
2398296677
#!/usr/bin/env python # -*- coding:utf-8 -*- # =========================== # @Author : inf # @Time : 2020/10/8 7:08 # =========================== import re from collections import Iterable from win.orm_database import DB, ORM_MAPPINGS class IntegerField(dict): """定义对应数据表的字段""" def __init__(self, f...
infun999/win
win/orm_database/base_orm.py
base_orm.py
py
10,795
python
zh
code
0
github-code
18
[ { "api_name": "win.orm_database.ORM_MAPPINGS", "line_number": 58, "usage_type": "name" }, { "api_name": "win.orm_database.DB", "line_number": 111, "usage_type": "name" }, { "api_name": "collections.Iterable", "line_number": 228, "usage_type": "argument" } ]
70232779561
'''remote_font.py''' import os import shutil from enum import Enum from urllib.parse import urlparse import requests from . import Font from fonty.lib.variants import FontAttribute from fonty.lib.constants import TMP_DIR class RemoteFont(object): '''Represents a remote font.''' # Meta Classes ---------------...
jamesssooi/fonty
fonty/models/font/remote_font.py
remote_font.py
py
3,862
python
en
code
15
github-code
18
[ { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "os.path.basename", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "urllib.parse.urlparse", "...
10952841070
from pyspark import SparkContext from pyspark.sql.session import SparkSession from pyspark.sql import functions as F from pyspark.sql.types import * # start spark with 1 worker thread sc = SparkContext("local[1]") sc.setLogLevel("ERROR") spark = SparkSession(sc) """ Are the tasks that request the more resources th...
lokeaichirou/spark-project
code/a7_try.py
a7_try.py
py
5,656
python
en
code
0
github-code
18
[ { "api_name": "pyspark.SparkContext", "line_number": 8, "usage_type": "call" }, { "api_name": "pyspark.sql.session.SparkSession", "line_number": 11, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.col", "line_number": 62, "usage_type": "call" }, { "ap...
70043646759
import flet as ft from pyastrov.core import AstroVCore from pyastrov.procimg.stack import ImageStacker import asyncio from pyastrov.logger import setup_logger from pyastrov.ui import ft_part import numpy as np from collections import deque from multiprocessing import Process, Manager, shared_memory import multiprocessi...
imoken1122/PyAstroV
pyastrov/ui/control_panel/stack.py
stack.py
py
5,814
python
en
code
0
github-code
18
[ { "api_name": "pyastrov.logger.setup_logger", "line_number": 13, "usage_type": "call" }, { "api_name": "flet.UserControl", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pyastrov.core.AstroVCore", "line_number": 18, "usage_type": "name" }, { "api_n...
10253492103
from django import forms from django.core import validators #from modules.h2hClass import * #from django.forms import NumberInput import requests def checkH2HLeague(value): url = 'https://fantasy.premierleague.com/api/leagues-h2h/' +str(value)+ '/standings/' r = requests.get(url) json = r.json() print(...
awhelanUCD/Fantasy-Premier-League-Aid-public
live_gameweek/forms.py
forms.py
py
895
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "django.forms.ValidationError", "line_number": 15, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 15, "usage_type": "name" }, { "api_name": "django.forms.Fo...
13091216144
""" Organize the performance results into a single csv. """ import os import sys import argparse from datetime import datetime from itertools import product import numpy as np import pandas as pd from scipy.stats import sem from tqdm import tqdm here = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, her...
jjbrophy47/trex
scripts/postprocess/runtime.py
runtime.py
py
4,882
python
en
code
3
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path.insert", "l...
34125975111
from crypt import methods import os import tensorflow as tf import numpy as np import keras as k from keras.models import load_model from keras.preprocessing import image from PIL.Image import open import cv2 from flask import Flask, request, render_template from werkzeug.utils import secure_filename app=Flask(__name_...
bsvn23/Mini
demoapp/app.py
app.py
py
1,346
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 25, "usage_type": "call" }, { "api_name": "PIL.Image.open", ...
3657811330
#!/usr/bin/python3 import networkx as nx import matplotlib.pyplot as plt from random import randrange G = nx.Graph() def create_graph(num): G.clear() H = nx.path_graph(num) G.add_nodes_from(H) def add_connection(num): x = randrange(0, num) y = randrange(0, num) while y == x: y = randrange(0, num) e = (x, y...
PedroCapa/SDLE
Ficha1/graphConnected.py
graphConnected.py
py
727
python
en
code
0
github-code
18
[ { "api_name": "networkx.Graph", "line_number": 7, "usage_type": "call" }, { "api_name": "networkx.path_graph", "line_number": 11, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randrange",...
73939320040
"""Shuffle and split data into train/validation and test sets. eICU is split into train/test. MIMIC is the same except for shuffling and filtering out age >= 18. """ import pandas as pd from sklearn.utils import shuffle SPLIT_PROP = 0.7 eicu_df = pd.read_csv('../../data/eicu/eicu_cleaned/eicu_anypna_2_days_post_i...
hlzhou/peer-score
src/data_processing/shuffle_split.py
shuffle_split.py
py
915
python
en
code
5
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.utils.s...
782376090
import numpy as np # Calculate the option price using the Black-Scholes model def black_scholes(S, K, T, r, sigma, option_type): from scipy.stats import norm T = T / 12 # Convert time to expiration to months d1 = (np.log(S / K) + (r + sigma ** 2 / 2) * T) / (sigma * np.sqrt(T)) d2 = d1 - sigma * np.sq...
iliap2000/options
app.py
app.py
py
1,137
python
en
code
0
github-code
18
[ { "api_name": "numpy.log", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.stats.norm.cdf", "line_number"...
71074539560
import os from urllib import request from dotenv import load_dotenv from telethon import TelegramClient from telethon.errors import FloodWaitError from telethon.tl.functions.contacts import ImportContactsRequest, DeleteContactsRequest from telethon.tl.types import InputPhoneContact load_dotenv() TELEGRAM_API_ID = in...
bagaswastu/inspektur
api/modules/telegram.py
telegram.py
py
1,836
python
en
code
37
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
34467567456
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import netCDF4 as nc import numpy as np import pytz from math import atan2, pi from pathlib import Path from pysolar.solar import get_azimuth_fast from scipy.interpolate import interp1d from globsim.common_utils import str_encode, series_interpolate from g...
geocryology/globsim
globsim/scale/JRAscale.py
JRAscale.py
py
19,878
python
en
code
18
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "globsim.scale.GenericScale.GenericScale", "line_number": 24, "usage_type": "name" }, { "api_name": "netCDF4.Dataset", "line_number": 49, "usage_type": "call" }, { "api_nam...
13945589804
import tornado.web from . import device_manager from .global_namespace import * class BaseHandler(tornado.web.RequestHandler): def end_with_json(self, code, data=None, message=None): request_url = self.request.uri result_dict = { 'code': code, 'data': data or {}, ...
Hanlen520/simhand2_pymanager
simhand2_manager/handler.py
handler.py
py
1,161
python
en
code
0
github-code
18
[ { "api_name": "tornado.web.web", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 6, "usage_type": "name" } ]
22644934235
import sys, time import random import requests import config def send_data_to_influxdb(env_data, start_vacuum_pump): line_protocol_data = f"{config.ORGANIZATION},sensor_id={config.SENSOR_ID} temperature={env_data['temperature']},humidity={env_data['humidity']},pressure={env_data['pressure']},pump_started={start...
normcyr/maple-sap-vacuum-controller
test_influxdb.py
test_influxdb.py
py
1,955
python
en
code
0
github-code
18
[ { "api_name": "config.ORGANIZATION", "line_number": 10, "usage_type": "attribute" }, { "api_name": "config.SENSOR_ID", "line_number": 10, "usage_type": "attribute" }, { "api_name": "config.INFLUXDB_URL", "line_number": 13, "usage_type": "attribute" }, { "api_name"...
3273192441
from bench.common import ( SampleConfig, register_sample, SampleSource, SampleTag, ) import numpy as np def get_sample_config(): return SampleConfig( args_cases=[(892, 52, 32), (492, 26, 16), (292, 18, 4)], requires_grad=[False] * 3, backward=[False], performance_it...
DeepLink-org/DLOP-Bench
bench/samples/long_tail/scaled_l2/__init__.py
__init__.py
py
902
python
en
code
38
github-code
18
[ { "api_name": "bench.common.SampleConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "bench.common.SampleSource.MMSEG", "line_number": 17, "usage_type": "attribute" }, { "api_name": "bench.common.SampleSource", "line_number": 17, "usage_type": "name" }, ...
32651892775
from datetime import datetime from decimal import Decimal from typing import Annotated, Any import fastapi as fa import services.payment.db_handlers as payment_hand import services.payment.schemas as payment_schemas from database.db_async import get_async_session from services.payment.utils.robokassa import ( calc...
alexei-emelin/tgparsing-backend
app/services/payment/views.py
views.py
py
2,575
python
en
code
0
github-code
18
[ { "api_name": "services.payment.schemas.PaymentCreate", "line_number": 22, "usage_type": "attribute" }, { "api_name": "services.payment.schemas", "line_number": 22, "usage_type": "name" }, { "api_name": "services.user.models.User", "line_number": 23, "usage_type": "name" ...
37304543674
from collections import defaultdict class Solution: def sumPrefixScores(self, words: List[str]) -> List[int]: ctr = defaultdict(int) for w in words: n = len(w) for i in range(1, n + 1): ctr[w[:i]] += 1 res = [] for w in words: n = ...
theabbie/leetcode
sum-of-prefix-scores-of-strings.py
sum-of-prefix-scores-of-strings.py
py
468
python
en
code
11
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
19498013352
from pymongo import MongoClient import certifi from pymongo import database def get_database(URI: str, DB: str) -> database.Database: # get certificate cert = certifi.where() # Create a new client and connect to the server client = MongoClient( URI, tlsCAFile=cert ) # Send a ...
AnimeTrackerr/Anime-Scrapper
Utils/ConnectMongoDB.py
ConnectMongoDB.py
py
795
python
en
code
0
github-code
18
[ { "api_name": "certifi.where", "line_number": 8, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "pymongo.database.Database", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pymong...
70539389480
import json from urllib.request import urlopen, Request from bs4 import BeautifulSoup import os from unidecode import unidecode if os.path.exists('cities.json'): os.remove('cities.json') host_name = 'https://en.wikipedia.org' url = host_name + '/wiki/List_of_cities_by_international_visitors' page = urlopen(url) ...
lijaso15/vievacance
backend/web-scraping/cities.py
cities.py
py
4,619
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line...
38658520203
__author__ = "Gagarin Ruslan" import unittest from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver import ChromeOptions, Chrome, Firefox, FirefoxOptions, FirefoxProfile from sele...
Theru1/samples
selenium_framework_plastiq.py
selenium_framework_plastiq.py
py
1,969
python
en
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.support.wait.WebDriverWait", "line_number": 20, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.presence_of_element_located",...
37520042433
import os import logging import traceback from logging.handlers import TimedRotatingFileHandler from .config_reader import ConfigReader class XlogConfig(object): def __init__(self , log_level=logging.DEBUG , console_log_flag=True , console_log_level=logging.INFO ...
Anlandme/dddd
src/comm/xlog.py
xlog.py
py
7,321
python
en
code
0
github-code
18
[ { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "config_reader....
7897221739
from django.urls import path from .views import * urlpatterns = [ path('mensajes/', mensajeList, name='mensaje_listar'), path('mensaje/<id>', mensajeDetalle , name='mensaje_detalle'), path('mensaje/nuevo/', mensajeCrear , name='mensaje_crear'), path('mensajes/editar/<id>', mensajeEditar , name='mensaje...
oamc90/EntregaFinal_Proyecto
app2/urls.py
urls.py
py
484
python
es
code
0
github-code
18
[ { "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", ...
27028550065
import json def xor(data): return bytearray((data[i] ^ ord("Q") for i in range(0, len(data)))) config = {} config['Hostname'] = "kunnoh" config['Migrate'] = "sec" config = json.dumps(config).encode() padding = b"\x00" * (2000 - len(config) - 1) config = xor(config) + b"\xff"+ padding # Find {"Hostname" with ope...
kunnoh/c2
patch.py
patch.py
py
575
python
en
code
0
github-code
18
[ { "api_name": "json.dumps", "line_number": 10, "usage_type": "call" } ]
3855424014
import os from xml.dom import minidom from libvirt import libvirtError from libvirttestapi.src import sharedmod required_params = ('poolname',) optional_params = {} def display_pool_info(conn): """Display current storage pool information""" logger.debug("current define storage pool: %s" % c...
libvirt/libvirt-test-API
libvirttestapi/repos/storage/build_netfs_pool.py
build_netfs_pool.py
py
2,113
python
en
code
12
github-code
18
[ { "api_name": "os.access", "line_number": 24, "usage_type": "call" }, { "api_name": "os.R_OK", "line_number": 24, "usage_type": "attribute" }, { "api_name": "libvirttestapi.src.sharedmod.libvirtobj", "line_number": 37, "usage_type": "attribute" }, { "api_name": "l...
35960202718
import cv2 import numpy as np from scipy.misc import imresize from PIL import Image import cv2 import matplotlib.pyplot as plt from scipy.misc import imsave from scipy.misc import toimage # Load an color image in grayscale img = cv2.imread('test.png') image = np.array(img) img = Image.fromarray(image) img.show() ...
sujit-rai/Super-Resolution-using-Capsnet
code/convolution_manual.py
convolution_manual.py
py
1,238
python
en
code
3
github-code
18
[ { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_numb...
25217262782
# https://leetcode.com/problems/pacific-atlantic-water-flow/ from typing import List class Solution: def pacificAtlantic(self, heights: List[List[int]]) -> List[List[int]]: m, n = len(heights), len(heights[0]) def dfs(i: int, j: int, visited: set, debug: bool = False) -> None: visited...
ronelzb/leetcode
problems/blind_75_must_do/0417_pacific_atlantic_water_flow.py
0417_pacific_atlantic_water_flow.py
py
1,081
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
25648211541
""" Apache2 Configuration: http://www.cyberciti.biz/faq/ubuntu-mod_python-apache-tutorial/ """ from mod_python import apache import time import math import json import os # File names log_file = "/var/www/py/speed_log.txt" json_filename = "/var/www/py/json_log.json" test = 1 start_time = None transfer_frequency = 3...
deradev/mpquicScheduler
src/AStream/dist/server/ThrottleServer.py
ThrottleServer.py
py
3,333
python
en
code
40
github-code
18
[ { "api_name": "json.load", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path.getsize", "line_number": 68, "usage_type": "call" }, { "api_name": "os.path", "line_number": 68, "usage_type": "attribute" }, { "api_name": "mod_python.apache.HTTP_NOT_FOU...
18304608471
#!/usr/bin/python ''' Documentation: Description: CHANGE CODE SECTION IN MAIN() Parameter: FOUND IN YAML FILE # hint: you cannot use print or use quit! # within project folder, have a library folder with all python scripts... # cd into project folder and run yml ...
ItMeansBigMountain/CloudAutomation
Ansible/library/ansible_module_template.py
ansible_module_template.py
py
1,806
python
en
code
0
github-code
18
[ { "api_name": "ansible.module_utils.basic.AnsibleModule", "line_number": 31, "usage_type": "call" }, { "api_name": "os.system", "line_number": 45, "usage_type": "call" } ]
71426668200
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV fil...
aorursy/new-nb-3
forwet_covid-19-analysis-1.py
forwet_covid-19-analysis-1.py
py
6,696
python
en
code
0
github-code
18
[ { "api_name": "os.walk", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "matplotlib.rc", "line_number": ...
21227258333
from rest_framework import serializers from rest_framework.validators import UniqueTogetherValidator from .models import Bookmark class BookmarkSerializer(serializers.ModelSerializer): class Meta: model = Bookmark fields = ("id", "user", "article", "bookmarked_on") validators = [ ...
andela/ah-backend-dojo
authors/apps/article_bookmarks/serializers.py
serializers.py
py
567
python
en
code
3
github-code
18
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Bookmark", "line_number": 9, "usage_type": "name" }, ...
12073228757
__author__ = 'mickael' from flask import Flask from flask import render_template from flask.ext.restful import Api from flask.ext.cors import CORS from flask_restful_swagger import swagger from utils import catch_exceptions import config # Flask application app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] =...
KIClubinfo/EDTAPI
server.py
server.py
py
1,239
python
en
code
1
github-code
18
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "config.DB_URL", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.ext.cors.CORS", "line_number": 15, "usage_type": "call" }, { "api_name": "lib.model.db.init_...
13881627081
import json import os import pickle import sys import numpy as np import pandas as pd import pytest import scipy from dotenv import load_dotenv from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from sklearn.linear_model import SGDClassifier sys.path.insert(1, os.path.join(sys.path[0], '..'...
lemminkainen94/mlops-project
app/tests/test_unit_tests.py
test_unit_tests.py
py
1,265
python
en
code
0
github-code
18
[ { "api_name": "sys.path.insert", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number...
2336405321
from .base import EntityRef from .exchange_ref import ExchangeRef from itertools import chain class MultipleReferences(Exception): pass class NoReference(Exception): pass class ProcessRef(EntityRef): """ Processes can lookup: """ _etype = 'process' _ref_field = 'referenceExchange' ...
AntelopeLCA/antelope
antelope/refs/process_ref.py
process_ref.py
py
11,926
python
en
code
1
github-code
18
[ { "api_name": "base.EntityRef", "line_number": 14, "usage_type": "name" }, { "api_name": "exchange_ref.ExchangeRef", "line_number": 133, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 291, "usage_type": "call" }, { "api_name": "itertools.c...
33071788495
from celery import shared_task from django.conf import settings from django.core.mail import send_mail from celery import Celery from cotacao.models import AtivoMonitorado from datetime import datetime, timedelta from .configs_email import * celery = Celery('tasks', broker='redis://127.0.0.1:6379') @shared_task de...
ilanaraujo/hermes
hermes/hermes/tasks.py
tasks.py
py
1,112
python
pt
code
0
github-code
18
[ { "api_name": "celery.Celery", "line_number": 12, "usage_type": "call" }, { "api_name": "cotacao.models.AtivoMonitorado.objejcts.all", "line_number": 16, "usage_type": "call" }, { "api_name": "cotacao.models.AtivoMonitorado.objejcts", "line_number": 16, "usage_type": "att...
24475126671
from __future__ import annotations import logging from enum import Enum from typing import TYPE_CHECKING, List, Set, Union, Tuple, Dict, Optional import networkx as nx # Avoid circular imports due to type checking. import objects.ast.util as util from objects.ast.models import Expression, Variable from preprocessing...
melroy999/2IMC00-SLCO
SLCOtoJAVA3.0/objects/locking/models.py
models.py
py
14,479
python
en
code
0
github-code
18
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 14, "usage_type": "name" }, { "api_name": "objects.ast.models.VariableRef", "line_number": 23, "usage_type": "name" }, { "api_name": "objects.ast.models.VariableRef", "line_number": 25, "usage_type": "name" }, { ...
22605980174
# -*- coding: utf-8 -*- """ Created on Mon Feb 19 16:35:51 2018 for printing: for i, layer in enumerate(base_model.layers): print(i, layer.name) @author: medvel """ # -------------------- Importing modules ----------------------------------- import matplotlib matplotlib.use('Agg') import matplotlib....
chaagu/exjobb
software/finetune_one_train_imaug.py
finetune_one_train_imaug.py
py
10,527
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.use", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.backend.clear_session", "line_number": 30, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 30, "usage_type": "name" }, { "api_name": "imgaug.augme...
11335622691
from flask import Flask, render_template, request import firebase_admin from firebase_admin import credentials from firebase_admin import firestore #database cred = credentials.Certificate('blacktie-2a2a9-firebase-adminsdk-59nbn-f6c28ab314.json') app = firebase_admin.initialize_app(cred) db = firestore.client() #cla...
gomesjair/blacktie
app.py
app.py
py
934
python
en
code
0
github-code
18
[ { "api_name": "firebase_admin.credentials.Certificate", "line_number": 7, "usage_type": "call" }, { "api_name": "firebase_admin.credentials", "line_number": 7, "usage_type": "name" }, { "api_name": "firebase_admin.initialize_app", "line_number": 8, "usage_type": "call" ...
13016625206
""" Steadyturning module: 1, building steady turning configuration; 2, special u's as zeros, roll, pitch and steer rates; 3, equilibrium values: dynamic equations & nonholonomic equations & combination. """ import bicycle as bi import sympy as sym import sympy.physics.mechanics as mec from numpy import * q2, q3, q4...
StefenYin/BicycleThesis
constraint/steadyturning.py
steadyturning.py
py
5,666
python
en
code
0
github-code
18
[ { "api_name": "sympy.physics.mechanics.dynamicsymbols", "line_number": 15, "usage_type": "call" }, { "api_name": "sympy.physics.mechanics", "line_number": 15, "usage_type": "name" }, { "api_name": "sympy.physics.mechanics.dynamicsymbols", "line_number": 16, "usage_type": ...
32305469361
from collections import OrderedDict import logging import os import binascii from io import BytesIO from django.http import StreamingHttpResponse, FileResponse, QueryDict from django.utils.http import urlquote from django.utils.translation import gettext_lazy, gettext as _ from django.core.validators import validate_e...
25280841/iharbor
apps/api/views.py
views.py
py
137,030
python
en
code
null
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 42, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 43, "usage_type": "call" }, { "api_name": "binascii.hexlify", "line_number": 47, "usage_type": "call" }, { "api_name": "os.urandom", ...
37556513448
import sqlite3 def get_match_rows(q): # Strings to build the query field_list = 'w0.url_id' table_list = '' clause_list = '' word_ids = [] # Split the words by spaces words = q.split(' ') table_number = 0 for word in words: word_row = conn.execute("select rowid from word_l...
FarsanRashid/search-guardian-news
Search.py
Search.py
py
3,085
python
en
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 91, "usage_type": "call" } ]
5963036256
from django.db import models from django.db.models import Sum, Q from django.core import exceptions from django.utils.translation import ugettext as _ from django.utils import timezone from time_tracker.models import Profile from time_tracker.models import Project import time class TimeReportManager(models.Manager)...
mtrdesign/mtr-time-tracker
rest/time_tracker/models/time_report.py
time_report.py
py
3,417
python
en
code
1
github-code
18
[ { "api_name": "django.db.models.Manager", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 13, "usage_type": "name" }, { "api_name": "django.db.models.Q", "line_number": 24, "usage_type": "call" }, { "api_name": "dja...
13560177459
import sqlite3 from common import * DB_CONNECTION = sqlite3.connect("resource/ichatbot.db") DB_CURSOR = DB_CONNECTION.cursor() def get_word_count(word): sql_word_count = "SELECT count FROM word WHERE word =:word" DB_CURSOR.execute(sql_word_count, {"word": word}) res_row = DB_CURSOR.fetchone() count ...
wenkwang/ichatbot
main/dbutil.py
dbutil.py
py
3,295
python
en
code
0
github-code
18
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" } ]
36533073361
import time import os import pdb import warnings from collections import OrderedDict from optparse import OptionParser import mdtraj import mbuild as mb import cg_mapping.mapping_functions as mapping_functions PATH_TO_MAPPINGS='/raid6/homes/ahy3nz/Programs/cg_mapping/cg_mapping/charmm_mappings/' HOOMD_FF="/raid6/hom...
ahy3nz/cg_mapping
cg_mapping/scripts/map_traj.py
map_traj.py
py
5,886
python
en
code
0
github-code
18
[ { "api_name": "optparse.OptionParser", "line_number": 17, "usage_type": "call" }, { "api_name": "mdtraj.load", "line_number": 27, "usage_type": "call" }, { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.join", "line_...
41522778568
from flask_restful import reqparse, Resource import numpy as np import pickle as p import pandas import json from sklearn.preprocessing import LabelEncoder path = "file/" class District(Resource): # 도/특별시/광역시 조회 def get(self): distinct_1= json.load(open(path+'district.json', 'rb')) keys = [key...
YeoJiSu/No-Crime-App
backend/venv/crime.py
crime.py
py
5,963
python
en
code
0
github-code
18
[ { "api_name": "flask_restful.Resource", "line_number": 9, "usage_type": "name" }, { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_restful.reqparse.RequestParser", "line_number": 18, "usage_type": "call" }, { "api_name": "...
5364680796
from collections import deque def bfs(graph, start, visited): queue = deque([start]) visited[start] = True while queue: v = queue.popleft() for i in graph[v]: if not visited[i]: queue.append(i) visited[i] = True T = int(input()) coun...
silverkong/Baekjoon
백준/Silver/10451. 순열 사이클/순열 사이클.py
순열 사이클.py
py
810
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 4, "usage_type": "call" } ]
7973337809
from torch.utils.data import Dataset import h5py import util import numpy as np from tqdm.autonotebook import tqdm import os from glob import glob import pickle import torch class QuenchDataset(Dataset): ''' positive_files = glob(down_folder + '*.h5') negative_files = glob(up_folder + '*.h5') print('...
sulcantonin/SRF_IPAC22
code/dataset.py
dataset.py
py
11,838
python
en
code
0
github-code
18
[ { "api_name": "torch.utils.data.Dataset", "line_number": 11, "usage_type": "name" }, { "api_name": "tqdm.autonotebook.tqdm", "line_number": 34, "usage_type": "call" }, { "api_name": "util.read_h5_llrf_locations", "line_number": 35, "usage_type": "call" }, { "api_n...
10067675145
import pandas as pd from sklearn import linear_model df = pd.read_csv("C:\\Users\\ASUS\\Desktop\\Codes\\Python\\regression_learning\\ins_multiple.csv") print(df) mean_Value = df.height.mean() df["height"] = df["height"].fillna(mean_Value) # There is a null value in height. So modifying dataFrame print(df) reg = lin...
soumajyoti02/Mechine-Learning-Codes
linear_reg_Mult_Value.py
linear_reg_Mult_Value.py
py
666
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.linear_model", "line_number": 12, "usage_type": "name" } ]
40320558301
from copy import deepcopy import mock from vinfraclient.cmd.compute.cluster import BaselineCPU from tests import utils baseline_cpu_info = [ { u'models': [ u'SandyBridge', u'Haswell', ], u'patched': True, u'node_id': u'id-0', u'hostname': u'master.vst...
acronis/vinfra
tests/vinfraclient/cmd/compute/cluster/test_cluster.py
test_cluster.py
py
2,779
python
en
code
3
github-code
18
[ { "api_name": "tests.utils.TestCommand", "line_number": 46, "usage_type": "attribute" }, { "api_name": "tests.utils", "line_number": 46, "usage_type": "name" }, { "api_name": "vinfraclient.cmd.compute.cluster.BaselineCPU", "line_number": 49, "usage_type": "call" }, { ...
70762176040
""" meta.py: The file containing the metadata for the student and teacher models """ from collections import namedtuple from sys import exit class AppMeta: """ AppMeta: Values to use throughout application runtime. """ # app default constants _REMOTE_REPO = "https://github.com/singlest...
hoovler/SsChallengeApp
challenge_app/meta.py
meta.py
py
4,658
python
en
code
0
github-code
18
[ { "api_name": "collections.namedtuple", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 53, "usage_type": "call" } ]
40528726734
import numpy as np import cv2 from line import Line import matplotlib.pyplot as plt # Define conversions in x and y from pixels space to meters ym_per_pix = 30 / 720 # meters per pixel in y dimension xm_per_pix = 3.7 / 700 # meters per pixel in x dimension class LaneFinder: def __init__(self, mtx, dist): ...
bejjani/udacityCarND
CarND-Advanced-Lane-Lines/lanefinder.py
lanefinder.py
py
13,322
python
en
code
0
github-code
18
[ { "api_name": "line.Line", "line_number": 15, "usage_type": "call" }, { "api_name": "line.Line", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_numbe...
16556248262
from rest_framework import serializers from .models import Order, OrderItem from django.db import transaction class OrderItemSerializer(serializers.ModelSerializer): price = serializers.DecimalField(max_digits=8, decimal_places=2) class Meta: model = OrderItem fields = ("price", "product", "q...
shamitabh/Vue
tutorial-typescript/backend/DjangoApi/order/serializers.py
serializers.py
py
1,289
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.DecimalField", "line_number": 7, "usa...
35501509297
from typing import Any, Mapping import numpy as np from pathlib import Path import argparse from collections import OrderedDict import os import torch from torch import nn from torch.utils.data import DataLoader from catalyst import dl from sklearn.model_selection import train_test_split import segmentation_models_p...
ai-forever/railway_infrastructure_detection_aij2021
segmentation/src/main.py
main.py
py
4,249
python
en
code
13
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 33, "usage_type": "call" }, { "api_name": "segmentation.src.dataset.RZDDataset", "line_number": 36, "usage_type": "call" }, ...
27380192250
#!/usr/bin/env python """ NNV - wip 005 : HAS: - Layout + canvas - Increment - Decrement Controls - Grid - Circle/Full Circle Examples NEEDS: - PLACE OBJECT WIDGET NEURONS To Do: - App architecure, where to add neurons. - Paceholder neurons """ import os from kivy.properties import BoundedNumericProperty from kivy...
KenoLeon/NeuralNetViewer_Wrk
Prototypes_Kivy/WIP-OLD/wip006.py
wip006.py
py
5,532
python
en
code
0
github-code
18
[ { "api_name": "kivy.config.Config.set", "line_number": 39, "usage_type": "call" }, { "api_name": "kivy.config.Config", "line_number": 39, "usage_type": "name" }, { "api_name": "kivy.config.Config.set", "line_number": 40, "usage_type": "call" }, { "api_name": "kivy...
37213807361
import argparse from typing import Dict, List import zmq from pysecurecircuit import const, utils from pysecurecircuit.circuit import GarbledCircuit, GarbledGate, GarbledKey from pysecurecircuit.ot import ot_decrypt, ot_request from pysecurecircuit.secure_types import _SecureInt class Client: def __init__( ...
Yash-Amin/pySecureCircuit
pysecurecircuit/client.py
client.py
py
6,137
python
en
code
0
github-code
18
[ { "api_name": "typing.Dict", "line_number": 38, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 40, "usage_type": "name" }, { "api_name": "zmq.Context", "line_number": 54, "usage_type": "call" }, { "api_name": "zmq.REQ", "line_number": 55, ...
70703366119
''' Created on 2020-08-22 @author: wf ''' import os import yaml #from wikibot.mwTable import MediaWikiTable # redundant copy in this library to avoid dependency issues # original is at from lodstorage.mwTable import MediaWikiTable class Query(object): ''' a Query e.g. for SPAQRL ''' def __init__(self,nam...
J4keFr0mStatef/The_Accu-Rack
AccurackVenv/Accurack1/Lib/site-packages/lodstorage/query.py
query.py
py
2,563
python
en
code
2
github-code
18
[ { "api_name": "lodstorage.mwTable.MediaWikiTable", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 79, "usage_type": "call" }, { "api_name": "os.path", "line_number": 79, "usage_type": "attribute" }, { "api_name": "yaml.s...
74471484839
from __future__ import annotations import jwt from flask import current_app import json from enum import Enum, IntFlag from typing import Optional from datetime import datetime, timedelta from redis_om import JsonModel, Field from app.extensions import bcrypt from app.api.common.utils.exceptions import UnauthorizedExc...
ABilenduke/seira-domi
app/models/user.py
user.py
py
3,999
python
en
code
0
github-code
18
[ { "api_name": "enum.Enum", "line_number": 13, "usage_type": "name" }, { "api_name": "redis_om.JsonModel", "line_number": 20, "usage_type": "name" }, { "api_name": "redis_om.Field", "line_number": 25, "usage_type": "call" }, { "api_name": "redis_om.Field", "lin...
17954932512
from django.shortcuts import redirect from django.utils.deprecation import MiddlewareMixin from ..views.common import * import json class UserMiddleware(MiddlewareMixin): """Checks if the user is allowed to access the page they are requesting.""" def process_request(self, request): """The main part of the middlew...
aldesabido/sampleproj
project/middleware/user_middleware.py
user_middleware.py
py
1,121
python
en
code
0
github-code
18
[ { "api_name": "django.utils.deprecation.MiddlewareMixin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.shortcuts.redirect", "line_number": 41, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 46, "usage_type": "call" }...
2656265154
import os import sys import json from zipfile import ZipFile import argparse import boto3 import spacy import pprint sys.path.append(os.path.join(os.path.dirname(__file__), "../../")) from yans.storage import Storage from yans.data.train import Evaluator, make_data def main(model_path, data_path, num_limit, ...
icoxfog417/yans-2019-annotation-hackathon
yans/data/evaluate.py
evaluate.py
py
2,056
python
en
code
13
github-code
18
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
12421204565
# import the necessary packages import numpy as np import cv2 import sqlite3 import io def convert_array(text): out = io.BytesIO(text) out.seek(0) return np.load(out) class CoverMatcher: def __init__(self, descriptor, ratio = 0.7, minMatches = 40, useHamming = True): # store the descriptor, ...
feilkontroll/objektivaudio1
pyimagesearch/covermatcher.py
covermatcher.py
py
3,424
python
en
code
0
github-code
18
[ { "api_name": "io.BytesIO", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlite3.register_converter", "line_number": 33, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
40081403769
import os import sys import json import argparse def write_ts_interface(name, content, outdir="./"): if outdir[-1] != "/": outdir += "/" iname = "I{}".format(name) filename = "{}{}.d.ts".format(outdir, iname) output = "export default interface {} {{\n".format(iname) for key in content.keys(): if type(cont...
NicoNex/most
json2ts.py
json2ts.py
py
2,031
python
en
code
0
github-code
18
[ { "api_name": "os.path.basename", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number": 44, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 53, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", ...
5749668315
import sys import argparse from collections import defaultdict reset_report = None def print_usage(name, input_file): print(f"Usage: python3 {name} {input_file}") def load_inputs(input_file): global reset_report report = [] if reset_report is not None: report = reset_report.copy() else: ...
smokeytheblair/adventcode
2020/day15.py
day15.py
py
2,082
python
en
code
2
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 72, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 73, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 78, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
11253892420
#actuator.py from ..device import sOPCUA_Device import logging class sOPCUA_Actuator(sOPCUA_Device): """ Abstract class to manage an actuator into an OPCUA server """ STATE_OFF = "Off" STATE_ON = "On" MKEY_TURN_ON = 'turn_on' MKEY_TURN_OFF = 'turn_off' def __init__(self, cate...
paolopasqua/iot_devices
iot_devices/opcua/server/actuators/actuator.py
actuator.py
py
1,182
python
en
code
0
github-code
18
[ { "api_name": "device.sOPCUA_Device", "line_number": 5, "usage_type": "name" }, { "api_name": "logging.debug", "line_number": 26, "usage_type": "call" }, { "api_name": "device.sOPCUA_Device.KEY_STATE", "line_number": 37, "usage_type": "attribute" }, { "api_name": ...
74195427880
import json import boto3 import os import base64 sagemaker = boto3.client("runtime.sagemaker") endpoint_name = os.environ["SAGEMAKER_ENDPOINT_NAME"] lambda_client = boto3.client("lambda") ip_filter_lambda_arn = os.environ["IP_FILTER_ARN"] def extract_review_full_text(base64_data): data = json.loads(base64.b64dec...
jakipatryk/aws-bigdata-toyproject
spam-filter/lambda_function.py
lambda_function.py
py
1,717
python
en
code
0
github-code
18
[ { "api_name": "boto3.client", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "boto3.client", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number"...
3502041405
import datetime import io import time import traceback import psycopg2 import telebot import pandas as pd import pandas.io.sql as psql import matplotlib.pyplot as plt from pylab import rcParams rcParams['figure.figsize'] = 12, 10 token = 'token' bot = telebot.TeleBot(token, threaded=False) keyb...
airocket/keep_dl
telegram_interface.py
telegram_interface.py
py
4,310
python
en
code
0
github-code
18
[ { "api_name": "pylab.rcParams", "line_number": 14, "usage_type": "name" }, { "api_name": "telebot.TeleBot", "line_number": 19, "usage_type": "call" }, { "api_name": "telebot.types.ReplyKeyboardMarkup", "line_number": 20, "usage_type": "call" }, { "api_name": "tele...
36919324908
import numpy as np import time def using_flat_index(d, xb, xq): index_flat = faiss.IndexFlatL2(d) # build a flat (CPU) index # make it a flat GPU index gpu_index_flat = faiss.index_cpu_to_gpu(res, 0, index_flat) # gpu_index_flat = faiss.index_cpu_to_gpus_list(index_flat, gpus = [2], ngpu=1) gpu...
oviazlo/perf_faiss_kNN
perf_flat_random.py
perf_flat_random.py
py
3,535
python
en
code
0
github-code
18
[ { "api_name": "tensorflow.sets.intersection", "line_number": 52, "usage_type": "call" }, { "api_name": "tensorflow.sets", "line_number": 52, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 70, "usage_type": "attribute" }, { "api_name": "os....
6784457338
import telebot from config.config import TOKEN from flask import Blueprint, request, abort from app import db from app.models import User, NewWords from app.telegram_bot.process_user_welcome import ProcessWelcome from app.telegram_bot.synonyms import find_synonym import random bot = telebot.TeleBot(TOKEN) web = Bluep...
Iaroslavv/English-learning-bot
app/telegram_bot/tele_bot.py
tele_bot.py
py
8,126
python
en
code
0
github-code
18
[ { "api_name": "telebot.TeleBot", "line_number": 11, "usage_type": "call" }, { "api_name": "config.config.TOKEN", "line_number": 11, "usage_type": "argument" }, { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request...
28439245168
# -*- coding: utf-8 -*- """ Created on Fri Oct 9 09:25:22 2020 @author: hrmha """ if __name__ == '__main__': print('Starting') from userClass import * from userClass import * from hash import * from findHash import * from getUsersData import * import matplotlib.pyplot as plt def getData(): data = usersListFr...
Hector290601/EDA2
busqueda/hashFind/main.py
main.py
py
2,277
python
en
code
2
github-code
18
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 63, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 63, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.suptitle", "line_number": 64, "usage_type": "call" }, { "api_name": ...
7633803395
import asyncio import aiocoap import logging import time import os import re import hashlib import aiocoap.resource as resource logging.basicConfig(level=logging.DEBUG,format='%(levelname)s %(message)s') logger = logging.getLogger('lwm2mserver') class Hasher(object): def __init__(self, seed): self....
wangnuannuan/lwm2m-client
lwm2mserver/server.py
server.py
py
13,117
python
en
code
1
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "hashlib.new"...
39406727561
import tensorflow as tf from tensorflow.keras.applications.resnet50 import preprocess_input import keras from keras import layers, models import os import numpy as np from pathlib import Path from keras.regularizers import l2 import matplotlib.pyplot as plt #from sklearn.model_selection import train_test_split #uncom...
moumed/Smart-3D-Camera-Pose-Estimation-for-Complex-Augmented-Reality-Environments-Using-Deep-Learning-Techn
[3_TOUIL][Annexe_1][3DNet-Code-main]/5-2-_3DNet_CNN_Regression_Model.py
5-2-_3DNet_CNN_Regression_Model.py
py
5,223
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 24, "usage_type": "call" }, { "api_name": "matpl...
9286727626
# logicPlan.py # ------------ # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.berkeley.edu. ...
doniobidov/data_science
Pacman intelligent agents AI/Project 3: Propositional logic-based agents/logicPlan.py
logicPlan.py
py
19,939
python
en
code
1
github-code
18
[ { "api_name": "util.raiseNotDefined", "line_number": 55, "usage_type": "call" }, { "api_name": "util.raiseNotDefined", "line_number": 62, "usage_type": "call" }, { "api_name": "util.raiseNotDefined", "line_number": 69, "usage_type": "call" }, { "api_name": "game.D...
25675670979
import cv2 as cv import numpy as np from math import atan # deskews picture with i pixels # returns deskewed picture def deskew(img, i): rows = img.shape[0] cols = img.shape[1] pts1 = np.float32([[0, 0], [cols - 1, 0], [cols - 1 + i, rows - 1]]) pts2 = np.float32([[0, 0], [cols - 1, 0], [cols - 1...
nieknaber/HandWritingRecognition
src/segmentation/slantNormalize.py
slantNormalize.py
py
1,639
python
en
code
0
github-code
18
[ { "api_name": "numpy.float32", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.getAffineTransform", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.warpAffine", ...
74738739881
import sys from random import randint import pygame from utils.models import Game, GameElement pygame.init() game = Game(width=900, height=700, color=(32, 52, 81)) game.display.set_caption("Awesome Shooter Game") dimentions = (game.screen.get_width(), game.screen.get_height()) fighter = GameElement('Fighter', './im...
wilfridterry/game-shooter
main.py
main.py
py
2,316
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "utils.models.Game", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.models.GameElement", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.models.Gam...
39260978053
from DataManager import dataBase from telethon import TelegramClient import asyncio import requests from LogData import logger, getDateTime from utilities import * logger.info('default', 'Basic Startup complete!!') userData = dataBase.getUserData() #function to send the telegram messages async def sendMessage(data,mes...
coder-nobody/Cowin-slot-telegaram-notifier
main.py
main.py
py
2,705
python
en
code
4
github-code
18
[ { "api_name": "LogData.logger.info", "line_number": 8, "usage_type": "call" }, { "api_name": "LogData.logger", "line_number": 8, "usage_type": "name" }, { "api_name": "DataManager.dataBase.getUserData", "line_number": 9, "usage_type": "call" }, { "api_name": "Data...
19480345430
import pygame import time import math import collections import random ifsetup = True thestat = 0 # setting up pygame stuff pygame.init() infoObject = pygame.display.Info() height = infoObject.current_h width = infoObject.current_w print("Screen Resolution: %s, %s" % (infoObject.current_w, in...
vladov3000/ib
ib.py
ib.py
py
16,341
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.display.Info", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pygame.display.se...
15233696400
''' breadth first values Write a function, breadth_first_values, that takes in the root of a binary tree. The function should return a list containing all values of the tree in breadth-first order. test_00: a = Node('a') b = Node('b') c = Node('c') d = Node('d') e = Node('e') f = Node('f') a.left = b a.right = c b.l...
VictorHeDev/structy
module4/breadth_first_values.py
breadth_first_values.py
py
1,713
python
en
code
1
github-code
18
[ { "api_name": "collections.deque", "line_number": 95, "usage_type": "call" } ]
29309032629
import torch import torchvision from PIL import Image # img = Image.open('PennFudanPed/PNGImages/FudanPed00001.png') # # mask = Image.open('PennFudanPed/PedMasks/FudanPed00001_mask.png') # # mask.putpalette([ # 0, 0, 0, # black background # 255, 0, 0, # index 1 is red # 255, 255, 0, # index 2 is yellow...
luckystoneke/PyTorchTutorial
objectdetection/JustTest.py
JustTest.py
py
3,063
python
en
code
0
github-code
18
[ { "api_name": "torchvision.models.detection.maskrcnn_resnet50_fpn", "line_number": 30, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 30, "usage_type": "attribute" }, { "api_name": "torchvision.models.detection.faster_rcnn.FastRCNNPredictor", "line...
74462109481
from typing import List class Solution: def reorderLogFiles(self, logs: List[str]) -> List[str]: digit_logs = [] letter_logs = [] for log in logs: if log.split()[1].isdigit(): digit_logs.append(log) else: letter_logs.append(log) ...
bbaJay749/Algorithm
Leetcode_937_Reorder Data in Log Files.py
Leetcode_937_Reorder Data in Log Files.py
py
429
python
en
code
1
github-code
18
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
33334383604
# https://nasa-openscapes.github.io/2021-Cloud-Hackathon/tutorials/05_Data_Access_Direct_S3.html # Instructions for getting access to the NASA data: https://urs.earthdata.nasa.gov/documentation/for_users/data_access/curl_and_wget # imports from datetime import datetime, timedelta import os import requests import boto...
rangeldaroya/aist-ssc
src/preprocess/00_download_hls.py
00_download_hls.py
py
5,189
python
en
code
0
github-code
18
[ { "api_name": "os.path.exists", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 36, "usage_type": "call" }, { "api_name": "requests.get", "line_numb...
27591131284
from requests.exceptions import RequestException from tkinter import Button, Tk, Toplevel, Label from tkinter.messagebox import askyesno from pkg_resources import parse_version from configparser import ConfigParser from tkinter.ttk import Progressbar from win32api import ShellExecute from PIL import Image, ImageTk from...
Boiiterra/math_problem_generator_app
launcher.py
launcher.py
py
4,791
python
en
code
3
github-code
18
[ { "api_name": "configparser.ConfigParser", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "name" }, { "api_name": "tkinter.Toplevel", ...
35472145429
from constants import * from dataset import pad_sequences from utils import Timer from sklearn.utils import shuffle from sklearn.model_selection import train_test_split import numpy as np import tensorflow as tf import os import shutil if not os.path.exists(MODEL_PATH): os.makedirs(MODEL_PATH) shutil.copy2('con...
hehondou/Pointwise_Ranking
pointwise.py
pointwise.py
py
13,516
python
en
code
1
github-code
18
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 14, "usage_type": "call" }, { "api_name": "shutil.copy2", "line_numb...
3304603576
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('feedback', '0001_initial'), ] operations = [ migrations.AddField( model_name='ordercall', name='page...
dkoldyaev/basis.ru
feedback/migrations/0002_ordercall_page.py
0002_ordercall_page.py
py
511
python
en
code
0
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
41765421951
from django import forms from django.core.exceptions import ValidationError from .models import Choice class QuestionInlineFormSet(forms.BaseInlineFormSet): def clean(self): if not (self.instance.QUESTION_MIN_LIMIT <= len(self.forms) <= self.instance.QUESTION_MAX_LIMIT): raise ValidationError...
python-hillel/python_advanced_06_12_2022
06_django_quiz/src/quiz/forms.py
forms.py
py
1,495
python
en
code
2
github-code
18
[ { "api_name": "django.forms.BaseInlineFormSet", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.core.exceptions.ValidationError", "line_number": 10, "usage_type": "call" }, { ...
1805749021
import logging from selenium import webdriver from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException import config as setting LOGGER = l...
f00dog-x300/SauceLabsWithPythonSelenium4
pages/base_page.py
base_page.py
py
2,417
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "config.BASE_URL", "line_number": 21, "usage_type": "attribute" }, { "api_name": "selenium.we...
37875127641
from collections import defaultdict def solution(X, Y, C): N = X recommendations = C graph = defaultdict(list) for recommendation in recommendations: A, B = map(int, recommendation.split()) graph[A].append(B) def dfs(node): visited = set() stack = [node] w...
jhowilbur/challenges-and-datastructure_python
challenges/codility/test/1/1_election_season_improved.py
1_election_season_improved.py
py
961
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" } ]
11671902282
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('hpilo', '0003_auto_20150208_0052'), ] operations = [ migrations.AlterField( model_name='ilostatusdetail', ...
wolfmc3/itmemory
hpilo/migrations/0004_auto_20150208_0054.py
0004_auto_20150208_0054.py
py
741
python
en
code
0
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
74928360039
""" Module containing pipelines (reoccuring function calls) for use with apscheduler. """ from datetime import datetime import logging from requests import Session import json from apscheduler.schedulers.background import BlockingScheduler from driver.driver_config_builder import DriverConfig from driver.compute_serv...
jeha-dblab/EDA_Framework
driver/pipeline.py
pipeline.py
py
5,820
python
en
code
29
github-code
18
[ { "api_name": "driver.driver_config_builder.DriverConfig", "line_number": 25, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 31, "usage_type": "call" }, { "api_name": "driver.driver_config_builder.DriverConfig", "line_number": 46, "usage_type": "name...
41885344675
"""Tests for ``siptools.scripts.create_addml`` module""" from __future__ import unicode_literals import os import pytest import lxml.etree as ET import siptools.scripts.create_addml as create_addml from siptools.utils import decode_path, read_md_references CSV_FILE = "tests/data/csvfile.csv" DELIMITER = ";" CHARSET...
Digital-Preservation-Finland/dpres-siptools
tests/scripts/test_create_addml.py
test_create_addml.py
py
7,428
python
en
code
22
github-code
18
[ { "api_name": "siptools.scripts.create_addml.create_addml_metadata", "line_number": 25, "usage_type": "call" }, { "api_name": "siptools.scripts.create_addml", "line_number": 25, "usage_type": "name" }, { "api_name": "pytest.mark.parametrize", "line_number": 21, "usage_typ...
9390733953
import torchvision.models as models import torch.nn as nn import config class Yolo(nn.Module): def __init__(self, backbone=None): super().__init__() if backbone is None: self.backbone = models.resnet18(pretrained=True) self.backbone.fc = nn.Sequential() else: ...
ratata-t/yolo-v1
yolo/model.py
model.py
py
680
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torchvision.models.resnet18", "line_number": 10, "usage_type": "call" }, { "api_name": "torchvision.m...