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
23784462396
import cocotb from cocotb.clock import Clock from cocotb.triggers import FallingEdge ,Timer,RisingEdge,ClockCycles from cocotb.queue import QueueEmpty, Queue import enum import logging import random import pandas as pd from pyuvm import utility_classes def get_int(signal): try: sig = int(signal.value) except Valu...
merldsu/PY_UVM_Framework
framework/BFM_RV32.py
BFM_RV32.py
py
3,472
python
en
code
29
github-code
6
[ { "api_name": "pyuvm.utility_classes.Singleton", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pyuvm.utility_classes", "line_number": 22, "usage_type": "name" }, { "api_name": "cocotb.top", "line_number": 25, "usage_type": "attribute" }, { "api_na...
31974019327
import numpy as np import matplotlib.pyplot as plt import json p1 = 0 p2 = 0 lr = 0.05 epochs = 4001 data = np.genfromtxt('data.csv', delimiter = ',') x_data = data[1: , 0] max_xdata = np.max(x_data) min_xdata = np.min(x_data) max_min_xdata = max_xdata - min_xdata x_data_n = (x_data - min_xdata) / max_min...
jessie-ydf/ft_linear_regression
training.py
training.py
py
2,322
python
en
code
0
github-code
6
[ { "api_name": "numpy.genfromtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 16...
70512193789
#! /usr/env/bin python """ Exercise 7.7 from Sutton and Barto "Reinforcement Learning" The goal is to empirically demonstrate the advantage of using replacing traces on a problem where you always want to move "right" rather than stay in the same place. The issue is that accumulating traces can bias you towards stayi...
clorenz7/corcore
RL_Exercises/right_wrong_replace_trace.py
right_wrong_replace_trace.py
py
8,352
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 104, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 138, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 148, "usage_type": "call" }, { "api_name": "random.random", "line_numb...
10630071825
import os.path import multiprocessing import sys import time import pytest from nengo.utils.lock import FileLock, TimeoutError def acquire_lock(filename): lock = FileLock(filename, timeout=0.01, poll=0.01) try: lock.acquire() except TimeoutError: sys.exit(0) else: sys.exit(1)...
Kanaderu/Neural-Networks
nengo-master/nengo/utils/tests/test_lock.py
test_lock.py
py
2,298
python
en
code
0
github-code
6
[ { "api_name": "nengo.utils.lock.FileLock", "line_number": 12, "usage_type": "call" }, { "api_name": "nengo.utils.lock.TimeoutError", "line_number": 15, "usage_type": "name" }, { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "sys....
73963284988
try: import matplotlib matplotlib.use('Agg') from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt except ImportError: plt = None import numpy as np import pandas as pd import os import click # in_files = "/project/workflow/results/metaphlan_profiles/" # files_path =...
singjc/MetagenPipe
src/preprocessing/report.py
report.py
py
3,789
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 18, "usage_type": "call" }, { "api_name": "click.echo", "line_numbe...
5034565214
from discord.ext import commands from .utils import checks import discord import inspect # to expose to the eval command import datetime from collections import Counter class Admin: """Admin-only commands that make the bot dynamic.""" def __init__(self, bot): self.bot = bot @commands.command(hid...
louissmokesbackwoods/Inkxbot
Inkxbotcogs/admin.py
admin.py
py
3,346
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.command", "line_number": 16, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 16, "usage_type": "name" }, { "api_name": "utils.checks.is_owner", "line_number": 17, "usage_type": "call" }, { "api_name"...
25442449161
from itertools import chain from . import resource class Theme(object): def __init__(self): self._styles = {} def set(self, class_name, state, key, value): self._styles.setdefault(class_name, {}).setdefault(state, {}) self._styles[class_name][state][key] = value def get_dict_for_class(self, class_name, stat...
jwayneroth/mpd-touch
pygameui/theme.py
theme.py
py
1,512
python
en
code
5
github-code
6
[ { "api_name": "itertools.chain", "line_number": 41, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 44, "usage_type": "call" } ]
42740297790
import numpy as np import cv2 h, w = 300, 300 canvas = np.zeros((h, w, 3), dtype="uint8") red = (0, 0, 255) black = (0, 0, 0) green = (0, 255, 0) for i in range(0, h, 10): for j in range(0, w, 10): if (i+j) % 2 == 1: cv2.rectangle(canvas, (10*i, 10*j), (10*i+10, 10*j+10), red, -1) cv2.circle(...
jah05/OpenCVPractice
checkers.py
checkers.py
py
401
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 1...
4977114838
#!/usr/bin/env python3 import argparse import os from pathlib import Path if __name__ == "__main__": parser = argparse.ArgumentParser(description="article scraper") parser.add_argument("--dataset", "-d", help="the dataset to be made after articles are scraped (choices: 3000, 5000)", default="...
avila-bugayong-esguerra/article-scraper
article_scraper/main.py
main.py
py
1,057
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "os.system", "line_n...
11098729055
#! env python3 from spider import * import psycopg2 import os isbns = os.getenv('ISBNS','').split(';') CONN_STR = os.getenv('CONN_STR','host=localhost port=5432') def main(): with psycopg2.connect(CONN_STR) as c: print('begin to fetch') for isbn in isbns: print('fetch: ' + isbn) try: fe...
XDU-PurpleBear/database
pb-isbn/src/run.py
run.py
py
527
python
en
code
0
github-code
6
[ { "api_name": "os.getenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "psycopg2.IntegrityError", "lin...
13109993516
from stock_model import stock_model from datetime import date if __name__ == '__main__': stock_list_file = open("stock_list.txt", "r") stock_list = stock_list_file.read().split("\n") stock_list_file.close() start_date = "2012-01-01" today = str(date.today()) #yeasterday = today #yeaster...
39xdgy/stock_prediction
random_file/main_US.py
main_US.py
py
792
python
en
code
0
github-code
6
[ { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "name" }, { "api_name": "stock_model.stock_model", "line_number": 22, "usage_type": "call" } ]
15087479880
import yt_dlp import os yt_base_url = "./yt/" MAX_VIDEO_DURATION = 360 # in seconds, 6 minutes atm def check_base_dir(): if not os.path.exists(yt_base_url): os.makedirs(yt_base_url) def clear_yt(): check_base_dir() for file in os.listdir(yt_base_url): os.remove(os.path.jo...
Wikijito7/ECIBot
youtube.py
youtube.py
py
1,441
python
en
code
3
github-code
6
[ { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number":...
94000924
import os import vlc import numpy as np import time from RPLCD.gpio import CharLCD import RPi.GPIO as GPIO import threading class Xwing: def __init__(self, label): self.label = label self.song_playing = False if (label == "music"): # make sure DigiAmp+ is unmuted ...
bsmigs/HalloweenXWing_2023
source_code/xwing.py
xwing.py
py
4,488
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 29, "usage_type": "call" }, { "api_name": "vlc.MediaPlayer", "line_number": 48, "usage_type": "call" }, { "api_name": "vlc.MediaPlayer", "line_number": 55, "usage_type": "call" }, { "api_name": "vlc.State", "line_numb...
4534790116
#!/usr/bin/env python # -*- coding: UTF-8 -*- # REF [site] >> https://www.nltk.org/ import nltk from collections import defaultdict # REF [site] >> # https://pythonspot.com/category/nltk/ # https://data-flair.training/blogs/nltk-python-tutorial/ def simple_example(): # Tokenization. sentence = """At eight o'clock ...
sangwook236/SWDT
sw_dev/python/rnd/test/language_processing/nltk_test.py
nltk_test.py
py
9,256
python
en
code
17
github-code
6
[ { "api_name": "nltk.word_tokenize", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.sent_tokenize", "line_number": 24, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 31, "usage_type": "call" }, { "api_name": "nlt...
73708252667
import logging from loguru import logger FORMAT = '[%(asctime)-5s]%(thread)s %(levelname)s::%(funcName)-8s > %(message)s' import sys logger.remove() logger.add(sys.stdout, format="<d>[{time:HH:mm:ss,SS}]</> \ <e>{thread.name}</>:<lvl>{level}</lvl>\t|\ {function}> {message}" ) log = logger
danlkv/ev-reduce
ev_reduce/helpers/logging.py
logging.py
py
302
python
en
code
0
github-code
6
[ { "api_name": "loguru.logger.remove", "line_number": 7, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 7, "usage_type": "name" }, { "api_name": "loguru.logger.add", "line_number": 8, "usage_type": "call" }, { "api_name": "loguru.logger", ...
27063193057
from rest_framework.views import APIView from .models import User , Message from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from .serializers import UserSerializer from django.core import serializers class Signup(APIView): serializer_class = UserSerializer ...
mchoopani/Chat-Server
chat/views.py
views.py
py
2,011
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.views.APIView", "line_number": 9, "usage_type": "name" }, { "api_name": "serializers.UserSerializer", "line_number": 10, "usage_type": "name" }, { "api_name": "models.User.objects.create", "line_number": 14, "usage_type": "call" }, { ...
39540680050
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 17 2021 @author: sagrana """ import datetime import uuid from django.test import Client import json from rest_framework import status from rest_framework.test import APITestCase from users.models import User from issues.models import Issue from proj...
theRuthless/stark_ly3000_web_app
backend/sprints/tests.py
tests.py
py
10,334
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.test.APITestCase", "line_number": 21, "usage_type": "name" }, { "api_name": "users.models.User.objects.create_user", "line_number": 28, "usage_type": "call" }, { "api_name": "users.models.User.objects", "line_number": 28, "usage_type": "attri...
11082029424
#!/usr/bin/python2.7 # coding: utf-8 import cv2 import numpy as np print('######### USER INPUT - IMAGE FILE NAME (without extension) ##############') choix_image = raw_input('-->') print('######### IMAGE FILE EXTENSION ###########') image_extension = raw_input('-->') img = cv2.imread(choix_image + image_extension,...
GNETWVS/underwater_image_processing
contrast_stretching.py
contrast_stretching.py
py
1,912
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 20,...
75136415547
import logging import os import time from typing import Optional import attr import tgalice import yaml from tgalice.cascade import Cascade from tgalice.dialog import Response, Context from tgalice.interfaces.yandex import extract_yandex_forms from tgalice.nlu.basic_nlu import like_help, fast_normalize from tgalice.n...
avidale/alice-stretching
dm.py
dm.py
py
3,110
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 22, "usage_type": "call" }, { "api_name": "tgalice.dialog_manager", "line_number": 25, "usage_type": "attribute" }, { "api_name": "tgalice.cascade.Cascade", "line_number": 26, "usage_type": "name" }, { "api_name": ...
30099401368
import functools import imaplib import itertools import select import socket import sys import re import warnings from collections import namedtuple from datetime import datetime, date from operator import itemgetter from logging import LoggerAdapter, getLogger from . import exceptions from . import imap4 from . impor...
mjs/imapclient
imapclient/imapclient.py
imapclient.py
py
73,027
python
en
code
466
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "imaplib.Commands", "line_number": 45, "usage_type": "attribute" }, { "api_name": "imaplib.Commands", "line_number": 46, "usage_type": "attribute" }, { "api_name": "imaplib...
18485856372
import time import logging import sounddevice import wave import numpy from math import log10 from bme280 import BME280 from pms5003 import PMS5003, ReadTimeoutError from enviroplus import gas from enviroplus.noise import Noise # TODO: erase that numpy requirement # ? weather sensor try: from smbus2 import SMBus ...
BurnoutDV/AirWatcher
air_watcher/sensors.py
sensors.py
py
11,247
python
en
code
0
github-code
6
[ { "api_name": "ltr559.LTR559", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "pms5003.PMS5003", "line_number": 38, "usage_type": "call" }, { "api_name": "smbus.SMBus", "li...
30046849528
from flask import Flask, render_template, redirect, url_for, request from flask_bootstrap import Bootstrap5 from flask_sqlalchemy import SQLAlchemy from flask_wtf import FlaskForm from wtforms import StringField, SubmitField from wtforms.validators import DataRequired import requests API_KEY = '273e34bfdd0c7164d3bf366...
CmoonC/TheTopMovies
main.py
main.py
py
5,221
python
en
code
0
github-code
6
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 35, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap5", "line_number": 38, "usage_type": "call" }, { "api_name": "fl...
31312083023
import cv2 import numpy as np import glob def crop_image(img): w, h, c = img.shape center = w/2 b, g, r = cv2.split(img) y, x = np.where((b > 20) & (g > 20) & (r > 20)) minimum_x = x[x == x.min()][0] minimum_y = y[y == y.min()][0] maximum_x = x[x == x.max()][0] maximum_y = y[y == y.max...
SMesForoush/ComputerVision
RA/move to center.py
move to center.py
py
1,141
python
en
code
0
github-code
6
[ { "api_name": "cv2.split", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 26, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 28, ...
9087649972
"""create comment Revision ID: cec7c1d94730 Revises: 5a58f2b40c8a Create Date: 2023-06-04 15:42:57.197975 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'cec7c1d94730' down_revision = '5a58f2b40c8a' branch_labels = None depends_on = None def upgrade() -> Non...
StasMyronenko/barter
migrations/versions/cec7c1d94730_create_comment.py
cec7c1d94730_create_comment.py
py
996
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
29477906576
import os from flask import Flask, request, render_template from azure.appconfiguration.provider import load, SettingSelector from azure.identity import DefaultAzureCredential from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient app = Flask(__name__) app.config['TEMPLATES_AUTO_RELOAD'] = Tru...
ChrisPolewiak/waf-testing-webapp
app.py
app.py
py
2,397
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "azure.storage.blob.BlobServiceClient", "line_number": 13, "usage_type": "call" }, { "api_name": "azure.identity.DefaultAzureCredential", "line_number": 13, "usage_type": "call" }, { ...
22493060526
import logging from pathlib import Path from collections import namedtuple from yapsy.IPlugin import IPlugin from raat.boards.serial.serial0 import Serial0 from raat.boards.nonvolatile.EEPROM.EEPROM import EEPROM from raat.boards.generic_board import GenericBoard THIS_PATH = Path(__file__).parent TEMPLATE = THIS_...
cryptologyrooms/raat
raat/boards/uno_etc/uno.py
uno.py
py
1,826
python
en
code
null
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "raat.boards.generic_board.GenericBoard", "line_number": 19, "usage_type": "name" }, { "api_name": "collections.namedtuple", "line_number": 20, "usage_type": "call" }, { "api_na...
22877663280
import json from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse from student.models import Student from courses.models import Course # Create your views here. def index(request): return HttpResponse('student page') def get_course_names(student): courses = student.courses....
vitchyr/ShyGuyHack
student/views.py
views.py
py
1,848
python
en
code
1
github-code
6
[ { "api_name": "django.http.HttpResponse", "line_number": 11, "usage_type": "call" }, { "api_name": "courses.models", "line_number": 14, "usage_type": "name" }, { "api_name": "student.models.courses.all", "line_number": 14, "usage_type": "call" }, { "api_name": "st...
42468553986
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import math from recommendersystem.conv import GeneralConv class MyRec(nn.Module): def __init__(self, config): super().__init__() self.feedback_aggregate = config.feedback_aggregate self.layer_aggregate = ...
henrykasim/CS6101_CRS
recommendersystem/myrecmodel.py
myrecmodel.py
py
9,267
python
en
code
0
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.Embedding", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
35135673173
from rest_framework import serializers from django_currentuser.middleware import get_current_authenticated_user from .models import * class TodoSerializer(serializers.ModelSerializer): class Meta: model = todo fields = '__all__' def create(self, validated_data): modelObject = sup...
EmonChow/coding_task
tasks/serializers.py
serializers.py
py
849
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "django_currentuser.middleware.get_current_authenticated_user", "line...
16645097369
# !/usr/bin/python # -*- coding: utf-8 -*- """ __author__ = 'qing.li' """ # 读取ini文件的工具类 import configparser class ReadIni: def __init__(self, file_path=None): if not file_path: self.file_path = "/Users/qing.li/PycharmProjects/AppiumPython/config/LocalElemnt.ini" else: self....
QingqinLi/ui_project
util/read_ini.py
read_ini.py
py
852
python
en
code
0
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 19, "usage_type": "call" } ]
38673800582
# -*- coding: UTF-8 -*- # # Ambiente de desemvolvimento: # # Dados dos ultimos registros de terremotos no mundo. # # url: http://monitorglobal.com.br/terremotos.html # # Referencia: # # $ conda activate \__CondaVirtual\pytr37 # $ code . # $ conda deactivate #...
neviim/terremotos
src/terremotos.py
terremotos.py
py
11,409
python
pt
code
0
github-code
6
[ { "api_name": "hashlib.md5", "line_number": 67, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 81, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 92, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "lin...
40634961285
# importing libraries import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split, cross_val_score from sklearn.metrics import mean_squared_error, mean_absolute_error pd.set_...
afatsumcemreg/machine_learning
01_linear_regression.py
01_linear_regression.py
py
3,312
python
en
code
2
github-code
6
[ { "api_name": "pandas.set_option", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" }, { "api_na...
10074581495
#!/usr/bin/env python import numpy as np def getEqns(N): """ String representations of equations to solve for N external particles. """ for i in reversed(range(2, N)): print("r_{} = {}u^{} - {}u^{}".format(i-1, N-i+1, N-i, N-i, N-i+1)) def mkData(N, npoint=100): U=np.linspace(0,1,npoint...
iamholger/flatmc
uterms.py
uterms.py
py
3,044
python
en
code
3
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.p...
35395917283
from hashlib import sha1, sha256 from typing import TYPE_CHECKING, Optional, cast from .kex import Kex, register_kex_alg from .misc import HashType, KeyExchangeFailed, ProtocolError from .misc import get_symbol_names, randrange from .packet import MPInt, String, SSHPacket from .public_key import KeyImportError, SSHKey...
ronf/asyncssh
asyncssh/kex_rsa.py
kex_rsa.py
py
5,209
python
en
code
1,408
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 13, "usage_type": "name" }, { "api_name": "kex.Kex", "line_number": 25, "usage_type": "name" }, { "api_name": "misc.get_symbol_names", "line_number": 28, "usage_type": "call" }, { "api_name": "misc.HashType", ...
35504552982
from typing import Protocol import pandas as pd import sofascore class Adapter(Protocol): def compute_sofa_score(self, patient_id, time) -> int: """Computes the SOFA score based on the patient's condition.""" condition = self._condition(patient_id, time) return sofascore.compute(conditi...
shimst3r/sofascore
sofascore/adapters.py
adapters.py
py
2,468
python
en
code
0
github-code
6
[ { "api_name": "typing.Protocol", "line_number": 8, "usage_type": "name" }, { "api_name": "sofascore.compute", "line_number": 13, "usage_type": "call" }, { "api_name": "sofascore.Condition", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pandas.read...
12921889955
# import the necessary packages from picamera.array import PiRGBArray from picamera import PiCamera import time import cv2 import numpy as np from allgo_utils import PCA9685,ultrasonic,ir_sens import wiringpi as wp camera = PiCamera() camera.resolution = (320, 240) camera.framerate = 10 rawCapture = PiRGBArray(camera...
IsmoilovMuhriddin/allgo
rasp/autocar.py
autocar.py
py
9,333
python
en
code
7
github-code
6
[ { "api_name": "picamera.PiCamera", "line_number": 10, "usage_type": "call" }, { "api_name": "picamera.array.PiRGBArray", "line_number": 13, "usage_type": "call" }, { "api_name": "wiringpi.OUTPUT", "line_number": 36, "usage_type": "attribute" }, { "api_name": "wiri...
6091786208
from flask import Blueprint, jsonify, request from models.haiku import Haiku, HaikuSchema, CommentSchema, Comment from lib.secure_route import secure_route api = Blueprint('haikus', __name__) haiku_schema = HaikuSchema() comment_schema = CommentSchema() @api.route('/haikus/<int:haiku_id>', methods=['GET']) def show...
Lily-La-Day/haiku-who
controllers/haikus.py
haikus.py
py
2,306
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "models.haiku.HaikuSchema", "line_number": 6, "usage_type": "call" }, { "api_name": "models.haiku.CommentSchema", "line_number": 7, "usage_type": "call" }, { "api_name": "mode...
3063551103
import json from config import PATH_POSTS, PATH_COMMENTS from json import JSONDecodeError def get_posts_all(): """Возвращает все посты из файла posts.json""" try: with open(PATH_POSTS, "r", encoding="utf-8") as file: posts = json.load(file) return posts except FileNotFoundError: raise ValueError("Файл p...
Grich77785/Coursework_3
Coursework_3/utils.py
utils.py
py
2,534
python
ru
code
0
github-code
6
[ { "api_name": "config.PATH_POSTS", "line_number": 10, "usage_type": "argument" }, { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "json.JSONDecodeError", "line_number": 15, "usage_type": "name" }, { "api_name": "config.PATH_COMM...
43242854461
from preggy import expect from tornado.testing import gen_test from tests.base import TestCase from thumbor.context import RequestParameters from thumbor.result_storages.no_storage import Storage as NoStorage class NoResultStorageTestCase(TestCase): def get_context(self): ctx = super().get_context() ...
thumbor/thumbor
tests/result_storages/test_no_storage.py
test_no_storage.py
py
780
python
en
code
9,707
github-code
6
[ { "api_name": "tests.base.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "thumbor.context.RequestParameters", "line_number": 12, "usage_type": "call" }, { "api_name": "thumbor.result_storages.no_storage.Storage", "line_number": 18, "usage_type": "call"...
24249146395
import os, csv, glob, datetime # set working dir os.chdir('/gscmnt/gc2783/qc/topmed_assay/') # set date mm_dd_yy = datetime.datetime.now().strftime("%m%d%y") # create status header field list ccdg_qc_outfile_header = ['QC Sample', 'WOID', 'PSE', 'Launch Status', 'Launch Date', 'Instrument Check', ...
awollam/Afib_qc
tm_afib_cat.py
tm_afib_cat.py
py
7,133
python
en
code
1
github-code
6
[ { "api_name": "os.chdir", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.isfile", ...
7436745862
""" Script that deletes Old Bird detector clips that have no start indices. The original Old Bird detectors include only approximate start times in the names of the clip files they create. To find the precise start time of a clip in its parent recording we must search for the samples of the clip in the recording. Some...
HaroldMills/Vesper
scripts/delete_old_bird_clips_without_start_indices.py
delete_old_bird_clips_without_start_indices.py
py
1,875
python
en
code
47
github-code
6
[ { "api_name": "vesper.util.django_utils.set_up_django", "line_number": 22, "usage_type": "call" }, { "api_name": "vesper.util.django_utils", "line_number": 22, "usage_type": "name" }, { "api_name": "django.db.transaction.atomic", "line_number": 37, "usage_type": "call" ...
21987171176
import pytest @pytest.fixture(name="fixer") def fixer_fixture(two_to_three_test_case): return two_to_three_test_case("intern") def test_prefix_preservation(fixer): b = """x = intern( a )""" a = """import sys\nx = sys.intern( a )""" fixer.check(b, a) b = """y = intern("b" # test ...
ryanwersal/crosswind
fixer_suites/two_to_three/tests/test_intern.py
test_intern.py
py
1,201
python
en
code
11
github-code
6
[ { "api_name": "pytest.fixture", "line_number": 4, "usage_type": "call" } ]
40982867104
from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from time import sleep driver = webdriver.Chrome() driver.get('https://www.google.com.tw/?gfe_rd=cr&ei=iMauVqrHMcGG2QSF26OABA&gws_rd=ssl') enter_email = driver.find_element_by_id('gb_70') ActionChains(driver).click(enter_e...
aeabom741/Web_automatic_test_selenium
ch04_獲得驗證資訊.py
ch04_獲得驗證資訊.py
py
626
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 5, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.action_chains.ActionChains", "line_number": 9, "usage_type": "call" ...
27455731305
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import gym from drl_test_model.run import run def drl_test(): # Use a breakpoint in the code line below to debug your s...
mayuting11/Newcastleyuting
drl_test/main.py
main.py
py
581
python
en
code
0
github-code
6
[ { "api_name": "gym.make", "line_number": 10, "usage_type": "call" }, { "api_name": "drl_test_model.run.run", "line_number": 11, "usage_type": "call" } ]
44900136453
import argparse,os,glob,re,json def process(args): print(args) model_path = "./models/"+args.name out_path = "./output/"+args.name os.system("mkdir -p "+ out_path) if args.decoder is None: decoder = max(glob.iglob(os.path.join(model_path,'decoder*')), key=os.path.getctime) else: ...
Jarlene/sketchnet
process_samples.py
process_samples.py
py
3,545
python
en
code
0
github-code
6
[ { "api_name": "os.system", "line_number": 6, "usage_type": "call" }, { "api_name": "glob.iglob", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "u...
72098223228
# python 3 # highter_lower game : entertainment from game_data import data import art import random from replit import clear import time person_a = random.choice(data) score = 0 while True: person_b = random.choice(data) # to avoid choosing the same person while person_a == person_b : person_b = random.ch...
jolliebonnie/Mini-programs
Higher-lower game/higher_lower.py
higher_lower.py
py
1,046
python
en
code
0
github-code
6
[ { "api_name": "random.choice", "line_number": 9, "usage_type": "call" }, { "api_name": "game_data.data", "line_number": 9, "usage_type": "argument" }, { "api_name": "random.choice", "line_number": 13, "usage_type": "call" }, { "api_name": "game_data.data", "li...
72259701948
import os import celery os.environ.setdefault("DJANGO_SETTINGS_MODULE", "validatr.api.settings") celery_app = celery.Celery("validatr") celery_app.config_from_object( "django.conf:settings", namespace="validatr", ), celery_app.autodiscover_tasks()
functionss/validatr
validatr/celery.py
celery.py
py
260
python
en
code
0
github-code
6
[ { "api_name": "os.environ.setdefault", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "celery.Celery", "line_number": 7, "usage_type": "call" } ]
38036071592
""" Module defining io functions. """ from typing import Any, Dict import numpy as np from monty.serialization import dumpfn, loadfn from amset.util import cast_dict_list, logger, validate_settings __author__ = "Alex Ganose" __maintainer__ = "Alex Ganose" __email__ = "aganose@lbl.gov" def write_settings(settings:...
hackingmaterials/amset
amset/io.py
io.py
py
3,350
python
en
code
110
github-code
6
[ { "api_name": "typing.Dict", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 17, "usage_type": "name" }, { "api_name": "amset.util.cast_dict_list", "line_number": 24, "usage_type": "call" }, { "api_name": "monty.serialization....
43726602541
import torch import torch.nn as nn import math # To compute the posterior predictive probability # The factor lambda is often set to either pi/8 or 3/pi^2 def mean_field_logits(logits, pred_cov, mean_field_factor): logits_scale = torch.sqrt(1.0 + torch.diag(pred_cov) * mean_field_factor) logits = logits / logi...
Juntae-Kwon/sngp
utils.py
utils.py
py
783
python
en
code
0
github-code
6
[ { "api_name": "torch.sqrt", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.diag", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn.Linear", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 14,...
25991185021
from git import Repo from git.remote import FetchInfo from git.exc import GitCommandError import os import platform import shutil from pathlib import Path, PurePosixPath, PureWindowsPath class GitManager: def __init__(self, local, remote=None): self.local = local self.remote = remote if ...
BiBiM-BoB/back-end
app/utils/BJW/utils/Git_manager.py
Git_manager.py
py
2,671
python
en
code
1
github-code
6
[ { "api_name": "platform.system", "line_number": 16, "usage_type": "call" }, { "api_name": "pathlib.PurePosixPath", "line_number": 17, "usage_type": "call" }, { "api_name": "pathlib.PureWindowsPath", "line_number": 19, "usage_type": "call" }, { "api_name": "git.Rep...
43125333631
from .base_dist import BaseDist import torch import numpy as np import queue import ctypes flood_fill_ll = ctypes.CDLL("./criterions/c/flood_fill.so") flood_fill_ll.flood_fill.restype = ctypes.c_float ''' res_int = adder.add_int(4,5) print("result: " + str(res_int)) ''' def flood_fill(_fake, _real): _fake, _real ...
mhy12345/Chinese-Character-Style-Transfer
criterions/flood_dist.py
flood_dist.py
py
1,960
python
en
code
23
github-code
6
[ { "api_name": "ctypes.CDLL", "line_number": 6, "usage_type": "call" }, { "api_name": "ctypes.c_float", "line_number": 7, "usage_type": "attribute" }, { "api_name": "ctypes.POINTER", "line_number": 16, "usage_type": "call" }, { "api_name": "ctypes.c_float", "li...
30783828943
from typing import NamedTuple, List from enum import Enum from collections import deque, defaultdict class Opcode(Enum): ADD = 1 MULTIPLY = 2 STORE_INPUT = 3 SEND_TO_OUTPUT = 4 JUMP_IF_TRUE = 5 JUMP_IF_FALSE = 6 LESS_THAN = 7 EQUALS = 8 ADJUST_RELATIVE_BASE = 9 PROGRAM_HAL...
giordafrancis/adventofcode2019
intcode.py
intcode.py
py
5,646
python
en
code
0
github-code
6
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.NamedTuple", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.List", "line_number...
38836844240
import io import requests import validators from PIL import Image from datetime import datetime from PyQt5.QtCore import QDate from PyQt5.QtGui import QImage, QPixmap, QPalette, QColor from PyQt5.QtWidgets import * from gui.private_list.private_list_modified import Private_List_Modified from service.service import Se...
Sipos-Lucas-George/Destination-Bucket-List
gui/private_list/private_list_backend.py
private_list_backend.py
py
9,349
python
en
code
0
github-code
6
[ { "api_name": "gui.private_list.private_list_modified.Private_List_Modified", "line_number": 16, "usage_type": "name" }, { "api_name": "service.service.Service", "line_number": 17, "usage_type": "name" }, { "api_name": "service.service", "line_number": 20, "usage_type": "...
21333385390
from django.shortcuts import render from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect from django.urls import reverse from django.views import generic from django.utils import timezone from django.http import HttpResponse from django import forms from django.core.excep...
consultant-nursing-2017/tnai
exam/views.py
views.py
py
21,983
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.get_user", "line_number": 64, "usage_type": "call" }, { "api_name": "django.contrib.auth", "line_number": 64, "usage_type": "name" }, { "api_name": "ra.models", "line_number": 66, "usage_type": "name" }, { "api_name": "ra.models....
28323358463
import datetime import csv import urllib.request from copy import deepcopy from django.utils.translation import ugettext_lazy as _ from .models import DayType class WorkCalendarParser: """Анализирует набор в csv формате содержащий производственный календарь. """ # Поддерживаемые языки languages ...
crowmurk/mallenom
mallenom/workcal/utils.py
utils.py
py
8,242
python
ru
code
0
github-code
6
[ { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 65, "usage_type": "call" }, { "api_name": "models.DayType.objects.values", "line_number": 84, "usage_type": "call" }, { "api_name": "models.DayType.objects", "line_number": 84, "usage_type": "attribute...
71136372667
from typing import Any, Dict, List, Optional from upscale.pruning.resolve import PruningSpec from upscale.pruning.tracing import Metadata import torch import torch.nn as nn from .utils import get_tensor_and_modules, get_tensor_to_module_metadata, group_indices_as_ranges def generate_pruned_weight( weight: torch....
apple/ml-upscale
src/upscale/pruning/pruner.py
pruner.py
py
8,095
python
en
code
54
github-code
6
[ { "api_name": "torch.Tensor", "line_number": 11, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", "...
17655996750
# coding: utf-8 import pandas as pd from pandas import DataFrame from pandas import DataFrame from pandas import concat from Stock_Interface import read_finance_year import datetime # 更新股票基础信息 def to_stock_list(pro): df = pro.stock_basic(list_status='L', fields='ts_code,symbol,name,area,industry,list_date,fullna...
Yusheng0313/JNB_WS
STOCK/Stock_Interface/build_finance_year.py
build_finance_year.py
py
5,578
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 42, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 48, "usage_type": "call" }, { "api_name": "pandas.read_csv",...
74306415227
# %% import json import requests import pandas as pd from datetime import datetime as dt from Exceptions import APIException from Exceptions import APIRequestException class Finnhub: data = None API_URL = "https://finnhub.io/api/v1" DEFAULT_TIMEOUT = 10 def __init__(self, api_key, proxies = None): ...
fscorrales/apys
src/apys/Finnhub.py
Finnhub.py
py
19,282
python
en
code
0
github-code
6
[ { "api_name": "requests.session", "line_number": 21, "usage_type": "call" }, { "api_name": "Exceptions.APIException", "line_number": 47, "usage_type": "call" }, { "api_name": "Exceptions.APIRequestException", "line_number": 56, "usage_type": "call" }, { "api_name"...
32102084849
from typing import List class Solution: def rotate(self, nums: List[int], k: int) -> None: l = len(nums) nums[:] = nums[l-k:] + nums[:l-k] print(nums) s = Solution() s.rotate([1,2,3,4,5,6,7],3)
Eleanoryuyuyu/LeetCode
python/Array/189. Rotate Array.py
189. Rotate Array.py
py
224
python
en
code
3
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
38023304844
from django.contrib.auth.views import LoginView from django.urls import path, re_path from document_flow.views import CustomLogoutView, index from . import views app_name = 'document_flow' urlpatterns = [ path('', index, name='index'), path('create_user/', views.create_user, name='create_user'), path('u...
AlexRubenko/Hillel_Django_proj
src/document_flow/urls.py
urls.py
py
1,410
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "document_flow.views.index", "line_number": 11, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "djang...
42981875994
from django.contrib.auth import authenticate, login, logout from django.db import IntegrityError from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from django import forms from datetime import date from django.db.models import Max from .models...
crunchydeer30/CS50W
Project 2 - Commerce/commerce/auctions/views.py
views.py
py
8,699
python
en
code
0
github-code
6
[ { "api_name": "models.Listing.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Listing.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.Listing", "line_number": 14, "usage_type": "name" }, { "api_name": ...
26676586255
import flask import pymongo server = flask.Flask('내서버') client = pymongo.MongoClient('localhost', 27017) #만약 '/' 주소로 누군가 오면, @server.route('/') def home(): # 'Hello World'를 출력하자 return flask.render_template('index.html') @server.route('/about') def about(): return flask.render_template('about.html') @se...
minkistic/SpartaCodingClub-Class
sparta.py/web.py
web.py
py
886
python
ko
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_temp...
9285521061
import thriftpy2 as thriftpy import numpy as np from thriftpy2.rpc import make_client from Branchy_Alexnet_Infer import infer from utils import test_data from config import * from Optimize import Optimize import time FILENAME = 'intermediate.npy' def client_start(): partition_thrift = thriftpy.load('partition.thr...
hush66/DNN-Partition-demo
DNN_Partition_Client.py
DNN_Partition_Client.py
py
1,406
python
en
code
25
github-code
6
[ { "api_name": "thriftpy2.load", "line_number": 13, "usage_type": "call" }, { "api_name": "thriftpy2.rpc.make_client", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.test_data", "line_number": 27, "usage_type": "call" }, { "api_name": "time.time", ...
15306940794
import json import sys import subprocess ''' (blocks.py) Blocks is an MDBook plugin/preprocessor which lets users construct beautiful Bootstrap components with "blocks" based markdown. ''' if __name__ == '__main__': # Check if there have been any arguments received if len(sys.argv) > 1: # If the ...
SlipperyBrick/Blocks
blocks-preprocessor/blocks.py
blocks.py
py
1,225
python
en
code
3
github-code
6
[ { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load", "line_number": 2...
33805651205
import time from uuid import uuid4 from typing import Optional from .base import BaseModel from .interface import IChat from ..schemas.delta import Delta from .interface import IPerson class Person(BaseModel, IPerson): class Status: IDLE = 'idle' FREE = 'free' IN_CHAT = 'in_chat' ...
backcrawler/ws_chat_py
ws_chat_py/models/person.py
person.py
py
3,070
python
en
code
0
github-code
6
[ { "api_name": "base.BaseModel", "line_number": 11, "usage_type": "name" }, { "api_name": "interface.IPerson", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 19, "usage_type": "name" }, { "api_name": "interface.IChat", ...
11110704884
import pygame class Bg(pygame.sprite.Sprite): def __init__(self): super(Bg, self).__init__() bg_small = pygame.image.load("bg.png").convert_alpha() grass_land = bg_small.subsurface((0, 0, 128, 128)) self.surf = pygame.transform.scale(grass_land, (800, 600)) self.rect = self...
PatrickShun/pygameDemo
demo2.py
demo2.py
py
3,068
python
en
code
0
github-code
6
[ { "api_name": "pygame.sprite", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.transform....
33460798474
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Dec 18 18:00:14 2021 @author: gurdeep_working """ import streamlit as st import pandas as pd from sklearn import datasets from sklearn.ensemble import RandomForestClassifier st.write(""" ## Simple Iris Flower Prediction App """) # si...
gurdeep101/streamlit
code/iris_classification.py
iris_classification.py
py
1,772
python
en
code
0
github-code
6
[ { "api_name": "streamlit.write", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit.sidebar.header", "line_number": 18, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 18, "usage_type": "attribute" }, { "api_name": "strea...
34209603006
import numpy as np import torch import os from torch.utils.data import TensorDataset, DataLoader from sklearn.model_selection import train_test_split def loadData(test_size = 0.2, val_size = 0.25, batchsize = 16): # val_size : percentage of test_size path = os.getcwd() + "\code\data\\" X = np.load(path +...
KodAgge/TeamCompositions
code/utils/import_data.py
import_data.py
py
1,152
python
en
code
1
github-code
6
[ { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_sp...
40687351663
import json from collections import namedtuple from typing import Any, Dict, List, Optional, Union from lte.protos.mconfig import mconfigs_pb2 from magma.common.misc_utils import get_ip_from_if from magma.configuration.exceptions import LoadConfigError from magma.configuration.mconfig_managers import load_service_mcon...
magma/magma
lte/gateway/python/magma/enodebd/device_config/configuration_init.py
configuration_init.py
py
18,580
python
en
code
1,605
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 29, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 42, "usage_type": "name" }, { "api_name": "magma.enodebd.exceptions.ConfigurationError", "line_number": 46, "usage_type": "call" }, { ...
37957351364
from django.shortcuts import render, redirect from django.contrib import messages from django.contrib.auth.decorators import login_required from .models import Userprofile from team.models import Team, Invitation, Plan from team.utils import send_invitation_accepted # Create your views here. @login_required def my...
AAhadNur/Timely
user/views.py
views.py
py
2,414
python
en
code
0
github-code
6
[ { "api_name": "team.models.Invitation.objects.filter", "line_number": 17, "usage_type": "call" }, { "api_name": "team.models.Invitation.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "team.models.Invitation", "line_number": 17, "usage_type": "name...
21336756023
from django.urls import path from .views import ( IocViewSet, SourceIocViewSet, DateIocViewSet, IocTypeViewSet, StatsViewSet ) urlpatterns = [ path("ioc_feeds", IocViewSet.as_view({ "get": "list" })), path('ioc_feeds/sources/<str:source>/', SourceIocViewSet.as_view({ "ge...
threathawkproject/ioc_aggregator
ioc_feeds/urls.py
urls.py
py
943
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "views.IocViewSet.as_view", "line_number": 11, "usage_type": "call" }, { "api_name": "views.IocViewSet", "line_number": 11, "usage_type": "name" }, { "api_name": "django.url...
33689117671
import i18n from fastapi import HTTPException from .. import crud from ..db import tables from ..models.chore_type import ChoreType from .base import CRUDBase class CRUDChoreTypes(CRUDBase[ChoreType, ChoreType, ChoreType, str]): async def create(self, *, lang: str, obj_in: ChoreType) -> ChoreType: result...
sralloza/chore-management-api
app/crud/chore_types.py
chore_types.py
py
1,589
python
en
code
0
github-code
6
[ { "api_name": "base.CRUDBase", "line_number": 10, "usage_type": "name" }, { "api_name": "models.chore_type.ChoreType", "line_number": 10, "usage_type": "name" }, { "api_name": "models.chore_type.ChoreType", "line_number": 11, "usage_type": "name" }, { "api_name": ...
26776955540
"""Unit tests for the PyCodeStyle plugin.""" import argparse import os import subprocess import mock from yapsy.PluginManager import PluginManager import statick_tool from statick_tool.config import Config from statick_tool.package import Package from statick_tool.plugin_context import PluginContext from statick_tool...
sscpac/statick
tests/plugins/tool/pydocstyle_tool_plugin/test_pydocstyle_tool_plugin.py
test_pydocstyle_tool_plugin.py
py
4,983
python
en
code
66
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "statick_tool.resources.Resources", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": ...
36151484492
import boto3 import os, sys, traceback from datetime import datetime from context import common, alerts region = 'us-east-1' s3_client = boto3.client('s3', region) ssm_client = boto3.client('ssm', region) log_group_name = common.get_parameter_from_ssm("dynamodb-bnr-log-grp-name", ssm_client) logger = alerts.Logger( ...
Tavisca-nilay-shrimanwar/github-actions-dynamic-workflows
DynamoDB/src/list/run.py
run.py
py
2,257
python
en
code
0
github-code
6
[ { "api_name": "boto3.client", "line_number": 7, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 8, "usage_type": "call" }, { "api_name": "context.common.get_parameter_from_ssm", "line_number": 10, "usage_type": "call" }, { "api_name": "context...
8267888726
from __future__ import annotations import pickle from unittest.mock import Mock, call import pytest from kombu import Connection, Exchange, Producer, Queue, binding from kombu.abstract import MaybeChannelBound from kombu.exceptions import NotBoundError from kombu.serialization import registry from t.mocks import Tra...
celery/kombu
t/unit/test_entity.py
test_entity.py
py
13,693
python
en
code
2,643
github-code
6
[ { "api_name": "kombu.Connection", "line_number": 16, "usage_type": "call" }, { "api_name": "t.mocks.Transport", "line_number": 16, "usage_type": "name" }, { "api_name": "kombu.Connection", "line_number": 15, "usage_type": "name" }, { "api_name": "kombu.binding", ...
8632553144
import logging import os from typing import Any, Dict, List, Type from dotwiz import DotWiz from deepsecrets import PROFILER_ON, logger from deepsecrets.core.engines.hashed_secret import HashedSecretEngine from deepsecrets.core.engines.regex import RegexEngine from deepsecrets.core.engines.semantic import SemanticEng...
avito-tech/deepsecrets
deepsecrets/scan_modes/cli.py
cli.py
py
3,333
python
en
code
174
github-code
6
[ { "api_name": "deepsecrets.core.modes.iscan_mode.ScanMode", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Type", "line_number": 22, "usage_type": "name" }, { "api_name": "ty...
34851625380
#====================================================================# # File Information #====================================================================# """ web.py ============= This file contains function used to access different web functionalities. """ #=======================================...
LyamBRS/BRS_Python_Libraries
BRS/Network/Web/web.py
web.py
py
3,740
python
en
code
0
github-code
6
[ { "api_name": "Debug.LoadingLog.LoadingLog.Start", "line_number": 15, "usage_type": "call" }, { "api_name": "Debug.LoadingLog.LoadingLog", "line_number": 15, "usage_type": "name" }, { "api_name": "Debug.LoadingLog.LoadingLog.Import", "line_number": 20, "usage_type": "call...
36592897344
# Json to Text import json with open("sample_json.json","r") as file: data = json.load(file) with open("json_to_text.txt","w") as file: file.write(str(data)) print("The json to text is saved as json_to_text.txt ") # # Yaml to text with open("sample.yaml","r") as file: data = yaml.load(file) with open("yaml_to_...
Hambardzumian/homework
oop_les15.py
oop_les15.py
py
896
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load", "line_number": 31, "usage_type": "call" }, { "api_name": "yaml.dump", "line_number": 32, ...
74021271869
import traceback import sys import json import socket from django.shortcuts import render from django.http import HttpResponse, Http404 from django.views.generic import TemplateView from .insurance import plans as plans from .insurance.plans import run_simulations plans.load_plans() class HealthSimView(TemplateVie...
Lucretiel/FidHealth
HealthSim/views.py
views.py
py
1,551
python
en
code
0
github-code
6
[ { "api_name": "insurance.plans.load_plans", "line_number": 14, "usage_type": "call" }, { "api_name": "insurance.plans", "line_number": 14, "usage_type": "name" }, { "api_name": "django.views.generic.TemplateView", "line_number": 16, "usage_type": "name" }, { "api_...
70998138748
#!/usr/bin/python3 # coding=utf-8 # author:chui import os import httplib2 import threading import queue import re import datetime import pandas as pd from pandas import DataFrame,Series,Timestamp # import json # import csv MAXDOWNLOADTHRD = 6 MAXRETRYTIMES = 4 STOCKDATAHISTORY = 200 #股票历史数据时间 STOCKSAVEPATH = r'Histo...
chuihero/stk
stock.py
stock.py
py
6,504
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "re.findall", "line_number": 69, "usage_type": "call" }, { "api_name": "re.compile", "line_number": ...
21844192294
import datetime from time import sleep from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.chrome.options import Options from selenium.webdriver.support import expected_...
PINGwyTEAM/parseRosreestr
parser.py
parser.py
py
6,437
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 20, "usage_type": "call" }, {...
17962796674
import requests class GraphqlClient: """Class which represents the interface to make graphQL requests through.""" def __init__(self, endpoint: str, headers: dict = {}): """Insantiate the client.""" self.endpoint = endpoint self.headers = headers def execute( self, ...
colin-i/test
act/query.py
query.py
py
1,841
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_number": 40, "usage_type": "call" }, { "api_name": "datetime.date.fromtimestamp", "line_number": 42, "usage_type": "call" }, { "api_name": "datetime.date", ...
71501085947
import gym from sys import platform import os from assets.vertical_mvt_pendulum import VerticalMvtPendulumEnv from assets.full_cheetah import FullCheetahEnv xml_path=os.path.join(os.getcwd(),'assets','xml') def return_env(choice,**kwargs): if choice == 'VMP': VPenv = VerticalMvtPendulumEnv(type='vertical...
JiazhengChai/spinningup_custom
utils.py
utils.py
py
1,737
python
en
code
1
github-code
6
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 8, "usage_type": "call" }, { "api_name": "assets.vertical_mvt_pendulum.Vertica...
38907268485
from sqlalchemy.exc import IntegrityError from app.core.repo.base import BaseSqlalchemyRepo from app.core.exceptions.repo import RepoException from .models import Amenty class AmentyRepo(BaseSqlalchemyRepo): model = Amenty async def create(self, db_session, obj_in): """ Create amenty ...
rasimatics/excursio-backend
app/apps/amenty/repo.py
repo.py
py
1,673
python
en
code
1
github-code
6
[ { "api_name": "app.core.repo.base.BaseSqlalchemyRepo", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Amenty", "line_number": 9, "usage_type": "name" }, { "api_name": "sqlalchemy.exc.IntegrityError", "line_number": 17, "usage_type": "name" }, { "a...
27309648210
from django.shortcuts import render, get_object_or_404, redirect from django.utils import timezone from .models import News from .forms import NewsForm from el_pagination.decorators import page_template # Create your views here. @page_template('news/news_list.html') # just add this decorator def news_list(request, te...
heumsi/ypc-django
ypc/news/views.py
views.py
py
1,708
python
en
code
0
github-code
6
[ { "api_name": "models.News.objects.filter", "line_number": 10, "usage_type": "call" }, { "api_name": "models.News.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.News", "line_number": 10, "usage_type": "name" }, { "api_name": "djang...
3591495774
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 10 11:15:19 2019 @author: nk7g14 """ import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.lines as mlines N_dict = {'All': [36420, 2069, 34351], 'ULX': [992, 913, 79], 'Unbeamed_ULX': [765, 765, 0], 'beamed_U...
nx1/ulx_pop
src/visualization/flowchart.py
flowchart.py
py
3,173
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.patches.Rectangle", "line_number": 43, "usage_type": "call" }, { "api_nam...
3989623951
from typing import Any, Dict, List, Self, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset @_attrs_define class AssetInfo: """Asset Info Attributes: aclass (Union[Unset, str]): Asset Class altname (Union[Unset, str]): A...
tlg7c5/kraken-connector
kraken_connector/schemas/asset_info.py
asset_info.py
py
3,245
python
en
code
0
github-code
6
[ { "api_name": "typing.Union", "line_number": 23, "usage_type": "name" }, { "api_name": "types.Unset", "line_number": 23, "usage_type": "name" }, { "api_name": "types.UNSET", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Union", "line_number"...
12483858359
import numpy as np import matplotlib.pyplot as plt from matplotlib.path import Path x = [0, 0, -1, -1, 1, 1, 0] y = [0, 1, 1, -1, -1, 0, 0] M = 64 K = 64 np.random.seed(100) t1 = 1.5*np.pi*(np.arange(M) + 0.5)/M r1 = 1/np.fmax(np.abs(np.sin(t1)), np.abs(np.cos(t1))) t2 = 1.5*np.pi*np.random.rand(K) r2 = 1/np.fmax(np...
tt-nakamura/drum
fig3.py
fig3.py
py
1,108
python
uk
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.arange", ...
32493202780
# -*- coding:utf-8 -*-- import urllib.request import xlwt from bs4 import BeautifulSoup import re from io import BytesIO import gzip def mains(): # 爬取网页 baseurl = "https://hz.newhouse.fang.com/house/s/b" headers={ "User-Agent" :"Mozilla / 5.0(Windows NT 10.0;Win64;x64) AppleWebKit / 537...
little-blak/python-
2.py
2.py
py
7,239
python
en
code
0
github-code
6
[ { "api_name": "urllib.request.request.Request", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 16, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 16, "usage_type": "name" }, { "api_nam...
19313593623
#!/usr/bin/python # Author: Dylan Boland # Modules that will be useful import argparse import os import sys import re # ==== Some General-info Strings ==== # Tags - define these here so they can be quickly and easily changed errorTag = """\t***Error: """ successTag = """\t***Success: """ infoTag = """\t***Info:...
DylanKennyBoland/getVerificationTestList
get_test_list.py
get_test_list.py
py
9,483
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 64, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 70, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number": 79, "usage_type": "call" }, { "api_name": "os.walk", "line_nu...
38036259892
import pytest from pymatgen.electronic_structure.core import Spin from amset.electronic_structure.common import ( get_cbm_energy, get_efermi, get_vb_idx, get_vbm_energy, ) @pytest.mark.parametrize( "system,energy_cutoff,expected", [ pytest.param( "tricky_sp", 1.5, {Spin.up...
hackingmaterials/amset
tests/electronic_structure/test_common.py
test_common.py
py
2,405
python
en
code
110
github-code
6
[ { "api_name": "amset.electronic_structure.common.get_vb_idx", "line_number": 22, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 12, "usage_type": "attribute" }, { ...
14028066425
import pandas as pd pd.core.common.is_list_like=pd.api.types.is_list_like # Used as a patch for pandas data reader to avoid error from pandas_datareader import data as web import fix_yahoo_finance as yf import datetime as dt import numpy as np import matplotlib import pylab import matplotlib.pyplot as plt im...
advi1993/Analysis-and-Visualization-of-Stock-Price
Server/RSI.py
RSI.py
py
2,440
python
en
code
0
github-code
6
[ { "api_name": "pandas.core", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pandas.api", "line_number": 3, "usage_type": "attribute" }, { "api_name": "numpy.diff", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "lin...
41455005139
# Body Recomposition Module of FitFreak from modules import exercises # Motivation for muscle building here # Workout plan for muscle building: split = ("Chest + Triceps", "Back + Biceps", "Shoulders + Abs", "Lower + Abs") plan = dict({"Monday": split[0], "Tuesday": split[1], "Wednesday": split[2], "Thursday": split...
shreyas-shivapuji/fitfreak
modules/bodyrecomp.py
bodyrecomp.py
py
3,901
python
en
code
0
github-code
6
[ { "api_name": "modules.exercises.getExercise", "line_number": 29, "usage_type": "call" }, { "api_name": "modules.exercises", "line_number": 29, "usage_type": "name" }, { "api_name": "modules.exercises.getExercise", "line_number": 30, "usage_type": "call" }, { "api...
13155734281
import logging class ConfigurationError(Exception): """Exception raised for errors in configuration """ def __init__(self, message): self.message = message def raise_config_error(mesg: str, logger: logging.Logger=None): if logger: logger.error(mesg) raise ConfigurationError(mesg...
learnlafayette/sensors
sensors/sensors/config/util.py
util.py
py
1,061
python
en
code
0
github-code
6
[ { "api_name": "logging.Logger", "line_number": 12, "usage_type": "attribute" } ]
10808321921
import os from typing import List, Tuple from AgentBasedModeling.helpers.burning import forest_fire_model as ffm from AgentBasedModeling.common.log import logger plt = ffm.pe.slp.plt LOGGER = logger.get_logger(__name__) LOGGER.setLevel(10) def find_percolation_probability( lattice_size: int, plant_probabili...
TheDecks/Studies
AgentBasedModeling/lists/list1/percolation_calculation.py
percolation_calculation.py
py
2,215
python
en
code
0
github-code
6
[ { "api_name": "AgentBasedModeling.helpers.burning.forest_fire_model.pe", "line_number": 7, "usage_type": "attribute" }, { "api_name": "AgentBasedModeling.helpers.burning.forest_fire_model", "line_number": 7, "usage_type": "name" }, { "api_name": "AgentBasedModeling.common.log.log...
69895147069
# -*- encoding: utf-8 -*- """ lunaport.plugg_views.healthstatus ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Class-based view to show service HealthStatus. """ #import urllib import os import datetime import json import pkg_resources import commands import pprint pp = pprint.PrettyPrinter(indent=4).pprint from flas...
greggyNapalm/lunaport_server
lunaport_server/plugg_views/HealthStatus.py
HealthStatus.py
py
2,652
python
en
code
0
github-code
6
[ { "api_name": "pprint.PrettyPrinter", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.views.MethodView", "line_number": 25, "usage_type": "name" }, { "api_name": "pkg_resources.get_distribution", "line_number": 56, "usage_type": "call" }, { "api_na...
74128329468
import sys from collections import defaultdict n = int(input()) nums = list(map(int,sys.stdin.readline().split())) m = int(input()) cards = list(map(int,sys.stdin.readline().split())) dic = defaultdict(int) for num in nums: dic[num] +=1 for card in cards: if card in dic.keys(): print(dic[...
Dayeon1351/TIL
BAEKJOON/10816.py
10816.py
py
371
python
en
code
0
github-code
6
[ { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdin", "li...
36289750483
import os, sys import numpy as np from psutil import virtual_memory from .constants import c, floattype from .exceptions import CmdInputError from .pml import PML, CFS from .utilities import rvalue, human_size from .waveforms import Waveform def process_singlecmds(singlecmds, multicmds, G): """Checks the validit...
SajadJ/gprMax
gprMax/input_cmds_singleuse.py
input_cmds_singleuse.py
py
9,989
python
en
code
null
github-code
6
[ { "api_name": "exceptions.CmdInputError", "line_number": 27, "usage_type": "call" }, { "api_name": "exceptions.CmdInputError", "line_number": 33, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 46, "usage_type": "call" }, { "api_name": "os.e...
297173824
from rest_framework.decorators import renderer_classes, api_view from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer import coreapi from rest_framework import response # noinspection PyArgumentList @api_view() @renderer_classes([SwaggerUIRenderer, OpenAPIRenderer]) def schema_view(request)...
abhishekpattnaik/Recommendation-System
main_training_project/recommend_app/swagger.py
swagger.py
py
1,435
python
en
code
0
github-code
6
[ { "api_name": "coreapi.Document", "line_number": 13, "usage_type": "call" }, { "api_name": "coreapi.Link", "line_number": 17, "usage_type": "call" }, { "api_name": "coreapi.Field", "line_number": 21, "usage_type": "call" }, { "api_name": "coreapi.Field", "line...
18003687247
from django.core.exceptions import ValidationError from django.contrib.contenttypes.models import ContentType from django.utils.translation import gettext_lazy as _ from rest_framework import generics, permissions, status from rest_framework.generics import get_object_or_404 from rest_framework.response import Response...
Shirhussain/RTL-Blog-with-multiple-user
comment/api/views.py
views.py
py
6,281
python
en
code
2
github-code
6
[ { "api_name": "comment.validators.ValidatorMixin", "line_number": 18, "usage_type": "name" }, { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 18, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 18, "usage_type": "...