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
30369843211
import time import traceback from functools import wraps from interface.logger import logger from .ob import model from config.network import HttpState def Timefn(f): # 计算方法运行时间 @wraps(f) def decotor(tm=None): currentTime = tm startTime = time.time() t = f() endTime = time...
Tantis/z-interface
utils/fn.py
fn.py
py
3,280
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 12, "usage_type": "call" }, { "api_name": "interface.logger.logger.debug", ...
6015384897
# -*- coding: utf-8 -*- """ Created on Thu Apr 23 21:33:14 2020 @author: TOSHIBA """ import pyodbc import pandas as pd def num2MX(value): for j in range(len(value)): aux = "" coma = 0 for i in range(len(value[j])-1, -1, -1): if coma == 3: aux = "...
JeRod19/ReproSur-IncomeAndOutcomes-Tracking
Module2.py
Module2.py
py
4,741
python
en
code
0
github-code
6
[ { "api_name": "pyodbc.connect", "line_number": 30, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.read_sql", "line_number": 71, "usage_type": "call" }, { "api_name": "pandas.read_sql", ...
27592576983
import logging LOG_FORMAT = '%(levelname)s %(asctime)s - %(message)s' class Logger: instance = None def __init__(self): logging.basicConfig( level=logging.INFO, filename='/home/richard/Documents/risk-profile-python/logs/logs.py', format=LOG_FORMAT, file...
richardpassos01/risk-profile-python
risk_profile/application/logger/logger.py
logger.py
py
440
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" } ]
34179060816
import heapq import numpy as np from copy import copy from itertools import product from math import inf as INFINITY from collections import defaultdict def in_bounds(grid, node): y, x = node return 0 <= y < len(grid) and 0 <= x < len(grid[y]) def get_adj(grid, current_node): y,x = current_node adj_no...
mpryor/advent-of-code-2021
day-15/part-2.py
part-2.py
py
1,675
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 18, "usage_type": "call" }, { "api_name": "math.inf", "line_number": 18, "usage_type": "name" }, { "api_name": "heapq.heappush", "line_number": 22, "usage_type": "call" }, { "api_name": "heapq.heappop", "...
39868314021
from django.db import models from django.utils.safestring import mark_safe from easy_thumbnails.fields import ThumbnailerImageField from main.model.pgm import Pgm from urllib import parse from django_project.settings import AAC_URL_PREFIX class Track(models.Model): pos = models.SmallIntegerField(db_index...
artemgv/spacemusic
app/main/model/track.py
track.py
py
6,664
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.SmallIntegerField", "line_number": 10, "usage_type": "call" }, { "api...
40738894813
""" ** coded by shibinmak on 1/10/18 ** ** I pledge to do my best ** ** May all beings be Happy,Peaceful,Liberated ** """ import cv2 import os import imutils import json import config from Alerts.Email import EmailAlert from Alerts.SMSAlert import SMSAlert from Alerts.whatsapp import WhatsApp import numpy as np from ...
shibinmak/security-s-s
securitysystem.py
securitysystem.py
py
5,016
python
en
code
9
github-code
6
[ { "api_name": "config.model", "line_number": 21, "usage_type": "attribute" }, { "api_name": "config.prototxt", "line_number": 22, "usage_type": "attribute" }, { "api_name": "Alerts.SMSAlert.SMSAlert", "line_number": 24, "usage_type": "call" }, { "api_name": "Alert...
22349081084
import streamlit as st import pandas as pd import numpy as np import re import time # Dashboard setup pd.set_option("display.max_colwidth", None) st.set_page_config( page_title="Taiwan Waste Management Data", page_icon="🗑️", layout="centered", initial_sidebar_state="auto", ) DATA_DIR = "data/" STAT_P...
frankcholula/twgc
streamlit_app.py
streamlit_app.py
py
5,121
python
en
code
0
github-code
6
[ { "api_name": "pandas.set_option", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.set_page_config", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "streamlit.c...
32067036953
# pip install loguru import logging from types import FrameType from typing import cast import os import sys from loguru import logger BASE_DIR = os.path.abspath('.') class InterceptHandler(logging.Handler): def emit(self, record: logging.LogRecord) -> None: # pragma: no cover # Get corresponding Loguru...
milespeng/myops_fastapi
scripts/log.py
log.py
py
1,844
python
en
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.Handler", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.LogRecord", ...
14098869799
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import builtins import logging import os import platform import shutil import sys import traceback from pathlib import Path import IPython from IPython.core.release import version_info from IPython.terminal.prompts import ClassicPrompts from traitlets.config.application i...
farisachugthai/dynamic_ipython
default_profile/ipython_config.py
ipython_config.py
py
29,454
python
en
code
7
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.error", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.exception...
8398727517
import numpy as np import pandas as pd from collections import Counter import matplotlib.pyplot as plt from matplotlib import style style.use('fivethirtyeight') dataset = {'k': [[1,2], [2,3], [3,1]], 'r': [[6,5], [7,7], [8,9]]} new_features = [5,7] def k_nearest_neighbor(dataset, predict, k=3): distances = [] ...
SarthakPatidar/Machine-Learning
Supervised Learning/algorithms/k-nearest neighbors/k_nearest_neighbor.py
k_nearest_neighbor.py
py
916
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.style.use", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.linalg.norm", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.linalg", ...
42510768159
import os import numpy as np import pandas as pd import scipy.misc from sklearn.cluster import KMeans import utils TRAIN_DIR = 'data/train' OUT_DIR = 'data' LABELS_DIR = 'bbox' FISH_CLASSES = ['ALB', 'BET', 'DOL', 'LAG', 'OTHER', 'SHARK', 'YFT'] MAX_EXAMPLES = 10000 EXPAND_BBOX = 0.5 N_SAMPLES = 100 os.makedirs(O...
cwkprojects/myprojects
applied_machine_learning/fisheries/generate_proposals.py
generate_proposals.py
py
1,515
python
en
code
0
github-code
6
[ { "api_name": "os.makedirs", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pandas.read_json", "line_...
10865944408
import logging import os import os.path import environ import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration env = environ.Env() env.read_env(str((environ.Path(__file__) - 1).path(".env"))) BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Language code for this installation. All cho...
tlrh314/UvA_API_Alumni
apiweb/settings/base.py
base.py
py
11,228
python
en
code
2
github-code
6
[ { "api_name": "environ.Env", "line_number": 9, "usage_type": "call" }, { "api_name": "environ.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
16800466391
import matplotlib.pyplot as plt import numpy as np from numba import vectorize, njit import numba from time import time """" This function creates a matrix of complex numbers from -2 to 2 and -2i to 2i Args: n: dimention of the matrix Returns: matrix: matrix of complex numbers """ @njit def cr...
ale12012/PythonProjects
MandelbrotSet/mandelbrot_gpu.py
mandelbrot_gpu.py
py
2,016
python
en
code
2
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.complex64", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numba.njit", "line_number": 15, "usage_type": "name" }, { "api_name": "numba.vectorize", "li...
7161975814
""" Design a hit counter which counts the number of hits received in the past 5 minutes (i.e., the past 300 seconds). Your system should accept a timestamp parameter (in seconds granularity), and you may assume that calls are being made to the system in chronological order (i.e., timestamp is monotonically increasing)...
CompetitiveCodingLeetcode/LeetcodeEasy
Queue/designHitCounter_Q362.py
designHitCounter_Q362.py
py
8,488
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 98, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 147, "usage_type": "attribute" } ]
12702098128
from rest_framework import status from rest_framework.permissions import IsAdminUser from rest_framework.response import Response from rest_framework.views import APIView # local imports from staffs.apps.authentication.serializers import (AddUserSerializer, LoginSeri...
sam-karis/staff-requests
staffs/apps/authentication/views.py
views.py
py
1,960
python
en
code
2
github-code
6
[ { "api_name": "rest_framework.views.APIView", "line_number": 12, "usage_type": "name" }, { "api_name": "staffs.apps.authentication.serializers.LoginSerializer", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.response.Response", "line_number": 27, ...
42931774680
import os import torchvision import torchvision.transforms as transforms normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) transform_train = transforms.Compose([ transforms.RandomResizedCrop(224), transforms.RandomHorizontalFlip(), tra...
EvgenyKashin/SRMnet
datasets/imagenet.py
imagenet.py
py
922
python
en
code
75
github-code
6
[ { "api_name": "torchvision.transforms.Normalize", "line_number": 5, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 5, "usage_type": "name" }, { "api_name": "torchvision.transforms.Compose", "line_number": 8, "usage_type": "call" }, { ...
9806654687
# import libraries from selenium.webdriver.common.by import By from pages.base_page import BasePage class MyWishlistPage(BasePage): # page objects wishlist_confirmation_txt = (By.XPATH, "//div[@data-bind='html: $parent.prepareMessageForHtml(message.text)']") # constructor def __init__(self, driver) -...
santoshsharma21/ecommerce--automation-project-python
pages/my_wishlist_page.py
my_wishlist_page.py
py
536
python
en
code
0
github-code
6
[ { "api_name": "pages.base_page.BasePage", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.XPATH", "line_number": 8, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 8, "usage_type": "name...
72323287549
from flask_wtf import FlaskForm from wtforms import StringField, IntegerField, FloatField, SelectField, SubmitField, TextAreaField, FieldList, FormField from wtforms.validators import DataRequired class BlogPostForm(FlaskForm): # no empty titles or text possible # we'll grab the date automatically from the Mo...
yasser64b/Flask-Web-Development
Myproject/truss_posts/forms.py
forms.py
py
2,043
python
en
code
0
github-code
6
[ { "api_name": "flask_wtf.FlaskForm", "line_number": 6, "usage_type": "name" }, { "api_name": "wtforms.StringField", "line_number": 11, "usage_type": "call" }, { "api_name": "wtforms.TextAreaField", "line_number": 12, "usage_type": "call" }, { "api_name": "wtforms....
30575109110
from matplotlib import ticker from PortfolioEngine.Components.PortfolioBalancer.BalancingStrategies.BaseBalancingStrategy import BaseBalancingStrategy from PortfolioEngine.Components.Indicator import Indicator from PortfolioEngine.Components.Portfolio import Portfolio from pandas import DataFrame import logging class ...
jminahan/backtest_framework
PortfolioEngine/Components/PortfolioBalancer/BalancingStrategies/EvenSplitBalancingStrategy.py
EvenSplitBalancingStrategy.py
py
2,201
python
en
code
0
github-code
6
[ { "api_name": "PortfolioEngine.Components.PortfolioBalancer.BalancingStrategies.BaseBalancingStrategy.BaseBalancingStrategy", "line_number": 8, "usage_type": "name" }, { "api_name": "PortfolioEngine.Components.Portfolio.Portfolio", "line_number": 9, "usage_type": "name" }, { "api...
4976305145
from django.contrib import admin from .models import Stock # Register your models here. @admin.register(Stock) class CEFAdmin(admin.ModelAdmin): list_display = ( 'ticker', 'is_updated', 'category', 'nav_', 'price_', 'price_chg', 'nav_chg', 'price_minus_nav', 'curr_disc', 'avg_minus_curr', 'c_to_avg'...
iliev0980/crazy_CEF
stocks/admin.py
admin.py
py
1,136
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 4, "usage_type": "call" }, { ...
30692516780
#!/usr/bin/env python """ Script for gathering GitHub data """ import csv import datetime import json import logging import os import re import time # import choicemodels import git import pandas as pd import networkit as nk import numpy as np import requests import six import stscraper import stutils from stutils i...
user2589/TAC_Github
utils.py
utils.py
py
29,315
python
en
code
null
github-code
6
[ { "api_name": "sqlalchemy.create_engine", "line_number": 36, "usage_type": "call" }, { "api_name": "stutils.decorators.DEFAULT_EXPIRES", "line_number": 52, "usage_type": "attribute" }, { "api_name": "stutils.decorators", "line_number": 52, "usage_type": "name" }, { ...
70287321149
import cv2 def main(): path = "rtsp://admin:Chinsoft@sx3.7766.org:754/doc/page/config.asp" cap = cv2.VideoCapture(path) c = 0 while True: re, frame = cap.read() if(re==False): break if(c%300==0): #cv2.imwrite("./res/{}.png".format(c), frame) print("coun...
dishen12/helmet
practice/test.py
test.py
py
405
python
en
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" } ]
15833779921
import yaml lst = ["computer", "printer", "keyboard", "mouse"] slovar2 = {"mouse": "50€", "keyboard": "20€"} slovar = {"items": lst, "sssss": 5, 'item_price': slovar2} with open('data_write.yaml', 'w') as f_n: yaml.safe_dump(slovar, f_n, allow_unicode=True, default_flow_style=False) with open('data_write.yaml') ...
EvgeniyBezzubov/urok8
task_3/task3.py
task3.py
py
354
python
en
code
0
github-code
6
[ { "api_name": "yaml.safe_dump", "line_number": 8, "usage_type": "call" } ]
8345242320
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy from PIL import Image, ImageColor, ImageChops from webapp.exceptions.imagediff_exception import * class ImageDiff(object): _imageA = None _imageB = None # 实例化ImageDiff对象是先检查图片是否存在再判断两张图片大小是否一致 def __init__(self, imagea, imageb): try: ...
megolee/Imgdiff
webapp/img/imgdiff.py
imgdiff.py
py
2,397
python
zh
code
0
github-code
6
[ { "api_name": "PIL.Image.open", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 15, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
5209471701
# bot actions related to interaction with the server go here # this file acts as an interface between the server and commands.py import discord import commands import os from bot import Bot COMMANDS = ["forecast", "set_home", "home"] FUNCTIONS = [commands.forecast, commands.set_home, commands.home] client = discord....
epw1624/avy-bot
src/events.py
events.py
py
1,168
python
en
code
0
github-code
6
[ { "api_name": "commands.forecast", "line_number": 10, "usage_type": "attribute" }, { "api_name": "commands.set_home", "line_number": 10, "usage_type": "attribute" }, { "api_name": "commands.home", "line_number": 10, "usage_type": "attribute" }, { "api_name": "disc...
18039093099
import os import random import base64 import download_picture from openpyxl import load_workbook def get_filename(path): filelist = os.listdir(path) return filelist def read_file(path): with open(path,encoding='utf-8',errors='ignore') as f: return f.read() def write_file(path): c...
wednesdaygogo/WafTestTools
sockethttp/file_handle.py
file_handle.py
py
7,250
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
1633261962
from __future__ import print_function # # pyramid.py - Helper functions for accessing GigaPan # # Copyright (c) 2011 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY U...
cmusatyalab/opendiamond
opendiamond/dataretriever/pyramid.py
pyramid.py
py
4,218
python
en
code
19
github-code
6
[ { "api_name": "future.standard_library.install_aliases", "line_number": 15, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 15, "usage_type": "name" }, { "api_name": "math.ceil", "line_number": 41, "usage_type": "call" }, { "api_nam...
23010326082
from typing import List, Optional from bw2calc import LCA from scipy import sparse from .matrix_tools import to_normalized_adjacency_matrix from .shortest_path import get_shortest_path try: import bw2data as bd from bw2data import Edge, Node brightway_available = True except ImportError: class Dumm...
brightway-lca/bw_graph_tools
bw_graph_tools/graph_traversal_utils.py
graph_traversal_utils.py
py
2,077
python
en
code
1
github-code
6
[ { "api_name": "bw2data.Node", "line_number": 20, "usage_type": "name" }, { "api_name": "bw2data.Edge", "line_number": 20, "usage_type": "name" }, { "api_name": "scipy.sparse.spmatrix", "line_number": 25, "usage_type": "attribute" }, { "api_name": "scipy.sparse", ...
24203671995
import torch import torch.nn as nn import torch.nn.functional as F from .Model import Model class ConvE(Model): def __init__(self, ent_tot, rel_tot, hidden, embedding_shape, \ dim=100, bias_flag=True, drops=[0,0,0]): super(ConvE, self).__init__(ent_tot, rel_tot) self.dim = dim ...
Toni-Chan/text-pwrd-kg-reasoning
OpenKE-OpenKE-PyTorch/openke/module/model/ConvE.py
ConvE.py
py
3,206
python
en
code
0
github-code
6
[ { "api_name": "Model.Model", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn.Embedding", ...
20080746612
from create_bot import bot from handlers import handler__commands from telebot import types from handlers import data_base from telegram import InputMediaPhoto from telegram.constants import ParseMode from telebot.types import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton import os from os import list...
Aynur-Safina/TG_bot_-
Бот_ЗаборМастер/handlers/handler__message_text.py
handler__message_text.py
py
22,804
python
ru
code
0
github-code
6
[ { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 19,...
7190204673
import requests import threading from PyQt5.QtCore import QThreadPool, pyqtSignal, QRunnable, Qt, QObject from PyQt5.QtGui import QPixmap, QImage from PyQt5.QtWidgets import QLabel, QWidget, QVBoxLayout, QApplication class Glide(QObject): image_loaded = pyqtSignal(tuple) class LabelInfo: def __init_...
flyfire/learning-py
qt/network-image-loading/glide.py
glide.py
py
4,569
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 10, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QPixmap", "line_number": 13, "usage_type": "name" }, { "api_name": "PyQt5...
14857635413
from aws_cdk import ( aws_ec2 as ec2, aws_ssm as ssm, Stack ) import config from config import formalize from constructs import Construct class SecurityStack(Stack): def __init__(self, scope: Construct, construct_id: str,vpc: ec2.Vpc, **kwargs) -> None: super().__init__(scope, construct_id, *...
Mostafa-Anwar/iac-eks
python/stacks/security_stack.py
security_stack.py
py
1,635
python
en
code
0
github-code
6
[ { "api_name": "aws_cdk.Stack", "line_number": 12, "usage_type": "name" }, { "api_name": "constructs.Construct", "line_number": 13, "usage_type": "name" }, { "api_name": "aws_cdk.aws_ec2.Vpc", "line_number": 13, "usage_type": "attribute" }, { "api_name": "aws_cdk.a...
36818281731
import pytest from core import Attribute from database.model import ModelAttribute, Model class TModel(Model): uid = ModelAttribute(uid=True) first = ModelAttribute() second = ModelAttribute(default=False) third = ModelAttribute(default=100) fourth = ModelAttribute(default=None) def test_create...
AzaubaevViktor/vk_grabber
src/database/tests/test_model.py
test_model.py
py
3,329
python
en
code
1
github-code
6
[ { "api_name": "database.model.Model", "line_number": 7, "usage_type": "name" }, { "api_name": "database.model.ModelAttribute", "line_number": 8, "usage_type": "call" }, { "api_name": "database.model.ModelAttribute", "line_number": 9, "usage_type": "call" }, { "api...
28668160085
import logging from collections import deque from datetime import datetime from decimal import Decimal from enum import IntEnum, Enum from typing import Union from cached_property import cached_property from peewee import (CharField, TextField, DateTimeField, IntegerField, BooleanField, ForeignKeyF...
haoweiking/image_tesseract_private
PaiDuiGuanJia/yiyun/models/match.py
match.py
py
41,155
python
en
code
0
github-code
6
[ { "api_name": "base.BaseModel", "line_number": 19, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_number": 32, "usage_type": "name" }, { "api_name": "peewee.IntegerField", "line_number": 57, "usage_type": "call" }, { "api_name": "peewee.IntegerField",...
34120233143
__author__ = 'Yves Bonjour' import unittest from Feeds import Feed from Feeds import MemoryFeedStore from Feeds import RedisFeedStore from Feeds import Feeds from FeedStoreMock import FeedStoreMock import uuid import redis class FeedTest(unittest.TestCase): def test_equals_same_values(self): # Arrange ...
ybonjour/nuus
services/feeds/tests/FeedsTest.py
FeedsTest.py
py
7,513
python
en
code
1
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "Feeds.Feed", "line_number": 17, "usage_type": "call" }, { "api_name": "Feeds.Feed", "line_number": 18, "usage_type": "call" }, { "api_name": "Feeds.Feed", "line_n...
443383386
#TODO: Add comments and license import time import math import datetime as dt from typing import List import numpy as np import rclpy import signal from rclpy.context import Context from rclpy.node import Node from rclpy.qos import qos_profile_system_default from dvl.dvl import Dvl from dvl.system import OutputData fro...
kabronius/wayfinder_dvl
wayfinder_dvl/wayfinder_dvl/wayfinder_dvl.py
wayfinder_dvl.py
py
6,707
python
en
code
0
github-code
6
[ { "api_name": "rclpy.node.Node", "line_number": 20, "usage_type": "name" }, { "api_name": "geometry_msgs.msg.TwistWithCovarianceStamped", "line_number": 32, "usage_type": "argument" }, { "api_name": "rclpy.qos.qos_profile_system_default", "line_number": 33, "usage_type": ...
71957451709
from namePart import * from fileSet import * import math import datetime class regularFileSet(fileSet): '''This is a set of files that starts with a particular file time and includes many files that are evenly spaced by some number of seconds. If files in set are still being recorded nFiles -1 is the flag for that'''...
eileenrmartin/FiberOpticEarthquakes
FileSetObjects/regularFileSet.py
regularFileSet.py
py
4,830
python
en
code
24
github-code
6
[ { "api_name": "fileSet.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.now", ...
34961893861
# Use this code at your own risk # Enter registered mobile number and password in the data dictionary # Enter Message in data1 dictionary and enter mobile number in which message needs to be sent in toMobile in data1. import json from datetime import datetime import requests def main(tono, todata): url1 = 'http...
rishav394/VIT-Scraper
send_sms.py
send_sms.py
py
1,724
python
en
code
3
github-code
6
[ { "api_name": "requests.session", "line_number": 16, "usage_type": "call" }, { "api_name": "json.load", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 43, "usage_type": "call" }, { "api_name": "datetime.dateti...
3081256684
# -*- coding: utf-8 -* """Output .. module:: output :synopsis: Module for generating output """ # imports import numpy as np import resoncalc.graphics as graphics import resoncalc.detection as detection from datetime import datetime from os import getcwd, path, mkdir from json import dumps # globals outdir = '' ...
hydratk/resoncalc
src/resoncalc/output.py
output.py
py
6,723
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_numb...
24223750039
import os from zipfile import ZipInfo def zip_add_dir(zipfile, path, prefix=''): ''' Add a directory recursively to the zip file with an optional prefix. ''' if prefix: zi = ZipInfo(prefix+'/') zi.external_attr = 16 zipfile.writestr(zi, '') cwd = os.path.abspath(os.getcwd())...
prodigeni/pdfmasher
ebooks/utils/zipfile.py
zipfile.py
py
661
python
en
code
0
github-code
6
[ { "api_name": "zipfile.ZipInfo", "line_number": 9, "usage_type": "call" }, { "api_name": "zipfile.writestr", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_n...
24905794273
import cadquery as cq from math import sin, cos, acos, radians, degrees from types import SimpleNamespace as Measures # A parametric Z axis end stop spacer for the Creality Ender 2 and Ender 3 3D printers. # # This spacer is to be glued with its mountplate face to the x axis assembly of the 3D printer, so that its spa...
tanius/cadquery-models
zspacer/z_spacer.py
z_spacer.py
py
1,998
python
en
code
11
github-code
6
[ { "api_name": "types.SimpleNamespace", "line_number": 21, "usage_type": "call" }, { "api_name": "cadquery.Workplane", "line_number": 32, "usage_type": "call" } ]
24990515775
import numpy as np import time import os import threading from tqdm import tqdm from tqdm import trange from multiprocessing import Process # class Reader(threading.Thread): class Reader(Process): def __init__(self, thread_no, file_list, file_dir, training_data, start_pos, end_pos): super(Reader, self).__...
Finallap/WiFi_Sensing_Python
data_loader/concurrent_study/csv_loader.py
csv_loader.py
py
3,193
python
en
code
5
github-code
6
[ { "api_name": "multiprocessing.Process", "line_number": 11, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.float16", "...
28652598391
from django.urls import path from . import views urlpatterns = [ path('', views.home, name='home'), path('contact_us/', views.contact, name='contact'), path('about_us/', views.about, name='about'), path('registeruser/', views.register, name='register'), path('loginuser/', views.user_login, name='lo...
Niraj-123456/FashionHub
my_project/urls.py
urls.py
py
868
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
41767558820
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN #四捨五入用 from itertools import permutations import numpy as np #xはlenが3のリストを想定. #要素は文字列を想定 def make_input(x): ans = [["h","h",x[0]],[x[0],"h",x[1]],[x[1],"s",x[2]],[x[2],"s","s"],["s","h","h"]] return ans #inputに自分の場合の事象を入れたら,8個の確率がでるよ. #確率は一つ目のkey...
faabl/class_seq
seq-1.py
seq-1.py
py
3,774
python
en
code
1
github-code
6
[ { "api_name": "decimal.Decimal", "line_number": 39, "usage_type": "call" }, { "api_name": "decimal.ROUND_HALF_UP", "line_number": 39, "usage_type": "name" }, { "api_name": "decimal.Decimal", "line_number": 58, "usage_type": "call" }, { "api_name": "itertools.permu...
21629245152
import argparse from data_preparation import make_training_data, max_padded_candidate_length, merge_vocab def get_arg_parser(): arg_parser = argparse.ArgumentParser() arg_parser.add_argument("--train_file", help="training data") arg_parser.add_argument("--silver_train_file", help="additional low quality...
bnmin/tdp_ranking
train.py
train.py
py
7,565
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "data_preparation.make_training_data", "line_number": 85, "usage_type": "call" }, { "api_name": "data_preparation.make_training_data", "line_number": 90, "usage_type": "call" ...
19768703962
#!/usr/bin/env python3 from __future__ import print_function, division import numpy as np def standard_grid(L): thetas = [] for i in range(1, L+1): if i % 2 == 0: theta = np.pi * (i - 1) / (2 * L - 1) else: theta = np.pi * (2 * L - i) / (2 * L - 1) thetas.appen...
praveenv253/sht
sht/grids.py
grids.py
py
843
python
en
code
2
github-code
6
[ { "api_name": "numpy.pi", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number":...
30573753276
#%% import pygame #%% class Visualiser: def __init__(self, display_width, display_height): self.X_BORDER_RATIO = 0.05 * 2 self.Y_BORDER_RATIO = 0.05 * 2 self.X_BORDER = display_width * self.X_BORDER_RATIO / 2 self.Y_BORDER = display_height * self.Y_BORDER_RATIO / 2 self....
alexandersoen/path_finder
visualiser.py
visualiser.py
py
3,395
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pygame.time.C...
34283115330
#!/usr/bin/env python # vim: et:tw=79:ts=4:sw=4 from __future__ import print_function, division import subprocess import os from os.path import join, exists import yaml import numpy as np from sklearn.svm import SVR from sklearn.linear_model import ARDRegression class GraphFile(object): """ Represent a graph o...
tchajed/partial-results
experiment.py
experiment.py
py
10,001
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 60, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 63, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 66, "usage_type": "call" }, { "api_name": "yaml.load", "line_number":...
34531773547
"""DjangoBackend URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class...
Glasgow19/team-9
Backend/DjangoBackend/DjangoBackend/urls.py
urls.py
py
3,012
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.routers.SimpleRouter", "line_number": 25, "usage_type": "name" }, { "api_name": "rest_framework.routers.Route", "line_number": 27, "usage_type": "call" }, { "api_name": "rest_framework.routers.Route", "line_number": 37, "usage_type": "call" ...
42248038663
import pickle from torch.utils.data import Dataset, DataLoader class VizWizDataset(Dataset): def __init__(self, data_dict): self.encoded_questions = data_dict['encoded_questions'] self.encoded_answers = data_dict['encoded_answers'] self.image_features = data_dict['image_features'] ...
reykoki/ugh
dataset.py
dataset.py
py
790
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 4, "usage_type": "name" } ]
30913349705
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('silver', '0029_plan_ec2count'), ] operations = [ migrations.RenameField( model_name='plan', old_name...
infomagnum-net/tcoapp
silver/migrations/0030_auto_20161110_0539.py
0030_auto_20161110_0539.py
py
389
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.RenameField", "line_number": 14, "usage_type": "call" }, ...
27146970463
import numpy as np import scipy.stats from sklearn.model_selection import train_test_split norms = {} timestamps = {} MEAN = None STD = None MIN = 20000 MAX = 0 normal = scipy.stats.norm(4.5, 1.08) features, labels = ([],[]) from sklearn.base import BaseEstimator, ClassifierMixin class Attack(BaseEstimator, Classi...
dyllew3/Timing-Attacks-Against-Opennym
Testing/baseline.py
baseline.py
py
3,852
python
en
code
0
github-code
6
[ { "api_name": "scipy.stats.stats.norm", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.stats.stats", "line_number": 13, "usage_type": "attribute" }, { "api_name": "scipy.stats", "line_number": 13, "usage_type": "name" }, { "api_name": "sklearn.bas...
11197048505
# USAGE # Start the server: # python run_front_server.py # Submit a request via Python: # python simple_request.py # import the necessary packages import pandas as pd from flask import render_template, request from wtforms import Form, TextAreaField, validators import pickle import numpy as np import dill import pand...
docinit/trauma_outcomes
trauma_outcomes/app/run_server.py
run_server.py
py
6,383
python
en
code
0
github-code
6
[ { "api_name": "dill._dill", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name":...
24756254365
import argparse import sys import os from distance_utils import time_series_twed from scipy.spatial.distance import squareform import itertools import pickle parser = argparse.ArgumentParser( description='Calculate distances of subsequences') parser.add_argument('--input_dir', required=True, type=str) parser.add...
luvalenz/time-series-variability-tree
2.2.twed.py
2.2.twed.py
py
1,914
python
en
code
2
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "lin...
14090003675
''' 目前已無作用。 為優化前主程式導入之物件class。 ''' import pygame class Ability(pygame.sprite.Sprite): def __init__(self, name, num, act, qty, x, y, zoom, lv, ab_point, ATK_growing, DEF_growing, HP_growing, ATK, DEF, SPD, HP, LUK): pygame.sprite.Sprite.__init__(self) self.name = name self.num = num ...
iank8622/Pygame
ability_value.py
ability_value.py
py
1,940
python
en
code
0
github-code
6
[ { "api_name": "pygame.sprite", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 10, "usage_type": "attribute" }, { "api_name": "py...
14789944317
from unittest.mock import MagicMock, ANY import pytest from gitgus.config import Config from gitgus.workflows.gus_wf import GusWorkflow from gitgus.gus.sobjects.work import Work from gitgus.gus.gus_client import GUSClient from tests.testing_utils import create_wi from tests.workflows.test_utils import _create_branch ...
mgfreshour/gitgus
tests/workflows/test_gus_wf.py
test_gus_wf.py
py
4,207
python
en
code
2
github-code
6
[ { "api_name": "gitgus.workflows.gus_wf.GusWorkflow", "line_number": 12, "usage_type": "name" }, { "api_name": "unittest.mock.MagicMock", "line_number": 13, "usage_type": "name" }, { "api_name": "unittest.mock.MagicMock", "line_number": 14, "usage_type": "name" }, { ...
36777291511
from typing import Callable, Any def check_correct(lexes, result, check: Callable[[Any, Any], bool]): assert len(lexes) == len(result) for lex, res in zip(lexes, result): if isinstance(lex, tuple) and isinstance(res, tuple): assert check_correct(lex, res, check) elif isinstance(le...
AzaubaevViktor/brainfuck_ng
lexer/tests/conftest.py
conftest.py
py
471
python
en
code
0
github-code
6
[ { "api_name": "typing.Callable", "line_number": 4, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 4, "usage_type": "name" } ]
24806850583
""" ============================================ vidgear library code is placed under the MIT license Copyright (c) 2019 Abhishek Thakur Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software with...
reddytocode/vidgear
vidgear/gears/camgear.py
camgear.py
py
11,377
python
en
code
null
github-code
6
[ { "api_name": "pkg_resources.parse_version", "line_number": 53, "usage_type": "call" }, { "api_name": "cv2.__version__", "line_number": 53, "usage_type": "attribute" }, { "api_name": "re.match", "line_number": 71, "usage_type": "call" }, { "api_name": "pafy.new", ...
24240947277
import pandas as pd from itertools import combinations import seaborn as sns import matplotlib.pyplot as plt class URMC: def __init__(self,features): """ Initializing weights and features """ self.feature_columns = features self.weights = {col: 0 for col in self.feature_col...
brittosabu/URMC
URMC.py
URMC.py
py
2,556
python
en
code
0
github-code
6
[ { "api_name": "itertools.combinations", "line_number": 25, "usage_type": "call" }, { "api_name": "seaborn.swarmplot", "line_number": 77, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 78, "usage_type": "call" }, { "api_name": "matpl...
8293360337
import abc from collections import defaultdict from typing import Callable, Literal, Optional import jax.numpy as np from jax import random import numpyro import numpyro.distributions as dist class ClassDecorator(abc.ABC): """ Class decorator interface. Must supply a __call__ method that takes one argum...
charles-river-analytics/sf_wrap
sf_wrap/wrap.py
wrap.py
py
19,003
python
en
code
2
github-code
6
[ { "api_name": "abc.ABC", "line_number": 11, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 18, "usage_type": "attribute" }, { "api_name": "abc.ABC", "line_number": 29, "usage_type": "attribute" }, { "api_name": "jax.random.PRNGKey"...
30030093588
import numpy as np import pandas as pd import pickle as pkl import os import sys import matplotlib.pyplot as plt from wordcloud import WordCloud from utils import stop_words, tokenize def draw_word_cloud(df, topic, n_articles=50, save=True): ftopic = df[df['topic_sorted']==topic] ftopic = ftopic.sort('weigh...
iyounus/tech_news_trends
word_cloud.py
word_cloud.py
py
2,126
python
en
code
0
github-code
6
[ { "api_name": "utils.tokenize", "line_number": 20, "usage_type": "call" }, { "api_name": "wordcloud.WordCloud", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotli...
37744647677
import requests from bs4 import BeautifulSoup from dataclasses import dataclass class Parser: ''' A class holding all the methods related to the interaction client -> website ''' link = 'https://www.imdb.com/' criterias = { 'Plot': 'plot', 'Quotes': 'quotes', 'Trivia': 'trivia', 'Goofs': 'goofs', 'Crazy ...
Sory-Noroc/MovieAll
tools.py
tools.py
py
3,831
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 28, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 123, "usage_type": "name" } ]
74223178747
from functools import cached_property import pandas import pymc as pm import pymc.math as pmmath from scipy.special import expit, logit import xarray import numpy from .pymc_model import PyMCModel class MUPCEloC(PyMCModel): "Centered variables for MUPCElo" model_name = "mu_pc_elo_c" weight_key = "pc_elo...
cpennington/yomi-skill
src/yomi_skill/models/mu_pc_elo_c.py
mu_pc_elo_c.py
py
2,234
python
en
code
0
github-code
6
[ { "api_name": "pymc_model.PyMCModel", "line_number": 13, "usage_type": "name" }, { "api_name": "scipy.special.logit", "line_number": 19, "usage_type": "call" }, { "api_name": "pymc.Model", "line_number": 25, "usage_type": "call" }, { "api_name": "pymc.Normal", ...
18847709784
import copy import os import logging import subprocess import contrib.ydb.tests.library.common.yatest_common as yatest_common from contrib.ydb.tests.library.harness.daemon import Daemon from contrib.ydb.tests.library.harness.kikimr_runner import get_unique_path_for_current_test, ensure_path_exists from cloud.blockstor...
ydb-platform/nbs
cloud/blockstore/tests/python/lib/disk_agent_runner.py
disk_agent_runner.py
py
20,063
python
en
code
32
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "contrib.ydb.tests.library.harness.daemon.Daemon", "line_number": 28, "usage_type": "name" }, { "api_name": "contrib.ydb.tests.library.common.yatest_common.PortManager", "line_number":...
12605621209
import asyncio import tornado.platform.asyncio from asr.server import MainHandler, TaskHandler if __name__ == '__main__': tornado.platform.asyncio.AsyncIOMainLoop().install() application = tornado.web.Application([ (r'/', MainHandler), (r'/tasks', TaskHandler), (r'/tasks/(.*)', TaskH...
tongda/asr-demo
main.py
main.py
py
421
python
en
code
0
github-code
6
[ { "api_name": "tornado.platform.asyncio.platform.asyncio.AsyncIOMainLoop", "line_number": 8, "usage_type": "call" }, { "api_name": "tornado.platform.asyncio.platform", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tornado.platform.asyncio", "line_number": 8, ...
4311934370
import requests from bs4 import BeautifulSoup def scrape_house_detail(url: str): # detail_page = requests.get(url) # house_detail_soup = BeautifulSoup(detail_page.text, "html.parser") # house_detail_file = open("house_detail.html", "w") # house_detail_file.write(detail_page.te...
psrijan/Data-Collection
detail_scraper.py
detail_scraper.py
py
1,567
python
en
code
0
github-code
6
[ { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" } ]
15561016721
import io from fastapi import FastAPI, UploadFile from PIL import Image from predict import model_predict app = FastAPI() @app.get("/") def read_root(): return "access /docs to see the post method!" @app.post("/predict") def predict_image(file: UploadFile): content = file.file.read() img = Image.open...
BrenoAV/ai-model-fastapi-docker
main.py
main.py
py
404
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 8, "usage_type": "call" }, { "api_name": "fastapi.UploadFile", "line_number": 17, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "lin...
26187068173
import pandas import os import regression from regression import * from functools import lru_cache regression.usecols=["Open", "High", "Low", "Close"] # redefine usecols @lru_cache(1) def run_correlator(): base_etf = 'spy.us' etf_list = [x[:x.rfind(".")] for x in os.listdir(base_dir)] df = get_data(etf...
thales-nascimento/cefetmg_ml_final_project
regressao_logistica/correlator.py
correlator.py
py
1,288
python
en
code
0
github-code
6
[ { "api_name": "regression.usecols", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 33, "usage_type": "call" }, { "api_name": "functools.lru_cach...
12574799254
import matplotlib.pyplot as plt import pygal from random_walk import RandomWalk from die import Die # Die Rolling Visualization with Matplotlib die_1 = Die() die_2 = Die() results = [die_1.roll() + die_2.roll() for _ in range(50000)] max_result = die_1.num_sides + die_2.num_sides frequencies = [results.count(value)...
NRinc/Visualization-data
combination of pygal and matplotlib/combination_of_pygal_and_matplotlib.py
combination_of_pygal_and_matplotlib.py
py
835
python
en
code
0
github-code
6
[ { "api_name": "die.Die", "line_number": 8, "usage_type": "call" }, { "api_name": "die.Die", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_num...
71314470587
import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import Qt class MyWindow(QWidget): def __init__(self): super().__init__() self.setupUI() def setupUI(self): self.setGeometry(800, 200, 700, 700) groupBox = QGroupBox("리뷰 요약") checkBox1 = QCheckBox(...
leekwangeun/22112022_Leekwangeun_SoftwareDesign
selenium/multicolumn.py
multicolumn.py
py
2,831
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtCore.Qt.AlignRight", "line_number": 67, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.Qt", "line_number": 67, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 81, "usage_type": "attribute" } ]
41198102030
import torch import argparse import os import re import numpy as np import PIL from torch import nn from torch.utils.data import DataLoader, Dataset, random_split from torchvision.transforms import ToTensor, Compose import torchvision.datasets as datasets from accelerate import Accelerator from torchvision.transforms ...
xi-studio/pl-swin-transformer
Unet/simple_unet.py
simple_unet.py
py
4,551
python
en
code
0
github-code
6
[ { "api_name": "torch.utils.data.Dataset", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.ones", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.ones", ...
30740786209
from random import randint import cv2 import matplotlib import numpy as np import tensorflow as tf from matplotlib import pyplot as plt from numpy.random import seed as np_seed from sklearn.utils import shuffle from tensorflow.python.framework.random_seed import set_seed from tensorflow.python.keras import Model from ...
Brachistochrone/computer-vision-course
homework_14/main.py
main.py
py
5,607
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 15, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matp...
23616964046
from setuptools import setup import pathlib # The directory containing this file HERE = pathlib.Path(__file__).parent # The text of the README file README = (HERE / "README.md").read_text(encoding='utf-8') setup( name='reactivity', version='0.0.2', py_modules=['reactivity'], description='a python vesi...
Xu-pixel/vue-reactivity-python
setup.py
setup.py
py
581
python
en
code
1
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" } ]
26067610655
import pytest from calcscore import round_score # you'll be picking what teams make it to the next round # - so picking 32, then 16, then 8, 4, 2, 1...i.e. round 1-6 winners # teams will have a name & a seed # seed doesn't change, so maybe make that not passed around w/ results def test_round_score_invalid_round():...
BrandonLeiran/bracket-scoring
test_calcscore.py
test_calcscore.py
py
809
python
en
code
0
github-code
6
[ { "api_name": "pytest.raises", "line_number": 10, "usage_type": "call" }, { "api_name": "calcscore.round_score", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 13, "usage_type": "call" }, { "api_name": "calcscore.round_sco...
70454123707
#!/usr/bin/env python3 import subprocess import argparse import os import glob import shutil import math from array import array def GlyRotHelper(glycur,glylen,glynum,glyend,gro_in,args,tempdir): print('current glycan contains residues ' + str(glycur) + ' to ' + str(glycur+glylen-1)) topfile = '../' + args.top tpr...
austenb28/GlyRot
bin/GlyRot.py
GlyRot.py
py
9,765
python
en
code
1
github-code
6
[ { "api_name": "subprocess.Popen", "line_number": 20, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 23, "usage_type": "attribute" }, { "api_name": "subprocess.PIPE", "line_number": 24, "usage_type": "attribute" }, { "api_name": "subprocess...
7854954782
from typing import List from day_8.part_1 import read_file class TreeVisibiltyCalc: data: List[List[str]] height: int width: int def __init__(self, data): self.data = data self.height = len(self.data) self.width = len(self.data[0]) def check_if_visible(self, character, l...
TrialAndErrror/advent-2022-python
day_8/part_2.py
part_2.py
py
2,488
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "day_8.part_1.read_file", "line_number": 67, "usage_type": "call" } ]
37114525939
import logging import matplotlib.pylab as plt import numpy as np from pyparsing import col import seaborn as sns from matplotlib.patches import Rectangle from stable_baselines3 import DQN from metareasoning_env import EXPANSION_STRATEGY_MAP, MetareasoningEnv RUN_NAME = 'fanciful-plant-61' RUN_CHECKPOINT = 'final' ...
justinsvegliato/metareasoning-for-state-abstractions
metareasoning_simulator.py
metareasoning_simulator.py
py
5,145
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 32, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 32, "usage_type": "attribute" }, { "api_name": "metareasoning_env.EXPANSION_STRATEGY_MAP.values", "line_number": 39, "usage_type": "call" }, { ...
72014619388
from mpqa_datahelpers import collect_opinion_entities import numpy as np import os import json import stanza from tqdm import tqdm from nltk.tokenize.simple import SpaceTokenizer tk = SpaceTokenizer() class Subelement(): def __init__(self, type, texts, offsets): self.type = type self.texts = tex...
jerbarnes/semeval22_structured_sentiment
data/mpqa/process_mpqa.py
process_mpqa.py
py
16,370
python
en
code
71
github-code
6
[ { "api_name": "nltk.tokenize.simple.SpaceTokenizer", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 184, "usage_type": "call" }, { "api_name": "numpy.argmin", "line_number": 185, "usage_type": "call" }, { "api_name": "numpy....
74173153788
# -*- coding: utf-8 -*- """Methods used in initialization of scanner.""" from collections import deque from copy import deepcopy from graphtransliterator import DirectedGraph import re def _constrained_parsers_of(constraints, long_parser, short_parser): """ Create a dict of parsers based on constraints. ...
urdubiometer/urdubiometer
urdubiometer/scanner/initialize.py
initialize.py
py
19,336
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 49, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 126, "usage_type": "call" }, { "api_name": "graphtransliterator.DirectedGraph", "line_number": 127, "usage_type": "call" }, { "api_name": "graphtra...
71157586749
import os import json from models.token import Token NULL_ADDRESS = "0x0000000000000000000000000000000000000000" # Contracts POLYGON_MATIC_ADDRESS = "0x0000000000000000000000000000000000001010" ZERION_ROUTER_ADDRESS = "0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F" ZERION_ROUTER_ABI = json.load(open(os.path.abspath("...
medadon41/zerion-swap
utils/constants.py
constants.py
py
2,027
python
en
code
2
github-code
6
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "json.load", "line_number":...
34418885123
from __future__ import annotations import random import cv2 import math import numpy as np from matplotlib import pyplot as plt from app_cv_test.common import * def show_image(title, img, destroy_all=True): cv2.imshow(title, img) cv2.waitKey(0) if(destroy_all): cv2.destroyAllWindows() def show_...
macchan1978/python_study
opencv_test.py
opencv_test.py
py
4,109
python
en
code
0
github-code
6
[ { "api_name": "cv2.imshow", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.Mat", "line_numb...
40252774085
import os from pathlib import Path from lib import create_from_template, add_git, create_project, get_title if __name__ == "__main__": DIR_PROJECT_FOLDER, args = create_project("electron") project = args.project file_name = Path.joinpath(DIR_PROJECT_FOLDER, "package.json") create_from_template("cep_...
nelreina/project-generator
src/create-electron-app.py
create-electron-app.py
py
2,796
python
en
code
0
github-code
6
[ { "api_name": "lib.create_project", "line_number": 8, "usage_type": "call" }, { "api_name": "pathlib.Path.joinpath", "line_number": 11, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "name" }, { "api_name": "lib.create_from_...
35816966845
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from itertools import product import os import numpy as np import pytest from chemreac import ReactionDiffusion from chemreac.symbolic import SymRD from chemreac.util.banded import get_banded from chemreac.util.grid import p...
chemreac/chemreac
chemreac/tests/test_reactiondiffusion.py
test_reactiondiffusion.py
py
34,142
python
en
code
14
github-code
6
[ { "api_name": "itertools.product", "line_number": 21, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.float64", ...
2052232108
import numpy as np import matplotlib.pyplot as plt n = int(input("Enter the number of terms:")) f = np.zeros(n, dtype=np.int16) a = 0 b = 1 for i in range(1, n): a, b = b, a+b # swap and unpack f[i] = a print("The fibonacci series upto {} term(s) is(are):".format(n), f) plt.figure() plt.plot(f, color='r',...
arunprasaad2711/Python_IISC_SIAM_2017
tryouts/fib.py
fib.py
py
527
python
en
code
8
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.int16", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
37731784103
import logging from assembler import Assembler from simplifier import Simplifier from decoder import Decoder from disassembler import Disassembler from utils.rendergraph import render_graph from verifier import verify_graph logger = logging.getLogger(__name__) def find_oep(insBytes): """ Finds the original ...
extremecoders-re/bytecode_simplifier
deobfuscator.py
deobfuscator.py
py
3,104
python
en
code
85
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "decoder.Decoder", "line_number": 24, "usage_type": "call" }, { "api_name": "disassembler.Disassembler", "line_number": 66, "usage_type": "call" }, { "api_name": "utils.ren...
71971229309
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json from containerregistry.client.v2 import docker_image as v2_image from containerregistry.client.v2 import util as v2_util from containerregistry.client.v2_2 import docker_digest from containerregis...
kubeflow/fairing
containerregistry/client/v2_2/v2_compat_.py
v2_compat_.py
py
9,845
python
en
code
336
github-code
6
[ { "api_name": "json.dumps", "line_number": 73, "usage_type": "call" }, { "api_name": "containerregistry.client.v2_2.docker_image.DockerImage", "line_number": 76, "usage_type": "attribute" }, { "api_name": "containerregistry.client.v2_2.docker_image", "line_number": 76, "u...
30929842095
from typing import List, Optional, Mapping, Any import torch import logging import asyncio from langchain import PromptTemplate, LLMChain, OpenAI from langchain.document_loaders import TextLoader, DirectoryLoader from langchain.text_splitter import CharacterTextSplitter from langchain.vectorstores import FAISS, Chroma...
inforix/lll
main.py
main.py
py
12,757
python
en
code
1
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.environ.get",...
38666397767
import time import datetime import numpy as np import cv2 import os import csv keypoint_names = [ "nose", "left_eye", "right_eye", "left_ear", "right_ear", "left_shoulder", "right_shoulder", "left_elbow", "right_elbow", "left_wrist", "right_wrist", "left_hip", "right...
kubabar1/MMPoseComputationComplexityTest
utils/pose_estimation_utils.py
pose_estimation_utils.py
py
3,368
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.copy", "line_number": 56, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number...
2126384578
import itertools from src.analyze import stance_analyze from src.classes.stance import Stance from src.classes.data import importance from src.classes.data.result_data import ResultData from src.constants import database as db_constants from src.constants import logger from src.constants import outcomes from src.datab...
WEB3-GForce/VOTE
src/analyze/decision_analyze.py
decision_analyze.py
py
8,118
python
en
code
1
github-code
6
[ { "api_name": "src.constants.logger.LOGGER.info", "line_number": 24, "usage_type": "call" }, { "api_name": "src.constants.logger.LOGGER", "line_number": 24, "usage_type": "attribute" }, { "api_name": "src.constants.logger", "line_number": 24, "usage_type": "name" }, {...
23404432532
"""The transcription command to run ASR providers against a dataset.""" import argparse import asyncio import importlib import json import os from pathlib import Path from typing import Dict, List, Tuple, Union import aiohttp from datasets import load_dataset from rich import print from rich.live import Live from ric...
Wordcab/rtasr
src/rtasr/cli/transcription_command.py
transcription_command.py
py
17,208
python
en
code
5
github-code
6
[ { "api_name": "argparse.Namespace", "line_number": 23, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 43, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 148, "usage_type": "name" }, { "api_name": "typ...
7730784450
# # streamlit_app.py import streamlit as st import psycopg2 import pandas as pd # Initialize connection. # Uses st.cache_resource to only run once. @st.cache_resource def init_connection(): return psycopg2.connect(**st.secrets["postgres"]) conn = init_connection() # Perform query. # Uses st.cache...
kaushik108108/JEE
jee_ranks.py
jee_ranks.py
py
3,971
python
en
code
0
github-code
6
[ { "api_name": "psycopg2.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "streamlit.secrets", "line_number": 11, "usage_type": "attribute" }, { "api_name": "streamlit.cache_resource", "line_number": 9, "usage_type": "attribute" }, { "api_name": "...
38678083172
import numpy as np import pandas as pd import matplotlib.pyplot as plt #gradient decent you should implement it def step_gradient(b_current, m_current, points, learningRate): N = float(len(points)) for i in range(0, len(points)): x = points[i, 0] y = points[i, 1] # h(x) = predicted_y = ...
5amessi/how-deep-is-deep-learning
linear_regression/practice/linear_regression.py
linear_regression.py
py
2,768
python
en
code
1
github-code
6
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 36, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 37, "usage_type": "call" }, { "api_name": "matpl...
4434463826
from django.urls import path from . import views app_name = 'detect' urlpatterns = [ # 로딩 화면 path('',views.index, name='index'), # uploadview path('uploadview/', views.uploadview, name='uploadview'), # main list 화면 path('listpage/', views.listpage, name='listpage'), # file upload pa...
hamahama9659/A.I.project_django_bigData
detect/urls.py
urls.py
py
691
python
en
code
1
github-code
6
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "django.urls.path", ...
427235322
# -*- coding: utf-8 -*- """ Tests for abagen.images module """ import gzip from pkg_resources import resource_filename import nibabel as nib import numpy as np import pandas as pd import pytest from abagen import images from abagen.matching import AtlasTree @pytest.fixture(scope='module') def annotation(tmp_path_f...
rmarkello/abagen
abagen/tests/test_images.py
test_images.py
py
9,091
python
en
code
75
github-code
6
[ { "api_name": "numpy.tile", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 21, "usage_type": "call" }, { "api_name": "nibabel.freesurfer.write_annot", "line_number": 30, "usage_type": "call" }, { "api_name": "nibabel.frees...
41296308589
from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.contrib.auth.views import LogoutView from django.contrib.auth import logout from django.contrib import messages from django.urls import reverse_lazy from django.utils.decorators import method_decorator fr...
aaricantto/kickit-development
backend/users/views/account.py
account.py
py
2,221
python
en
code
0
github-code
6
[ { "api_name": "users.models.EventManagerApplication.objects.get_or_create", "line_number": 22, "usage_type": "call" }, { "api_name": "users.models.EventManagerApplication.objects", "line_number": 22, "usage_type": "attribute" }, { "api_name": "users.models.EventManagerApplication...
70702894267
from flask import Flask, render_template, session, jsonify import requests app = Flask(__name__) app.secret_key = 'your_secret_key' # Set a secret key for session encryption @app.route("/") def home_page(): session['visits'] = session.get('visits', 0) + 1 # Increment page visit count return render_template(...
Haknin/jenkins_docker
app.py
app.py
py
1,332
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.session.get", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", ...
21359526810
"""Clean Code in Python - Chapter 7: Generators, Iterators, and Asynchronous Programming > Asynchronous programming / asynchronous iteration """ import asyncio async def coroutine(index: int) -> int: await asyncio.sleep(0.1) return index * 1_000 class RecordStreamer: def __init__(self, max_rows=100) ->...
rmariano/Clean-code-in-Python
book/src/ch07/src/async_iteration.py
async_iteration.py
py
1,132
python
en
code
145
github-code
6
[ { "api_name": "asyncio.sleep", "line_number": 9, "usage_type": "call" } ]
14728512830
from flask import Flask, render_template ,request from flask_sqlalchemy import SQLAlchemy from datetime import datetime app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:@localhost/enchatmoves' db = SQLAlchemy(app) class Contacts(db.Model): srNo = db.Column(db.Integer ,...
veda424/dance-website-using-flask
flask_1/main.py
main.py
py
1,144
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flask...
38401769015
#!bash/python from queue import Queue import socket import threading import pyfiglet import datetime from datetime import * # Banner ascii_banner = pyfiglet.figlet_format("NEED PORT SCANNER") print(ascii_banner) print("*" * 50) target = input('What target do you want to scan?: ') queue = Queue() open_ports = [] print("...
NEED-Programming/Python-Programs
Ethical Hacking/Port Scanners/Threaded_Port_Scanner.py
Threaded_Port_Scanner.py
py
1,917
python
en
code
0
github-code
6
[ { "api_name": "pyfiglet.figlet_format", "line_number": 9, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "socket.socket", "l...
35843718944
from defines import SolutionResult import json class Solution: def __init__(self, instance_name: str, algo_name: str, makespan: int = 0, sum: int = 0, result: str = SolutionResult.RUNNING.name, steps: list = None, extra_data= None): if steps is None: steps = [] if ext...
Ysommer/SoGC2021_tech
controlCenter/solution/solution.py
solution.py
py
2,103
python
en
code
0
github-code
6
[ { "api_name": "defines.SolutionResult.RUNNING", "line_number": 7, "usage_type": "attribute" }, { "api_name": "defines.SolutionResult", "line_number": 7, "usage_type": "name" }, { "api_name": "defines.SolutionResult", "line_number": 22, "usage_type": "name" }, { "a...