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
45608542686
import os import pytest from pycarta.api import create_agent @pytest.fixture def cartaAuth(): if "CARTA_AUTH" not in os.environ: print("Set 'export CARTA_AUTH=[Carta auth token]' before testing.") raise ValueError( "Environment variable CARTA_AUTH must be set to run tests." ) ...
jessec1001/pycarta
tests/common_fixtures.py
common_fixtures.py
py
579
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
31678821422
from fastapi import FastAPI from fastapi.responses import StreamingResponse from fastapi.middleware.cors import CORSMiddleware from dotenv import load_dotenv import uvicorn from .models import ChatData, TestData from .chat import introduce, ask, generate app = FastAPI() load_dotenv() origins = [ "*" ] app.add_m...
IsaacOrzDev/personal-chat-api
app/main.py
main.py
py
867
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 9, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 18, "usage_type": "argument" }, { "api_...
9660784063
# https://www.acmicpc.net/problem/12891 import sys from collections import deque input = sys.stdin.readline def solve(): n, l = map(int, input().split()) # n = 숫자의 갯수, l 슬라이딩 윈도우의 크기 numbers = list(map(int, input().split())) dq = deque() for i in range(n): # 맨 뒤에 있는 노드의 value가, numbers[i] 보...
java-squid/lets-algorithm
03--data-structure/han/baekjoon/11003.py
11003.py
py
1,108
python
ko
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" } ]
73510613307
from collections import defaultdict from collections import deque graph = defaultdict(list) for _ in range(int(input())): arr = list(map(int, input().split())) graph[arr[0]].append(arr[1]) graph[arr[1]].append(arr[0]) tt = [x for x in graph if len(graph[x]) == 1] queue = deque([tt[0]]) visited = set([...
yonaSisay/a2sv-competitive-programming
mailstamps.py
mailstamps.py
py
532
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
6474793905
from __future__ import annotations from typing import List, Iterator from collections import deque def not_sums(numbers: List[int], lookback: int = 25) -> Iterator[int]: q = deque() for n in numbers: if len(q) < lookback: q.append(n) else: sums = {a + b ...
joelgrus/advent2020
advent2020/day09.py
day09.py
py
1,506
python
en
code
29
github-code
6
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.Iterator", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_nu...
30518654005
from typing import List import sys class Solution: def minimumInteger(self, N : int, A : List[int]) -> int: # code here sum=0; for a in A : sum+=a; mn = sys.maxsize; for a in A : if sum<=N*a : mn = min(mn,a); return mn; ...
Vivek-8877/GeeksForGeeks-Solution
March 2023/Day 30/Minimum Integer/minimum-integer.py
minimum-integer.py
py
891
python
en
code
11
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "sys.maxsize", "line_number": 10, "usage_type": "attribute" } ]
18432225771
from scripts.crawler import SeleniumRequest from scripts.crawler.parser import infoParser, topidParser from movies.models import Movie, MovieReviewDummy from tqdm import tqdm import os from urllib.request import urlretrieve from PIL import Image def run(): request = SeleniumRequest() img_folder_path = '....
HEEpage/final_mrs
scripts/movie_state_crawl.py
movie_state_crawl.py
py
5,017
python
ko
code
3
github-code
6
[ { "api_name": "scripts.crawler.SeleniumRequest", "line_number": 11, "usage_type": "call" }, { "api_name": "scripts.crawler.parser.topidParser", "line_number": 32, "usage_type": "name" }, { "api_name": "movies.models.Movie.objects.filter", "line_number": 37, "usage_type": ...
39463963867
# - need to read from kafka, topic # - need to write to cassandra, table from cassandra.cluster import Cluster from kafka import KafkaConsumer from kafka.errors import KafkaError import argparse import atexit import json import logging import time import datetime # - default kafka topic to read from topic_name = 'st...
xt435/real-time-analytics-system
cassandra/data-storage.py
data-storage.py
py
4,234
python
en
code
1
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 32, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 36, "usage_type": "attribute" }, { "api_name": "json.loads",...
9264296962
import matplotlib.pyplot as plt import numpy as np import pandas as pd import config def get_vertices_in_sensor_range(dist, plot=True, plot_sensors=True): """ Get vertices that are close to at least one sensor. """ import mne from conpy.forward import select_vertices_in_sensor_range fwd = mn...
wmvanvliet/beamformer_simulation
plotting_functions.py
plotting_functions.py
py
21,307
python
en
code
4
github-code
6
[ { "api_name": "mne.read_forward_solution", "line_number": 15, "usage_type": "call" }, { "api_name": "config.fname", "line_number": 15, "usage_type": "attribute" }, { "api_name": "conpy.forward.select_vertices_in_sensor_range", "line_number": 17, "usage_type": "call" }, ...
29001063614
from pathlib import Path from setuptools import find_packages, setup from xycrypto import __version__, __author__ readme = Path(__file__).with_name('README.md').read_text() classifiers = [ 'License :: OSI Approved', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Pro...
xymy/xycrypto
setup.py
setup.py
py
1,132
python
en
code
1
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 22, "usage_type": "call" }, { "api_name": "xycrypto.__version__", "line_number": 24, "usage_type": "name" }, { "api_name": "xycrypto.__author__...
26598543911
# transform from recipe to greek from parse import wrapper, remove_punc_lower, food, direction, make_recipe_obj import string from collections import deque from get_key_ingredient import get_key, get_key_food def lookup(ing, lst): name_lst = ing.name.lower().translate(str.maketrans('', '', string.punctuation)).sp...
emilyjenkins08/Recipes
transform_greek.py
transform_greek.py
py
22,039
python
en
code
1
github-code
6
[ { "api_name": "string.punctuation", "line_number": 9, "usage_type": "attribute" }, { "api_name": "parse.food", "line_number": 49, "usage_type": "call" }, { "api_name": "parse.food", "line_number": 52, "usage_type": "call" }, { "api_name": "parse.food", "line_n...
14634997629
import api.receipt_item from common import utils from entity.Receipt import Receipt def build(receipt: Receipt): api_receipt_items = build_receipt_items(receipt) total_sales_taxes_in_units = utils.get_price_in_units(price_in_cents=receipt.get_total_sales_taxes()) total_amount_in_units = utils.get_price_in...
tatma/simple-receipt-api
api/receipt.py
receipt.py
py
774
python
en
code
0
github-code
6
[ { "api_name": "entity.Receipt.Receipt", "line_number": 6, "usage_type": "name" }, { "api_name": "common.utils.get_price_in_units", "line_number": 8, "usage_type": "call" }, { "api_name": "common.utils", "line_number": 8, "usage_type": "name" }, { "api_name": "comm...
5038140181
import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as go from dash.dependencies import Input,Output from numpy import random import pandas as pd app=dash.Dash() df=pd.read_csv(r'C:/Users/PRINCE/Desktop/covid19 colab/mpg.csv') # ADDING NOISE, JITTER df['year...
stephenprin/Visualization-of-dataset-MPG-
main.py
main.py
py
1,219
python
en
code
0
github-code
6
[ { "api_name": "dash.Dash", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "lin...
40371126022
from typing import Union, Tuple, Dict import pygame from pygame_gui.core import ObjectID from pygame_gui.core.interfaces import IContainerLikeInterface, IUIManagerInterface from pygame_gui.core import UIElement from pygame_gui.core.utility import premul_alpha_surface class UIImage(UIElement): """ Displays a...
Martian2024/PyGame_Project
venv/Lib/site-packages/pygame_gui/elements/ui_image.py
ui_image.py
py
3,460
python
en
code
3
github-code
6
[ { "api_name": "pygame_gui.core.UIElement", "line_number": 11, "usage_type": "name" }, { "api_name": "pygame.Rect", "line_number": 29, "usage_type": "attribute" }, { "api_name": "pygame.surface", "line_number": 30, "usage_type": "attribute" }, { "api_name": "pygame...
5089403437
import threading from tkinter import * # GUI import pyglet import chatterbot import pyttsx3 as pp # Text to Audio import speech_recognition as s # Speech to Speech from chatterbot.trainers import ListTrainer def run1(): animation = pyglet.image.load_animation('source.gif') animSprite = pyglet.sp...
Sudiptobanerjee123/Patent_Go
Test_final.py
Test_final.py
py
3,152
python
en
code
0
github-code
6
[ { "api_name": "pyglet.image.load_animation", "line_number": 11, "usage_type": "call" }, { "api_name": "pyglet.image", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pyglet.sprite.Sprite", "line_number": 12, "usage_type": "call" }, { "api_name": "py...
1815407241
from __future__ import absolute_import import os import ipdb import matplotlib from tqdm import tqdm from torch.utils import data as data_ from utils.config import opt from data.dataset import Dataset, TestDataset, inverse_normalize # from model.faster_rcnn_vgg16 import FasterRCNNVGG16 from model.faster_rcnn_resnet50 ...
chuliuT/simple-faster-rcnn-annotations
train.py
train.py
py
4,508
python
en
code
0
github-code
6
[ { "api_name": "resource.getrlimit", "line_number": 20, "usage_type": "call" }, { "api_name": "resource.RLIMIT_NOFILE", "line_number": 20, "usage_type": "attribute" }, { "api_name": "resource.setrlimit", "line_number": 21, "usage_type": "call" }, { "api_name": "res...
30997826470
""" apps/products/views_images.py """ import os from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from .forms import ImageForm from .models import Product def images_list(requ...
BrRoman/editor
editor/apps/products/views_images.py
views_images.py
py
2,984
python
en
code
0
github-code
6
[ { "api_name": "models.Product.objects.filter", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Product.objects", "line_number": 16, "usage_type": "attribute" }, { "api_name": "models.Product", "line_number": 16, "usage_type": "name" }, { "api_name...
20543171056
import warnings from datetime import datetime from typing import Callable, Dict, NamedTuple, Optional, Tuple import jax from jax import numpy as jnp from tqdm import tqdm from mcx.inference.adaptation import ( StanWarmupState, stan_hmc_warmup, stan_warmup_schedule, ) from mcx.inference.integrators import ...
rlouf/mcx
mcx/inference/hmc.py
hmc.py
py
12,607
python
en
code
327
github-code
6
[ { "api_name": "typing.NamedTuple", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 23, "usage_type": "name" }, { "api_name": "jax.numpy.DeviceArr...
30070241838
import os import sys assert sys.version_info >= (3, 5) # make sure we have Python 3.5+ from pyspark import SparkConf, SparkContext from transformers import ( TokenClassificationPipeline, AutoModelForTokenClassification, AutoTokenizer, ) from transformers.pipelines import AggregationStrategy from transform...
irisjiayuema/big-data-lab-I-final
NLP/Trials/step1_rdd.py
step1_rdd.py
py
3,397
python
en
code
3
github-code
6
[ { "api_name": "sys.version_info", "line_number": 3, "usage_type": "attribute" }, { "api_name": "transformers.TokenClassificationPipeline", "line_number": 23, "usage_type": "name" }, { "api_name": "transformers.AutoModelForTokenClassification.from_pretrained", "line_number": 2...
41853273092
import itertools from absl.testing import parameterized import tensorflow as tf from official.nlp.modeling.layers import kernel_attention as attention _FEATURE_TRANSFORM = ['relu', 'elu', 'exp', 'l2'] _REDRAW = [True, False] _TRAINING = [True, False] _IS_SHORT_SEQ = [True, False] _BEGIN_KERNEL = [0, 512] class Ke...
sek788432/Waymo-2D-Object-Detection
input/models/official/nlp/modeling/layers/kernel_attention_test.py
kernel_attention_test.py
py
3,531
python
en
code
79
github-code
6
[ { "api_name": "tensorflow.test", "line_number": 16, "usage_type": "attribute" }, { "api_name": "absl.testing.parameterized.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "absl.testing.parameterized", "line_number": 16, "usage_type": "name" }, ...
10693633838
from loguru import logger import sys __all__ = ['get_logger'] def get_logger(name: str = None, level: str = "DEBUG", rotation: str = '500 MB', retention: str = '3 days'): sink = sys.stderr if name is None else name configs = dict(sink=sink, format="{time:YYYY-MM-DD HH:mm:ss:SSSS} {level} {module}.py: {messag...
mikuh/naive-rllib
naive_rllib/utils/default_logger.py
default_logger.py
py
493
python
en
code
0
github-code
6
[ { "api_name": "sys.stderr", "line_number": 8, "usage_type": "attribute" }, { "api_name": "loguru.logger.add", "line_number": 12, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 12, "usage_type": "name" }, { "api_name": "loguru.logger", "l...
72769187067
""" Compare values of loss functions between different models: numpy, pytorch """ import numpy as np import os import matplotlib.pyplot as plt from plot_utils import save_plot, set_plot_style from q1_plot_data import TYPE1_EDGE_COLOR, TYPE2_EDGE_COLOR from itertools import cycle def load_losses_from_cache(cache_...
evgenyneu/ASP5020_data_analysis_problem_sets
ps5/code/compare_losses_between_models.py
compare_losses_between_models.py
py
2,349
python
en
code
0
github-code
6
[ { "api_name": "numpy.load", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", ...
27261265756
import sys import telethon from telethon import functions from telethon.sync import TelegramClient, events from .utils import ValidatePhone, LOGIN_MESSAGE class UserManager: """ """ __api_hash = None __api_id = None __session = None def __init__(self, api_id, api_hash, session): sel...
mzarchi/telethon-scripts
codes/user.py
user.py
py
3,540
python
en
code
2
github-code
6
[ { "api_name": "utils.LOGIN_MESSAGE", "line_number": 26, "usage_type": "argument" }, { "api_name": "utils.ValidatePhone", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 29, "usage_type": "call" }, { "api_name": "telethon.sync.Te...
14177915562
"""Facilitates process of querying CosmosDB container.""" import http.client as http_client import logging import sys from typing import Callable import azure.functions as func from .modules import get_query_from_body, get_query_items, connection_setup from .modules.custom_error import QueryCosmosDBError log = logg...
wieczorekgrzegorz/ksef-krportal-communication
modules/query_cosmosdb/query_cosmosdb.py
query_cosmosdb.py
py
3,895
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "azure.functions.HttpRequest", "line_number": 17, "usage_type": "attribute" }, { "api_name": "azure.functions", "line_number": 17, "usage_type": "name" }, { "api_name": "ty...
25725025659
from tkinter import * import pandas import random from PIL import Image, ImageTk BACKGROUND_COLOR = "#B1DDC6" new_dict = {} to_learn = {} try: data = pandas.read_csv("data/all_word_I_know.CSV UFT-8(Comma delimited)") except FileNotFoundError: original_data = pandas.read_csv("data/flash_csv21.csv") to_learn...
mahmood-212/flash-card
main.py
main.py
py
3,139
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
825051415
# -*- coding: utf-8 -*- from PySide2 import QtCore, QtWidgets from hardware import ( ArduinoUno, KeithleySource, KeithleyMultimeter, OceanSpectrometer, ThorlabMotor, ) from tests.tests import ( MockArduinoUno, MockKeithleySource, MockKeithleyMultimeter, MockOceanSpectrometer, M...
GatherLab/OLED-jvl-measurement
src/goniometer_measurement.py
goniometer_measurement.py
py
30,555
python
en
code
1
github-code
6
[ { "api_name": "PySide2.QtCore.QThread", "line_number": 29, "usage_type": "attribute" }, { "api_name": "PySide2.QtCore", "line_number": 29, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Signal", "line_number": 34, "usage_type": "call" }, { "api_name": "PySi...
36170900911
import numpy as np import pandas as pd from sklearn.compose import ColumnTransformer from sklearn.preprocessing import OneHotEncoder from sklearn.ensemble import RandomForestRegressor def main(): # remove buildingYear for the time being because of the missing values df = pd.read_csv('data/immobiliare_ads_Ca...
framoni/real-estate
rf.py
rf.py
py
5,157
python
it
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.isna", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.compose.ColumnTransformer", "line_number": 48, "usage_type": "call" }, { "api_name": "sklearn...
3226080791
import smtplib, ssl import argparse import pandas as pd import os from glob import glob from smtpd import DebuggingServer import asyncore import threading from time import sleep from email.message import EmailMessage import mimetypes from string import Template from tqdm import tqdm import sys import subprocess as sp f...
yairfax/EmailMerge
driver.py
driver.py
py
7,908
python
en
code
2
github-code
6
[ { "api_name": "subprocess.check_output", "line_number": 21, "usage_type": "call" }, { "api_name": "subprocess.CalledProcessError", "line_number": 23, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 30, "usage_type": "call" }, { ...
18308259882
import os import uuid import zipfile from os.path import join, dirname from tempfile import gettempdir from unittest import TestCase import pandas as pd import numpy as np from aequilibrae import TrafficAssignment, TrafficClass, Graph, Project, PathResults from aequilibrae.matrix import AequilibraeMatrix from ...data ...
AequilibraE/aequilibrae
tests/aequilibrae/paths/test_select_link.py
test_select_link.py
py
10,277
python
en
code
140
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
12064694605
import sys import math as m from pyspark.sql import functions as f from pyspark.sql import SparkSession from pyspark.sql import * from pyspark.sql.types import IntegerType, FloatType from pyspark.ml.regression import LinearRegression from pyspark.ml.evaluation import RegressionEvaluator from pyspark.ml.pipeline import ...
rtbanks/PracticalApp2
PracticalApplication.py
PracticalApplication.py
py
5,860
python
en
code
0
github-code
6
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 14, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 14, "usage_type"...
43497341909
import pytest import json from flask import json, Response from bs4 import BeautifulSoup from werkzeug.utils import cached_property from app import create_app class TestingResponse(Response): @cached_property def json(self): assert self.mimetype == 'application/x-www-form-urlencoded' return js...
minelminel/sirajify
src/test.py
test.py
py
1,456
python
en
code
0
github-code
6
[ { "api_name": "flask.Response", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.json", "line_number": 13, "usage_type": "name" }, { "api_name": "werkzeug.utils.cached_prope...
29771971996
#!/usr/bin/env python # coding: utf-8 # # Plotting Tiles # # ## Objectives # # Introduce several different methods for plotting ECCO v4 fields that are stored as tiles in `Datasets` or `DataArrays`. Emphasis is placed on fields stored on the ECCO v4 native llc90 grid and loaded from NetCDF tile files. # # ## Intro...
ECCO-GROUP/ECCO-v4-Python-Tutorial
Tutorials_as_Python_Files/ECCO_v4_Plotting_Tiles.py
ECCO_v4_Plotting_Tiles.py
py
26,876
python
en
code
44
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 62, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 87, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 87, "usage_type": "attribute" }, { "api_name": "xarray.open_dat...
21281869310
import os, sys from tqdm import tqdm import torch as th sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) from decalib.deca import DECA from decalib.datasets import datasets from decalib.utils.config import cfg as deca_cfg import pickle from torch.utils.data import DataLoader import l...
adobe-research/diffusion-rig
scripts/create_data.py
create_data.py
py
4,541
python
en
code
202
github-code
6
[ { "api_name": "sys.path.insert", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number...
6706020880
# pylint: disable=C0103,C0114,C0115,C0116, C0209, C0301, W0105 import os import sys import pwinput as pw from sqlalchemy import create_engine import pandas as pd import mariadb class App: print("Boas-vindas a OrFy!") # Cria um diretório na pasta do sistema Program Files folder = "C:\\Program Files\\OrFy"...
Mcecy/Orfy1.0
src/app_main.py
app_main.py
py
21,725
python
pt
code
0
github-code
6
[ { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 19, "usage_type": "call" }, { "api_name": "pwinput.pwinput", "line_n...
1326171453
import numpy as np import os import re from tqdm import tqdm import random import torch from torch.utils.data import Dataset, DataLoader from config import config_info # handle os files class FileManager(object): def __init__(self,RootDir): self.RootDir=RootDir for _,_,files in os.walk(self.RootDir)...
1926627357/IoT
linke_preprocess.py
linke_preprocess.py
py
5,408
python
en
code
0
github-code
6
[ { "api_name": "os.walk", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "random.shuffle", "line_number":...
26625589286
""" URLConf for Satchmo Newsletter app This will get automatically added by satchmo_store, under the url given in your livesettings "NEWSLETTER","NEWSLETTER_SLUG" """ from django.conf.urls.defaults import * from livesettings import config_value import logging log = logging.getLogger('newsletter.urls') urlpatterns = ...
dokterbob/satchmo
satchmo/apps/satchmo_ext/newsletter/urls.py
urls.py
py
1,161
python
en
code
30
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "livesettings.config_value", "line_number": 23, "usage_type": "call" } ]
13610774745
from django.views import generic class IndexView(generic.RedirectView): permanent = False def get_redirect_url(self, *args, **kwargs): if self.request.user.is_authenticated(): self.pattern_name = 'accounts:dashboard' else: self.pattern_name = 'learn:project_list' ...
klebercode/sofia
sofia/apps/core/views.py
views.py
py
550
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.RedirectView", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 4, "usage_type": "name" }, { "api_name": "django.views.generic.TemplateView.as_view", "line_number": 17, "usage_type": "c...
77963027
# File Structure: # //isolate_label_islandremoval_Kmeans.py # //lab_directrory # this script applies PCA to a 3d segmentation import nibabel as nib import SimpleITK as sitk import os, sys import numpy as np from sklearn.cluster import KMeans from sklearn.decomposition import PCA lab_directrory = "lab" # directory w...
kylerioux/python_ML_scripts
postprocessing_network_inference/PCA_3d_segmentation.py
PCA_3d_segmentation.py
py
1,939
python
en
code
0
github-code
6
[ { "api_name": "SimpleITK.ReadImage", "line_number": 19, "usage_type": "call" }, { "api_name": "SimpleITK.GetArrayFromImage", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 27, "usage_type": "call" }, { "api_name": "SimpleITK.G...
22377686426
from PyQt5.QtCore import Qt from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QWidget from PyQt5.QtWidgets import QVBoxLayout from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtWidgets import QLabel from PyQt5.QtWidgets import QLineEdit class RecipientLayout(QVBoxLayout): infoChanged = pyqtSignal...
WalterCM/aktor
src/views/Recipient.py
Recipient.py
py
1,702
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 19, "usage_type": "call" }, { "api_na...
25549048481
from flask import Flask, render_template import datetime import requests app = Flask(__name__) @app.route('/') def home(): now = datetime.datetime.now() return render_template('index.html',year=now.year) @app.route('/guess/<username>') def guess(username): name = (username).title() inpt = {"name": na...
harisuryaa/Python-Projects
flask url/server.py
server.py
py
705
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.render_te...
30483969149
import io import csv from uuid import uuid4 from django.core.files.base import ContentFile from celery import shared_task from .models import Schema, DataSet from . import data_type @shared_task def generate_csv_task(schema_id, records): schema = Schema.objects.get(pk=schema_id) columns = schema.column_set...
romanets-oleksandr/csv-data-generator
csv_generator/tasks.py
tasks.py
py
964
python
en
code
0
github-code
6
[ { "api_name": "models.Schema.objects.get", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Schema.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.Schema", "line_number": 14, "usage_type": "name" }, { "api_name": "io...
34035309839
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import copy import numpy as np from six.moves import xrange import tensorflow as tf import warnings from . import utils_tf from tensorflow.python.platform import flags ...
hx173149/Ttansferable-Adversarial-Perturbation
cleverhans/attacks_tf.py
attacks_tf.py
py
4,154
python
en
code
2
github-code
6
[ { "api_name": "tensorflow.python.platform.flags.FLAGS", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.python.platform.flags", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.inf", "line_number": 21, "usage_type": "attribute" }...
20681985815
import pickle import logging # Enable logging logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO ) logger = logging.getLogger(__name__) def print_(palabra="Inicio"): print("=".rjust(50, "=")) print(f"{palabra}".rjust(50, ".")) print("=".rjust(50, "=")...
ramirovazq/llantasbot
utils/comfortable.py
comfortable.py
py
1,597
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "pickle.load", ...
1097411224
import tweepy import requests import json class CurrencyRatesFetcher: currency_codes: tuple def __init__(self, searched_currency_codes: tuple): self.url = 'http://api.nbp.pl/api/exchangerates/tables/A' self.currency_codes = searched_currency_codes def get_currency_rates(self) -> tuple[str...
dgucik/nbp-currency-twitter-bot
main.py
main.py
py
1,384
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 22, "usage_type": "call" }, { "api_name": "tweepy.Client", "line_number": 34, "usage_type": "call" } ]
27679665780
#!/usr/bin/env python import sys import mgrs import numpy file=sys.argv[1] lonlat = numpy.loadtxt(file) nburst = len(lonlat) for n in range (0,nburst): m = mgrs.MGRS() a = m.toMGRS(lonlat[n,1],lonlat[n,0],MGRSPrecision=1) print(a)
comet-licsar/licsar_proc
python/listlonlat2mgrs.py
listlonlat2mgrs.py
py
247
python
en
code
9
github-code
6
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.loadtxt", "line_number": 8, "usage_type": "call" }, { "api_name": "mgrs.MGRS", "line_number": 12, "usage_type": "call" } ]
21412683963
#Based on https://scikit-image.org/docs/dev/auto_examples/transform/plot_radon_transform.html (accessed on 05.11.2020) import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as anim from skimage.data import shepp_logan_phantom from skimage.transform import radon, rescale, frt2, radon_transform...
tobias-stadler/CT-scanner
illustration2.py
illustration2.py
py
1,842
python
en
code
1
github-code
6
[ { "api_name": "skimage.io.imread", "line_number": 15, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linspace", "lin...
35338023155
"""dueling Q""" import random import datetime as dt import click import numpy as np import tensorflow as tf from tensorflow import keras import conf from conf import MODELS from conf import PATH, MAX_POWER import energy_gym from energy_gym import get_feed, set_extra_params from standalone_d_dqn import Memory, choose_a...
Open-Building-Management/EnergyGym
dueling.py
dueling.py
py
9,008
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 32, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.array"...
7439710242
#!/usr/bin/env python3 # import the necessary packages from imutils import face_utils import numpy as np import argparse import imutils import dlib #import h5py import pickle import face_recognition import os import sys import time import json import cv2 as cv import paho.mqtt.client as mqtt # mema oriented librar...
hbarnard/mema
face_unlock.py
face_unlock.py
py
6,601
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 37, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 43, "usage_type": "call" }, { "api_name": "memalib.mema_utility.curl_speak", "line_number": 45, "usage_type": "call" }, { "api_name": "memalib.mema...
31679160358
""" Copyright 2023 AIT Austrian Institute of Technology GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
ChettakattuA/Voctractor
app.py
app.py
py
7,703
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
25007774821
__author__ = "Borja López Soilán (Pexego)" import os import base64 from osv import osv, fields import openoffice_report from tools.translate import _ class report_xml_file(osv.osv): _name = 'ir.actions.report.xml.file' _columns = { 'file': fields.binary('File', required=True, filters="*.odt,*.pdf,*.ht...
factorlibre/openerp-extra-6.1
pxgo_openoffice_reports/report_xml.py
report_xml.py
py
7,333
python
en
code
9
github-code
6
[ { "api_name": "osv.osv.osv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "osv.osv", "line_number": 9, "usage_type": "name" }, { "api_name": "osv.fields.binary", "line_number": 12, "usage_type": "call" }, { "api_name": "osv.fields", "line_numbe...
16127468857
from collections import defaultdict N = int(input()) p = [] p_exist = defaultdict(int) for _ in range(N): x, y = map(int, input().split()) p.append([x, y]) p_exist[(x, y)] = 1 ans = 0 for i in range(N): for j in range(i + 1, N): x1, y1 = p[i] x2, y2 = p[j] if x1 == x2 or y1 == ...
keimoriyama/Atcoder
ABC/218/d.py
d.py
py
450
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" } ]
72192134909
from PyQt5.QtSerialPort import QSerialPort from PyQt5 import QtCore import pynmea2 import datetime import signal from sun_pos import getSunPos class GPSQObject(QtCore.QObject): messageSignal = QtCore.pyqtSignal(str) def __init__(self, *args, **kwargs): super(QtCore.QObject, self).__init__(*args, **kwar...
dakoner/heliostat
heliostat_ui/gps_qobject.py
gps_qobject.py
py
1,745
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 8, "usage_type": "call" }, { "api_name": "PyQt5.QtC...
3136135370
import random from collections import deque times = {'Change oil': 2, 'Inflate tires': 5, 'Get diagnostic': 30, } _all = [0] menu = {'change_oil': "Change oil", 'inflate_tires': "Inflate tires", 'diagnostic': "Get diagnostic", } tickets = {'Change oil': [0, deque()], 'Inflate tires': [0, deque()], 'Get diagnostic': [0...
saukin/Hypercar-Service-Center
Hypercar Service Center/task/hypercar/tickets/tickets_logic.py
tickets_logic.py
py
846
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
41983304889
import termcolor def prompt_input_bill(note_type: int) -> int: """ Prompts the user for a single note count :param note_type: The note type to insert into the machine :return: A validated count of all notes inserted for this note_type """ try: value = int(input(f"How many {str(note_typ...
alii/copington-ticket-theme-park
utils/payment.py
payment.py
py
1,698
python
en
code
2
github-code
6
[ { "api_name": "termcolor.colored", "line_number": 18, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 39, "usage_type": "call" } ]
35178436213
"""SRFC ACC TRACKER by SHEEPY 2022""" import codecs import os import sys import sqlite3 import requests # 非标准库 import time import linecache import logging import configparser import traceback import smtplib from email.mime.text import MIMEText from email.utils import formataddr headers = {'user-agent':...
Sheepy1977/ws_sim_tracker
acc/acc_tracker_nosqlite_0.47.py
acc_tracker_nosqlite_0.47.py
py
13,831
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 47, "usage_type": "call" }, { "api_name": "linecache.updatecache", "line_number": 89, "usage_type": "call" }, { "api_name": "linecache.g...
24012326871
from ssl import Options import numpy as np import matplotlib.pyplot as plt import tkinter as tk from tkinter import * from tkinter import filedialog def converting_to_Gforce(array, sen): return array / [1.0]*sen #opening file diretory root = tk.Tk() root.withdraw() file_path = filedialog.askopenfilename() ...
MarinsLucas/STEP
STEP.py
STEP.py
py
1,685
python
en
code
0
github-code
6
[ { "api_name": "tkinter.Tk", "line_number": 13, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 15, "usage_type": "name" }, { "api_name": "nump...
26038676896
import logging from pants.core.util_rules.distdir import DistDir from pants.engine.fs import Digest, MergeDigests, Workspace from pants.engine.goal import Goal, GoalSubsystem from pants.engine.rules import Get, MultiGet, collect_rules, goal_rule from pants.engine.target import ( FilteredTargets, GenerateSource...
pantsbuild/pants
src/python/pants/backend/codegen/export_codegen_goal.py
export_codegen_goal.py
py
3,363
python
en
code
2,896
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "pants.engine.goal.GoalSubsystem", "line_number": 21, "usage_type": "name" }, { "api_name": "pants.engine.unions.UnionMembership", "line_number": 26, "usage_type": "name" }, { ...
41264176498
""" COMP30024 Artificial Intelligence, Semester 1 2019 Solution to Project Part A: Searching Authors: Zheping Liu, 683781; Bohan Yang, 814642 """ import sys import json import heapq # A Priority queue implemented using heapq # Reference: https://segmentfault.com/a/1190000010007858 class PriorityQueue: def __init...
zhepingLiu/COMP30024_zheping_alisha
search.py
search.py
py
17,040
python
en
code
0
github-code
6
[ { "api_name": "heapq.heappush", "line_number": 21, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 39, "usage_type": "attribute" }, { "api_name": "json.load", "line_numb...
42218330299
import http.server import json #Define a custome request handler by subclass class MyRequestHandler(http.server.BaseHTTPRequestHandler): def do_Get(self): if self.path =='api/resource': self.send_response(200) self.send_header('Content-type','application/json') self.en...
chandrasekharnayak/PythonProgramNotestAT-5
BuildApiFramework/RestFrameWork/create_request_handeler.py
create_request_handeler.py
py
1,009
python
en
code
0
github-code
6
[ { "api_name": "http.server.server", "line_number": 6, "usage_type": "attribute" }, { "api_name": "http.server", "line_number": 6, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" } ]
12849929812
from ask_amy.utilities.slot_validator import Slot_Validator import logging from datetime import datetime logger = logging.getLogger() class LIST_OF_CITIES(Slot_Validator): VALID = 0 # Passed validation MSG_01_TEXT = 1 # Failed Validation _valid_values = [ 'seattle', 'los angeles', 'monterey', ...
dphiggs01/ASK_Amy_Example_Skills
alexa_07_tide_skill/alexa_tide_types.py
alexa_tide_types.py
py
1,239
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "ask_amy.utilities.slot_validator.Slot_Validator", "line_number": 8, "usage_type": "name" }, { "api_name": "ask_amy.utilities.slot_validator.Slot_Validator", "line_number": 24, "usa...
18390240321
from django.contrib.auth.decorators import permission_required from django.views.generic import RedirectView, TemplateView from django.urls import include, path, re_path, reverse_lazy from photologue.views import GalleryArchiveIndexView, PhotoDetailView from .models import GalleryCustom from .views import GalleryCust...
ria4/tln
photos/urls.py
urls.py
py
1,272
python
en
code
3
github-code
6
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "views.GalleryCustomDetailView.as_view", "line_number": 12, "usage_type": "call" }, { "api_name": "views.GalleryCustomDetailView", "line_number": 12, "usage_type": "name" }, { ...
1814670136
# -*- coding: utf-8 -*- # chapsmap.py #%% import numpy as np #from randomtest import X0 def f_logistic(X, param=4.0): ''' logistic map (batch-compatible): ''' return param*X*(1.0-X) def f_tent(X, param=2.0): ''' logistic map (batch-compatible): ''' return (X<1.0/2) * param*X + (X>=1.0/2) * p...
yymgch/chaosgan
chaosmap.py
chaosmap.py
py
3,968
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 48, ...
22867901383
import nltk from nltk.stem import WordNetLemmatizer from tensorflow.keras.models import load_model from numpy import array import pickle import os from global_function import training_ignore_letters, training_epochs, training_batch_size def Training_Required(): res = os.path.exists('Resources/training/all...
TroySigX/smartbot
AITasks.py
AITasks.py
py
3,770
python
en
code
2
github-code
6
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number...
75127018427
from __init__ import DATASETS_DIR, CFG_DIR import os import cv2 import numpy as np from posture_6d.data.dataset_format import LinemodFormat, VocFormat, FileCluster from posture_6d.data.mesh_manager import MeshManager from posture_6d.data.viewmeta import ViewMeta from tqdm import tqdm import copy import matplotlib.pyplo...
Nx1021/OLDT
gen_mixed_linemod.py
gen_mixed_linemod.py
py
10,020
python
en
code
0
github-code
6
[ { "api_name": "posture_6d.data.viewmeta.ViewMeta", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.random.rand", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": ...
3637615933
import boto3 import os import logging # Make sure all of the important regions have the tables created regions = os.environ['REGIONS'].split(',') def handler(event, context): logger = logging.getLogger() logger.setLevel(logging.INFO) customer_id = event['customer_id'] item_id = event['key'] item_va...
brcoding/superstore
deploy/create_superstore_item.py
create_superstore_item.py
py
728
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "boto3.resource", ...
28665798265
# coding:utf-8 import requests import json def get_simple_weather(town_id): url = 'http://tj.nineton.cn/Heart/index/all?city={}'.format(town_id) print(url) json_str = requests.get(url).text ##print(jsonStr) data = json.loads(json_str) weather = data['weather'][0] print('city', weather['...
haoweiking/wx_reply
get_weather.py
get_weather.py
py
1,164
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 26, "usage_type": "call" } ]
29379963623
import datetime import os import time import random import traceback from firebase_admin import firestore from tqdm import tqdm from api_service import get_all_dist_codes_api, get_dist_vaccination_calendar from db_service import _get_slot_document_key, notify_all_subscribers, db, _get_all_subscribed_dists_from_db, \ ...
keshav-sarraf/vaccine_slot_availability
db_refresh.py
db_refresh.py
py
5,600
python
en
code
2
github-code
6
[ { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "time.tzset", "line_number": 17, "usage_type": "call" }, { "api_name": "db_service._get_slot_document_key", "line_number": 37, "usage_type": "call" }, { "api_name": "db_servi...
11670695573
import math import random from dataclasses import dataclass from time import perf_counter_ns from action import Action, ActionType from board import Board from game_state import GameState, MAX_DAY class SimulationNode: def __init__(self, player_actions: list[Action], opponent_actions: list[Action]): self...
bdaene/codingame
challenges/spring_challenge_2021/simulation.py
simulation.py
py
4,423
python
en
code
0
github-code
6
[ { "api_name": "action.Action", "line_number": 12, "usage_type": "name" }, { "api_name": "math.log", "line_number": 29, "usage_type": "call" }, { "api_name": "math.log", "line_number": 31, "usage_type": "call" }, { "api_name": "board.Board", "line_number": 41, ...
39428488153
# -*- coding: utf-8 -*- # This Scripts used to Report Each variables during the Test Procedure # We choose Markdown as the presentation of reports # The Report contents including # 1. Distribution of Single Sentence WER # 2. Distribution of Real Rtf # 3. The Whole WER # 4. Weigthen RTF # 5. rtf --- WER(not finished, ne...
dongfangdu/docker_autolearning_2.0
src/auto_test/src/report.py
report.py
py
6,059
python
en
code
0
github-code
6
[ { "api_name": "sys.setdefaultencoding", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.use", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "...
70780569788
""" Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 < numbers.length. Return the indices of the two numbers, index1 ...
storrer/udd-programming-practice
neetcode/two_sum/two_sum_II_array_is_sorted.py
two_sum_II_array_is_sorted.py
py
2,409
python
en
code
1
github-code
6
[ { "api_name": "typing.List", "line_number": 41, "usage_type": "name" } ]
18656730479
""" The module gives all the functions used through the manually segmentation """ #!/usr/bin/env python3 import json import traceback import cv2 import numpy as np import os import sys import tkinter as tk from tkinter import messagebox sys.path.append(os.path.abspath('..')) sys.path.append(os.path.abspath('../..')) ...
sank96/segmentation-evaluation
performance_tool/manually_segmentation.py
manually_segmentation.py
py
8,152
python
en
code
5
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_num...
7817854368
import os import texture import time import six from pykeyboard import PyKeyboard class Scenario(texture.BaseScenario): def load(self): text = """ FILE COPY ========= Current file: %s You will have 10 seconds to switch to the window in which the contents will be c...
rmed/fyd
dialogs/copyist.py
copyist.py
py
1,728
python
en
code
0
github-code
6
[ { "api_name": "texture.BaseScenario", "line_number": 7, "usage_type": "attribute" }, { "api_name": "texture.tprint", "line_number": 22, "usage_type": "call" }, { "api_name": "texture.tprint", "line_number": 27, "usage_type": "call" }, { "api_name": "texture.loader...
23242206817
from flask import Flask, render_template, redirect, request from flask_cors import CORS, cross_origin from flask_socketio import SocketIO from subprocess import Popen, PIPE import config import os import sys import subprocess import socket import platform import psutil import requests import time import re import json ...
Smith-Chris1/pi-dash
app.py
app.py
py
12,018
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 23, "usage_type": "call" }, { "api_name": "flask_socketio.SocketIO", ...
24493129443
from libs.db_connect import mongo_connect import math import datetime as dt import pandas as pd import json from libs.convert import ohlc_to_ohlc DB = mongo_connect() # mongodb connect SAVE_DATA = False # state to disable and enable save data to DB save_seconds = 3600 # define the every time for save data to db symb...
ratwc/aow-socket
data/tick.py
tick.py
py
5,555
python
en
code
0
github-code
6
[ { "api_name": "libs.db_connect.mongo_connect", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 26, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 26, "usage_type": "call" }, { "api_name": "math.floor",...
38807864869
from django.shortcuts import render, redirect, HttpResponse from django.contrib import messages from .models import * def index(request): return render(request, 'planner/index.html') def createUser(request): result = User.objects.validateRegistration(request.POST) if type(result) is list: for error in result:...
FlyEaglesFly37/PythonBeltExamRetake
apps/planner/views.py
views.py
py
2,349
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.messages.error", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.messages", "line_number": 12, "usage_type": "name" }, { "api_...
35506298683
import csv from django.core.management.base import BaseCommand from api.models import Ingredient class Command(BaseCommand): help = 'Импорт ингредиентов из csv файла' def handle(self, *args, **options): with open(r'data/ingredients.csv', encoding='utf8') as csvfile: re...
aayadin/foodgram-project-react
backend/api/management/commands/import_ingredients.py
import_ingredients.py
py
631
python
en
code
0
github-code
6
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "csv.reader", "line_number": 14, "usage_type": "call" }, { "api_name": "api.models.Ingredient", "line_number": 16, "usage_type": "call" } ]
72589895229
import os from PIL import Image import numpy as np from torch.utils.data import Dataset import torch import torchvision class AMDloader(Dataset): def __init__(self, image_files, possible_labels, transform=None): self._transform = transform self._image_files = image_files self.possible_lab...
branislavhesko/deep_classifier
utils/dataloader_AMD.py
dataloader_AMD.py
py
1,358
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 22, "usage_type": "name" }, { "api_name": "torch.Tensor", "...
26227348232
import json import urllib.parse from streamlit import caching from streamlit import type_util from streamlit.logger import get_logger LOGGER = get_logger(__name__) SHARING_MODES = set( [ # This means the plot will be sent to the Streamlit app rather than to # Plotly. "streamlit", ...
ejnunn/PPE-Object-Detection
env/lib/python3.7/site-packages/streamlit/elements/plotly_chart.py
plotly_chart.py
py
2,882
python
en
code
7
github-code
6
[ { "api_name": "streamlit.logger.get_logger", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.type_util.is_type", "line_number": 36, "usage_type": "call" }, { "api_name": "streamlit.type_util", "line_number": 36, "usage_type": "name" }, { "api_na...
29810062393
from django.core.exceptions import ValidationError from django.test import TestCase from bookclubs.models import User, Post, Comment, Club class CommentModelTestCase(TestCase): """Unit tests for the Comment model""" fixtures = [ 'bookclubs/tests/fixtures/default_user.json', 'bookclubs/tests/...
hihi-itsann/SEG_Major_Group
bookclubs/tests/models/test_comment_model.py
test_comment_model.py
py
1,757
python
en
code
7
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "django.test.TestCase", "line_number": 16, "usage_type": "argument" }, { "api_name": "bookclubs.models.User.objects.get", "line_number": 17, "usage_type": "call" }, { "ap...
14959451909
from yoti_python_sandbox.client import SandboxClient from yoti_python_sandbox.tests.conftest import PEM_FILE_PATH from yoti_python_sandbox.token import YotiTokenRequest from yoti_python_sandbox.token import YotiTokenResponse from .mocks import mocked_request_failed_sandbox_token from ..sandbox_exception import SandboxE...
getyoti/yoti-python-sdk-sandbox
yoti_python_sandbox/tests/test_sandbox_client.py
test_sandbox_client.py
py
2,253
python
en
code
0
github-code
6
[ { "api_name": "yoti_python_sandbox.client.SandboxClient.builder", "line_number": 17, "usage_type": "call" }, { "api_name": "yoti_python_sandbox.client.SandboxClient", "line_number": 17, "usage_type": "name" }, { "api_name": "pytest.raises", "line_number": 18, "usage_type"...
1893912162
import sys import os from time import sleep # sys.path.append(r'C:\Python24\Lib') sys.path.append(r'C:\Users\martin.carufel\AppData\Local\Programs\Python\Python37-32\Lib\site-packages') sys.path.append('C:/Drive-W/Internal_tools/Libraries/IOLibrary/trunk/out') from IOWrapper import IOWrapper import clr clr.AddReference...
MartinCarufel/Python_script
Gui_iron_python/buttonLib.py
buttonLib.py
py
2,124
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
75260855547
import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.utils as utils import torchvision.datasets as dsets import torchvision.transforms as transforms from torchvision.utils import save_image import os impo...
dayznight7/celebA-dcgan
main.py
main.py
py
10,617
python
ko
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 15, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 35, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 35, "usage_type": "name" }, { "api_name": "...
28297795457
#!/bin/env python from bs4 import BeautifulSoup as bs import json import sys import time with open(sys.argv[1], 'r') as foodler: soup = bs(foodler.read(), 'lxml') js = soup.script.text dec = json.JSONDecoder() js_decoded = dec.decode(js) price = js_decoded['price'] orderDate = js_decoded['orderDate'].split('T')[...
zingbretsen/fall_demo
scripts/lab_dinner.py
lab_dinner.py
py
635
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "json.JSONDecoder", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_n...
20870815751
import cv2 as cv import commons as c from keras.models import load_model import numpy as np import os path = "./rows" img_cols = 125 img_rows = 15 model = load_model("model.h5") def readRows(): imagenes = [] for i in os.listdir(path): imagenes.append(i) return sorted(imagenes, key=lambda x: int(x....
eduman13/proyectoFinal
answer.py
answer.py
py
1,050
python
en
code
0
github-code
6
[ { "api_name": "keras.models.load_model", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.expand_dims", ...
21112700552
from .plugin import Plugin import requests import hashlib import base64 import time # 插件名称 name = '汽车之家极速版' # 描述信息 description = """ 汽车之家极速版(快应用) 验证码登录接口 源代码: http://t4.market.xiaomi.com/download/Mina/0b30a5ae89ca689a7c56aaa6a634762362c4170db 更新时间: 2020-08-12 """ # 作者 author = 'kksanyu' # 是否启用该插件 enable = False cl...
superdashu/who_are_you
plugins/autohome.py
autohome.py
py
1,843
python
en
code
5
github-code
6
[ { "api_name": "plugin.Plugin", "line_number": 23, "usage_type": "name" }, { "api_name": "base64.b64encode", "line_number": 30, "usage_type": "call" }, { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_numb...
70720668987
""" Clase que representa la lista de incidencias de un usuario """ import re from collections import Counter class IssueSonar: def __init__(self, issues): self.total = issues.__sizeof__() self.issues = issues def getNumIssuesBlocker(self): """ Obtiene el número de incidenci...
falimotxo/SonarIssues
process/Process.py
Process.py
py
6,225
python
en
code
0
github-code
6
[ { "api_name": "re.split", "line_number": 65, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 68, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 69, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number...
20144007337
import cv2 import numpy as np import matplotlib.pyplot as plt # Different methods for smoothing images # This function shows an image using the matplotlib functionality def show_with_matplotlib(color_img, title, pos): # pos - position in the figure plot # First convert the BGR image to RGB rgb = color_im...
Raylow00/OpenCV-Tutorials
2_Opencv_image_processing/3_image_smoothing.py
3_image_smoothing.py
py
3,374
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.subplot", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 24, "usage_type": "call" }, { "api_name": "...
70542906747
import pygame BLACK, WHITE, BROWN = (0, 0, 0), (255, 255, 255), (139, 69, 19) position = [0, 0] x1, y1 = 380, 380 x2, y2 = 250, 260 pygame.init() #audio = pygame.mixer.Sound("musica/colisão.ogg") screen = pygame.display.set_mode((600, 600)) pygame.display.set_caption("Colisão") clock = pygame.time.Clock() while True:...
debsk/Games
Anotações/colisão.py
colisão.py
py
1,057
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
74981120826
# -*- coding: utf-8 -*- """ Created on Fri Jul 11 13:12:59 2014 @author: othmane """ from .xmlparse import XMLParse from .pgrid import PGrid import os class PFTS: """ Initialises the power flow calculation. Args: xmlpath (str): The path to the simulation xml file. Attributes: pgrid (PGrid): The P...
timinou/pfts
pfts/pfts.py
pfts.py
py
2,420
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.cbook.dedent", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_number": 55, "usage_type": "attribute" }, { "api_name": "xmlparse.XMLPars...
16498287996
#!/usr/bin/python3 # coding=utf-8 import os import random from PIL import Image import cv2 import numpy as np import torch from torch.utils.data import Dataset ########################### Data Augmentation ########################### class Normalize(object): def __init__(self, mean, std): self.mean = mea...
heqin-zhu/DFTR
codes/DFTR/datasets/SODData.py
SODData.py
py
6,949
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.randint", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.ran...
17629258076
import random import colorama from colorama import Fore, Back, Style colorama.init(autoreset=True) # Creates a board with 10 empty values board = [' ' for x in range(10)] # Demonstration Board displaying position layout demo_board = """ | | 1 | 2 | 3 | | ----------- | | 4 | 5 | 6 | | ----------...
Code-Institute-Submissions/MrBertieG-noughts-and-crosses_NovResub
run.py
run.py
py
13,267
python
en
code
0
github-code
6
[ { "api_name": "colorama.init", "line_number": 4, "usage_type": "call" }, { "api_name": "colorama.Fore.YELLOW", "line_number": 95, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 95, "usage_type": "name" }, { "api_name": "colorama.Fore.YE...
39359075461
import time import selenium from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select driver=webdriver.Chrome() driver.implicitly_wait(30) driver.get('http://demo.automationtesting.in/Index.html') driver....
Paviterence/Selenium-Python-BasicCodes
links_practice.py
links_practice.py
py
787
python
en
code
1
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 11, "usage_type": "attribute" }, { ...
38592110773
from algosdk.v2client import indexer from pydantic import BaseModel from typing import Optional, List class Transaction(BaseModel): sender: str round_time: int confirmed_round: int note: Optional[str] group_id: Optional[str] tx_id: Optional[str] transaction_type: Optional[str] class C...
theonetwoone/Staking
retrieve_latest_data.py
retrieve_latest_data.py
py
3,663
python
en
code
null
github-code
6
[ { "api_name": "pydantic.BaseModel", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", ...
74789964667
import requests from bs4 import BeautifulSoup import pandas as pd def extractData(): # response = requests.get(url) with open('response.html', 'r') as file: html = file.read() soup = BeautifulSoup(html, 'html.parser') # print(soup) data = [] questions = soup.find_all('span', class_='qu...
jasbatra19/Capstone
QuestionGenerator/quesAnswer/crawler.py
crawler.py
py
1,490
python
en
code
0
github-code
6
[ { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 39, "usage_type": "call" } ]
37070528416
import copy from database import crud import pydantic_models import config import fastapi api = fastapi.FastAPI() # GET @api.get("/users") @crud.db_session def get_users(): users = [] for user in crud.User.select()[:]: users.append(user.to_dict()) return users @api.get('/get_info_by_user_id/{us...
Develtomas/python
fastAPI/app.py
app.py
py
2,099
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 7, "usage_type": "call" }, { "api_name": "database.crud.User.select", "line_number": 15, "usage_type": "call" }, { "api_name": "database.crud.User", "line_number": 15, "usage_type": "attribute" }, { "api_name": "data...
29456771132
import abc from oslo_config import cfg from oslo_log import log import six import yaml from atrope import cache import atrope.dispatcher.manager from atrope import exception import atrope.image_list.hepix CONF = cfg.CONF CONF.import_opt("hepix_sources", "atrope.image_list.hepix", group="sources") LOG = log.getLogge...
alvarolopez/atrope
atrope/image_list/manager.py
manager.py
py
3,720
python
en
code
2
github-code
6
[ { "api_name": "oslo_config.cfg.CONF", "line_number": 13, "usage_type": "attribute" }, { "api_name": "oslo_config.cfg", "line_number": 13, "usage_type": "name" }, { "api_name": "oslo_log.log.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "oslo...
28696418488
from django.db import models # Create your models here. from django.contrib.auth.models import AbstractUser class UserInfo(AbstractUser): # settings: AUTH_USER_MODEL = "blog.UserInfo" """ 用户信息 """ nid = models.BigAutoField(primary_key=True) nickname = models.CharField(verbose_name='昵称', max_le...
CXTV/CSDN
csdn/models.py
models.py
py
5,879
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.BigAutoField", "line_number": 11, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { ...
39555883859
# -*- coding: utf-8 -*- """ Created on July 9 2020 @author: Gerardo Cervantes """ from gui.make_draggable import Draggable import tkinter as tk from tkinter.font import Font from PIL import ImageTk, Image from ctypes import windll class TitleBar(tk.Frame): ICON_IMG_PATH = 'images/icon.png' COLOR = '#2a324...
gcervantes8/Star-Classifier-For-Mario-64
gui/title_bar.py
title_bar.py
py
4,941
python
en
code
8
github-code
6
[ { "api_name": "tkinter.Frame", "line_number": 16, "usage_type": "attribute" }, { "api_name": "tkinter.Frame.__init__", "line_number": 31, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 31, "usage_type": "attribute" }, { "api_name": "tkinter....
22624762999
from __future__ import division from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import argparse import logging import os import chainer from chaine...
pfnet-research/capg
train_ppo_gym.py
train_ppo_gym.py
py
7,880
python
en
code
28
github-code
6
[ { "api_name": "future.standard_library.install_aliases", "line_number": 7, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 7, "usage_type": "name" }, { "api_name": "gym.undo_logger_setup", "line_number": 16, "usage_type": "call" }, { ...
21115291014
from pyspark import SparkConf, SparkContext conf = SparkConf().setAppName("Quick Average Max Min RDD") sc = SparkContext.getOrCreate(conf=conf) rdd = sc.textFile("/opt/spark-data/average_quiz_sample.csv") print(rdd.collect()) rddorig = rdd.map(lambda x: x.split(',')) rddavg = rddorig.map(lambda x: (x[0], (float(x[2]),...
zcemycl/distributeCompute
src/spark/tutorials/al-quiz-avg-min-max.py
al-quiz-avg-min-max.py
py
702
python
en
code
0
github-code
6
[ { "api_name": "pyspark.SparkConf", "line_number": 3, "usage_type": "call" }, { "api_name": "pyspark.SparkContext.getOrCreate", "line_number": 4, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 4, "usage_type": "name" } ]