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
70965223549
### THEORETICAL PROBABILITY ### # For the following problems, use python to simulate the problem and calculate an experimental probability, then compare that to the theoretical probability. from scipy import stats import numpy as np # Grades of State University graduates are normally distributed with a mean of 3.0 a...
crisgiovanoni/statistics-exercises
probability_distributions.py
probability_distributions.py
py
9,018
python
en
code
0
github-code
6
[ { "api_name": "scipy.stats.norm", "line_number": 16, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 16, "usage_type": "name" }, { "api_name": "numpy.random.normal", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.random", "...
18361449182
from rest_framework import serializers from .models import * class UserSerializer(serializers.ModelSerializer): password = serializers.CharField(write_only=True) def create(self, validated_data): user = User.objects.create( username=validated_data['username'], email=validated...
raulfanc/gradebook_backend
gradebook_app/serializers.py
serializers.py
py
2,626
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.CharField", "line_number": 7, "usage_...
26024379550
# 积分守恒型 Lax - Friedrichs 格式 # 导入所需要的模块 import numpy as np from fealpy.decorator import cartesian from scipy.sparse import diags from scipy.sparse import csr_matrix from typing import Union,Tuple,List # Union: 将多个集合合并为一个集合 from scipy.sparse.linalg import spsolve import matplotlib.pyplot as plt from fealpy.mesh import...
suanhaitech/pythonstudy2023
python-jovan/Numerical solution of differential equation/hyperbolic/test_exp2.py
test_exp2.py
py
3,132
python
en
code
2
github-code
6
[ { "api_name": "typing.Union", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Union", "line_number...
25442443781
import pygame from . import view from . import render from . import callback from . import button HORIZONTAL = 0 VERTICAL = 1 SCROLLBAR_SIZE = 12 class ScrollbarThumbView(view.View): """Draggable thumb of a scrollbar.""" def __init__(self, direction): size = SCROLLBAR_SIZE view.View.__init__(...
jwayneroth/mpd-touch
pygameui/scroll.py
scroll.py
py
14,197
python
en
code
5
github-code
6
[ { "api_name": "pygame.Rect", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.K_DOWN", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pygame.K_UP", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pygame.K_RIGHT", ...
74977722427
import logging from ontobio.io.gafparser import GafParser from dipper.sources.Source import Source from dipper.models.assoc.Association import Assoc from dipper.models.Model import Model from dipper.models.Reference import Reference __author__ = 'timputman' LOG = logging.getLogger(__name__) class RGD(Source): ...
monarch-initiative/dipper
dipper/sources/RGD.py
RGD.py
py
4,818
python
en
code
53
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "dipper.sources.Source.Source", "line_number": 14, "usage_type": "name" }, { "api_name": "ontobio.io.gafparser.GafParser", "line_number": 91, "usage_type": "call" }, { "api...
70281057148
from typing import List, Iterable from torch.utils import data from allennlp.common.registrable import Registrable from allennlp.data.samplers.bucket_batch_sampler import BucketBatchSampler from allennlp.data.samplers.max_tokens_batch_sampler import MaxTokensBatchSampler """ Duplicates of the pytorch Sampler classes....
esteng/ambiguous_vqa
models/allennlp/data/samplers/pytorch_samplers.py
pytorch_samplers.py
py
7,387
python
en
code
5
github-code
6
[ { "api_name": "allennlp.common.registrable.Registrable", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 22, "usage_type": "name" }, { "api_name": "allennlp.common.registrable.Registrable", "line_number": 26, "usage_type": "name"...
72708100028
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2022/8/13 15:04 # @Author : 0x00A0 # @File : main.py # @Description : TKINTER窗口程序 import asyncio import multiprocessing import os import re import shutil import sys import threading import time import tkinter from tkinter import filedialog, messagebox from...
0x00A0/FaceAge
main.pyw
main.pyw
pyw
6,807
python
en
code
2
github-code
6
[ { "api_name": "shutil.rmtree", "line_number": 29, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 30, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 41, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 5...
20123867357
import requests import json from collections import OrderedDict target = "static/data/words_cached.json" words_cached = json.loads(requests.get("http://mnemonic-si.appspot.com/api/words").text) open(target, "w").write(json.dumps(words_cached, indent=4)) print("wrote to %s" % target) words = OrderedDict({}) for word i...
flowcoin/mnemonic
frontend/scripts/dump_words.py
dump_words.py
py
1,010
python
en
code
1
github-code
6
[ { "api_name": "json.loads", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_n...
21568994484
import torch import torchvision.datasets from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter # 相对路径为相对于当前工程的 dataset = torchvision.datasets.CIFAR10("./PyTorch/data", train=True, transform=torchvision.transforms.ToTensor(), download=True, ) dataloader = DataLoader(dataset, 64) # 打...
puzhiyuan/AutonomousDriving
PyTorch/src/TensorBoard.py
TensorBoard.py
py
761
python
en
code
1
github-code
6
[ { "api_name": "torchvision.datasets.datasets.CIFAR10", "line_number": 8, "usage_type": "call" }, { "api_name": "torchvision.datasets.datasets", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torchvision.datasets", "line_number": 8, "usage_type": "name" },...
38857299042
from django.db.utils import IntegrityError from spyne.error import ResourceNotFoundError, ResourceAlreadyExistsError from spyne.model.complex import Iterable from spyne.model.primitive import Integer from spyne.protocol.soap import Soap11 from spyne.application import Application from spyne.decorator import rpc from s...
Vixx-X/SOAP-REST-MICROSERVICES
SOAP/soap/soap/apps/soap/views.py
views.py
py
1,975
python
en
code
0
github-code
6
[ { "api_name": "spyne.util.django.DjangoService", "line_number": 19, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 26, "usage_type": "call" }, { "api_name": "models.Submission.objects.create", "line_number": 27, "usage_type": "call" }, { "api_n...
28670801665
from os import close from numpy.lib.npyio import NpzFile import pandas as pd import os import tqdm import re import numpy as np from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt from sklearn.metrics import r2_score from scipy import stats Folder_Path = r'C:\Users\hp\Desktop\wdpashp\wdpa...
HaoweiGis/EarthLearning
tools/LightPollution/LightPollution2.py
LightPollution2.py
py
9,858
python
en
code
3
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
2083516856
import csv import json from collections import OrderedDict from pathlib import Path from typing import Any, List, Optional, Union import torch from pytorch_lightning import LightningModule, Trainer from src.utils import pylogger log = pylogger.get_pylogger(__name__) def process_state_dict( state_dict: Union[Or...
gorodnitskiy/yet-another-lightning-hydra-template
src/utils/saving_utils.py
saving_utils.py
py
7,154
python
en
code
128
github-code
6
[ { "api_name": "src.utils.pylogger.get_pylogger", "line_number": 12, "usage_type": "call" }, { "api_name": "src.utils.pylogger", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 16, "usage_type": "name" }, { "api_name": "colle...
11964989637
from django.urls import path from .views import * app_name = 'blog' urlpatterns = [ path('', posts_list, name='post_list'), path('tag/<slug:tag_slug>', posts_list, name='post_list_by_tag'), # path('', PostsList.as_view(), name='post_list'), path('p/<slug:slug>/<int:year>/<int:month>/<i...
black15/django-blog-v2
blog/urls.py
urls.py
py
500
python
en
code
2
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
41389643477
from ciscoconfparse import CiscoConfParse import hashlib import difflib class audit: def configuration_must_have(self,input_parent,input_config,show_command_output,show_command): audit = False actual_child_config = "No Configuration Found: {}".format(input_config) parent_config = "" ...
johnanthonyraluta/Port_Mapping
Resources/cisco/ios_xr/audit.py
audit.py
py
2,484
python
en
code
0
github-code
6
[ { "api_name": "ciscoconfparse.CiscoConfParse", "line_number": 12, "usage_type": "call" }, { "api_name": "hashlib.sha224", "line_number": 41, "usage_type": "call" }, { "api_name": "hashlib.sha224", "line_number": 42, "usage_type": "call" }, { "api_name": "difflib.D...
10713095984
from typing import Set from pychu.tlogic.tcards import Card from pychu.tpattern.multiples import TMultiFinder from pychu.tpattern.tpatternfinder import TPatternFinder def find_bombs(cards): buffer = [] out = [] first = True for card in cards: if first: first = False b...
akkurat/tichu
python/src/pychu/tpattern/bombs.py
bombs.py
py
830
python
en
code
0
github-code
6
[ { "api_name": "pychu.tpattern.tpatternfinder.TPatternFinder", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 28, "usage_type": "name" }, { "api_name": "pychu.tlogic.tcards.Card", "line_number": 28, "usage_type": "name" }, { "...
24325824848
import cv2 import numpy as np from scipy.ndimage.measurements import label from code.features import FeatureExtractor from collections import deque HEAT_INCREMENT = 10 class VehicleDetector: def __init__(self, svc, scaler, n_rows, n_cols, config, buffer_size = 8): self.svc = svc ...
olasson/SDCND-T1-P5-VehicleDetection
code/detect.py
detect.py
py
5,703
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 44, "usage_type": "call" }, { "api_name": "code.features.FeatureExtractor", "line_number": 46, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 53, "usage_type": "attribute" }, { "api_name": "...
70322594108
"""remove_product_rating_score Revision ID: 177cf327b079 Revises: acf2fa2bcf67 Create Date: 2023-05-26 14:43:55.049871 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "177cf327b079" down_revision = "acf2fa2bcf67" branch_labels = None depends_on = None def upg...
ttq186/DressUp
alembic/versions/2023-05-26_remove_product_rating_score.py
2023-05-26_remove_product_rating_score.py
py
741
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.drop_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.add_column", "line_number": 27, "usage_type": "call" }, { "api_name": "alembic.op", ...
4333793200
# ruff: noqa: FBT001 # note: only used items are defined here, with used typing import sys from typing import Iterator, Optional, Sequence, TypeVar from xml.etree.ElementTree import Element, ParseError if sys.version_info < (3, 8): # pragma: no cover from typing_extensions import Protocol else: # pragma: no cov...
Rogdham/bigxml
stubs/defusedxml/ElementTree.pyi
ElementTree.pyi
pyi
858
python
en
code
17
github-code
6
[ { "api_name": "sys.version_info", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.TypeVar", "line_number": 13, "usage_type": "call" }, { "api_name": "typing.Protocol", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Optional",...
39275871070
import sys import time import traceback from datetime import datetime import random import re from decimal import Decimal import numexpr from typing import List, Dict import disnake from disnake.ext import commands, tasks from disnake import ActionRow, Button from disnake.enums import OptionType from disnake.app_comm...
wrkzcoin/TipBot
wrkzcoin_tipbot/cogs/mathtip.py
mathtip.py
py
26,213
python
en
code
137
github-code
6
[ { "api_name": "disnake.ui", "line_number": 31, "usage_type": "attribute" }, { "api_name": "disnake.ui", "line_number": 36, "usage_type": "attribute" }, { "api_name": "disnake.Message", "line_number": 37, "usage_type": "attribute" }, { "api_name": "typing.Dict", ...
10422855793
import dataclasses import io import logging import math import shutil import tempfile from pathlib import Path import discord import graphviz import PIL.Image from discord import Embed from discord.ext.commands import Context, Converter from PIL import ImageDraw from randovania.game_description import default_databas...
randovania/randovania
randovania/server/discord/database_command.py
database_command.py
py
16,089
python
en
code
165
github-code
6
[ { "api_name": "randovania.game_description.db.area.Area", "line_number": 29, "usage_type": "name" }, { "api_name": "discord.ui", "line_number": 31, "usage_type": "attribute" }, { "api_name": "dataclasses.dataclass", "line_number": 27, "usage_type": "call" }, { "ap...
21686337671
import argparse import mmread_utils as mmu import pickle as pkl def parse_annots(fn): """ Columns are: * 0 - run_barcode * 1 - cell_ontology_class * 17 - tissue """ annots_dict = {} for i, line in enumerate(open(fn)): if i == 0: continue line = line.split(',') ...
dobinlab/STARsoloManuscript
splicing/make_mmu_pkl.py
make_mmu_pkl.py
py
3,304
python
en
code
8
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 71, "usage_type": "call" }, { "api_name": "mmread_utils.load_all_gene_counts", "line_number": 86, "usage_type": "call" }, { "api_name": "mmread_utils.get_all_sjs", "line_number": 90, "usage_type": "call" }, { ...
13279743396
import datetime import matplotlib.pyplot as plt import matplotlib.dates import pandas as pd import numpy as np import os.path class Graphs: def __init__(self, data_base): self.data_base = data_base def overall_results_per(self): correct = self.data_base["correct"].sum() / len(self.data_bas...
jlcoto/der_die_das
grapher_gen_results.py
grapher_gen_results.py
py
10,304
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 37, "usage_type": "call" }, { "api_name"...
36294713470
# 2016년 1월 1일은 금요일입니다. 2016년 a월 b일은 무슨 요일일까요? 두 수 a ,b를 입력받아 2016년 a월 b일이 무슨 요일인지 리턴하는 함수, solution을 완성하세요. 요일의 이름은 일요일부터 토요일까지 각각 SUN,MON,TUE,WED,THU,FRI,SAT # 입니다. 예를 들어 a=5, b=24라면 5월 24일은 화요일이므로 문자열 "TUE"를 반환하세요. # 제한 조건 # 2016년은 윤년입니다. # 2016년 a월 b일은 실제로 있는 날입니다. (13월 26일이나 2월 45일같은 날짜는 주어지지 않습니다) # jan = 31 # ...
minkimhere/algorithm_python
13_2016.py
13_2016.py
py
1,324
python
ko
code
0
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 39, "usage_type": "call" } ]
70128173308
""" Main Qt widget and file as well. """ import sys from PySide6.QtWidgets import QApplication, QWidget, QPushButton, QHBoxLayout from PySide6.QtCore import QTimer import globals from main_gl_widget import MainGlWidget # Important: # You need to run the following command to generate the ui_form.py file # pyside...
Iosiv42/GoL
src/widget.py
widget.py
py
1,938
python
en
code
0
github-code
6
[ { "api_name": "PySide6.QtWidgets.QWidget", "line_number": 18, "usage_type": "name" }, { "api_name": "ui_form.Ui_Widget", "line_number": 23, "usage_type": "call" }, { "api_name": "main_gl_widget.MainGlWidget", "line_number": 28, "usage_type": "call" }, { "api_name"...
8952803072
# Create your views here. from bet_data_fetcher.models import * from django.conf import settings from django.core.cache import cache from exceptions import * import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) def _fetch_data_from_sites(): """ Fetches data from site classes in bet_s...
rahul342/betapp
bet_data_fetcher/views.py
views.py
py
4,634
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "bet_sites.StanJamer", "line_number": 16, "usage_type": "call" }, { "api_name": "django.core.ca...
4072532441
from __future__ import division import os import sys import subprocess import threading import json import numpy as np import ast import tempfile # Assumes spice.jar is in the same directory as spice.py. Change as needed. SPICE_JAR = 'SPICE-1.0/spice-1.0.jar' TEMP_DIR = 'tmp' CACHE_DIR = 'cache' class Spice: """...
SamarthGVasist/Image-Captioning-using-Deep-Learning-Models-CDSAML-
SPICE.py
SPICE.py
py
5,716
python
en
code
0
github-code
6
[ { "api_name": "numpy.nan", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path", "line_number": 49, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "li...
11472746542
import json from typing import List, Dict, Any def extract_json(string: str) -> List[Dict[str, Any]]: json_strings = [] json_objects = [] open_brackets = 0 start_index = None for index, char in enumerate(string): if char == '{': open_brackets += 1 if open_brackets =...
hsyhhssyy/amiyabot-arknights-hsyhhssyy-maa
utils/string_operation.py
string_operation.py
py
1,033
python
en
code
3
github-code
6
[ { "api_name": "json.loads", "line_number": 22, "usage_type": "call" }, { "api_name": "json.JSONDecodeError", "line_number": 24, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 4, "usage_type": "name" }, { "api_name": "typing.Dict", "li...
35141470185
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read() with open("requirements.txt") as requirements_file: requirements = requir...
hXtreme/flask-easyapi
setup.py
setup.py
py
1,725
python
en
code
2
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 24, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 50, "usage_type": "call" } ]
4246502703
from Model.Animal import animalModel from Controller.Animal import animalController from fastapi import APIRouter, Depends, HTTPException router = APIRouter( prefix="/animals", tags=["animals"], responses={404: {"description": "Not found"}}, ) _animalCon = animalController.animalController() @router.get...
aziznaufal/Mainan
Python/PercobaanFastAPI/Route/Animal/AnimalApi.py
AnimalApi.py
py
596
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "Controller.Animal.animalController.animalController", "line_number": 12, "usage_type": "call" }, { "api_name": "Controller.Animal.animalController", "line_number": 12, "usage_type"...
6993423096
from __future__ import annotations import math from typing import TYPE_CHECKING from adapter.path_adapter import PathAdapter, PathAttributeID from adapter.straight_adapter import StraightAdapter from common.image_manager import ImageID from entity_base.image.image_state import ImageState from models.path_models.path_se...
AnselChang/Pathogen4
models/path_models/path_segment_model.py
path_segment_model.py
py
12,457
python
en
code
11
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 21, "usage_type": "name" }, { "api_name": "models.path_models.path_element_model.SerializedPathElementState", "line_number": 30, "usage_type": "name" }, { "api_name": "models.path_models.segment_direction.SegmentDirection", ...
26040212886
from __future__ import annotations import dataclasses import logging import os from abc import ABCMeta from dataclasses import dataclass from typing import Any, ClassVar, Generic, Iterable, Mapping, Type, TypeVar import yaml from typing_extensions import final from pants.backend.helm.subsystems.helm import HelmSubsy...
pantsbuild/pants
src/python/pants/backend/helm/util_rules/tool.py
tool.py
py
16,274
python
en
code
2,896
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 50, "usage_type": "call" }, { "api_name": "pants.option.subsystem.Subsystem", "line_number": 74, "usage_type": "name" }, { "api_name": "abc.ABCMeta", "line_number": 74, "usage_type": "name" }, { "api_name": "typing...
14127553386
import tkinter as tk import datetime class App: def __init__(self,parent): self.parent = parent self.hour_label = tk.Label(self.parent,text="H",background='plum1',font=('verdana',12,'bold')) self.tick1 = tk.Label(self.parent,text=':',background='plum1',font=('verdana',1...
vishalnain-10/Digital-Watch-using-tkinter
digi_clock.py
digi_clock.py
py
2,437
python
en
code
0
github-code
6
[ { "api_name": "tkinter.Label", "line_number": 10, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 11, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 12, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_n...
4759197935
"""Test the gambit.sigs.convert module.""" import pytest import numpy as np from gambit.sigs.convert import dense_to_sparse, sparse_to_dense, can_convert, \ check_can_convert, convert_dense, convert_sparse from gambit.kmers import KmerSpec from gambit.test import random_seq def test_dense_sparse_conversion(): """...
jlumpe/gambit
tests/sigs/test_sigs_convert.py
test_sigs_convert.py
py
2,427
python
en
code
16
github-code
6
[ { "api_name": "gambit.kmers.KmerSpec", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 21, "usage_type": "call" }, { "api_name": "gambit.sigs.convert.de...
137753727
############################################################################### # Pareto-Optimal Cuts for Benders Decomposition # # Article: Accelerating Benders Decomposition: Algorithmic Enhancement and # # Model Selection Criteria ...
isaac0821/BendersDecomposition
benders.py
benders.py
py
10,604
python
en
code
15
github-code
6
[ { "api_name": "random.randint", "line_number": 36, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 40, "usage_type": "call" }, { "api_name": "gurobipy.Model", "line_number": 107, "usage_type": "call" }, { "api_name": "gurobipy.GRB", "lin...
30783796663
""" https://adventofcode.com/2019/day/8 """ from typing import List, Tuple, NamedTuple, Iterator import itertools import math Layer = Tuple[Tuple[int]] class LayerMetrics(NamedTuple): name: str count: int layer_nums: Layer def grouper(iterable: List[int], size:int) -> Iterator[Tuple[int]]: iterable ...
giordafrancis/adventofcode2019
day08_image.py
day08_image.py
py
2,140
python
en
code
0
github-code
6
[ { "api_name": "typing.Tuple", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.NamedTuple", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 16, "usage_type": "name" }, { "api_name": "itertools.islice", "lin...
7937970870
from PIL import Image, ImageDraw, ImageFont, ImageColor, ImageEnhance import requests import io import json from rembg import remove, new_session import uvicorn from fastapi import FastAPI, Request from fastapi.responses import FileResponse, Response app = FastAPI() def ReduceOpacity(im, opacity): """ Return...
kimtrietvan/Image-text-template
main.py
main.py
py
10,449
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.ImageEnhance.Brightness", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.ImageEnhance", "line_number": 24, "usage_type": "name" }, { "api_name": "json.load...
37020505173
# 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 law or agreed to in writing, software # dist...
TateWalker/Galactic-Data
irsa.py
irsa.py
py
14,152
python
en
code
0
github-code
6
[ { "api_name": "math.cos", "line_number": 48, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 48, "usage_type": "call" }, { "api_name": "astropy.coordinates.Angle", "line_number": 53, "usage_type": "call" }, { "api_name": "astropy.units.hour", ...
30528663499
from PIL import Image, ImageDraw def board(num, size): col = (255, 255, 255) picture = Image.new("RGB", (num * size, num * size), col) x = size * num y = x draw = ImageDraw.Draw(picture) for i in range(0, x, size): if i % (size * 2) == 0: for j in range(0, y, size): ...
OrAnge-Lime/Python-Practice-3
26.2.py
26.2.py
py
704
python
en
code
0
github-code
6
[ { "api_name": "PIL.Image.new", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 6, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_num...
42084381756
import logging import json import re from typing import Any from concurrent.futures import ThreadPoolExecutor from pymongo import MongoClient, database from bson.json_util import dumps, loads from bson.objectid import ObjectId from backend.conf.confload import config from backend.models.system import ResponseBasic f...
tbotnz/cmdboss
backend/cmdboss_db/cmdboss_db.py
cmdboss_db.py
py
7,900
python
en
code
22
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "backend.conf.confload.config.mongo_server_ip", "line_number": 24, "usage_type": "attribute" }, { "api_name": "backend.conf.confload.config", "line_number": 24, "usage_type": "name...
6442868869
import torch import torch.nn as nn from constants import IMG_SIZE class LinearVAE(nn.Module): def __init__(self, num_features): super(LinearVAE, self).__init__() self.num_features = num_features self.encoder = nn.Sequential( nn.Linear(in_features=IMG_SIZE ** 2, out_features=51...
antoineeudes/MLFlowPlayground
src/model.py
model.py
py
1,564
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
19265213860
from kubernetes import client, config from datetime import datetime import threading import time from settings import CPU_THRESHOLD ,SUSPEND_AFTER_DRAIN def time_now(): return datetime.now().strftime("%H:%M:%S") class Drainy: """ This Drainy class is to auto-drain a faulty node as self-healing solution ...
netmanyys/drainy
main.py
main.py
py
5,104
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "kubernetes.config.load_incluster_config", "line_number": 15, "usage_type": "call" }, { "api...
70396795707
import chex import jax import jax.numpy as jnp import shinrl as srl dS = 10 dA = 5 obs_shape = (2,) act_shape = (3,) init_probs = jnp.array([0.2, 0.8, 0, 0, 0, 0, 0, 0, 0, 0]) discount = 0.99 def tran_fn(state, action): next_state = jnp.array([state, (state + action) % 10], dtype=int) prob = jnp.array([0.2,...
omron-sinicx/ShinRL
tests/envs/base/mdp_test.py
mdp_test.py
py
1,458
python
en
code
42
github-code
6
[ { "api_name": "jax.numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "jax.numpy", "line_number": 11, "usage_type": "name" }, { "api_name": "jax.numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "jax.numpy", "line_numbe...
25785346221
import numpy as np import matplotlib.pyplot as plt import xlrd from config import SHEET_INDEX, ROW_START, ROW_END, COLUMN_START, COLUMN_END,FILE_NAME from model import Unit plt.rcParams['font.family']='Calibri' def read_data(): workbook = xlrd.open_workbook(FILE_NAME) sheet = workbook.sheets()[0] result = ...
gaufung/CodeBase
PDA/Figures/app.py
app.py
py
2,205
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "xlrd.open_workbook", "line_number": 9, "usage_type": "call" }, { "api_name": "con...
27812524833
from collections import deque class Queue: def __init__(self): self.queue = deque() def enqueue(self, item): self.queue.append(item) def dequeue(self): if self.is_empty(): raise IndexError("Queue is empty") return self.queue.popleft() def is_empty(self): ...
aaryam-dev/Python_DSA
Data Structures/2_Queue/Queue.py
Queue.py
py
897
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 38, "usage_type": "call" } ]
27537060768
import requests import json BASE_URL = 'http://localhost:9000' def test_health(): response = requests.get(BASE_URL) assert response.status_code == 200 assert response.text == "Welcome to our Spring-Boot Application!" def test_get_logs(): response = requests.get(BASE_URL + "/logs") logs = respon...
GalDavid6/GaMosh.DevOps
tests/test_http.py
test_http.py
py
696
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number":...
3935444552
import argparse import sys import time from datetime import datetime, timedelta from glados.es.ws2es.es_util import ESUtil, num_shards_by_num_rows, DefaultMappings, CURRENT_ES_VERSION import glados.es.ws2es.signal_handler as signal_handler import glados.es.ws2es.resources_description as resources_description import gla...
chembl/chembl_ws_2_es
src/glados/es/ws2es/cluster_replication/cluster_replicator.py
cluster_replicator.py
py
13,233
python
en
code
1
github-code
6
[ { "api_name": "threading.Thread", "line_number": 26, "usage_type": "name" }, { "api_name": "glados.es.ws2es.es_util.ESUtil", "line_number": 28, "usage_type": "name" }, { "api_name": "sys.stderr", "line_number": 48, "usage_type": "attribute" }, { "api_name": "glado...
3695969994
"""Split-Attention""" import torch from torch import nn import torch.nn.functional as F from torch.nn.modules.utils import _pair from .dropblock import DropBlock2D __all__ = ['SplAtConv2d'] class SplAtConv2d(nn.Module): """Split-Attention Conv2d """ def __init__(self, in_channels, out_channels, kernel_...
welkin-feng/ComputerVision
cvmodels/models/layers/splat.py
splat.py
py
3,449
python
en
code
2
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.ReLU", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line...
26625314906
from django.contrib.auth.decorators import user_passes_test from django.core import urlresolvers from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext as _ from product.forms import VariationM...
dokterbob/satchmo
satchmo/apps/product/views/adminviews.py
adminviews.py
py
5,586
python
en
code
30
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "product.forms.InventoryForm", "line_number": 19, "usage_type": "call" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 22, "usage_type": "call" }, { "ap...
5634782182
#encoding:utf-8 # 导入matplotlib.pyplot, numpy 包 import numpy as np import matplotlib.pyplot as plt # 添加主题样式 # plt.style.use('mystyle') # 设置图的大小,添加子图 fig = plt.figure(figsize=(5,5)) ax = fig.add_subplot(111) #绘制sin, cos x = np.arange(-np.pi, np.pi, np.pi / 100) y1 = np.sin(x) y2 = np.cos(x) y3=np.tan(x) s...
peipei1109/P_04_CodeCategory
visualize/pltmultiLegend.py
pltmultiLegend.py
py
1,227
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.pi", ...
35776081465
from django.urls import path from . import consumers websocket_urlpatterns = [ path('ws/machine/<int:pk>/last/', consumers.MachineLastRunConsumer), path('ws/machine/<int:pk>/runs/', consumers.MachineRunsStatusConsumer), path('ws/machine/status/', consumers.MachinesStatusConsumer), ]
TobKed/system_test_progress_tracking
system_test_progress_tracking/progress_tracking/routing.py
routing.py
py
299
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" } ]
15757203807
from django.http import HttpRequest from django.test import TestCase from snippets.views import top from django.urls import resolve from snippets.views import top, snippet_new, snippet_edit, snippet_detail # Create your tests here. class CreateSnippetTest(TestCase): def test_should_resolve_snippet_new(self): ...
KentaKamikokuryo/DjangoWebApplication
djangosnippets/snippets/tests.py
tests.py
py
771
python
en
code
0
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "django.urls.resolve", "line_number": 12, "usage_type": "call" }, { "api_name": "snippets.views.snippet_new", "line_number": 13, "usage_type": "argument" }, { "api_name":...
1883937681
# -*- coding: utf-8 -*- """ Created on Thu Jun 10 21:31:20 2021 @author: Scott """ # %% Set up import pandas as pd import numpy as np import os import glob import matplotlib.pyplot as plt from matplotlib.lines import Line2D # import plotly.graph_objects as go from matplotlib.collections import PatchCollection from mat...
sckilcoyne/Election_Results
cambridge.py
cambridge.py
py
8,768
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 18, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_na...
30357800081
from math import log10 from pyface.qt import QtCore, QtGui from traits.api import TraitError, Str, Float, Any, Bool from .editor_factory import TextEditor from .editor import Editor from .constants import OKColor, ErrorColor from .helper import IconButton # ------------------------------------------------------...
enthought/traitsui
traitsui/qt/range_editor.py
range_editor.py
py
25,173
python
en
code
290
github-code
6
[ { "api_name": "editor.Editor", "line_number": 21, "usage_type": "name" }, { "api_name": "traits.api.Any", "line_number": 31, "usage_type": "call" }, { "api_name": "editor.Editor._set_value", "line_number": 36, "usage_type": "call" }, { "api_name": "editor.Editor",...
23520366148
import pygame from animation_folder import import_folder class Door(pygame.sprite.Sprite): def __init__(self, pos): super().__init__() # Door attributes self.frames = 0 self.animation_speed = 0.15 self.animations = import_folder('./graphics/pain_character/door') self...
lekan2410/Naruto-Platformer-V2
Code/door.py
door.py
py
825
python
en
code
0
github-code
6
[ { "api_name": "pygame.sprite", "line_number": 4, "usage_type": "attribute" }, { "api_name": "animation_folder.import_folder", "line_number": 10, "usage_type": "call" } ]
1414104927
import logging import coloredlogs import sys import os import yaml import argparse log = logging.getLogger(__name__) class Workspace: BACK_CONFIG_VERSION = "0.03" CONFIG_VERSION = "0.05" DEFAULT_WORKSPACE_DIR = os.path.join(os.path.expanduser("~"), ".tng-workspac...
sonata-nfv/tng-sdk-project
src/tngsdk/project/workspace.py
workspace.py
py
14,885
python
en
code
5
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "...
18003891687
from unittest.mock import patch from django.urls import reverse from rest_framework import status from django.contrib import messages from comment.conf import settings from comment.models import Comment from comment.tests.base import BaseCommentTest, BaseCommentFlagTest, BaseCommentViewTest from comment.tests.test_ut...
Shirhussain/RTL-Blog-with-multiple-user
comment/tests/test_views.py
test_views.py
py
22,289
python
en
code
2
github-code
6
[ { "api_name": "comment.tests.base.BaseCommentViewTest", "line_number": 13, "usage_type": "name" }, { "api_name": "comment.models.Comment.objects.all", "line_number": 16, "usage_type": "call" }, { "api_name": "comment.models.Comment.objects", "line_number": 16, "usage_type...
72780266429
import onnx import numpy as np import onnxruntime as ort import tvm from tvm.contrib import graph_executor import tvm.auto_scheduler as auto_scheduler from tvm import relay, autotvm import tvm.relay.testing from tvm.autotvm.tuner import XGBTuner, GATuner, RandomTuner, GridSearchTuner model_encoder = "/home/xinyuwang/...
angry-crab/tvm_example
python/ansor.py
ansor.py
py
2,954
python
en
code
0
github-code
6
[ { "api_name": "onnx.load", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 23, "usage_type": "attribute" }, { "api_name": "tvm.relay.frontend.from_onnx"...
9309515906
from sklearn import svm import numpy as np import cv2 from autoCanny import auto_canny from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score train =[] label =[] for i in range(0,10): for j in range(1,3795): path = "hog/" + str(i) + "/" + "img (" + str(j) + ").jpg" ...
mervedadas/Optical-Character-Recognition
model.py
model.py
py
1,275
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 20,...
386804619
""" Created on Tue Nov 10 This program finds the solution to the system Ax = b and the LU factorization of A using the Doolittle method. Parameters ---------- A : Invertible matrix b : Constant vector Returns ------- x : Solution L : Factorization matrix L U : Factorization matriz U @author: Cesar Andres Garcia ...
jsperezsalazar2001/SADA_ANALYTICS
SADA_ANALYTICS/public/python/stepped.py
stepped.py
py
3,549
python
en
code
1
github-code
6
[ { "api_name": "numpy.set_printoptions", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
42166292211
#!/usr/bin/env python # coding: utf-8 # In[ ]: import numpy as np import cv2 import sys # In[ ]: def view_img(filepath): img = cv2.imread(filepath) window = cv2.namedWindow("Image Viewer", cv2.WINDOW_NORMAL) img = cv2.resize(img, (1080, 720)) cv2.imshow(window, img) cv2.waitKey() print("i...
ANSHAY/OpenCV
practice/scripts/view_img.py
view_img.py
py
605
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.WINDOW_NORMAL", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.resize", "l...
32909453379
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import m3u8 import os import sys from Crypto.Cipher import AES from multiprocessing import Pool import multiprocessing import requests import logging import threading import queue import aiohttp import asyncio import time from functools import wraps from concurrent.futures...
id10tttt/tools
m3u8_donwload.py
m3u8_donwload.py
py
9,424
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "asyncio.Semaphore", "line_number": 22, "usage_type": "call" }, { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_n...
3475871616
#!/bin/env python3 import requests import time import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np IP = "127.0.0.1" PORT = ":12345" url = "http://" + IP + PORT + "/cpu" response = requests.get(url) if response.ok: print ("%s" % (response.content)) else: response.raise_...
Antonito/cpp_gkrellm
scripts/cpu_load.py
cpu_load.py
py
829
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.py...
22904964205
import argparse from os.path import join from pathlib import Path import cv2 import numpy as np parser = argparse.ArgumentParser(description='This script creates points.txt and clusters.txt files for a given image.') parser.add_argument('--src_img', type=str, help='Path to the source image.') parser.add_argument('--...
markomih/kmeans_mapreduce
data_prep_scripts/data_prep.py
data_prep.py
py
1,652
python
en
code
41
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "pathlib.Path", "...
71749352509
import random from kafka import KafkaProducer producer = KafkaProducer(bootstrap_servers='0.0.0.0:9092') num = random.randint(0, 10) num_bytes = bytes(str(num), encoding='utf-8') is_send = producer.send('test-topic', value=num_bytes, key=num_bytes) # Block for 'synchronous' sends try: record_metadata = is_send....
makseli/kafka-docker-python
producer.py
producer.py
py
639
python
en
code
0
github-code
6
[ { "api_name": "kafka.KafkaProducer", "line_number": 4, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 6, "usage_type": "call" } ]
71483194428
import pyautogui as pgui import time # pgui.PAUSE = 2.5 pgui.FAILSAFE = True # positional variables // TO BE CHANGED IF REUSED, using mouse_pos.py export_position = 1250, 540 tab_delimited_file_position = 1304, 785 records_from_button_position = 1092, 724 records_from_button_position_first_box = 1207, 724 records_fro...
KnuxV/projet_transdisciplinaire
auto_clicker.py
auto_clicker.py
py
2,612
python
en
code
0
github-code
6
[ { "api_name": "pyautogui.FAILSAFE", "line_number": 5, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 31, "usage_type": "call" }, { "api_name": "pyautogui.click", "line_number": 32, "usage_type": "call" }, { "api_name": "pyautogui.click", ...
5033653307
from django.test import TestCase from django.contrib.auth.models import User from django.conf import settings from unittest.mock import Mock, patch from unittest import mock from twilio.rest import Client from help.models import Group, Event, UserProfile from help.forms import RegisterForm, UserForm, GroupForm, Contact...
davidbarat/P13
needhelp/help/tests/test_forms_models.py
test_forms_models.py
py
3,779
python
en
code
0
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 31, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 31, "us...
37182141846
from PyQt5.QtWidgets import QLabel, QWidget class DescriptionLabel(QLabel): def __init__(self, text: str, parent: QWidget): super().__init__(text, parent) self.setMaximumWidth(300) self.setWordWrap(True) self.setStyleSheet("QLabel{" "font-size: 8pt;}")
brankomilovanovic/Database-Handler
handlers/rel/mysql/Connection/UI/DescriptionLabel.py
DescriptionLabel.py
py
318
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 4, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 5, "usage_type": "name" } ]
18777180614
import base64 from io import BytesIO from flask import request # Get a Float parameter with name `name` from the request or # return the specified default value if it's absent def num(name, default=0): val = request.args.get(name) return float(float(val) if val is not None else default) # Get an...
Hitonoriol/MOND-PI
lab-10-endpoints/io_utils.py
io_utils.py
py
2,196
python
en
code
0
github-code
6
[ { "api_name": "flask.request.args.get", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.reque...
5480416527
import os import requests from bs4 import BeautifulSoup import re import sys import getopt user_agent = 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36' def get_music_data(url): """ 用于获取歌曲列表中的歌曲信息 """ headers = {'User-Agent':user_agent}...
haochen1204/Reptile_WYYmusic
pachong.py
pachong.py
py
3,850
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.exists", "line_numb...
74577178748
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('rest', '0001_initial'), ] operations = [ migrations.CreateModel( name='ImageLike', fields=[ ...
ayyoobimani/Cloth-server
hiCloth/hicloth/rest/migrations/0002_imagelike_tag_userimageaction_usertaglike.py
0002_imagelike_tag_userimageaction_usertaglike.py
py
2,196
python
en
code
0
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
22676201180
import mxnet as mx import numpy as np import importlib import os import pickle from sklearn import preprocessing from rmacRegions import rmac_regions if __name__ == '__main__': featureDim = { 'vgg16': 512, 'resnet18': 512, 'resnet101': 512, 'resnet152': 512, 'custom': 512 ...
juvu/ImageSearch
utils/genDatabase_RMAC.py
genDatabase_RMAC.py
py
2,141
python
en
code
null
github-code
6
[ { "api_name": "importlib.import_module", "line_number": 20, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 24, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.newaxis", "l...
37307665313
import tkinter as tk from tkinter import ttk import serial from time import sleep # Configure the serial port settings port = "/dev/ttyS0" baudrate = 9600 # Open the serial port ser = serial.Serial(port, baudrate) def on_FOTA_selected(): data=4 ser.write(bytes([data])) ser.flush() received=...
nadinfromc137/AutoSync-ACCwithFOTA
GUI/gui.py
gui.py
py
3,626
python
en
code
1
github-code
6
[ { "api_name": "serial.Serial", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 37, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 4...
811875796
# Substring with Concatenation of All Words - https://leetcode.com/problems/substring-with-concatenation-of-all-words/ '''You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and...
Saima-Chaity/Leetcode
Sliding_Window/SubstringWithConcatenationOfAllWords.py
SubstringWithConcatenationOfAllWords.py
py
1,493
python
en
code
0
github-code
6
[ { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" } ]
20544187876
from taskManager.plotting import * import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--log_path", type=str, required=True, help="Input TSV file path containing the output of ResourceMonitor" ) parser.add_argument( ...
rlorigro/TaskManager
bin/plot_resource_usage.py
plot_resource_usage.py
py
630
python
en
code
4
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" } ]
39253570970
from datetime import datetime from urllib.parse import urljoin import os import responses from django.conf import settings from django.test import TestCase from mangaki.models import (Work, WorkTitle, RelatedWork, Category, Genre, Language, ExtLanguage, Artist, Staff, Studio) from mangaki....
mangaki/mangaki
mangaki/mangaki/tests/test_anilist.py
test_anilist.py
py
11,533
python
en
code
137
github-code
6
[ { "api_name": "django.test.TestCase", "line_number": 17, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.conf.settings.T...
32603947460
from django.db import models from simple_history.models import HistoricalRecords from base.models.base import AuthBaseEntity from base.models.inventory import Inventory class Promotion(AuthBaseEntity): class Meta: ordering = ['-modified', '-created'] inventory = models.ForeignKey(Inventory, on_del...
SainezKimutai/test-capital
base/models/promotion.py
promotion.py
py
678
python
en
code
0
github-code
6
[ { "api_name": "base.models.base.AuthBaseEntity", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 14, "usage_type": "call" }, { "api_name": "base.models.inventory.Inventory", "line_number": 14, "usage_type": "argument" ...
22423126020
import streamlit as st import pandas as pd import numpy as np import pickle import librosa import csv import os from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import LabelEncoder #from audio_recorder_streamlit import audio_recorder # def predict_age(audio_bytes): # input = librosa.cor...
DirectorOfUnskillful/Music_Genre_Classification
app1.py
app1.py
py
7,405
python
en
code
0
github-code
6
[ { "api_name": "os.path.splitext", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "attribute" }, { "api_name": "csv.writer", "line_number": 50, "usage_type": "call" }, { "api_name": "librosa.load", "line_num...
44724952954
# !/usr/bin/python """Main File to embedd and SRT or ASS subtitle file into an MKV file.""" import os import sys from os.path import basename from mkv import mkv import argparse import time def initParser(): parser = argparse.ArgumentParser() parser.add_argument("inputMkv", type=argparse.FileType('r'), ...
voelkerb/matroskaPlotter
bakeSub.py
bakeSub.py
py
1,360
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 16, "usage_type": "call" }, { "api_name": "mkv.mkv.g...
7005065421
import logging import logging.config from huggingface_hub import HfApi from typing import Text, Optional from .config_parser import ConfigParser from .exceptions import TaskModelMismatchException logging_config_parser = ConfigParser('config/logging.yaml') logging.config.dictConfig(logging_config_parser.get_config_dic...
MinuraPunchihewa/hugging-py-face
hugging_py_face/base_api.py
base_api.py
py
1,024
python
en
code
1
github-code
6
[ { "api_name": "config_parser.ConfigParser", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.config.dictConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 10, "usage_type": "attribute" }, { "api_name"...
73554526269
from hw_asr.base import BaseModel import math import torch import torch.nn as nn import torch.nn.functional as F class MaskConv(nn.Module): def __init__(self, seq_module): super(MaskConv, self).__init__() self.seq_module = seq_module def forward(self, x, lengths): for module in self...
ArseniyBolotin/asr_project
hw_asr/model/deepspeech.py
deepspeech.py
py
4,068
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.BoolTensor", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.Module", "l...
69997908667
import requests try: import BeautifulSoup #python2 version = 2 except ImportError: import bs4 as BeautifulSoup #python3 version = 3 def get_people_by_url(url, recurse=False): response = requests.get(url) html = response.content if version == 2: soup = BeautifulSoup.BeautifulSoup(ht...
barryam3/MITpeople
MITpeople.py
MITpeople.py
py
2,696
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.Tag", "line_...
37273225181
from cc3d.core.PySteppables import * from cc3d.CompuCellSetup import persistent_globals as pg class ConstraintInitializerSteppable(SteppableBasePy): def __init__(self,frequency=1): SteppableBasePy.__init__(self,frequency) def start(self): for cell in self.cell_list: cell.targ...
SouKot/cc3d-scipyOptimize
Simulation/nutrient_stress_mitosisSteppables.py
nutrient_stress_mitosisSteppables.py
py
9,639
python
en
code
0
github-code
6
[ { "api_name": "cc3d.CompuCellSetup.persistent_globals.input_object", "line_number": 57, "usage_type": "attribute" }, { "api_name": "cc3d.CompuCellSetup.persistent_globals", "line_number": 57, "usage_type": "name" }, { "api_name": "cc3d.CompuCellSetup.persistent_globals.input_obje...
21666324114
#https://leetcode.com/problems/3sum/ from collections import defaultdict class Solution: #Fast and extremely clever solution, need to study this further to understand how it works def threeSum(self, nums: list[int]) -> list[list[int]]: negative = defaultdict(int) positive = defaultdict(int) ...
Adam-1776/Practice
DSA/3sum/solution.py
solution.py
py
2,243
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" } ]
36644827726
def log(message: str): with open('progress.log', 'a') as f: f.write(message+'\n') def log_broken_file(e, broken_filename: str): with open('broken_files.log', 'a') as f: f.write(broken_filename+'\n') f.write(str(e)+'\n') import os import json # import sys import random from datetime im...
AdrienSF/twitter-analysis
older/save_trained_lda.py
save_trained_lda.py
py
3,790
python
en
code
0
github-code
6
[ { "api_name": "nltk.download", "line_number": 20, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.date", "lin...
5290534852
# This file is part of Channel Capacity Estimator, # licenced under GNU GPL 3 (see file License.txt). # Homepage: http://pmbm.ippt.pan.pl/software/cce from collections import Counter import numpy as np import tensorflow.compat.v1 as tf tf.disable_v2_behavior() def weight_optimizer(neighb_count, labels) -> (float, l...
pawel-czyz/channel-capacity-estimator
cce/optimization.py
optimization.py
py
2,289
python
en
code
6
github-code
6
[ { "api_name": "tensorflow.compat.v1.disable_v2_behavior", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1", "line_number": 9, "usage_type": "name" }, { "api_name": "tensorflow.compat.v1.reset_default_graph", "line_number": 30, "usage_type": "...
21628349339
#!/usr/bin/python3 # this file contains the code to publish parsed messages to your system # currently there is only MQTT implemented, which can be configured in the central config import logging import paho.mqtt.publish #internal imports import config def is_interval_matched(dateTime): dateTime seconds = i...
aburgr/smartmeter-reader
publish.py
publish.py
py
1,793
python
en
code
14
github-code
6
[ { "api_name": "config.mqtt_publish_interval_seconds", "line_number": 14, "usage_type": "attribute" }, { "api_name": "config.mqtt_enabled", "line_number": 20, "usage_type": "attribute" }, { "api_name": "config.mqtt_topic_prefix", "line_number": 25, "usage_type": "attribute...
71859300669
''' Plotting Histograms and Scatter Plots for analysis Also makes and prints dataframes sorted by various statistics (see per_million) Makes a final csv file with relevant contribution stats ''' import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm import w...
fzyang1227/ds2000proj
graphs.py
graphs.py
py
5,649
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "m...
73761204349
import numpy as np from constants.constants import UNI, EXTENDED from utils.progress_bar import progress_bar def create(img:np.array, UNICODE=EXTENDED) -> str: res = "" for i,line in enumerate(img): progress_bar(i/img.shape[0]) for pixel in line: res += UNICODE[int(sum(pixel)/768*le...
carlospuenteg/Image-to-Unicode
create_txt.py
create_txt.py
py
363
python
en
code
9
github-code
6
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "attribute" }, { "api_name": "constants.constants.EXTENDED", "line_number": 5, "usage_type": "name" }, { "api_name": "utils.progress_bar.progress_bar", "line_number": 8, "usage_type": "call" }, { "api_na...
31672849616
''' from PyQt5 import QtCore, QtWidgets, QtGui from PyQt5.QtWebEngineWidgets import QWebEngineView from PyQt5.QtCore import QUrl xcept ImportError: print("PyQt5 is not installed") ''' from PySide2 import QtCore, QtWidgets, QtGui from PySide2.QtWebEngineWidgets import QWebEngineView from PySide2.QtCore import QUrl...
ArturW/Discovery
pydiscoveryt.py
pydiscoveryt.py
py
10,341
python
en
code
0
github-code
6
[ { "api_name": "socket.socket", "line_number": 35, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 35, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", "line_number": 35, "usage_type": "attribute" }, { "api_name": "socket.SOL_S...
367509253
import streamlit as st import pandas as pd import random from stqdm import stqdm df_64 = pd.read_csv("juyok_DB.csv", encoding='UTF8') df_est = pd.read_csv("juyok_DB_est.csv", encoding='UTF8') # st.write(df_64) st.markdown("## **당신의 이름은 무엇인가요?**") name = st.text_input("이름: ") st.markdown("## **당신의 성별은 무엇인가요?**") s...
baemsu/juyok
app.py
app.py
py
3,094
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 11, "usage_type": "call" }, { "api_name": "streamlit.text_input...
37016357191
#!/usr/bin/env python3 from __future__ import print_function import ase.io import sys import numpy as np if len(sys.argv) != 3: sys.stderr.write("Usage: %s model.so model_params < input.xyz\n" % sys.argv[0]) sys.exit(1) at = ase.io.read(sys.stdin, format="extxyz") import fortranMCMDpy FORTRAN_model = sys.a...
libAtoms/pymatnest
test_fortran_model.py
test_fortran_model.py
py
1,204
python
en
code
26
github-code
6
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_nu...
12477052664
from cProfile import label from multiprocessing.sharedctypes import Value from re import T from typing import Dict, List, Optional, Tuple import torch import matplotlib.pyplot as plt import matplotlib.ticker as mticker import transformers import numpy as np import random import argparse from collections import default...
mariopenglee/llm-metalearning
src/submission/icl.py
icl.py
py
11,435
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.backends.mps.is_available", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.backends", "line_number": 23, "usage_type": "attribute" }, { "api_name": "t...
19235406042
from dash import dcc, html, dash_table import config import sites import numpy as np import pandas as pd def call_layout(site_config): layout = html.Div([ html.Div(id='dash-header', children=[ html.H1(children=config.title), html.H3(children=dcc.M...
fenggroup/bike-traffic-plotly-dash
layouts.py
layouts.py
py
9,242
python
en
code
5
github-code
6
[ { "api_name": "dash.html.Div", "line_number": 10, "usage_type": "call" }, { "api_name": "dash.html", "line_number": 10, "usage_type": "name" }, { "api_name": "dash.html.Div", "line_number": 12, "usage_type": "call" }, { "api_name": "dash.html", "line_number": ...
1919214297
from lxml import etree import requests import pymysql def getdel(): url = 'https://book.douban.com/top250' data = requests.get(url).text s=etree.HTML(data) file=s.xpath('//*[@id="content"]/div/div[1]/div/table/tr/td[2]/div[1]/a/@title') print(file) return fil...
cxzw/python--
16219111435/席子文爬虫作业/静态爬虫.py
静态爬虫.py
py
601
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 7, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 7, "usage_type": "name" }, { "api_name": "pymysql.connect", "line_numb...
43371076004
import requests from bs4 import BeautifulSoup import os def get_book(url): response = requests.get(url) response.encoding = "utf-8" text = response.text soup = BeautifulSoup(text) div_show = soup.select("div.dirShow")[0] # print(div_show) dirs = div_show.select("li a") count = len(dir...
frebudd/python
book_spider.py
book_spider.py
py
1,460
python
en
code
2
github-code
6
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "l...
37276060555
import torch import numpy as np import torch.nn.functional as F import torch.nn as nn from torch.nn.modules.utils import _pair, _quadruple import math class MedianPool2d(nn.Module): """ Median pool (usable as median filter when stride=1) module. Args: kernel_size: size of pooling kernel, int or 2...
yeongjoonJu/CFR-GAN
tools/ops.py
ops.py
py
9,407
python
en
code
74
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.modules.utils._pair", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn.mod...
5264982546
#!<path_from_which_python_command> import sys import os from datetime import date import datetime import pkgutil import os import shutil import subprocess import time import urllib.request # To download files from tkinter import Tk, ttk # Download bar import zipfile from pathlib import Path import urllib.request as req...
gomuG/ROMiner
gUtil.py
gUtil.py
py
10,668
python
en
code
1
github-code
6
[ { "api_name": "CustomLogger.logger", "line_number": 19, "usage_type": "attribute" }, { "api_name": "urllib.request.get", "line_number": 44, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 44, "usage_type": "name" }, { "api_name": "requests.g...
22047012801
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import RangeSlider import pims def gui(input_img): # read in an image, usually np.array kind. This one will be a stack of images # Initialize the frame number to be zero, since array indexing frame = 0 img = input_img fig, axs = pl...
kzhang425/PyImgTracker
gui_plots.py
gui_plots.py
py
1,454
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots_adjust", "line_number": 13, "usage_type": "call" }, { "ap...
6841379030
import itertools from collections import OrderedDict import nltk from spellchecker import SpellChecker from nltk.corpus import wordnet as wn from ranker import Ranker #import utils """ search engine for spell checker """ # DO NOT MODIFY CLASS NAME class Searcher: # DO NOT MODIFY THIS SIGNATURE # You can change...
hallelhel/Search_Engine
searcher_4.py
searcher_4.py
py
4,158
python
en
code
0
github-code
6
[ { "api_name": "ranker.Ranker", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 50, "usage_type": "call" }, { "api_name": "itertools.islice", "line_number": 51, "usage_type": "call" }, { "api_name": "spellchecker.S...
3200668360
import rodMassParam as P import matplotlib.pyplot as plt from control import TransferFunction as tf import control as cnt import numpy as np import rodMassParam as P # ----------- noise specification -------- # attenuate noise above omega_n by gamma_n def add_spec_noise(gamma, omega, flag): w = np.logspace(np.log1...
mebach/me431
homework_template_folders/homework_template_folders/practice_final/python/loopshape_rodMass.py
loopshape_rodMass.py
py
6,465
python
en
code
0
github-code
6
[ { "api_name": "numpy.logspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.log10", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...