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
74537456828
import numpy as np, cv2 def draw_histo(hist, shape=(200, 256)): hist_img = np.full(shape, 255, np.uint8) # 흰색이 배경이 되도록 초기화 cv2.normalize(hist, hist, 0, shape[0], cv2.NORM_MINMAX) # 최솟값이 0, 최대값이 그래프의 높이 값을 갖도록 빈도값을 조정 gap = hist_img.shape[1]/hist.shape[0] for i, h in enumerate(hist): x =...
binlee52/OpenCV-python
Common/histogram.py
histogram.py
py
539
python
en
code
1
github-code
6
[ { "api_name": "numpy.full", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cv2.normalize", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.NORM_MINMAX", "line_nu...
42641515679
# -*- coding: utf-8 -*- # @Time : 2020/12/13 11:04 # @Author : Joker # @Site : # @File : draw.py # @Software: PyCharm import numpy as np import matplotlib.pyplot as plt m = 20 # 行 n = 2 # 列 c = 5 # 分类数量 test_point = [2, 6] # 测试点数据 if __name__ == '__main__': # 文件地址 path = "C:/Users/99259/source...
Chimaeras/Data_Mining_ex
src/category_draw.py
category_draw.py
py
3,852
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 45, "usage_type": "attribute" }, { "api_name": "matplotlib.py...
70416778427
from config import config import random import requests import chardet from db.db_select import sqlhelper import threading lock = threading.Lock() class Downloader(object): @staticmethod def download(url): try: r = requests.get(url=url, headers=config.get_header(), timeout=config.TIMEOUT)...
queenswang/IpProxyPool
spider/HtmlDownloader.py
HtmlDownloader.py
py
1,469
python
en
code
0
github-code
6
[ { "api_name": "threading.Lock", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "config.config.get_header", "line_number": 15, "usage_type": "call" }, { "api_name": "config.config", ...
21025178712
#!/usr/bin/env python3 import logging import sys from ev3dev2.motor import OUTPUT_A, OUTPUT_B, OUTPUT_C, MediumMotor from ev3dev2.control.rc_tank import RemoteControlledTank log = logging.getLogger(__name__) class TRACK3R(RemoteControlledTank): """ Base class for all TRACK3R variations. The only difference ...
ev3dev/ev3dev-lang-python-demo
robots/TRACK3R/TRACK3R.py
TRACK3R.py
py
2,002
python
en
code
59
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "ev3dev2.control.rc_tank.RemoteControlledTank", "line_number": 11, "usage_type": "name" }, { "api_name": "ev3dev2.control.rc_tank.RemoteControlledTank.__init__", "line_number": 20, ...
6460673982
import logging from pprint import pprint # noqa from olefile import isOleFile, OleFileIO from ingestors.support.timestamp import TimestampSupport from ingestors.support.encoding import EncodingSupport log = logging.getLogger(__name__) class OLESupport(TimestampSupport, EncodingSupport): """Provides helpers for...
alephdata/ingest-file
ingestors/support/ole.py
ole.py
py
2,390
python
en
code
45
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "ingestors.support.timestamp.TimestampSupport", "line_number": 11, "usage_type": "name" }, { "api_name": "ingestors.support.encoding.EncodingSupport", "line_number": 11, "usage_type...
19993528742
""" This script crawls data about Malaysian stock indices and stores the output in a csv file. """ import requests from bs4 import BeautifulSoup import time #Website to get the indices base_url = 'https://www.investing.com/indices/malaysia-indices?' print('Scraping: ' + base_url) headers = {'User-Agent':...
ammar1y/Data-Mining-Assignment
Web crawlers/Malaysian stock indices crawler.py
Malaysian stock indices crawler.py
py
3,548
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 61, "usage_type": "call" }, { "api_name": "time.strftime", "lin...
20972621530
import sys import random import math from tools.model import io import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from detection import box, anchors, display, evaluate, loss import argparse from detection.models import models from tools.image import cv def ran...
oliver-batchelor/detection
models/test.py
test.py
py
2,957
python
en
code
0
github-code
6
[ { "api_name": "random.uniform", "line_number": 21, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 22, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 24, "usage_type": "call" }, { "api_name": "random.uniform", "li...
37379394096
try: import Image import ImageDraw except: from PIL import Image from PIL import ImageDraw import glob import numpy as np import os import sys def image_clip(img_path, size): # 转换为数组进行分割操作,计算能完整分割的行数、列数 imarray = np.array(Image.open(img_path)) imshape = imarray.shape image_col = int(i...
faye0078/RS-ImgShp2Dataset
train_example/model/Fast_NAS/data/slip_img.py
slip_img.py
py
1,752
python
zh
code
1
github-code
6
[ { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 16, "usage_type": "name" }, { "api_name": "PIL.Image.fromarray", "line_...
14896890650
"""empty message Revision ID: 97dd2d43d5f4 Revises: d5e28ae20d48 Create Date: 2018-05-30 00:51:39.536518 """ # revision identifiers, used by Alembic. revision = '97dd2d43d5f4' down_revision = 'd5e28ae20d48' from alembic import op import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic ...
duvholt/memorizer
migrations/versions/97dd2d43d5f4_.py
97dd2d43d5f4_.py
py
828
python
en
code
16
github-code
6
[ { "api_name": "alembic.op.add_column", "line_number": 19, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 19, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.Boolean...
70211001788
from django.conf.urls import patterns, include, url from django.conf import settings from cer_manager.views import * # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'cer_manager.views.ho...
colive/cer_manager
urls.py
urls.py
py
1,030
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.patterns", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 19, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 20, "usage_type": "call" }, { "api_name": "dj...
10173968880
from configparser import ConfigParser # get the configparser object config_object = ConfigParser() # set config config_object["SERVERCONFIG_BROWSER"] = { "host": "127.0.0.1", "port": "8888", "web_directory": "www/" } config_object["SERVERCONFIG"] = { "host": "127.0.0.1", "port": "8080", } # Writ...
kaumnen/diy-http-server
config/config.py
config.py
py
428
python
en
code
0
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 4, "usage_type": "call" } ]
17287700821
import yaml import argparse from jinja2 import Environment, FileSystemLoader, Template def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--jobs', required=True) parser.add_argument('--job_config', required=True) return parser.parse_...
Chappers1992/Variability
run.py
run.py
py
759
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 15, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 17, "usage_type": "call" }, { "api_name": "jinja2.FileSystem...
71733863868
from logging import Logger from extract.adapters.airtable.credentials import AirtableCredentials from pyairtable import Table class AirTableAdapter: def __init__(self, logger: Logger, credentials: AirtableCredentials): self.logger = logger self.api_key = credentials.api_key self.base_id = ...
patrikbraborec/good-crm-analytics
src/extract/adapters/airtable/impl.py
impl.py
py
1,004
python
en
code
1
github-code
6
[ { "api_name": "logging.Logger", "line_number": 7, "usage_type": "name" }, { "api_name": "extract.adapters.airtable.credentials.AirtableCredentials", "line_number": 7, "usage_type": "name" }, { "api_name": "pyairtable.Table", "line_number": 18, "usage_type": "call" } ]
41791316904
import pytessy as pt from PIL import ImageFilter, Image if __name__ == "__main__": # Create pytessy instance ocrReader = pt.PyTessy() files = ["cell_pic.jpg"] for file in files: # Load Image img = Image.open(file) # Scale up image w, h = img.size img = img.resize((2 * w, 2 * h)) # Sharpen imag...
TheNova22/OurVision
legacy1/testtessy.py
testtessy.py
py
628
python
en
code
null
github-code
6
[ { "api_name": "pytessy.PyTessy", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 18, "usage_type": "name" }, { "api_name": "PIL.ImageFilter.SHARPEN", ...
26969758526
import os import time import numpy as np import torch from torchvision.utils import make_grid from torchvision.transforms import ToPILImage from base import BaseTrainer from evaluate import get_fid_score, get_i3d_activations, init_i3d_model, evaluate_video_error from utils.readers import save_frames_to_dir from model...
amjltc295/Free-Form-Video-Inpainting
src/trainer/trainer.py
trainer.py
py
21,228
python
en
code
323
github-code
6
[ { "api_name": "base.BaseTrainer", "line_number": 15, "usage_type": "name" }, { "api_name": "model.loss", "line_number": 31, "usage_type": "argument" }, { "api_name": "model.loss.AdversarialLoss", "line_number": 44, "usage_type": "call" }, { "api_name": "torchvisio...
13155871471
import serial import time # pass in upper and lower 8 bit values # returns the 16 bit value as an int # def PrintContcatBytes(valueOne, valueTwo): # print bin(valueOne)[2:].rjust(8,'0') class ReturnValue(object): def __init__(self, valid, pm10, pm25, pm100, num3, num5, num10, num25, num50, num100): self....
learnlafayette/sensors
sensors/sensors/test/samples/pm_sample.py
pm_sample.py
py
2,794
python
en
code
0
github-code
6
[ { "api_name": "serial.Serial", "line_number": 71, "usage_type": "call" } ]
1480464469
from jinja2 import DebugUndefined from app.models import db, Order from datetime import datetime def seed_orders(): christian = Order( userId=1, gigId=2, gigImage='https://nerdrr.s3.amazonaws.com/fruits-basket.jpg', deliveryInstructions='Please mail directly to me.', placed=datetime(2022, 6, 5, 8...
Amlovern/nerdrr
app/seeds/orders.py
orders.py
py
1,402
python
en
code
0
github-code
6
[ { "api_name": "app.models.Order", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "app.models.Order"...
25069435045
from typing import List, Any, Tuple from ups_lib.av_request import AddressValidationRequest from purplship.core.utils import ( XP, DP, request as http, exec_parrallel, Serializable, Deserializable, Envelope, Pipeline, Job, ) from purplship.api.proxy import Proxy as BaseProxy from pur...
danh91/purplship
sdk/extensions/ups/purplship/mappers/ups/proxy.py
proxy.py
py
3,654
python
en
code
null
github-code
6
[ { "api_name": "purplship.api.proxy.Proxy", "line_number": 18, "usage_type": "name" }, { "api_name": "purplship.mappers.ups.settings.Settings", "line_number": 19, "usage_type": "name" }, { "api_name": "purplship.core.utils.Serializable", "line_number": 21, "usage_type": "n...
18100941624
""" 739. Daily Temperatures https://leetcode.com/problems/daily-temperatures/ """ from typing import List from unittest import TestCase, main class Solution: def dailyTemperatures(self, temperatures: List[int]) -> List[int]: stack: List[int] = [] # List of indexes, not temperatures answer ...
hirotake111/leetcode_diary
leetcode/739/solution.py
solution.py
py
1,081
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "name" } ]
21340780197
import sqlite3 from recipe import Recipe, Quantity, stringsToQuantities class Database: def __init__(self,database): self.connection = sqlite3.connect(database) self.c = self.connection.cursor() # self.c.execute("""DROP TABLE IF EXISTS ingredients""") # self.c.execute("""DROP T...
fcopp/RecipeApplication
backend/backend.py
backend.py
py
7,842
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "recipe.name", "line_number": 60, "usage_type": "attribute" }, { "api_name": "recipe.name", "line_number": 65, "usage_type": "attribute" }, { "api_name": "recipe.name", "l...
1369504657
# -*- coding: utf-8 -*- import RPi.GPIO as GPIO import time, datetime from lcd import * from Email import * import server lcd_init () GPIO.setmode(GPIO.BOARD) print('System start/restart - ' + str(datetime.datetime.now())) #Switch for Bin 1 to be connected to pin 18 and 3.3v pin #Switch for Bin 2 to be connected to...
CraigHissett/TM_Timber
BinSensor/BinSensor.py
BinSensor.py
py
1,875
python
en
code
0
github-code
6
[ { "api_name": "RPi.GPIO.setmode", "line_number": 10, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 10, "usage_type": "name" }, { "api_name": "RPi.GPIO.BOARD", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now",...
21114723474
import os from dotenv import load_dotenv, dotenv_values # FOR LOG import logging from logging.handlers import RotatingFileHandler import datetime import math import json # Load environmental variable config = dotenv_values(".env") # --------------------------------------------------- LOGGING ---------------...
Splroak/add_member_telegram
src/test_BatchProcessor.py
test_BatchProcessor.py
py
2,365
python
en
code
0
github-code
6
[ { "api_name": "dotenv.dotenv_values", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_...
24117960481
import gym import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Categorical import numpy as np from skimage.transform import resize # hyper params gamma = 0.98 class Policy(nn.Module): def __init__(self): super(Policy, sel...
sachinumrao/pytorch_tutorials
cnn_breakout_rl.py
cnn_breakout_rl.py
py
4,757
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 38, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
43371065244
from selenium import webdriver from selenium.webdriver.common.keys import Keys class Spider: try: page = webdriver.Chrome() url = "https://music.163.com/#/song?id=31654747" page.get(url) search = page.find_element_by_id("srch") search.send_keys("aaa") search.send_ke...
frebudd/python
autoinput.py
autoinput.py
py
382
python
en
code
2
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.keys.Keys.ENTER", "line_number": 12, "usage_type": "attribute" }, ...
28800521491
"""Function to calculate the enrichment score for a given similarity matrix.""" import numpy as np import pandas as pd from typing import List, Union import scipy from cytominer_eval.utils.operation_utils import assign_replicates def enrichment( similarity_melted_df: pd.DataFrame, replicate_groups: List[str]...
cytomining/cytominer-eval
cytominer_eval/operations/enrichment.py
enrichment.py
py
2,845
python
en
code
7
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 11, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "lin...
9837240055
from urllib.parse import urljoin import requests import json from fake_useragent import UserAgent from lxml import html import re from pymongo import MongoClient ua = UserAgent() movie_records = [] first = True base_url = "https://www.imdb.com/" url = "https://www.imdb.com/search/title/?genres=drama&groups=top_250&sor...
shreyashettyk/DE
Imdb_data_extraction/imdb.py
imdb.py
py
2,184
python
en
code
0
github-code
6
[ { "api_name": "fake_useragent.UserAgent", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 17, "usage_type": "call" }, { "api_name": "lxml.html",...
19239185532
# stack ! 과제는 끝나지 않아! # 효율 고려 X, 하나 넣고 하나 빼기 import sys from collections import deque input = sys.stdin.readline N = int(input()) S = deque() # 과제 넣어두는 스택 tot = 0 # 총 점수 for _ in range(N): W = list(map(int, input().split())) if W[0]: # 새 과제가 있다면 if W[2] == 1: # 지금 바로 끝낼 수 있으면 점수 바로 더해주기 ...
sdh98429/dj2_alg_study
BAEKJOON/stack/b17952.py
b17952.py
py
878
python
ko
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" } ]
11900486194
import dash from dash import html from matplotlib import container from navbar import create_navbar import dash_bootstrap_components as dbc from dash import Dash, html, dcc, Input, Output import plotly.express as px import pandas as pd f_sb2021 = pd.read_csv("f_sb2021.csv", on_bad_lines='skip', sep=';') f_sb2022 = pd....
jeanpierec/ljpiere_projects
DataScience_projects/Proyecto5_DS4ABucaramanga/home.py
home.py
py
4,956
python
en
code
1
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
38701948852
#coding=utf8 import config import json import sys, time py3k = sys.version_info.major > 2 import os.path import urllib if py3k: from urllib import parse as urlparse else: import urlparse def get_one(): return config.dbconn().fetch_rows('http', condition={'checked': 0}, order="id asc", limit="1", fetchone=True) de...
5alt/ZeroExploit
parser.py
parser.py
py
2,452
python
en
code
4
github-code
6
[ { "api_name": "sys.version_info", "line_number": 5, "usage_type": "attribute" }, { "api_name": "config.dbconn", "line_number": 15, "usage_type": "call" }, { "api_name": "urlparse.urlparse", "line_number": 43, "usage_type": "call" }, { "api_name": "json.loads", ...
17441173344
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import streamlit as st import ptitprince as pt def scatter_plot(df,fig): hobbies = [] for col in df.columns: hobbies.append(col) print(col) st.title(" Scatter Plot") hobby = st.selectbox("X-axis: ", hobbies) #...
imsanjoykb/Data-Analytics-Tool-Development
apps/graphs.py
graphs.py
py
4,249
python
en
code
3
github-code
6
[ { "api_name": "streamlit.title", "line_number": 12, "usage_type": "call" }, { "api_name": "streamlit.selectbox", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 15, "usage_type": "call" }, { "api_name": "streamlit.selectb...
14150647036
import json import re from requests_toolbelt import MultipartEncoder from todayLoginService import TodayLoginService from liteTools import * class AutoSign: # 初始化签到类 def __init__(self, todayLoginService: TodayLoginService, userInfo): self.session = todayLoginService.session self.host = today...
zuiqiangdexianyu/ruoli-sign-optimization
actions/autoSign.py
autoSign.py
py
16,038
python
en
code
null
github-code
6
[ { "api_name": "todayLoginService.TodayLoginService", "line_number": 12, "usage_type": "name" }, { "api_name": "todayLoginService.session", "line_number": 13, "usage_type": "attribute" }, { "api_name": "todayLoginService.host", "line_number": 14, "usage_type": "attribute" ...
72729319867
# External dependencies import openai import io import os import tempfile from datetime import datetime from flask import render_template, request, url_for, redirect, flash, Response, session, send_file, Markup from flask_login import login_user, login_required, logout_user, current_user from flask_mail import Message ...
joaomorossini/Clever-Letter-Generator
routes.py
routes.py
py
10,934
python
en
code
1
github-code
6
[ { "api_name": "flask.request.headers.get", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.request.headers", "line_number": 20, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 20, "usage_type": "name" }, { "api_name": "ap...
33846054954
from jwst.stpipe import Step from jwst import datamodels from ..datamodels import TMTDarkModel from . import dark_sub from ..utils.subarray import get_subarray_model __all__ = ["DarkCurrentStep"] class DarkCurrentStep(Step): """ DarkCurrentStep: Performs dark current correction by subtracting dark curr...
oirlab/iris_pipeline
iris_pipeline/dark_current/dark_current_step.py
dark_current_step.py
py
1,857
python
en
code
0
github-code
6
[ { "api_name": "jwst.stpipe.Step", "line_number": 12, "usage_type": "name" }, { "api_name": "jwst.datamodels.open", "line_number": 27, "usage_type": "call" }, { "api_name": "jwst.datamodels", "line_number": 27, "usage_type": "name" }, { "api_name": "datamodels.TMTD...
2856090188
import unittest from conans.test.tools import TestClient from conans.util.files import load import os import platform class ConanEnvTest(unittest.TestCase): def conan_env_deps_test(self): client = TestClient() conanfile = ''' from conans import ConanFile class HelloConan(ConanFile): name = "...
AversivePlusPlus/AversivePlusPlus
tools/conan/conans/test/integration/conan_env_test.py
conan_env_test.py
py
2,180
python
en
code
31
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "conans.test.tools.TestClient", "line_number": 11, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 45, "usage_type": "call" }, { "api_name": "os...
72332661307
#!/usr/bin/env python3 import os import configparser from mongoengine.connection import connect from .data_model import Post from .render_template import render from .mailgun_emailer import send_email def email_last_scraped_date(): ## mongodb params (using configparser) config = configparser.ConfigParser() ...
alysivji/reddit-top-posts-scrapy
top_post_emailer/__init__.py
__init__.py
py
917
python
en
code
14
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.abspath",...
25575181895
from typing import List class Solution: def rotate(self, nums: List[int], k: int) -> None: new_array = [1]*len(nums) for i in range(len(nums)): new_p = (i - k)%len(nums) new_array[i] = nums[new_p] return new_array s = Solution() l = [1,2,3,4,5,6,7] x = s.rotate(l,...
ThadeuFerreira/python_code_challengers
rotate_array.py
rotate_array.py
py
331
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
35116816269
# Import the libraries import cv2 import numpy as np import math as m from matplotlib import pyplot as plt #-- PRE-PROCESSING -- # Read the image nimg = 'image1' # Change 'image1' for the name of your image image = cv2.imread(nimg + '.jpg') # Extract the RGB layers of the image rgB = np.matrix(image[:,:,0]) # Blue rGb...
selenebpradop/basic_exercises-computer_vision
contours_of_an_image_v2.py
contours_of_an_image_v2.py
py
2,461
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number"...
74750166267
from src.components import summarizer from celery import Celery from celery.utils.log import get_task_logger from EmailSender import send_email logger = get_task_logger(__name__) celery = Celery( __name__, backend="redis://127.0.0.1:6379", broker="redis://127.0.0.1:6379" ) @celery.task(name="summarizer") def Gma...
SVijayB/Gist
scripts/flask_celery.py
flask_celery.py
py
816
python
en
code
4
github-code
6
[ { "api_name": "celery.utils.log.get_task_logger", "line_number": 6, "usage_type": "call" }, { "api_name": "celery.Celery", "line_number": 7, "usage_type": "call" }, { "api_name": "src.components.summarizer.summarize", "line_number": 16, "usage_type": "call" }, { "...
25293805211
import unittest from task import fix_encoding expected_content = """Roses are räd. Violets aren't blüe. It's literally in the name. They're called violets. """ filename = "example.txt" output = "output.txt" class TestCase(unittest.TestCase): def setUp(self) -> None: with open(filename, "w") as f: ...
DoctorManhattan123/edotools-python-course
Strings, inputs and files/file encoding/tests/test_task.py
test_task.py
py
604
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "task.fix_encoding", "line_number": 21, "usage_type": "call" } ]
6146581577
import datetime import pyttsx3 import speech_recognition as sr import wikipedia import webbrowser import pywhatkit import time import threading import newsapi import random maquina = pyttsx3.init() voz = maquina.getProperty('voices') maquina.setProperty('voice', voz[1].id) def executa_comando(): t...
lucasss45/Fryday-IA
alfredv2.6.py
alfredv2.6.py
py
6,390
python
pt
code
0
github-code
6
[ { "api_name": "pyttsx3.init", "line_number": 12, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 18, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 19, "usage_type": "call" }, { "api_name...
26829773618
####################################### # This file computes several characteristics of the portage graph ####################################### import math import sys import core_data import hyportage_constraint_ast import hyportage_data import utils import graphs import host.scripts.utils from host.scripts impor...
HyVar/gentoo_to_mspl
host/statistics/statistics.py
statistics.py
py
14,279
python
en
code
10
github-code
6
[ { "api_name": "math.sqrt", "line_number": 33, "usage_type": "call" }, { "api_name": "host.scripts.utils.scripts", "line_number": 37, "usage_type": "attribute" }, { "api_name": "host.scripts.utils", "line_number": 37, "usage_type": "name" }, { "api_name": "sys.maxi...
26239060381
#!/usr/bin/env python3 ''' This script will incement the major version number of the specified products. It is assumed that the version number in the label itself is correct, and the version just needs to be added on to the filename. Usage: versioning.py <label_file>... ''' import re import os import sys from bs4 im...
sbn-psi/data-tools
orex/pds4-tools/versioning.py
versioning.py
py
5,949
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
71470012027
from lxml import etree from xml.etree import ElementTree def get_text_from_file(xml_file): tree = etree.parse(xml_file) root = tree.getroot() for element in root.iterfind('.//para'): for ele in element.findall('.//display'): parent = ele.getparent() parent.remove(ele) ...
ayandeephazra/Natural_Language_Processing_Research
PaperDownload/papers/process_xml.py
process_xml.py
py
349
python
en
code
2
github-code
6
[ { "api_name": "lxml.etree.parse", "line_number": 6, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 6, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.dump", "line_number": 12, "usage_type": "call" }, { "api_name": "xml.etree.Elemen...
23704854533
#!/usr/bin/env python3 import json import os import requests import datetime base_url="https://raw.githubusercontent.com/threatstop/crl-ocsp-whitelist/master/" uri_list=['crl-hostnames.txt','crl-ipv4.txt','crl-ipv6.txt','ocsp-hostnames.txt','ocsp-ipv4.txt','ocsp-ipv6.txt'] dict=dict() dict['list']=list() def source_r...
007Alice/misp-warninglists
tools/generate-crl-ip-list.py
generate-crl-ip-list.py
py
943
python
en
code
null
github-code
6
[ { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 28, "usage_type": "attribute" }, { "api_name": "json.dumps", ...
43005467228
""" Utility functions """ import torch import matplotlib as mpl import numpy as np import math mpl.use('Agg') from matplotlib import pyplot as plt def sin_data(n_train, n_test, noise_std, sort=False): """Create 1D sine function regression dataset :n_train: Number of training samples. :n_test: Number of t...
weiyadi/dlm_sgp
conjugate/utils.py
utils.py
py
4,966
python
en
code
2
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.sin", "line_number": 22, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.rand", "line_number": ...
30969861276
import matplotlib.pyplot as plt import time import numpy as np from PIL import Image class graphic_display(): def __init__(self): self.um_per_pixel = 0.5 self.cm_hot = plt.get_cmap('hot') self.cm_jet = plt.get_cmap('jet') self.cm_vir = plt.get_cmap('virid...
peterlionelnewman/flow_lithographic_printer
Graphic_display.py
Graphic_display.py
py
6,222
python
en
code
1
github-code
6
[ { "api_name": "matplotlib.pyplot.get_cmap", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.get_cmap", "line_number": 10, "usage_type": "call" }, { "api_name": ...
39607752443
import logging import os from django.conf import settings from django.core.management.base import BaseCommand from core.management.commands import configure_logging from core.models import Batch, OcrDump configure_logging("dump_ocr_logging.config", "dump_ocr.log") _logger = logging.getLogger(__name__) class Comma...
open-oni/open-oni
core/management/commands/dump_ocr.py
dump_ocr.py
py
1,024
python
en
code
43
github-code
6
[ { "api_name": "core.management.commands.configure_logging", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 15, "usage_type": "...
2962541494
# TomoPy recon on Cyclone: compare different algorithms import tomopy import dxchange import numpy as np import os import logging from time import time def touint8(data, quantiles=None): # scale data to uint8 # if quantiles is empty data is scaled based on its min and max values if quantiles == None: ...
SESAME-Synchrotron/BEATS_recon
tests/Cyclone/tomopy_testCyclone_recon_algorithms_comparison.py
tomopy_testCyclone_recon_algorithms_comparison.py
py
2,975
python
en
code
0
github-code
6
[ { "api_name": "numpy.min", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.quantile", "line_number": 2...
20186345178
# Import pakages import torch import torch.nn as nn import gym import os import torch.nn.functional as F import torch.multiprocessing as mp import numpy as np # Import python files from utils import v_wrap, set_init, push_and_pull, record from shared_adam import SharedAdam os.environ["OMP_NUM_THREADS"] = "1" os.enviro...
smfelixchoi/MATH-DRL-study
6.A3C/discrete_A3C.py
discrete_A3C.py
py
4,973
python
en
code
1
github-code
6
[ { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "gym.make", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_...
21379925078
from bogos import ScrapeBogos import configparser import twitter def lambda_handler(event, context): config = configparser.ConfigParser() config.read('config.ini'); keywords = '' keywordMultiWord = False url = '' prefixText = '' postfixText = '' noBogoText = '' print('Config values:') if 'BOGO' n...
DFieldFL/publix-bogo-notification
BogoMain.py
BogoMain.py
py
2,732
python
en
code
2
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 7, "usage_type": "call" }, { "api_name": "bogos.ScrapeBogos", "line_number": 61, "usage_type": "call" }, { "api_name": "bogos.initialize", "line_number": 62, "usage_type": "call" }, { "api_name": "bogos.get...
16704497954
import pickle import numpy as np import scipy.io as sio from library.error_handler import Error_Handler class Data_Loader: def load_data_from_pkl(self, filepath_x, filepath_y, ordering="True"): with open(filepath_x, "rb") as file_x: x_data = pickle.load(file_x) with o...
tzee/EKDAA-Release
library/data_loader.py
data_loader.py
py
2,380
python
en
code
2
github-code
6
[ { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_numbe...
36064906771
''' Created on 2017-1-13 @author: xuls ''' from PIL import Image import os PATH2=os.path.dirname(os.getcwd()) def classfiy_histogram(image1,image2,size = (256,256)): image1 = image1.resize(size).convert("RGB") g = image1.histogram() image2 = image2.resize(size).convert("RGB") s = ima...
xulishuang/qichebaojiadaquan
src/script/sameas.py
sameas.py
py
1,917
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number...
162022841
import time from selenium import webdriver from django.contrib.staticfiles.testing import StaticLiveServerTestCase from .pages.login import LoginPage class ManageUserTestCase(StaticLiveServerTestCase): def setUp(self): self.browser = webdriver.Firefox() self.browser.implicitly_wait(20) s...
pophils/TaskManagement
yasanaproject/tests/functional/test_manage_user.py
test_manage_user.py
py
2,447
python
en
code
1
github-code
6
[ { "api_name": "django.contrib.staticfiles.testing.StaticLiveServerTestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type...
70602414269
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 19 11:06:45 2020 @author: xchen """ ## required packages # system imports import os import sys from termcolor import colored from colorama import init # data manipulation and data clean from nltk.corpus import stopwords # sklearn from sklearn imp...
linnvel/text-classifier-master
ML.py
ML.py
py
5,072
python
en
code
0
github-code
6
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 34, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 34, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 47, "usage_type": "call" }, { "api_name": "os.pat...
34608371364
import os.path import json import os def readDIPfile(parent_path): edges = {} index = 0 xmlfilepath = os.path.join(parent_path, r'data\Hsapi20170205CR.txt') f = open(xmlfilepath) lines = f.readlines() for line in lines: line_list = line.strip("\n").split("\t") if line_list[9] ==...
LittleBird120/DiseaseGenePredicition
DiseaseGenePredicition/Human_COVID_node2vec20210315/data_processing/readHumanProtein.py
readHumanProtein.py
py
919
python
en
code
0
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": "json.dump", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number"...
1435864274
import math import numpy as np import cv2 from matplotlib import pyplot as plt def Euclidean_Distance(pointA, pointB): ans = ((pointA[0] - pointB[0])**2+(pointA[1] - pointB[1])**2)**0.5 return ans def Flat_Kernel(distance, bandwidth, point_number): inRange = [] weight = np.zeros((point_numb...
laitathei/algorithm_implemention
machine_learning/Mean_Shift/utils.py
utils.py
py
1,331
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 21, ...
8519707697
import bs4 as bs import requests import regex as re import pandas as pd from src.config import * def get_page_body(url: str): try: response = requests.get(url, timeout=10) if response.status_code == 200: page = bs.BeautifulSoup(response.text) return page.body except req...
bakalstats/py_project
src/scraping_utils.py
scraping_utils.py
py
2,826
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 14, "usage_type": "attribute" }, { "api_name": "requests.exce...
73795089468
import json import os from flask import current_app, redirect, request, Response from . import blueprint @blueprint.route("/routes") def routes(): data = { "name": current_app.config["name"], "version": current_app.config["version"], "routes": { "api": [ "/api/...
cumbof/igv-flask
igv/routes/basics.py
basics.py
py
1,385
python
en
code
0
github-code
6
[ { "api_name": "flask.current_app.config", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.current_app.config", "line_number": 12, "usage_type": "attribute" }, { "api...
6448028292
import datetime import time import MySQLdb import cv2, os cascadePath = ("haarcascade_frontalface_default.xml") faceCascade = cv2.CascadeClassifier(cascadePath) recognizer = cv2.face.LBPHFaceRecognizer_create() recognizer.read('dataTrain/train.yml') now = datetime.datetime.now() def getProfile(id): db = MySQLdb....
Kuroboy/Presensi-Face
faceRec.py
faceRec.py
py
1,634
python
en
code
0
github-code
6
[ { "api_name": "cv2.CascadeClassifier", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.face.LBPHFaceRecognizer_create", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.face", "line_number": 8, "usage_type": "attribute" }, { "api_name": "d...
73900222588
# coding: utf-8 import unittest import os from django.conf import settings from studitemps_storage.path import guarded_join from studitemps_storage.path import guarded_safe_join from studitemps_storage.path import guarded_join_or_create from studitemps_storage.path import FileSystemNotAvailable ABSPATH = os.path.a...
STUDITEMPS/studitools_storages
studitemps_storage/tests/suites/path.py
path.py
py
3,073
python
en
code
0
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
25571472390
import logging # fmt = "%(name)s----->%(message)s----->%(asctime)s" # logging.basicConfig(level="DEBUG",format=fmt) # logging.debug("这是debug信息") # logging.info('这是info信息') # logging.warning('这是警告信息') # logging.error('这是错误信息') # logging.critical('这是cri信息') logger = logging.getLogger('heihei') #默认的打印级别是WARNING,所以当跟控制台...
lishuangbo0123/basic
history_study/test.py
test.py
py
1,059
python
zh
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.Fil...
25754911493
import os from multiprocessing import freeze_support,set_start_method import multiprocessing from Optimization import Optimization from GA import RCGA from PSO import PSO if __name__=='__main__': from datetime import datetime start = datetime.now() print('start:', start.strftime("%m.%d.%H.%M")) multipr...
zhengjunhao11/model-updating-framework
program_framework/Input.py
Input.py
py
1,002
python
en
code
1
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" }, { "api_name": "multiprocessing.freeze_support", "line_number": 12, "usage_type": "call" }, { "api_name":...
1066446639
""" This module defines the interface for communicating with the sound module. .. autoclass:: _Sound :members: :undoc-members: :show-inheritance: """ import glob import os import platform import subprocess from functools import partial from opsoro.console_msg import * from opsoro.sound.tts import TTS from o...
OPSORO/OS
src/opsoro/sound/__init__.py
__init__.py
py
4,683
python
en
code
9
github-code
6
[ { "api_name": "functools.partial", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.dirname", ...
73816196028
import numpy as np import matplotlib.pyplot as plt import difuzija as di import sys sys.getdefaultencoding() def rho(x): if x >= 2.0 and x <= 5.0: return 5.5 else: return 0.0 j = [0, 100, 200, 300, 400] t = [0.5*J for J in j] P1 = [0.0, 20.0, 0.0, t[0]] #pocetni uvjeti P2 = [0.0, 20.0, 0....
FabjanJozic/MMF3
Predavanje12_PDJ/Zadatak1.py
Zadatak1.py
py
1,404
python
en
code
0
github-code
6
[ { "api_name": "sys.getdefaultencoding", "line_number": 6, "usage_type": "call" }, { "api_name": "difuzija.D_exp", "line_number": 26, "usage_type": "call" }, { "api_name": "difuzija.D_exp", "line_number": 27, "usage_type": "call" }, { "api_name": "difuzija.D_exp", ...
14594327515
import tensorflow as tf import json from model_provider import get_model from utils.create_gan_tfrecords import TFRecordsGAN from utils.augment_images import augment_autoencoder import os import tensorflow.keras as K import datetime import string from losses import get_loss, gradient_penalty import argparse physical_d...
AhmedBadar512/Badr_AI_Repo
cycle_gan_train.py
cycle_gan_train.py
py
18,298
python
en
code
2
github-code
6
[ { "api_name": "tensorflow.config.experimental.list_physical_devices", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.config", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorflow.config.experimental.set_memory_growth", "line_number":...
36914067207
from django.urls import path from rest_framework import routers from user_accounts import views router = routers.DefaultRouter() # router.register('users', user_viewsets) urlpatterns = [ path('create_user/', views.create_user.as_view(), name='create_user'), path('login_user/', views.login_user.as_view(), name...
AmbeyiBrian/ELECTRONIC-SCHOOL-MANAGER-KENYA
elimu_backend/user_accounts/urls.py
urls.py
py
649
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 5, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_nam...
74927169786
''' The photon Project ------------------- File: read_conf.py This file reads the configuration file @author: R. THOMAS @year: 2018 @place: ESO @License: GPL v3.0 - see LICENCE.txt ''' #### Python Libraries import configparser import os class Conf: """ This Class defines the arguments to be calle to use...
astrom-tom/Photon
photon/read_conf.py
read_conf.py
py
3,134
python
en
code
3
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
74182045309
"""feature for malware.""" import os.path from abc import ABC, abstractmethod import numpy as np import filebrowser import lief from capstone import * class Feature(ABC): """interface for all feature type.""" def __init__(self): super().__init__() self.dtype = np.float32 self.name =...
dagrons/try
feature/feature.py
feature.py
py
3,314
python
en
code
0
github-code
6
[ { "api_name": "abc.ABC", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.float32", "line_number": 17, "usage_type": "attribute" }, { "api_name": "abc.abstractmethod", "line_number": 20, "usage_type": "name" }, { "api_name": "abc.ABC", "line_num...
9380859967
import numpy as np import time, glob, cv2 from pymycobot import MyCobotSocket from pymycobot import PI_PORT, PI_BAUD from single_aruco_detection import marker_detecting from forward_kinematics import F_K from inverse_kinematics import I_K import matplotlib.pyplot as plt from scipy.linalg import orthogonal_procrustes ...
zzZzzccHEnn/Visual_Tracking
evaluation.py
evaluation.py
py
3,833
python
en
code
0
github-code
6
[ { "api_name": "numpy.load", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 25, ...
23595304281
import os import re import time from option import Option import pandas as pd import wget as wget from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait import download __author__ = 'Song Hui' # 作者名 def get_options_from_command_line(): ...
songofhawk/simplerpa
test/test_selenium/facebook_download.py
facebook_download.py
py
4,871
python
en
code
15
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "option.Option", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "l...
41707501948
import tensorflow as tf from config import cfg def detect_loss(): def get_box_highest_percentage(arr): shape = tf.shape(arr) reshaped = tf.reshape(arr, (shape[0], tf.reduce_prod(shape[1:-1]), -1)) # returns array containing the index of the highest percentage of each batch # wher...
burnpiro/tiny-face-detection-tensorflow2
model/loss.py
loss.py
py
1,942
python
en
code
27
github-code
6
[ { "api_name": "tensorflow.shape", "line_number": 7, "usage_type": "call" }, { "api_name": "tensorflow.reshape", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.reduce_prod", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.ar...
13348518622
import argparse import datetime import pathlib import subprocess import sys import time import run_all_utils command = ''' python ../modules/S3segmenter/large/S3segmenter.py --imagePath "{}" --stackProbPath "{}" --outputPath "{}" --probMapChan {probMapChan} --area-max 50000 -...
Yu-AnChen/orion-scripts
processing/command-s3seg.py
command-s3seg.py
py
2,454
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 35, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 37, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 51, "usage_type": "call" }, { "api_name": "run_all_utils.init...
10966555857
import json class Config(dict): def __init__(self, path=None, section='default', *args, **kwargs): super().__init__(*args, **kwargs) if path is not None: self.read(path, section) def read(self, path, section='default'): '''read config from config file. will...
lycsjm/acgnmanager
src/lib/config.py
config.py
py
1,751
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 52, "usage_type": "call" } ]
8632528934
from multiprocessing import cpu_count from deepsecrets.core.utils.fs import path_exists QUOTA_FILE = '/sys/fs/cgroup/cpu/cpu.cfs_quota_us' PERIOD_FILE = '/sys/fs/cgroup/cpu/cpu.cfs_period_us' CGROUP_2_MAX = '/sys/fs/cgroup/cpu.max' class CpuHelper: def get_limit(self) -> int: multiproc_limit = self._by...
avito-tech/deepsecrets
deepsecrets/core/utils/cpu.py
cpu.py
py
1,763
python
en
code
174
github-code
6
[ { "api_name": "multiprocessing.cpu_count", "line_number": 20, "usage_type": "call" }, { "api_name": "deepsecrets.core.utils.fs.path_exists", "line_number": 27, "usage_type": "call" }, { "api_name": "deepsecrets.core.utils.fs.path_exists", "line_number": 35, "usage_type": ...
32749134758
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import confusion_matrix, classification_report def main(): # the g...
AleksandarPav/Decision-Tree-and-Random-Forest
main.py
main.py
py
3,272
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib...
40170866347
import os import numpy as np import cv2 import imutils import sys np.set_printoptions(threshold=sys.maxsize) corner_shapes_map = { 3: "triangle", 4: "rectangle", 5: "pentagon", 6: "hexagon" } model_prediction_map = { 0: "triangle", 1: "rectangle", 2: "circle" } def get_corners_in_canva...
nirajsrimal/UWB_2FA
BackEnd/solver.py
solver.py
py
2,434
python
en
code
1
github-code
6
[ { "api_name": "numpy.set_printoptions", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.findContours", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.RETR_EXTER...
73016396668
# TODO save output in a set to remove duplicated warnings import sys import time import subprocess import linecache rules = { "false":[ "PyArg_ParseTuple" ], "NULL":[ "Py_BuildValue", "PyLong_FromLong", #"PyBytes_FromStringAndSize", #"PyBytes_AsString", #"Py...
S4Plus/pyceac
checkers/2/checker.py
checker.py
py
4,376
python
en
code
3
github-code
6
[ { "api_name": "subprocess.Popen", "line_number": 51, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 51, "usage_type": "attribute" }, { "api_name": "linecache.getline", "line_number": 65, "usage_type": "call" }, { "api_name": "linecache.get...
36406902723
#!/usr/bin/env python # -*- coding: utf-8 -* import os import csv import cloudpickle import numpy as np import pandas as pd from scipy.integrate import quad from scipy.stats import ( gaussian_kde, ks_2samp, t ) from sklearn.feature_selection import SelectorMixin from sklearn.base import Tr...
mcrts/dmatch
dmatch/utils.py
utils.py
py
11,860
python
en
code
1
github-code
6
[ { "api_name": "csv.QUOTE_ALL", "line_number": 31, "usage_type": "attribute" }, { "api_name": "numpy.random.default_rng", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 44, "usage_type": "attribute" }, { "api_name": "numpy.l...
41648714624
import unittest from PIL import Image import numpy as np from texture.analysis import CoOccur class MyTestCase(unittest.TestCase): def test_offset_slices(self): slices = CoOccur._offset_slices(4, 225) self.assertEqual(slices, ([[None, -3], [3, None]], [[3, None], [None, -3]])) pixels = np...
MatteoZanella/siv-texture-analysis
tests/test_com.py
test_com.py
py
2,951
python
en
code
1
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "texture.analysis.CoOccur._offset_slices", "line_number": 9, "usage_type": "call" }, { "api_name": "texture.analysis.CoOccur", "line_number": 9, "usage_type": "name" }, { ...
41236509775
from django.urls import path from rest_framework.routers import DefaultRouter from . import views urlpatterns = [ ] router = DefaultRouter() router.register("porcelain", viewset=views.PorcelainView, basename="porcelain") router.register("dynasty", viewset=views.DynastyView, basename="dynasty") router.register("Empe...
beishangongzi/porcelain-backend
predict_model/urls.py
urls.py
py
412
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 10, "usage_type": "call" } ]
18390234941
from django import template from photos.models import GalleryCustom register = template.Library() @register.filter def stripgallery(title): """ Remove gallery prefix from photo titles of the form gallery__mytitle. """ idx = title.find("__") if idx < 0: return title return title[idx+...
ria4/tln
photos/templatetags/photos_extras.py
photos_extras.py
py
1,682
python
en
code
3
github-code
6
[ { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" }, { "api_name": "photos.models.GalleryCustom.objects.filter", "line_number": 24, "usage_type": "call" }, { "...
5896021463
import torch import torch.utils.data as data import numpy as np from collections import defaultdict from tqdm import tqdm from copy import deepcopy import config_data as conf import random infor_train_data_path = np.load('/content/drive/MyDrive/DASR-WGAN/data/dianping/version3/infor_train.npy', allow_pickle = True).t...
PeiJieSun/AAAI-submission
DataModule_domain_infor.py
DataModule_domain_infor.py
py
19,566
python
en
code
0
github-code
6
[ { "api_name": "numpy.load", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 13, ...
16090817554
from django.urls import path from . import api_endpoints as views from .api_endpoints.Contacts.ContactsList.views import ContactListAPIView app_name = 'about' urlpatterns = [ path('addresses/', views.AddressListAPIView.as_view(), name='address_list'), path('company_stats/', views.CompanyStatListAPIView.as_vi...
bilolsolih/decormax
apps/about/urls.py
urls.py
py
863
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
25097408304
# -*- coding: utf-8 -*- """ Created on Fri Jul 15 09:34:07 2022 @author: maria """ import numpy as np import pandas as pd from numpy import zeros, newaxis import matplotlib.pyplot as plt import scipy as sp from scipy.signal import butter,filtfilt,medfilt import csv import re #getting the F traces which are classi...
mariacozan/Analysis_and_Processing
functions/functions2022_07_15.py
functions2022_07_15.py
py
26,567
python
en
code
0
github-code
6
[ { "api_name": "numpy.load", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number":...
22555751097
from flask_app.config.mysqlconnection import connectToMySQL from flask import flash class Product: db = "my_solo" def __init__(self, data): self.id = data['id'] self.wood = data['wood'] self.thickness = data['thickness'] self.description = data['description'] self.crea...
tsu112/solo_project
flask_app/models/product.py
product.py
py
2,288
python
en
code
1
github-code
6
[ { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 20, "usage_type": "call" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL", "line_number": 27, "usage_type": "call" }, { "api_name": "flask_app.config.mysqlconnection.connectToMySQL",...
30357845811
import unittest from traits.api import Enum, HasTraits, Int, Str, Instance from traitsui.api import HGroup, Item, Group, VGroup, View from traitsui.menu import ToolBar, Action from traitsui.testing.api import Index, IsVisible, MouseClick, UITester from traitsui.tests._tools import ( create_ui, requires_toolkit...
enthought/traitsui
traitsui/qt/tests/test_ui_panel.py
test_ui_panel.py
py
8,436
python
en
code
290
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 15, "usage_type": "name" }, { "api_name": "traits.api.Int", "line_number": 17, "usage_type": "call" }, { "api_name": "traits.api.Str", "line_number": 18, "usage_type": "call" }, { "api_name": "traits.api.Instanc...
15409655756
""" 一个网站域名,如"discuss.leetcode.com",包含了多个子域名。作为顶级域名,常用的有"com",下一级则有"leetcode.com",最低的一级为"discuss.leetcode.com"。当我们访问域名"discuss.leetcode.com"时,也同时访问了其父域名"leetcode.com"以及顶级域名 "com"。 给定一个带访问次数和域名的组合,要求分别计算每个域名被访问的次数。其格式为访问次数+空格+地址,例如:"9001 discuss.leetcode.com"。 接下来会给出一组访问次数和域名组合的列表cpdomains 。要求解析出所有域名的访问次数,输出格式和输入格式相同,...
Octoberr/letcode
easy/811subdomainvisitcount.py
811subdomainvisitcount.py
py
1,796
python
zh
code
1
github-code
6
[ { "api_name": "collections.Counter", "line_number": 27, "usage_type": "call" } ]
17642557437
import os from flask import Flask, request, jsonify from flask_pymongo import PyMongo from bson import ObjectId import bcrypt import jwt import ssl import datetime from functools import wraps from dotenv import load_dotenv load_dotenv('.env') app = Flask(__name__) app.config['MONGO_URI'] = os.environ.get('MONGO_URI')...
abhi1083/simple_crud_ops
main.py
main.py
py
6,831
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_...
45333966266
from markdown import markdown from unittest import TestCase from markdown_vimwiki.extension import VimwikiExtension class TestExtension(TestCase): def test_default_config(self): source = """ Hello World =========== * [-] rejected * [ ] done0 * [.] done1 * [o] done2 * [O] done3 * [X] done...
makyo/markdown-vimwiki
markdown_vimwiki/tests/test_extension.py
test_extension.py
py
1,499
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "markdown.markdown", "line_number": 38, "usage_type": "call" }, { "api_name": "markdown_vimwiki.extension.VimwikiExtension", "line_number": 38, "usage_type": "call" }, { "ap...
13489533801
import json import requests resource = requests.post('http://216.10.245.166/Library/DeleteBook.php', json = {"ID" : "ashish123227"}, headers={'Content-Type' : 'application/json' } ) assert resource.status_code == 200 , f'the api failed with an error messages as : {resource.text}' response...
bhagatashish/APT_Testing
delete_book.py
delete_book.py
py
462
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 5, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" } ]
18777503409
from flask import Flask from flask import render_template from pymongo import MongoClient import json from bson import json_util from bson.json_util import dumps import random import numpy as np import ast import pandas as pd from sklearn import preprocessing from sklearn.cluster import KMeans from sklearn.metrics.pair...
rbadri91/N.C.-Crime-Data-Visualization
app.py
app.py
py
11,214
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 35, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 39, "usage_type": "call" }, { "api_name": "json.dumps", ...
20426981888
""" All rights reserved. --Yang Song (songyangmri@gmail.com) --2021/1/7 """ import os import pickle import random from abc import abstractmethod from lifelines import CoxPHFitter, AalenAdditiveFitter from lifelines.utils.printer import Printer from lifelines import utils from SA.Utility import mylog from SA.DataConta...
salan668/FAE
SA/Fitter.py
Fitter.py
py
2,221
python
en
code
121
github-code
6
[ { "api_name": "SA.DataContainer.DataContainer", "line_number": 24, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pickle.dump"...
5005373290
from typing import Any, Iterable, MutableMapping from typing_extensions import TypeAlias from .. import etree from .._types import Unused, _AnyStr, _ElemClsLookupArg, _FileReadSource from ._element import HtmlElement _HtmlElemParser: TypeAlias = etree._parser._DefEtreeParsers[HtmlElement] # # Parser # # Stub versio...
abelcheung/types-lxml
lxml-stubs/html/_parse.pyi
_parse.pyi
pyi
5,211
python
en
code
23
github-code
6
[ { "api_name": "typing_extensions.TypeAlias", "line_number": 8, "usage_type": "name" }, { "api_name": "_element.HtmlElement", "line_number": 8, "usage_type": "name" }, { "api_name": "_element.HtmlElement", "line_number": 19, "usage_type": "name" }, { "api_name": "_...
30366690531
""" Example of how to use a DataView and bare renderers to create plots """ from numpy import linspace, sin, cos # Enthought library imports. from chaco.api import ( DataView, ArrayDataSource, ScatterPlot, LinePlot, LinearMapper, ) from chaco.tools.api import PanTool, ZoomTool from enable.api impo...
enthought/chaco
chaco/examples/demo/data_view.py
data_view.py
py
2,098
python
en
code
286
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 21, "usage_type": "name" }, { "api_name": "traits.api.Instance", "line_number": 22, "usage_type": "call" }, { "api_name": "enable.api.Component", "line_number": 22, "usage_type": "argument" }, { "api_name": "tra...
40194290799
import tweepy import time print('Starting bot....') CONSUMER_KEY = "Cqw4pXPk4lz2EEUieSDKjKuQT" CONSUMER_SECRET = "AhQZvxkBNS2bmXdUOX8tu5SoZi9vYdNimwmTuzkE9ZJJuzTEk5" ACCES_KEY = "1323551878483865600-LVgJ1466OXyOnZqKNt4H3k0hBBQlmO" ACCES_SECRET = "yWdPUmakm5Cn4eMURajaZkNkbeaXgLhzvD7msCsB5Ipxw" auth = tweepy.OAuthHandl...
byte-exe/bot-reply-back_tweets
twt_bot.py
twt_bot.py
py
1,355
python
en
code
0
github-code
6
[ { "api_name": "tweepy.OAuthHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 45, "usage_type": "call" } ]
21141343602
import asyncio import math import sys from collections import Counter, defaultdict from pprint import pprint import aiohttp import async_timeout import click import matplotlib.pyplot as plt import numpy as np import pandas as pd from pyecharts import Bar as Line from pyecharts import Overlap from lucky.commands impor...
onecans/my
mystockservice/lucky/commands/min_max_counter.py
min_max_counter.py
py
3,486
python
en
code
2
github-code
6
[ { "api_name": "lucky.commands.util.fetch", "line_number": 22, "usage_type": "call" }, { "api_name": "lucky.commands.util", "line_number": 22, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 24, "usage_type": "call" }, { "api_name": ...
43078051498
import time from datadog import initialize from datadog import api as dogapi from datadog.dogstatsd.base import DogStatsd from datadog.dogstatsd.context import TimedContextManagerDecorator from flask import g, request class TimerWrapper(TimedContextManagerDecorator): def __init__(self, statsd, *args, **kwargs): ...
sky107/python-lab-project-sky
pyprojectbackend/lib/python3.9/site-packages/flask_datadog.py
flask_datadog.py
py
13,019
python
en
code
0
github-code
6
[ { "api_name": "datadog.dogstatsd.context.TimedContextManagerDecorator", "line_number": 10, "usage_type": "name" }, { "api_name": "datadog.dogstatsd.base.DogStatsd", "line_number": 98, "usage_type": "call" }, { "api_name": "flask.g.flask_datadog_start_time", "line_number": 139...
33626128629
import jsonlines import os from pathlib import Path from xml_handler import XmlHandler from google_cloud_storage_client import GoogleCloudStorageClient def main(event, context): # Retrieve file from GCS input_filename = event.get("name") input_bucket_name = event.get("bucket") output_bucket_name = os...
MeneerBunt/MarjolandHarvestData
src/convert_xml_to_json/main.py
main.py
py
1,202
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "google_cloud_storage_client.GoogleCloudStorageClient", "line_number": 15, "usage_type": "call" }, { ...
21202048829
from kivy.uix.label import Label from kivy.uix.textinput import TextInput from kivy.uix.gridlayout import GridLayout from kivy.uix.scrollview import ScrollView from app.main import ShowcaseScreen from app.widgets.heartfelt_hellos_button import HeartfeltHellosButton from app.widgets.heartfelt_hellos_step_progression_but...
JelindoGames/HeartfeltHellos
app/data/screen_types/deprecated/idea_creation_screen.py
idea_creation_screen.py
py
4,316
python
en
code
0
github-code
6
[ { "api_name": "app.main.ShowcaseScreen", "line_number": 11, "usage_type": "name" }, { "api_name": "kivy.uix.gridlayout.GridLayout", "line_number": 22, "usage_type": "call" }, { "api_name": "kivy.uix.scrollview.ScrollView", "line_number": 24, "usage_type": "call" }, { ...
16930544030
from __future__ import absolute_import from .dataset_iter import default_collate, DatasetIter from .samplers import RandomSampler, SequentialSampler import torch import os import os.path import warnings import fnmatch import math import numpy as np try: import nibabel except: warnings.warn('Cant import nib...
huiyi1990/torchsample
torchsample/datasets.py
datasets.py
py
12,057
python
en
code
null
github-code
6
[ { "api_name": "warnings.warn", "line_number": 19, "usage_type": "call" }, { "api_name": "warnings.warn", "line_number": 24, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_numb...