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
34677552243
import logging import numpy as np from ComperfModelling import predict_from_model def run_kernel_density_estimation(values, normalised=False, normalisation_statistic=0): values = values.reshape(-1,1) # What should bandwidth be? Add as part of experiment configuration? bandwidth = 100000 evaluation_gap = 50000 ...
Richard549/ComPerf
src/ComperfAnalysis.py
ComperfAnalysis.py
py
28,464
python
en
code
0
github-code
36
[ { "api_name": "numpy.amax", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.amin", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 3...
15031346901
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os sys.path.append(os.path.dirname(__file__)) import argparse from CustomPrint import custom_print_init, print_info, print_debug, print_error, print_warning from Scrapers import url2recipe_json from RecipeOutput import recipe_output from CustomExceptions im...
rodneyshupe/recipe-dl
recipe_dl/main.py
main.py
py
6,146
python
en
code
1
github-code
36
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number...
6535858908
import os import requests SESSION_ID = os.getenv("aoc_session_id") def get_data(day=1): headers = {"cookie":f"session={SESSION_ID}"} days_data = requests.get(f"https://adventofcode.com/2022/day/{day}/input", headers=headers) if not os.path.exists(f"advent_of_code\day_{day}"): os.makedirs(f"adve...
OliverWBurke/advent_of_code_2022
advent_of_code/utils.py
utils.py
py
533
python
en
code
0
github-code
36
[ { "api_name": "os.getenv", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12,...
17251067645
import os import pandas as pd from PIL import Image import numpy as np import torch import torch.nn.functional as F import torchvision.datasets as datasets from torch.utils.data import Dataset, DataLoader import torchvision.models as models import torchvision.transforms as transforms import matplotlib.pyplot as plt im...
Peter870512/ML_2020Spring
HW6/hw6_best.py
hw6_best.py
py
6,895
python
en
code
0
github-code
36
[ { "api_name": "torch.device", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 21, "usage_type": "name" }, { "api_name": "torch.from_numpy", "line_number": 26, "usage_type": "call" }, { "api_name": "torchvision.tr...
32786726933
import boto3 import re from datetime import datetime, timedelta import os def lambda_handler(event, context): TERMINATION_AGE = 0 ec2_client = boto3.client('ec2', region_name='us-east-1') # Get a list of stopped instances instances = ec2_client.describe_instances(Filters=[{'Name': 'instance-...
SuleymanBat/TROUBLESHOOTING_SOLUTIONS_FOR_DEVOPS
TERRAFORM/terraform-stoppedEC2s/lambda.py
lambda.py
py
1,468
python
en
code
0
github-code
36
[ { "api_name": "boto3.client", "line_number": 10, "usage_type": "call" }, { "api_name": "re.search", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime",...
26238422374
import logging import logging.config import os from typing import Union class Reporter: def __init__(self, logger: Union[logging.Logger, None] = None, lvl: int = logging.INFO) -> None: """Reporter Class. Parameters ---------- logger : logger or...
danielkelshaw/PySwallow
pyswallow/utils/reporter.py
reporter.py
py
1,301
python
en
code
2
github-code
36
[ { "api_name": "typing.Union", "line_number": 11, "usage_type": "name" }, { "api_name": "logging.Logger", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.getLogger"...
72274079145
from typing import Tuple, List import pandas as pd import time import re import functools class Processor: def __init__(self, dataframe: pd.DataFrame): self._df = dataframe def get(self): return self._df.copy() def __repr__(self) -> str: return self._df.__repr__ de...
hungngocphat01/python-mutils
mutils/pandas.py
pandas.py
py
1,113
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 34, "usage_type": "name" }, { "api_name": "re.match", "line_num...
72150153383
import chunk from nltk.tokenize import word_tokenize,sent_tokenize ,PunktSentenceTokenizer from nltk.corpus import stopwords,state_union from nltk.stem import PorterStemmer import nltk def token(inputs): # input = "hi vi what time is it" return (sent_tokenize(inputs)) def sw(): text = "token is showing thi...
astroxiii/VI-CORE
expirment.py
expirment.py
py
4,160
python
en
code
0
github-code
36
[ { "api_name": "nltk.tokenize.sent_tokenize", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 12, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 12, "usage_type": "name" }, { "api_...
3273044860
#!/usr/bin/env python3 import base64 import hashlib import os import random import string from subprocess import Popen, PIPE API = "https://corona-stats.online?top=15" def execute_payload(): print("######### DONT BE A COVIDIOT, STAY @ HOME #########") cmd1 = Popen(["curl", "-s"] + [API], stdout=PIPE) cmd...
ysyesilyurt/virus.py
sandbox/virus.py
virus.py
py
2,726
python
en
code
1
github-code
36
[ { "api_name": "subprocess.Popen", "line_number": 14, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 14, "usage_type": "name" }, { "api_name": "subprocess.Popen", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.basename", ...
22035870178
import asyncio, gbulb, logging, logging.handlers from multiprocessing import Process from python_dbus_system_api import start_server from ustatus.ustatus import Ustatus from ustatus.utils.notifications import notify_error def main(): setup_logging() # Ensure API is running (if already running this will just...
mbrea-c/ustatus
src/ustatus/main.py
main.py
py
1,070
python
en
code
0
github-code
36
[ { "api_name": "multiprocessing.Process", "line_number": 14, "usage_type": "call" }, { "api_name": "python_dbus_system_api.start_server", "line_number": 14, "usage_type": "name" }, { "api_name": "gbulb.install", "line_number": 16, "usage_type": "call" }, { "api_nam...
42737050383
from brownie import network, AdvancedCollectible from scripts.helpful_scripts import get_account, get_gtype, OPENSEA_URL # File uploaded to IPFS and took the god_metadata_dic = { "SHIVA": "https://ipfs.io/ipfs/QmULNZ8umdtXYAUB5y9UpaLXBNmN7SCgcpnMbEdx5eSEyi?filename=0-SHIVA.json", # "GANESH": "https://ipfs.io/i...
shubhamghimire/nft-demo
scripts/advanced_collectible/set_tokenuri.py
set_tokenuri.py
py
1,360
python
en
code
0
github-code
36
[ { "api_name": "brownie.network.show_active", "line_number": 13, "usage_type": "call" }, { "api_name": "brownie.network", "line_number": 13, "usage_type": "name" }, { "api_name": "brownie.AdvancedCollectible", "line_number": 14, "usage_type": "name" }, { "api_name"...
10650544707
# Server that provides some services related with genes and chromosomes using the HTTP protocol. # The user introduces the parameters through the main page HTML, the data is taken from the rest.ensembl.org # web page and the results are presented in another HTML page. # importing the needed resources import http.serve...
paugarciar/2018-19-PNE-Final-project
some tests (drafts)/server_without json object.py
server_without json object.py
py
10,515
python
en
code
0
github-code
36
[ { "api_name": "http.server.client.HTTPSConnection", "line_number": 21, "usage_type": "call" }, { "api_name": "http.server.client", "line_number": 21, "usage_type": "attribute" }, { "api_name": "http.server", "line_number": 21, "usage_type": "name" }, { "api_name":...
2031636755
import os import sys import torch import numpy as np import time cur_path = os.path.abspath(os.path.dirname(__file__)) root_path = os.path.split(cur_path)[0] sys.path.append(root_path) from torchvision import transforms from PIL import Image from segmentron.utils.visualize import get_color_pallete from segmentron.mod...
GhadeerElmkaiel/Trans2Seg
tools/demo.py
demo.py
py
13,641
python
en
code
1
github-code
36
[ { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.split", "line_n...
41537740788
# -*- coding: utf-8 -*- # @Time : 2018/4/19 9:43 # @Author : Narata # @Project : demo # @File : view.py # @Software : PyCharm from django.shortcuts import render from django.http import HttpResponse def add(request): a = request.GET['a'] b = request.GET['b'] callback = request.GET['callback'] ...
narata/demo
ajax/view.py
view.py
py
447
python
en
code
0
github-code
36
[ { "api_name": "django.http.HttpResponse", "line_number": 18, "usage_type": "call" } ]
22166964803
import sqlite3 import pandas as pd # Define DBOperation class to manage all data into the database. # Give a name of your choice to the database class DBOperations: sql_create_table_firsttime = "CREATE TABLE IF NOT EXISTS employee (" \ "employee_id INTEGER PRIMARY KEY AUTOINCREMEN...
SvetA95/DatabasesAndCloud_Assignment3
lab3.py
lab3.py
py
9,339
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 41, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 51, "usage_type": "call" }, { "api_name": "pandas.read_sql_query", "line_number": 102, "usage_type": "call" } ]
38941944677
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('shifts_app', '0010_auto_20171130_2233'), ] operations = [ migrations.R...
ssrahman34/Employee-Shifts-Project
shift_project/shifts_app/migrations/0011_auto_20171201_2240.py
0011_auto_20171201_2240.py
py
924
python
en
code
0
github-code
36
[ { "api_name": "django.db.migrations.Migration", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.migrations.RemoveField", "line_number": 16, "usage_type": "call" }, ...
21695020276
"""mtgrecorder URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
edasaur/mtg-recorder
mtgrecorder/urls.py
urls.py
py
1,981
python
en
code
0
github-code
36
[ { "api_name": "django.conf.urls.url", "line_number": 20, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 20, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "dj...
74788588584
import itertools from day07.day7_lib import calc_amp, calc_amp_with_feedback from util import get_program if __name__ == "__main__": p = get_program("inputs/day7.txt") all_possible_phase_settings = itertools.permutations(range(5)) a_max, max_config = max( ((calc_amp(p, phase_config), phase_config...
el-hult/adventofcode2019
day07/day7_runner.py
day7_runner.py
py
797
python
en
code
0
github-code
36
[ { "api_name": "util.get_program", "line_number": 7, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 9, "usage_type": "call" }, { "api_name": "day07.day7_lib.calc_amp", "line_number": 11, "usage_type": "call" }, { "api_name": "day07.d...
18953334688
import numpy as np from collections import Counter import pandas as pd from math import log10 import matplotlib.pyplot as plt from HMM_errors import * class SequenceReader: """ This class builds HMM from protein or DNA sequence alignment. """ def __init__(self, path_to_file, amino_acids=True, del...
Kronossos/SAD2_project_2
SequenceReader.py
SequenceReader.py
py
11,452
python
en
code
0
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 45, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 101, "usage_type": "call" }, { "api_name": "collections.Co...
17797113504
from __future__ import absolute_import, division, print_function, unicode_literals import os from pants.base.build_environment import get_buildroot from pants_test.backend.python.pants_requirement_integration_test_base import \ PantsRequirementIntegrationTestBase class PantsRequirementIntegrationTest(PantsRequire...
fakeNetflix/twitter-repo-pants
tests/python/pants_test/backend/python/test_pants_requirement_integration.py
test_pants_requirement_integration.py
py
2,104
python
en
code
0
github-code
36
[ { "api_name": "pants_test.backend.python.pants_requirement_integration_test_base.PantsRequirementIntegrationTestBase", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
28370505452
import itertools import os import pathlib from typing import List import pytest from fastapi.testclient import TestClient from indigo_service import jsonapi from indigo_service.indigo_http import app client = TestClient(app) test_structures = [ {"structure": "CNC", "format": "auto"}, {"structure": "CN1C=NC...
karen-sarkisyan/Indigo
api/http/tests/test_indigo_http.py
test_indigo_http.py
py
4,788
python
en
code
null
github-code
36
[ { "api_name": "fastapi.testclient.TestClient", "line_number": 13, "usage_type": "call" }, { "api_name": "indigo_service.indigo_http.app", "line_number": 13, "usage_type": "argument" }, { "api_name": "typing.List", "line_number": 46, "usage_type": "name" }, { "api_...
3656577055
import os from ultralytics import YOLO import cv2 from tracker import Tracker import numpy as np videoDir = os.path.\ join('.','data','people.mp4') cap = cv2.VideoCapture(videoDir) tracker = Tracker() ret, frame = cap.read() # uses deep sort model = YOLO("yolov8n.pt") num_1 = 0 num_2 = 0 ...
PeterGQ/SuspicionDetector
main.py
main.py
py
4,791
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "tracker.Tracker", "line_...
32698917361
from __future__ import annotations import os from typing import Union, TYPE_CHECKING if TYPE_CHECKING: from api.python.script_building.dag import DAGNode from api.python.operator.nodes.matrix import Matrix from api.python.operator.nodes.frame import Frame from api.python.operator.nodes.scalar import Sc...
daphne-eu/daphne
src/api/python/utils/consts.py
consts.py
py
1,109
python
en
code
51
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Union", "lin...
12211586840
import fileinput from collections import Counter from operator import mul, ne from itertools import product lines = list(map(lambda e: e.strip(), fileinput.input())) counts = map(Counter, lines) values = map(lambda e: set(e.values()), counts) has_2_3 = map(lambda e: (2 in e, 3 in e), values) sum_2_3 = map(sum, zip(*h...
whg/aoc2018
day2.py
day2.py
py
585
python
en
code
0
github-code
36
[ { "api_name": "fileinput.input", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 8, "usage_type": "argument" }, { "api_name": "operator.mul", "line_number": 12, "usage_type": "call" }, { "api_name": "itertools.product"...
15731069765
from __future__ import annotations from typing import Any from typing import Callable from typing import Iterator from typing import List from typing import Optional from typing import Type from typing import TYPE_CHECKING from typing import Union from .. import util from ..operations import ops if TYPE_CHECKING: ...
sqlalchemy/alembic
alembic/autogenerate/rewriter.py
rewriter.py
py
7,384
python
en
code
2,219
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 55, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 97, "usage_type": "name" }, { "api_name": "typing.Type", "...
24339607859
from logging import Logger from pathlib import Path import shutil class IsNotAFileError(OSError): """Exception raised if operation only works on files.""" class IsNotADirectoryError(OSError): """Exception raised if operation only works on directories.""" class NonEmptyDirectoryError(OSError): """Excep...
src-d/ml-mining
sourced/ml/mining/utils/fs.py
fs.py
py
2,380
python
en
code
8
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 25, "usage_type": "name" }, { "api_name": "logging.Logger", "line_number": 25, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_num...
5799651728
import vqa_gradients import numpy as np from scipy.linalg import expm from scipy.stats import unitary_group from scipy.misc import derivative import functools as ft tp = lambda a,b: np.tensordot(a,b,axes=0) n_qubits = 3 H = 1/np.sqrt(2) * np.array([[1,1],[1,-1]]) X = np.array([[0,1],[1,0]]) M = ft.reduce(tp, np.re...
Mark-D-W/vqa_gradients
tests/test_Series.py
test_Series.py
py
1,176
python
en
code
0
github-code
36
[ { "api_name": "numpy.tensordot", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
30333853221
import cv2 import numpy as np import matplotlib.pyplot as plt # H entre 0 e 33 (cor de pele) # S entre 58 e 255 (saturação S baixo = branco) # V entre 30 e 255 (V = 0 preto) min_HSV = np.array([0, 58, 30], dtype="uint8") # for better results, use skin-detector-YCrCb colorspace max_HSV = np.array([33, 255, 255], dtype="...
Vicinius/digital-image-processing
pratica05/skin-detector-hsv.py
skin-detector-hsv.py
py
721
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_numbe...
71929274345
from model import Todo import motor.motor_asyncio client = motor.motor_asyncio.AsyncIOMotorClient('mongodb://root:example@localhost:27017/TodoList?authSource=admin') database = client.TodoList collection = database.todo async def fetchOneTodo(title): document = await collection.find_one({"title":title}) retur...
coronel08/farm-stack-todo
backend/database.py
database.py
py
912
python
en
code
0
github-code
36
[ { "api_name": "motor.motor_asyncio.motor_asyncio.AsyncIOMotorClient", "line_number": 4, "usage_type": "call" }, { "api_name": "motor.motor_asyncio.motor_asyncio", "line_number": 4, "usage_type": "attribute" }, { "api_name": "motor.motor_asyncio", "line_number": 4, "usage_...
31706326025
import argparse import torch import os from torch.utils.data import DataLoader from dataset.dataset import Crowd from model.model import Count import numpy as np def parse_arg(): parser = argparse.ArgumentParser() parser.add_argument('--downsample-ratio', default=8, type=int, help='the...
cha15yq/CUT
test.py
test.py
py
2,238
python
en
code
10
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.backends", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 35, "usage_type": "attribute" }, { "api_name": "dataset.d...
23410785734
# -*- coding: utf-8 -*- """ 简单的两步任务, 串行. """ from datetime import datetime from airflow.decorators import dag, task dag_id = "dag2" @dag( dag_id=dag_id, start_date=datetime(2021, 1, 1), schedule="@once", catchup=False, ) def dag2(): """ 这个例子中我们有两个 Task, 先运行 Task 1, 再运行 Task 2. 如果 Task 1 不成功...
MacHu-GWU/Dev-Exp-Share
docs/source/Open-Source-Softwares/Amazon-Managed-Workflows-for-Apache-Airflow-MWAA/02-Common-Patterns/dags/dag2.py
dag2.py
py
2,892
python
en
code
3
github-code
36
[ { "api_name": "random.randint", "line_number": 41, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 44, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
16559387946
from rich import print from rich.console import Console from rich.table import Table from decimal import * import sys # TODO: Load file by launching with arguments # Pitch calculation for non feed/rev # Ignore comments when finding G84 manualFile=False filePath = "Sample Gcode/Solidworks/CGIP11719.nc" if...
nick-burrill/Gcode-Tools
Tap Checker.py
Tap Checker.py
py
3,497
python
en
code
1
github-code
36
[ { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "rich.print", "line_number": 21, "usage_type": "call" }, { "api_name": "rich.print", "line_number": 101, "usage_type": "call" }, { "api_name": "rich.console.Console", "line...
26312475383
import sys from os import path import numpy import scipy import cupy import cupyx import datetime from dataclasses import dataclass @dataclass class ExecutionSetup: gpu: bool = False precision: str = 'float64' data_folder: str = f".{path.sep}data{path.sep}" precision_np = numpy.float64 precision_cp...
chrasa/removal-of-imaging-artifacts-NN
cpu_gpu_abstraction.py
cpu_gpu_abstraction.py
py
3,305
python
en
code
0
github-code
36
[ { "api_name": "os.path.sep", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.float64", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cupy.float64", "line_...
25937674832
from core.base_classes.entity import BaseEntityProps from core.value_objects import DateVO, ID from abc import ABC, abstractmethod from typing import Any, Generic, TypeVar, get_args from infrastructure.database.base_classes.mongodb import OrmEntityBase Entity = TypeVar('Entity', bound=BaseEntityProps) OrmEntity = Typ...
KCDichDaNgu/KC4.0_DichDaNgu_BackEnd
src/infrastructure/database/base_classes/mongodb/orm_mapper_base.py
orm_mapper_base.py
py
1,853
python
en
code
0
github-code
36
[ { "api_name": "typing.TypeVar", "line_number": 8, "usage_type": "call" }, { "api_name": "core.base_classes.entity.BaseEntityProps", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.TypeVar", "line_number": 9, "usage_type": "call" }, { "api_name": "t...
35243312943
from rest_framework import serializers from rest_framework.renderers import JSONRenderer from rest_framework.response import Response from rest_framework.views import APIView from .models import Group, Facultie, Student, HistoryOfRating class FacultiesSerializers(serializers.ModelSerializer): class Meta...
Ruslan1kHasanov/social_project
main/serializers.py
serializers.py
py
4,354
python
ru
code
0
github-code
36
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "models.Facultie", "line_number": 11, "usage_type": "name" }, ...
38177166821
import logging import os from django.conf import settings from django.db.models import Q from django.http import HttpResponse from django.utils.safestring import mark_safe from cvAppMain.helpers import get_cv_url from cvAppMain.models import GeneratedPDF logger = logging.getLogger('django') def make_context(proces...
EricFelixLuther/cvApp
cv_App/cvAppMain/pdf_logic.py
pdf_logic.py
py
1,819
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 19, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 20, "usage_type": "call" }, { "api_name": "django.utils....
4254437724
from sklearn.decomposition import FastICA import numpy import matplotlib.pyplot as plt import time from scipy.io import wavfile from Processor import Processor from sklearn import preprocessing class ICA: def __init__(self, mixed_sig, no_of_components): self.mixed_signal = mixed_sig se...
sarmientoj24/ICA
ICA.py
ICA.py
py
3,910
python
en
code
1
github-code
36
[ { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.decomposition.FastICA", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.decomposition.FastICA", "line_number": 23, "usage_type": "call" }, { "api_name": ...
40837765126
import os import tarfile from six.moves import urllib import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.linear_model im...
lewiis252/pythonProject4
cal_hous.py
cal_hous.py
py
2,609
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
25587181346
import torch from tqdm import tqdm, trange from utils_squad_evaluate import EVAL_OPTS, main as evaluate_on_squad, plot_pr_curve from utils_squad import (read_squad_examples, convert_examples_to_features, RawResult, write_predictions, RawResultExtended, write_predictions...
markjluo/DL-Project-A-Deep-Learning-Based-Chatbot
evaluate.py
evaluate.py
py
2,255
python
en
code
2
github-code
36
[ { "api_name": "tqdm.tqdm", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 19, "usage_type": "call" }, { "api_name": "utils_squad.RawResult", "line_number": 31, "usage_type": "call" }, { "api_name": "utils_squad.write_predi...
25282953204
# -*- coding: utf-8 -*- import requests from bs4 import BeautifulSoup def main(): #--- 取得URLの決定 url = 'https://github.com/librariapj' #--- requestsでdom取得 response = requests.get(url) #--- 取得結果の表示 print(response) # print(response.text) #--- BS4に取得内容を格納 soup = BeautifulSoup(response.c...
librariapj/SampleProject
src/hello.py
hello.py
py
535
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" } ]
13861490174
from django.core.paginator import Paginator import plotly.graph_objects as go from django.shortcuts import render from django.contrib import messages import matplotlib.dates as mdates from .api_calls import ( fetch_coins, fetch_market_charts, fetch_coin_details, fetch_order_book, fetch_coi...
LazyCiao/Performance-Pulse
crypto_pulse/views.py
views.py
py
10,994
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 22, "usage_type": "call" }, { "api_name": "api_calls.fetch_coins", "line_number": 34, "usage_type": "call" }, { "api_name": "api_calls.API_BASE_URL", "line_number": 34, "usage_type": "argument" }, { "api_name": "api_c...
28671672532
import pandas as pd import numpy import os import sys import csv import logging import psycopg2 from psycopg2.extensions import register_adapter, AsIs from cloudharness import applications def addapt_numpy_int64(numpy_int64): return AsIs(numpy_int64) register_adapter(numpy.int64, addapt_numpy_int64) app = app...
MetaCell/asu-olfactory
applications/pub-chem-index/tasks/ingestion/populate_parallel.py
populate_parallel.py
py
5,809
python
en
code
0
github-code
36
[ { "api_name": "psycopg2.extensions.AsIs", "line_number": 14, "usage_type": "call" }, { "api_name": "psycopg2.extensions.register_adapter", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.int64", "line_number": 17, "usage_type": "attribute" }, { "ap...
19453685544
# -*- coding: utf-8 -*- """ Jianyu Chen This is a project for optimal control. Python code for 1-dim double well system """ #%% import torch from torch import nn from torch.nn import functional as F import math import numpy as np import matplotlib.pyplot as plt #%% t = np.arange(100) * 0.01 print(t) sigma = 1 #%% u= n...
Cecilia-ChenJY/PMP-for-Optimal-Control
double_well.py
double_well.py
py
4,448
python
en
code
0
github-code
36
[ { "api_name": "numpy.arange", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
6530887784
# FLASK: location API functions from flask import Flask, jsonify, request import pymysql from __main__ import app from helpers.location import * from db_connect.db_connection import connect # Open database connection db = connect() cursor = db.cursor() # New payment or get payments to a tutor @app.route("/location...
judgyknowitall/DataBaseProject
venvProject/apis/location_route.py
location_route.py
py
897
python
en
code
0
github-code
36
[ { "api_name": "db_connect.db_connection.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 20, "usage_type": "attribute" }, { "a...
10858226319
import uvicorn from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from sockets import sio_app app = FastAPI() app.mount('/', app=sio_app) app.add_middleware( CORSMiddleware, allow_origins=['*'], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) @app....
jrdeveloper124/socketio-app
server/main.py
main.py
py
468
python
en
code
9
github-code
36
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "sockets.sio_app", "line_number": 7, "usage_type": "name" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 10, "usage_type": "argument" }, { "api_name...
37949950597
#!/usr/bin/python3 """This module defines the class Place that inherits from class BaseModel""" from models.base_model import BaseModel, Base from sqlalchemy import Column, String, Integer, Float, ForeignKey from sqlalchemy.orm import relationship from sqlalchemy.sql.schema import Table import os if os.getenv('HBNB_...
Chiemelie10/AirBnB_Practice_v2
models/place.py
place.py
py
3,794
python
en
code
0
github-code
36
[ { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.sql.schema.Table", "line_number": 12, "usage_type": "call" }, { "api_name": "models.base_model.Base.metadata", "line_number": 13, "usage_type": "attribute" }, { "api_na...
22354032685
import pathlib import typing import sqlalchemy.orm from fastapi import Depends import mlrun.common.schemas.model_monitoring import mlrun.common.schemas.model_monitoring.constants as mm_constants import mlrun.model_monitoring.stream_processing import mlrun.model_monitoring.tracking_policy import server.api.api.endpoin...
mlrun/mlrun
server/api/crud/model_monitoring/deployment.py
deployment.py
py
35,326
python
en
code
1,129
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "call" }, { "api_name": "mlrun.common.schemas.model_monitoring.mlconf", "line_number": 40, "usage_type": "attribute" }, { "api_name": "mlrun.common.schemas.model_monitoring", "line_number": 40, "usage_type": "...
29147272703
# TODO # urrlib <-> requests import requests from .http_helper import TwitterHttpHelper as HttpHelper from urllib.parse import quote from orderedset import OrderedSet from lxml.html import document_fromstring from lxml.etree import tostring, ParserError import time import re class CircularOrderedSet(OrderedSet): ...
labteral/bluebird
bluebird/scraper.py
scraper.py
py
20,410
python
en
code
45
github-code
36
[ { "api_name": "orderedset.OrderedSet", "line_number": 14, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 35, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 36, "usage_type": "call" }, { "api_name": "re.findall", "line_nu...
26765982477
import requests from flask import Flask, render_template, request, redirect, url_for, flash from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['DEBUG'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///weather.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SECRET_KE...
thenileshunde/weatherly
app.py
app.py
py
2,509
python
en
code
1
github-code
36
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "flask.render_temp...
34848563515
"""1.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?""" def is_unique(input_string): """determines if a string has all unique characters""" from collections import Counter counter = Counter(input_string) for char, values ...
stonecharioteer/blog
source/code/books/ctci/01_arrays_and_strings/ex_1x1_unique.py
ex_1x1_unique.py
py
1,001
python
en
code
5
github-code
36
[ { "api_name": "collections.Counter", "line_number": 9, "usage_type": "call" } ]
6762090600
import numpy as np import matplotlib.pyplot as plt import pandas as pd import math # Importing the dataset dataset = pd.read_csv('Ads_CTR_Optimisation.csv') #Implementing the UCB(from scratch.!!) #we need to consider this number for each ad i. We're going to create a vector that will contain each of those memb...
raja17021998/Exciting-Machine-Learning-Journey-on-Python-and-R
Part 6 - Reinforcement Learning/Section 32 - Upper Confidence Bound (UCB)/UCB/upper_confidence_bound_wd.py
upper_confidence_bound_wd.py
py
1,845
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 26, "usage_type": "call" }, { "api_name": "math.log", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_...
5487070944
# from ADBInterface import from Common import CommonFunction, AssertResult, ADBCommand, DealAlert from Common.Log import MyLog, OutPutText import re from Conf.Config import Config from ADBInterface import simplify_interface_code from ADBInterface.Qualcomm import QualcommChip import time import datetime meta_alert = De...
wmm98/Telpo_TPS469_Automation
ADBInterface/Qualcomm/Android_Versions/Qualcomm_Android_11.py
Qualcomm_Android_11.py
py
7,148
python
en
code
0
github-code
36
[ { "api_name": "Common.DealAlert.AlertData", "line_number": 11, "usage_type": "call" }, { "api_name": "Common.DealAlert", "line_number": 11, "usage_type": "name" }, { "api_name": "Common.Log.MyLog", "line_number": 12, "usage_type": "call" }, { "api_name": "Common.L...
23992990502
''' 286. Walls and Gates https://leetcode.com/problems/walls-and-gates/ ''' from typing import List from collections import deque # The key is to recognize that if we search from gates to empty rooms # We are guaranteed to find the shortest path by using BFS class Solution: def wallsAndGates(self, rooms: List[Lis...
asset311/leetcode
bfs/walls_and_gates.py
walls_and_gates.py
py
1,621
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 34, "usage_type": "call" } ]
23843055382
from django.urls import path from .views import Frontpage, Shop, Signup, Login, MyAccount, EditMyAccount from product.views import ProductDetailView from django.contrib.auth.views import LogoutView urlpatterns = [ path('', Frontpage.as_view(), name='frontpage'), path('signup/', Signup.as_view(), name='signup'...
DenisVasil/Django-Tailwind-Shop
core/urls.py
urls.py
py
774
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.Frontpage.as_view", "line_number": 8, "usage_type": "call" }, { "api_name": "views.Frontpage", "line_number": 8, "usage_type": "name" }, { "api_name": "django.urls.pat...
74362482985
from group_class import FacebookGroups from scraper import scrape from db_handler import init_mongo from datetime import datetime from rich import print import config import time import random import os import sys # Sleep for the desired time and restart for the sake of establishing new requests session def sleep_and...
itamark87/Project-Ekron
main.py
main.py
py
2,648
python
en
code
0
github-code
36
[ { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "os.execl", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.executable", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number":...
13069484239
import os import numpy as np from PIL import Image, ImageDraw, ImageFont from scipy.ndimage import label from config import cfg import labels def benchmark_vis(iou_ar, fn): pred_pgt_ar = np.zeros_like(iou_ar) structure = np.ones((3, 3), dtype=int) segment_ar = label(iou_ar, structure)[0] for idx in...
mrcoee/Automatic-Label-Error-Detection
src/visualization.py
visualization.py
py
4,667
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros_like", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.ndimage.label", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.unique", "l...
7244240814
#!/usr/bin/env python # coding: utf-8 # In[1]: # Dependencies import os import pandas as pd from splinter import Browser from bs4 import BeautifulSoup from webdriver_manager.chrome import ChromeDriverManager # In[2]: def init_browser(): #set the chromedriver path executable_path = {"executable_path": "chr...
mshi2/web-scraping-challenge
Missions_to_Mars/scrape_mars.py
scrape_mars.py
py
3,178
python
en
code
0
github-code
36
[ { "api_name": "splinter.Browser", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 36, "usage_type": "call" }, { "api_name": "splinter.Browser", "line_number": 65, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup...
30323488487
"""GLOBIO InVEST Model""" import os import logging import gdal import osr import numpy import pygeoprocessing logging.basicConfig(format='%(asctime)s %(name)-20s %(levelname)-8s \ %(message)s', level=logging.DEBUG, datefmt='%m/%d/%Y %H:%M:%S ') LOGGER = logging.getLogger('invest_natcap.globio.globio') ...
natcap/invest-natcap.invest-3
invest_natcap/globio/globio.py
globio.py
py
23,365
python
en
code
0
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "pygeoprocess...
74157719464
from torch import nn class AE_Deconv(nn.Module): def __init__(self, input_dim: int = 63, latent_dim: int = 16): super().__init__() assert latent_dim < 32 self.encoder = nn.Sequential( nn.Linear(input_dim, 32), nn.BatchNorm1d(32), nn.ReLU(True), ...
DanBigioi/Sign2Speech
src/models/components/autoencoder.py
autoencoder.py
py
2,475
python
en
code
1
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
22349295595
import sys import os from npbgpp.npbgplusplus.modeling.refiner.unet import RefinerUNet from pytorch3d.io import load_obj, load_ply, save_obj import cv2 import numpy as np import pickle import torch import torch.nn as nn import torch.nn.functional as F import trimesh import yaml from .quad_rasterizer import QuadRaste...
SamsungLabs/NeuralHaircut
src/hair_networks/strands_renderer.py
strands_renderer.py
py
6,865
python
en
code
453
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 23, "usage_type": "name" }, { "api_name": "pytorch3d.io.load_obj", "line_number": 43, "usage_type": "call" }, { "api_name": "pytorch3d.io.load...
71919299305
#!/usr/bin/python3 #-*- coding: utf-8 -*- """ The use case of this script is the following: Put all movies (radarr) or series (sonarr) with a certain tag in a collection in plex Requirements (python3 -m pip install [requirement]): requests Setup: Fill the variables below firstly, then run the script with -h to see ...
Casvt/Plex-scripts
sonarr/tag_to_collection.py
tag_to_collection.py
py
6,013
python
en
code
285
github-code
36
[ { "api_name": "os.getenv", "line_number": 31, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 32, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 33, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 35, ...
38093193093
import typing import pytest from forml import project from forml.io import dsl, layout from forml.io._input import extract class TestSlicer: """Slicer unit tests.""" @staticmethod @pytest.fixture(scope='session') def features(project_components: project.Components) -> typing.Sequence[dsl.Feature]: ...
formlio/forml
tests/io/_input/test_extract.py
test_extract.py
py
2,136
python
en
code
103
github-code
36
[ { "api_name": "forml.project.Components", "line_number": 15, "usage_type": "attribute" }, { "api_name": "forml.project", "line_number": 15, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.Seq...
30381880481
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 30 09:32:26 2018 @author: jon """ import cmath import math import numpy as np import matplotlib.pyplot as plt from pynufft import NUFFT_cpu def expectedIFT(img, X, u, v): N = img.shape[0]//2 for x in range (-N, N): for y in range...
lord-blueberry/p8-pipeline
sandbox/first_runs/pynufft/BUG.py
BUG.py
py
915
python
en
code
0
github-code
36
[ { "api_name": "cmath.exp", "line_number": 21, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 21, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.complex128", "line_numbe...
28959351830
from cfg import constants import torch import numpy as np import trimesh import pyrender import cv2 import os def render_smpl(vertices, faces, image, intrinsics, pose, transl, alpha=1.0, filename='render_sample.png'): img_size = image.shape[-2] material = pyrender.MetallicRoughnessMateri...
yohanshin/Pseudo-SMPL-GT
utils/visualization.py
visualization.py
py
3,955
python
en
code
0
github-code
36
[ { "api_name": "pyrender.MetallicRoughnessMaterial", "line_number": 19, "usage_type": "call" }, { "api_name": "trimesh.Trimesh", "line_number": 25, "usage_type": "call" }, { "api_name": "trimesh.transformations.rotation_matrix", "line_number": 28, "usage_type": "call" },...
11038838210
#!/usr/bin/env python # coding: utf-8 # # Filter #1: Broken Frame 🔨 # My broken_frame() function creates a fractured effect in the image below that I liken in appearance to the Distorted Glass filter in Photoshop. import PIL.ImageOps from PIL import Image def broken_frame(image): length = image.size[1] ...
mars-aria/vfx-filters
broken-frame filter/broken-frame_filter.py
broken-frame_filter.py
py
677
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 20, "usage_type": "name" } ]
41674825810
''' --- Changes for this version --- - change to save in txt format, as saved format no longer a valid json format - removed the open and end line, only take tweet object ''' # used material: workshop solution from past course in UniMelb (COMP20008): https://edstem.org/au/courses/9158/lessons/25867/slides/185032/solut...
Juaneag/COMP90024-Assignment2-Team39
twitter/preprocess.py
preprocess.py
py
5,927
python
en
code
0
github-code
36
[ { "api_name": "nltk.download", "line_number": 30, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 31, "usage_type": "call" }, { "api_name": "nltk.stem.porter.PorterStemmer", "line_number": 41, "usage_type": "call" }, { "api_name": "nltk.corpu...
23480037190
from typing import List class Solution: def combinationSum(candidates: List[int], target: int) -> List[List[int]]: answer = [] # 주어진 target에 candidates로 주어진 원소들을 빼나가면서 0이 나오면 정답에 추가하는 식으로 로직 구현 # 원소들의 조합의 합이 target이 되는지를 판단해야 하기 때문에 dfs를 이용 def dfs(cur_sum, cur_index, sub_answer):...
raddaslul/basic_algoritm
hikers/combination_sum.py
combination_sum.py
py
1,231
python
ko
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
11737753941
import pandas as pd import numpy as np from rdkit import Chem # 1. sdfファイルの名前を指定 # ex. ChemCupid_Namiki.sdf filename = 'ChemCupid_Namiki' # ----------------------------------------- def main(): mols = [mol for mol in Chem.SDMolSupplier( f'{filename}.sdf') if mol is not None] smiles = [Chem.MolToSmil...
yuito118/share-chemo
sdfToSmiles.py
sdfToSmiles.py
py
488
python
en
code
0
github-code
36
[ { "api_name": "rdkit.Chem.SDMolSupplier", "line_number": 13, "usage_type": "call" }, { "api_name": "rdkit.Chem", "line_number": 13, "usage_type": "name" }, { "api_name": "rdkit.Chem.MolToSmiles", "line_number": 15, "usage_type": "call" }, { "api_name": "rdkit.Chem...
30097509663
"""Script for demonstrating polynomial regression. Data obtained from: https://www.kaggle.com/karthickveerakumar/salary-data-simple-linear-regression """ import csv import numpy as np import matplotlib.pyplot as plt NUM_ITERS = 250 ALPHA = 0.01 def main(): X, y = load_data() X, stds = scale_features(X) ...
JhihYangWu/ML-Practice
03 Polynomial Regression/polynomial_regression.py
polynomial_regression.py
py
2,912
python
en
code
1
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "csv.reader", ...
7047886953
import base64 import json import boto3 import uuid from botocore.client import Config def lambda_handler(event, context): config = Config(connect_timeout=15, retries={'max_attempts': 3}) sqs = boto3.resource('sqs', config=config) queue = sqs.get_queue_by_name( QueueName='eks-notification-canada-c...
cds-snc/notification-lambdas
sesemailcallbacks/ses_to_sqs_email_callbacks.py
ses_to_sqs_email_callbacks.py
py
1,971
python
en
code
0
github-code
36
[ { "api_name": "botocore.client.Config", "line_number": 10, "usage_type": "call" }, { "api_name": "boto3.resource", "line_number": 11, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 20, "usage_type": "call" }, { "api_name": "base64.b64encode", ...
71508824103
from wsgiref import simple_server from flask import Flask, request, render_template,url_for, app from flask import Response from flask_cors import CORS, cross_origin from logistic_deploy import predObj import os import json app = Flask(__name__) CORS(app) app.config['DEBUG'] = True class ClientApi: def __ini...
amitranjasahoo12/logistics-regression
app.py
app.py
py
2,548
python
en
code
0
github-code
36
[ { "api_name": "flask.app", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.app", "line_number": ...
2954317677
#! /usr/bin/env python # -*- coding: utf-8 -*- # Python標準ライブラリ import cv2 from cv_bridge import CvBridge, CvBridgeError # Python追加ライブラリ import mediapipe as mp # ROSに関するライブラリ import rospy from sensor_msgs.msg import CompressedImage class HandDetection(): def __init__(self): # MediaPipeが提供しているhandsの値を読み込...
Shoichi-Hasegawa0628/mediapipe_ros
src/main_ros.py
main_ros.py
py
2,503
python
en
code
0
github-code
36
[ { "api_name": "mediapipe.solutions", "line_number": 19, "usage_type": "attribute" }, { "api_name": "mediapipe.solutions", "line_number": 20, "usage_type": "attribute" }, { "api_name": "cv_bridge.CvBridge", "line_number": 23, "usage_type": "call" }, { "api_name": "...
31916197135
#!/usr/bin/env python # coding: utf-8 # # Technical test results for HEVA company # This notebook repeats the statement of the test. Under each activity you will find the code and the result produced. # You will find all the requirements to run this notebook in the requirements.md file. # ## Configuration # ### 1. ...
mdavid674/TEST_HEVA
main/result.py
result.py
py
14,008
python
en
code
0
github-code
36
[ { "api_name": "sys.stdout", "line_number": 43, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession.builder.config", "line_number": 72, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 72, "usage_type": "attribute" ...
69903435304
#!/usr/bin/env python # # A script that check fulltextsearch queue in nextcloud # This works only for Postgres Backend # # # Main Author # - Filip Krahl <filip.krahl@t-systems.com> # # USAGE # # See README.md # from optparse import OptionParser import sys import time import re import os import numbers try: im...
FLiPp3r90/nextcloud_fulltextsearch_pg
nextcloud_fulltextsearch_pg.py
nextcloud_fulltextsearch_pg.py
py
5,947
python
en
code
1
github-code
36
[ { "api_name": "sys.exit", "line_number": 28, "usage_type": "call" }, { "api_name": "numbers.Real", "line_number": 50, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 56, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 59,...
74768118503
from django.http import HttpRequest from djaveAllowed.models import Allowed from djaveAllowed.credentials import UserCredentials from djaveAPI.get_instance import get_instance from djaveAPI.problem import Problem from djaveClassMagic.find_models import model_from_name def get_request_ajax_obj(request, model=None, pk=...
dasmith2/djaveAPI
djaveAPI/get_request_variable.py
get_request_variable.py
py
2,142
python
en
code
0
github-code
36
[ { "api_name": "djaveClassMagic.find_models.model_from_name", "line_number": 29, "usage_type": "call" }, { "api_name": "djaveAllowed.models.Allowed", "line_number": 29, "usage_type": "argument" }, { "api_name": "djaveAllowed.credentials.UserCredentials", "line_number": 30, ...
43911039109
import numpy as n import matplotlib.pyplot as plt v0 = float(input("Podaj V0: ")) katpierwszy = float(input("Podaj kat: ")) * n.pi / 180 kat = katpierwszy* n.pi / 180 time = 2 * v0 * n.sin(kat) / 9.81 hmax = v0**2 * n.sin(kat)**2 / (2 * 9.81) zasieg = 2 * v0**2 * n.sin(kat)**2 / 9.81 punkty = 100 t = n.lin...
AWyszynska/JSP2022
lista9/zadanie3.py
zadanie3.py
py
796
python
pl
code
0
github-code
36
[ { "api_name": "numpy.pi", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.sin", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 9, ...
506102860
""" Split Raster's into tiles """ import os from osgeo import gdal def nrsts_fm_rst(rst, rows, cols, out_fld, bname): """ Split raster into several rasters The number of new rasters will be determined by the extent of the raster and the maximum number of rows and cols that the new rasters could...
jasp382/glass
glass/dtt/rst/split.py
split.py
py
3,146
python
en
code
2
github-code
36
[ { "api_name": "osgeo.gdal.Open", "line_number": 22, "usage_type": "call" }, { "api_name": "osgeo.gdal", "line_number": 22, "usage_type": "name" }, { "api_name": "osgeo.gdal.GA_ReadOnly", "line_number": 22, "usage_type": "attribute" }, { "api_name": "glass.prop.img...
36050038659
from typing import Optional from tornado.template import Loader from web.controllers.utils.errors import handle_errors from web.controllers.utils.validated import ValidatedFormRequestHandler from web.schemas import template_schema from web.services.email.abstract import AbstractEmailService from web.validation import...
MFrackowiak/sc_r_mailmarketing
web/controllers/template.py
template.py
py
2,346
python
en
code
0
github-code
36
[ { "api_name": "web.controllers.utils.validated.ValidatedFormRequestHandler", "line_number": 12, "usage_type": "name" }, { "api_name": "tornado.template.Loader", "line_number": 13, "usage_type": "name" }, { "api_name": "web.services.email.abstract.AbstractEmailService", "line_...
2623856397
import discord import logging import os from discord.ext import commands logger = logging.getLogger('serverlinker') logger.setLevel(logging.DEBUG) handler = logging.StreamHandler() handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')) logger.addHandler(handler) initial_extensions...
Kelwing/DiscordLinkerBot
main.py
main.py
py
1,599
python
en
code
2
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.Forma...
72597561384
from torch import nn import torch class OrderPredictor(nn.Module): def __init__(self, model_dim): super().__init__() self.disc_linear = nn.ModuleList([ nn.Linear(2 * model_dim, model_dim) for _ in range(3) ]) self.final_linear = nn.Linear(3 * model_dim, 6) def forw...
AwalkZY/CPN
model/sub_modules/auxiliary.py
auxiliary.py
py
937
python
en
code
10
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.ModuleList", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
18315390523
# This script does the following: # # 1. Steps through all of the shapefiles associated with the aerial photos and # determines whether the shapefile falls entirely within in the fjord. Photos # that don't fall entirely within the fjord are excluded from analysis. A file # titled 'input_files.npy' is created that conta...
ojiving/iceberg_segmentation
s1_image_segmentation_parallel_with_shapefiles.py
s1_image_segmentation_parallel_with_shapefiles.py
py
6,975
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.ioff", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 35, "usage_type": "name" }, { "api_name": "os.path.basename", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", ...
3866986259
# -*- coding: utf-8 -*- """ Created on Wed Dec 16 20:47:36 2020 @author: mixmp """ import random import math import numpy as np import mpmath def nearest_neighbour_for_TPS(path): ###################function for reading the tps document########################33 def read_tps(path): with ...
michaelampalkoudi/Master-projects
HW_9_Computational_optimization.py
HW_9_Computational_optimization.py
py
8,857
python
en
code
0
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 74, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 77, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 85, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 88, ...
73157455464
""" Test tifffile plugin functionality. """ import datetime import io import warnings from copy import deepcopy import numpy as np import pytest from conftest import deprecated_test import imageio.v2 as iio import imageio.v3 as iio3 from imageio.config import known_extensions, known_plugins tifffile = pytest.import...
imageio/imageio
tests/test_tifffile.py
test_tifffile.py
py
11,873
python
en
code
1,339
github-code
36
[ { "api_name": "pytest.importorskip", "line_number": 17, "usage_type": "call" }, { "api_name": "imageio.config.known_plugins.copy", "line_number": 23, "usage_type": "call" }, { "api_name": "imageio.config.known_plugins", "line_number": 23, "usage_type": "name" }, { ...
43328947226
from bs4 import BeautifulSoup #from requests import Session as R import requests as R import time import random import os import json from fake_useragent import UserAgent from stem import Signal from stem.control import Controller from selenium import webdriver from selenium.webdriver.firefox.options import Options fro...
naturalkind/simpleparsing
build_parse_drive2/dr4_1.py
dr4_1.py
py
9,278
python
en
code
0
github-code
36
[ { "api_name": "os.walk", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 5...
1952962326
from multiprocessing import Process,Queue,Pipe from slave import serialize import time def timer(*args, f=None): before = time.time() f(*args) after = time.time() return after - before big_str = ' '.join(['abcdeftghijklmnopq\n' for y in range(1000000)]) + ' ' print(len(big_str)) parent_conn,child_...
brokenpath/generator
master.py
master.py
py
484
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 7, "usage_type": "call" }, { "api_name": "time.time", "line_number": 9, "usage_type": "call" }, { "api_name": "multiprocessing.Pipe", "line_number": 17, "usage_type": "call" }, { "api_name": "multiprocessing.Process", ...
36189547346
from concurrent.futures.thread import ThreadPoolExecutor import requests # url = "http://www.eversunshine.cn/" # url = "https://static-4c89007f-af34-418a-909e-be456bf03b70.bspapp.com/#/" # url = "https://www.baidu.com/" def DOS(): # resp = requests.get(url, timeout=3) # print(resp.text) # print(data) ...
wuheyouzi/code
PycharmProjects/dos/main.py
main.py
py
495
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "concurrent.futures.thread.ThreadPoolExecutor", "line_number": 19, "usage_type": "call" } ]
12780519052
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F from core.modules import RNNCell, SequenceWise, ConvLayer def im2col(x, K, P): N, C, H, W = x.shape L = N * H * W CK2 = C * K ** ...
etienne87/torch_object_rnn
core/convs/plastic_conv.py
plastic_conv.py
py
4,185
python
en
code
9
github-code
36
[ { "api_name": "torch.nn.functional.unfold", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.bmm", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.bmm", ...
9747404267
# Author: Ranjodh Singh import requests from bs4 import BeautifulSoup as bs import os url = "http://www.thehindu.com/archive/" html = requests.get(url) soup = bs(html.__dict__['_content'], "html5lib") container = soup.select("#archiveTodayContainer") for link in container[0].find_all("a"): resp = requests.get(li...
singhranjodh/the-hindu-archive-scraper
script.py
script.py
py
1,304
python
en
code
7
github-code
36
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "li...
25717533361
from typing import Type, TypeVar, MutableMapping, Any, Iterable from datapipelines import ( DataSource, PipelineContext, Query, NotFoundError, validate_query, ) from .common import RiotAPIService, APINotFoundError from ...data import Platform, Region from ...dto.staticdata.version import VersionLis...
meraki-analytics/cassiopeia
cassiopeia/datastores/riotapi/spectator.py
spectator.py
py
3,558
python
en
code
522
github-code
36
[ { "api_name": "typing.TypeVar", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.MutableMapping", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 20, "usage_type": "name" }, { "api_name": "datapipelines.Pipelin...
35940617435
# -*- coding: utf-8 -*- """ Created on Thu Jul 30 16:21:28 2018 @author: bob.lee """ from src.model_test import image_cnn from PIL import Image import sys def image_main(image_name): image = Image.open(image_name) image = image.flatten() / 255 predict_text = image_cnn(image) return pre...
lidunwei12/Verification_code
main.py
main.py
py
420
python
en
code
1
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 13, "usage_type": "name" }, { "api_name": "src.model_test.image_cnn", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.argv", "lin...
34717450162
from bottle import route from bottle import run from bottle import request from bottle import HTTPError import album @route("/albums/<artist>") def albums(artist): """ в переменную albums_list записываем таблицу найденных альбомов для этого обращаемся к функции find(), которую мы написали в модуле ...
zpa1986/-zpa1986-skillfactory-module-11-zaykin_B6-Practice
album_server.py
album_server.py
py
1,730
python
ru
code
0
github-code
36
[ { "api_name": "album.find", "line_number": 12, "usage_type": "call" }, { "api_name": "bottle.HTTPError", "line_number": 15, "usage_type": "call" }, { "api_name": "album.album", "line_number": 17, "usage_type": "attribute" }, { "api_name": "bottle.route", "line...
30874171906
import argparse import os import time import gym import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from PPO import PPO from unity_wrapper_zzy import UnityWrapper parser = argparse.ArgumentParser(description='Train or test neural net motor controller.') parser.add_argument('--train', dest='trai...
TreeletZhang/CarVerification
main.py
main.py
py
7,123
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "unity_wrapper_zzy.U...
31414356277
"""Module test user information reource.""" import json from unittest import mock from flask import Response from .base_test import BaseTestCase, Center, Cohort, Society from api.utils.marshmallow_schemas import basic_info_schema def info_mock(status_code, society=None, location=None, cohort=None, data=None): "...
andela/andela-societies-backend
src/tests/test_user_information.py
test_user_information.py
py
7,480
python
en
code
1
github-code
36
[ { "api_name": "flask.Response", "line_number": 14, "usage_type": "call" }, { "api_name": "base_test.BaseTestCase", "line_number": 20, "usage_type": "name" }, { "api_name": "base_test.BaseTestCase.setUp", "line_number": 25, "usage_type": "call" }, { "api_name": "ba...
20593599782
# coding:utf-8 """ Create by Wangmeng Song July 21,2017 """ import shapefile as sf from shapely.geometry import Polygon, Point import os import inspect import numpy as np import json filedir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + "/" + "area" pingchearea = u'pincheArea.dbf' # 拼...
Octoberr/Auto_Schedule
recomTimeOnTheBus/eastandwestside.py
eastandwestside.py
py
7,983
python
en
code
6
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "inspect.getfile", "l...
71245259624
# -*- coding: utf-8 -*- # pylint: disable-msg=W0403,W0603,C0111,C0103,W0142,C0301 """ partialy stolen from python locale tests ;) requires nose (easy_install nose) nosetests -v --with-coverage --cover-package=localization test_localization.py """ from django.conf import settings settings.configure(DEBUG=True, ...
shula/citytree
contrib/nesh/localization/test_localization.py
test_localization.py
py
7,157
python
en
code
2
github-code
36
[ { "api_name": "django.conf.settings.configure", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 9, "usage_type": "name" }, { "api_name": "locale.setlocale", "line_number": 21, "usage_type": "call" }, { "api_name": "lo...
32967621302
from arcana_app.models import Truck from twilio.rest import Client from datetime import date, timedelta def my_scheduled_job(): ''' Background task with interval set in settings. Function send SMS when is information that MOT expires. Function sends message one time when 20 days left to mot expiration. ...
KamilNurzynski/Arcana
arcana_app/cron.py
cron.py
py
848
python
en
code
1
github-code
36
[ { "api_name": "arcana_app.models.Truck.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "arcana_app.models.Truck.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "arcana_app.models.Truck", "line_number": 12, "usage_type": "name...
26009605425
import datetime import os import subprocess import time import dimacs start = time.time() solved = 0 hardest = {} try: for file in dimacs.satlib_problems: file = os.path.join("C:\\satlib", file) print(file) dimacs.print_header(file) expected = dimacs.get_expected(file) cm...
russellw/ayane
script/batch_dimacs.py
batch_dimacs.py
py
1,303
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 8, "usage_type": "call" }, { "api_name": "dimacs.satlib_problems", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line...
29752162238
# -*- coding: utf-8 -*- """ Created on Tue Jan 23 02:22:23 2018 @author: RAJAT """ import numpy as np from time import time from keras.models import Sequential from keras.layers import Dense, Dropout , Activation,Flatten,Convolution2D, MaxPooling2D ,AveragePooling2D from keras.callbacks import TensorBoard ...
rajatkb/STU-NET-Stupid-Neural-Net
edition 1 CNN= = = softmax/model.py
model.py
py
3,722
python
en
code
3
github-code
36
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
34455433400
# -*- coding: utf8 -*- from django.contrib import admin from models_app.models import Document @admin.register(Document) class DocumentAdmin(admin.ModelAdmin): list_display = [ 'id', 'name', 'file', 'position', 'task', ] list_display_links = ( 'id', ...
Aplles/project_tracker
models_app/admin/document/resources.py
resources.py
py
472
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 6, "usage_type": "call" }, { ...
32226927177
import streamlit as st import requests import json from dbnomics import fetch_series import pandas as pd from pandas.api.types import ( is_categorical_dtype, is_datetime64_any_dtype, is_numeric_dtype, ) import altair as alt st.set_page_config(page_title="DB Nomics Marco Data Vizualizer", layout="wide") s...
Silvan-Fischer/MacroDataViz
MarcoDataViz.py
MarcoDataViz.py
py
8,039
python
en
code
0
github-code
36
[ { "api_name": "streamlit.set_page_config", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.session_state", "line_number": 16, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "j...