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
5170664594
# ============================================================================== # File: modeling_data.py # Project: allison # File Created: Tuesday, 23rd November 2021 9:14:48 pm # Author: Dillon Koch # ----- # Last Modified: Tuesday, 23rd November 2021 9:14:49 pm # Modified By: Dillon Koch # ----- # # ----- # buildin...
DillonKoch/Sports_Betting
Data_Cleaning/modeling_data.py
modeling_data.py
py
20,862
python
en
code
0
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sys.path.append", "...
27928842006
import scipy.sparse as sparse import numpy as np from Layers.Base import Base class Dropout(Base): def __init__(self, probability): self.probability = probability self.trainable = False self.testing_phase = False self.random_selection = None def forward(self, input_tensor): ...
7atem60010/DeepLearning-Labs
Exercise 3/src_to_implement/Layers/Dropout.py
Dropout.py
py
1,005
python
en
code
0
github-code
21
[ { "api_name": "Layers.Base.Base", "line_number": 6, "usage_type": "name" }, { "api_name": "scipy.sparse.random", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.sparse", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.ones", "li...
71954817332
from abc import abstractmethod, ABC import torch import numpy as np from utils.TSP import TSP from utils.Grid import Grid, MIN_LAT, MIN_LNG, MIN_LAT_MELB, MIN_LNG_MELB from tsptw.functions import get_sequence from mcs.nets.DRL import TaskSelectingState TIME_SCALE = 0.01 DEPOT_INDEX = 43 class Solver(ABC): def ...
SongTunes/SMORE
solver/Solver.py
Solver.py
py
11,721
python
en
code
0
github-code
21
[ { "api_name": "abc.ABC", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.device", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda", "line_n...
13773066703
"""Concatenates multiple fasta files into one""" import sys import csv import re from Bio import SeqIO from extract_gb_info import get_locus from yaml_io import read_yaml def get_fasta_reference_concat(fasta_ref): """ The get_fasta_reference_concat function takes a fasta file as inputand returns the concatena...
RdrigoE/insaflu_snakemake
workflow/scripts/concat_segments.py
concat_segments.py
py
7,552
python
en
code
1
github-code
21
[ { "api_name": "Bio.SeqIO.parse", "line_number": 22, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 22, "usage_type": "name" }, { "api_name": "Bio.SeqIO.parse", "line_number": 53, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_numbe...
11224184102
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of parltrack. # parltrack is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
parltrack/parltrack
old_scrapers/amendments.py
amendments.py
py
32,089
python
en
code
67
github-code
21
[ { "api_name": "tempfile.mkstemp", "line_number": 38, "usage_type": "call" }, { "api_name": "os.fdopen", "line_number": 39, "usage_type": "call" }, { "api_name": "parltrack.utils.fetch_raw", "line_number": 40, "usage_type": "call" }, { "api_name": "sh.pdftotext", ...
41187948843
from django.contrib import admin from django.http import HttpResponseRedirect from django.urls import path from .models import Menu, MenuItem admin.site.register(Menu) @admin.register(MenuItem) class MenuItemAdmin(admin.ModelAdmin): # Add button to update all keys and levels. change_list_template = 'entitie...
wenerikk5/treemenu
menu/admin.py
admin.py
py
1,999
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.admin.site.register", "line_number": 7, "usage_type": "call" }, { "api_name": "models.Menu", "line_number": 7, "usage_type": "argument" }, { "api_name": "django.contrib.admin.site", "line_number": 7, "usage_type": "attribute" }, { "ap...
8123472126
import copy, os import numpy as np import matplotlib.pyplot as plt import pandas as pd import data_utils as data_utils import matplotlib.lines as mlines from lifelines import statistics from os.path import join from sklearn.manifold import TSNE from matplotlib.patches import Patch from matplotlib import cm from scipy ...
PHOENIXcenter/SRPS
scripts_py/viz_utils.py
viz_utils.py
py
37,062
python
en
code
0
github-code
21
[ { "api_name": "data_utils.get_km_curve", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 44, "usage_type": "call" }, { "api_name": "lifelines.statistics....
8589092383
import requests import configparser import psycopg2 from sql_queries import drop_table_queries, create_table_queries def drop_tables(cur, conn): """ The function to drop table Parameters: cur : The cursor that will be used to execute queries. conn : The connection towards current conn...
afontana1/Data-Engineering
projects/Data Engineering/etl-api-to-table/etl_frameio.py
etl_frameio.py
py
2,282
python
en
code
2
github-code
21
[ { "api_name": "sql_queries.drop_table_queries", "line_number": 15, "usage_type": "name" }, { "api_name": "sql_queries.create_table_queries", "line_number": 29, "usage_type": "name" }, { "api_name": "configparser.ConfigParser", "line_number": 37, "usage_type": "call" }, ...
12146431688
import scrapy, re from dc2019.items import Dc2019Item class Elect2019Spider(scrapy.Spider): name = 'elect2019' allowed_domains = ['elections.gov.hk'] start_urls = ['https://www.elections.gov.hk/dc2019/chi/results_hk.html', 'https://www.elections.gov.hk/dc2019/eng/results_hk.html'] db = {} items = ...
sammyfung/hkdistrictcouncil2019
dc2019/dc2019/spiders/elect2019.py
elect2019.py
py
7,902
python
en
code
2
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 19, "usage_type": "call" }, { "api_name": "re.search", "line_number": 25, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 50,...
42546998712
#!/usr/bin/env python from __future__ import print_function import roslib import sys import rospy import cv2 from std_msgs.msg import String from sensor_msgs.msg import Image import sensor_msgs.point_cloud2 as pc2 from cv_bridge import CvBridge, CvBridgeError import message_filters import open3d as o3d from open3d_r...
MinchangSung0223/multi_view
test_image.py
test_image.py
py
4,481
python
en
code
0
github-code
21
[ { "api_name": "rospy.init_node", "line_number": 24, "usage_type": "call" }, { "api_name": "cv_bridge.CvBridge", "line_number": 25, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 26, "usage_type": "call" }, { "api_name": "sensor_msgs.msg.Im...
69907159092
from random import randint from flask import Flask, render_template, request, session, redirect app = Flask(__name__) app.secret_key ='testsecretkey' @app.route('/') def index(): if "num" not in session: print(randint(1,100)) session["num"] = randint(1,100) session["list...
TheTechieYeti/Python
flask/fundamentals/great_number_game/server.py
server.py
py
1,443
python
en
code
1
github-code
21
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 8, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.session", "line_numbe...
24636820007
""" " This script downloads files from a webpage to a folder in the same directory as this script. " It works by scraping the HTML, extracting the links, and downloading files using " appropriately parsed links. " " @author Andy Vuong " """ # note to self: Make more "pythonic" later. from lxml import html from lxml im...
andyvuong/data-scripts
scrapers/get-files.py
get-files.py
py
5,070
python
en
code
2
github-code
21
[ { "api_name": "urllib.request.request.urlopen", "line_number": 28, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 28, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 28, "usage_type": "name" }, { "api_nam...
33632430089
import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy import interpolate def sep(): plt.figure(figsize=(8, 8)) goes.plot() plt.ylabel('FPDO') plt.yscale('log') plt.show() energy = [6.643, 12.61, 20.55, 46.62, 103.7, 154.6] eimax = interpolat...
niki-papavasileiou/SPE-Analysis
main.py
main.py
py
11,611
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylabel", "line_number": 11, "usage_type": "call" }, { "api_name": "mat...
23728837400
from sklearn.neighbors import KNeighborsRegressor from sklearn.model_selection import train_test_split def knn_regressor(dataframe, n_neighbors, weights, target, *args): features = list(*args) X = dataframe[features] y = dataframe[target] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)...
rpanasiuk/House-price-estimation
server/model/model.py
model.py
py
419
python
en
code
0
github-code
21
[ { "api_name": "sklearn.model_selection.train_test_split", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsRegressor", "line_number": 13, "usage_type": "call" } ]
7173240477
import tempfile import os.path from jumpscale.loader import j import pytest @pytest.fixture def tear_down(autouse=True): yield if j.sals.fs.exists("/tmp/x"): j.sals.fs.rmtree("/tmp/x") if j.sals.fs.exists("/tmp/x.gz"): j.sals.fs.rmtree("/tmp/x.gz") def test_compress(tear_down): with ...
threefoldtech/js-ng
tests/data/tarfile/test_tar_file.py
test_tar_file.py
py
1,290
python
en
code
5
github-code
21
[ { "api_name": "jumpscale.loader.j.sals.fs.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "jumpscale.loader.j.sals", "line_number": 10, "usage_type": "attribute" }, { "api_name": "jumpscale.loader.j", "line_number": 10, "usage_type": "name" }, { ...
72788707894
from collections import defaultdict from settings import DB_HOST, DB_NAME, DB_PASSWORD, DB_USER, db class Artist: def __init__(self, name, artist_id: str, guild_id: int = None, latest_release_id: str = None, latest_release_name=None, role_id: int = None): self.id = artist_id ...
AndrewKassab/fanbot
utils/database.py
database.py
py
5,331
python
en
code
3
github-code
21
[ { "api_name": "settings.db", "line_number": 27, "usage_type": "name" }, { "api_name": "settings.DB_HOST", "line_number": 34, "usage_type": "name" }, { "api_name": "settings.DB_USER", "line_number": 35, "usage_type": "name" }, { "api_name": "settings.DB_PASSWORD", ...
26163112647
from datetime import timedelta import os import multiprocessing def here(*dirs): return os.path.join(os.path.abspath(os.path.dirname(__file__)), *dirs) BASE_DIR = here('..') def root(*dirs): return os.path.join(os.path.abspath(BASE_DIR), *dirs) # Quick-start development settings - unsuitable for product...
drgarcia1986/pbb
pbb/settings/common.py
common.py
py
3,667
python
en
code
1
github-code
21
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_nu...
27612777764
import torch.nn.functional as F from torch import nn from torch.nn.utils import spectral_norm class LocalLayer(nn.Module): def __init__(self, n_input=84, n_output=2, nonlinearity=False): super().__init__() self.nonlinearity = nonlinearity layers = [] if nonlinearity: l...
AvivSham/pFedHN
experiments/pfedhn_pc/models.py
models.py
py
3,725
python
en
code
156
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.ReLU", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
4824926967
import itertools class Leaf: id_iter = itertools.count() def __init__(self, up, down, right, left): self.up = up self.down = down self.right = right self.left = left self.parents = [] # Adjacent Leaves (Max of 4 in general position) self.left_top = None ...
multiojuice/TrapezoidalMap-PointLocations
leaf.py
leaf.py
py
3,716
python
en
code
0
github-code
21
[ { "api_name": "itertools.count", "line_number": 4, "usage_type": "call" } ]
41311169588
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('signup', views.signup, name='signup'), path('userlogin', views.userlogin, name='userlogin'), path('librlogin', views.librlogin, name='librlogin'), path('userhome', views.userhome, name='userh...
HemankBajaj/Library_Management
library_management/library/urls.py
urls.py
py
1,274
python
en
code
0
github-code
21
[ { "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", ...
30378070866
from selenium import webdriver import unittest import logging from phptravels_pages.credential_page import CredentialPage from phptravels_pages.main_page import MainPage from phptravels_tests.read_config_data import ReadConfigData class DubaiTourReservationTest(unittest.TestCase): """This class tests flight reser...
tosmansk/Dubai_Repo
phptravels_tests/test_tour_reservation.py
test_tour_reservation.py
py
5,261
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "phptravels_tests.read_config_data.ReadConfigData", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 26, "usage_type": "cal...
10242221210
from django.conf import settings from tendenci.apps.site_settings.utils import get_setting from tendenci.apps.theme.utils import get_theme_info def theme(request): contexts = {} if 'theme' in request.GET and request.user.profile.is_superuser: if request.GET.get('theme'): request.session['t...
musasesay/membershiptemplet
tendenci/apps/theme/context_processors.py
context_processors.py
py
1,086
python
en
code
1
github-code
21
[ { "api_name": "tendenci.apps.site_settings.utils.get_setting", "line_number": 17, "usage_type": "call" }, { "api_name": "django.conf.settings.USE_S3_STORAGE", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 21, "usage_t...
7900000555
#!/usr/bin/python import subprocess import statistics import sys def main(): time_collections = [] for i in range(20): print("Run " + str(i) + " . . .") # Send command # cmd = "TIMEFORMAT=%R && time sh scripts/run.sh " + sys.argv[1] + " " + sys.argv[2] + " 2>&1 >/dev/null | tail -n...
luisrmendes/dQuantumSim
scripts/runBenchmarks.py
runBenchmarks.py
py
1,034
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "subprocess.check_output", "line_number": 19, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 29, "usage_type": "call" }, { "api_name": "statistics.medi...
40549619912
from http import HTTPStatus from unittest.mock import MagicMock from uuid import UUID import pytest from tests.common import StubDIContainer from common import AgentHeartbeat from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic AGENT_ID = UUID("7029dfac-8f87-490b-9a82-e5d005040d99") TIMESTAMP...
guardicore/monkey
monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_heartbeat.py
test_agent_heartbeat.py
py
1,598
python
en
code
6,367
github-code
21
[ { "api_name": "uuid.UUID", "line_number": 11, "usage_type": "call" }, { "api_name": "unittest.mock.MagicMock", "line_number": 17, "usage_type": "call" }, { "api_name": "monkey_island.cc.event_queue.IIslandEventQueue", "line_number": 17, "usage_type": "name" }, { "...
71367158454
import os import openai from fastapi import FastAPI from fastapi import Form from pydantic import BaseModel app = FastAPI() @app.post("/ask/") async def ask(api_key: str = Form(), ask_content: str = Form()): res = ask_chatgpt(api_key, ask_content) return res def ask_chatgpt(api_key, ask_content): ope...
LvPeng990324/web_toolbox_go
other_system/chatgpt/chatgpt_server.py
chatgpt_server.py
py
647
python
en
code
0
github-code
21
[ { "api_name": "fastapi.FastAPI", "line_number": 9, "usage_type": "call" }, { "api_name": "fastapi.Form", "line_number": 13, "usage_type": "call" }, { "api_name": "openai.api_key", "line_number": 19, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletion...
1070380987
from pytube import YouTube, Playlist import ffmpeg, os from pathvalidate import sanitize_filename def await_user_input(options, allowed_values): """ Waits for valid user input and returns the input. """ while True: print("Please choose one of the following:") for option in options:...
Taggagii/Arbitrary-Coding
Youtube-downloader-mrk2.py
Youtube-downloader-mrk2.py
py
4,610
python
en
code
0
github-code
21
[ { "api_name": "pathvalidate.sanitize_filename", "line_number": 22, "usage_type": "call" }, { "api_name": "os.system", "line_number": 23, "usage_type": "call" }, { "api_name": "pytube.Playlist", "line_number": 31, "usage_type": "call" }, { "api_name": "pytube.YouTu...
46873871874
import streamlit as st st.header("Welcome to OpenWeather") import json, requests APIkey = '2a2b2ebeb8f6b2026e0336fa02e72143' location = st.text_input("Insert a location:", 'London', help="insert here the location you want the weather") # check API documentation to see what structure of URL is needed to access the da...
Vstrijova/Programming
myfirstapp.py
myfirstapp.py
py
993
python
en
code
0
github-code
21
[ { "api_name": "streamlit.header", "line_number": 3, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "li...
18749631178
#!/usr/bin/env python3 # https://www.hackerrank.com/challenges/python-print # #python import io import sys import unittest def printer(n, file): list(map(lambda item: print(item, end='', file=file), range(1, n + 1))) def main(): printer(int(input().strip()), sys.stdout) print('') if __name__ == '__ma...
altermarkive/training
algorithms/code/hackerrank/python_print/test_python_print.py
test_python_print.py
py
833
python
en
code
2
github-code
21
[ { "api_name": "sys.stdout", "line_number": 15, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.stdin", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.stdout", ...
73595480053
from controller import connection, send_email from flask import Flask, request, jsonify, render_template app = Flask(__name__) @app.route('/email') def index(): return render_template('send_email.html') @app.route('/send_email', methods=['POST']) def login(): email = request.form["email"] ...
CalebeLadis/Send-Email
app.py
app.py
py
841
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.reques...
43867231977
"""On_update extension for movement management """ from random import random from typing import cast from math import fabs import arcade as arc from alien_invasion import CONSTANTS from alien_invasion.entities.common.state_manager.state import AlienMoveset from alien_invasion.entities.starship import Starship def on...
ironkayman/tftm-alien-invasion
alien_invasion/entities/alien/bulk_logic/moveset_stategy.py
moveset_stategy.py
py
2,294
python
en
code
1
github-code
21
[ { "api_name": "arcade.SpriteList", "line_number": 14, "usage_type": "attribute" }, { "api_name": "alien_invasion.entities.starship.Starship", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.cast", "line_number": 38, "usage_type": "call" }, { "api_...
37445513160
from vllm import LLM, SamplingParams from time import perf_counter from dotenv import load_dotenv import os # Load environment variables # load_dotenv() # huggingface_token = os.environ.get('HUGGINGFACE_TOKEN') # Define sampling parameters sampling_params = SamplingParams( temperature=0.6, top_p=0.9, ma...
SecureAIAutonomyLab/fast-llama
scripts/llama2_inference.py
llama2_inference.py
py
1,188
python
en
code
0
github-code
21
[ { "api_name": "vllm.SamplingParams", "line_number": 11, "usage_type": "call" }, { "api_name": "vllm.LLM", "line_number": 20, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 37, "usage_type": "call" }, { "api_name": "time.perf_counter", ...
12805285317
import requests api_key = "2f7baa6e335553ea1ca4d8924a6a769b" base_url = "http://api.openweathermap.org/data/2.5/weather?" city_name = input("Enter city name: ") complete_url = base_url + "appid=" + api_key + "&q=" + city_name response = requests.get(complete_url) data = response.json() if data["cod"] != "404": ...
Dhruv656/Weather
weather.py
weather.py
py
667
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" } ]
33284153097
import pandas as pd import numpy as np import matplotlib.pyplot as plt filepath = "../data/data/phone_brand_device_model.csv" brand_data = pd.read_csv(filepath, usecols=[1, 2]) sanxing_data = brand_data[brand_data['phone_brand'].isin(['三星'])] sanxing_model = sanxing_data[['device_model']].groupby(by='device_model', ...
dataanalysing/AnalysingPrj
Lihuihui/The_most_popular_sanxing_model.py
The_most_popular_sanxing_model.py
py
1,932
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 41, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 41, "usage_type": "name" }, { "api_name": "matp...
2916813040
from typing import Any, List from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.orm import Session from app import crud, models, schemas from app.api import deps router = APIRouter() @router.get("/", response_model=List[schemas.FileFormat]) def read_file_formats( db: Session = Depends(deps.g...
changsin/adart
src/backend/app/app/api/api_v1/endpoints/file_format.py
file_format.py
py
2,939
python
en
code
0
github-code
21
[ { "api_name": "fastapi.APIRouter", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 14, "usage_type": "name" }, { "api_name": "app.models.User", "line_number": 17, "usage_type": "attribute" }, { "api_name": "app.mode...
12056986580
from detection import Detector import cv2 class compose(): def __init__(self, Detector=Detector()): self.Detector = Detector def composing(self): self.Detector.detector.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector()) cv2.startWindowThread() cap = self.Detector....
Klaiddom/People_tracking
core/__init__.py
__init__.py
py
1,127
python
en
code
0
github-code
21
[ { "api_name": "detection.Detector", "line_number": 7, "usage_type": "call" }, { "api_name": "detection.Detector", "line_number": 8, "usage_type": "name" }, { "api_name": "cv2.HOGDescriptor_getDefaultPeopleDetector", "line_number": 12, "usage_type": "call" }, { "ap...
9768062987
#!/usr/bin/env python import argparse import sys class ClipText(object): def __init__(self, filename, top, bottom): self.file_obj = open(filename) self.top = top self.bottom = bottom def clip_text(self): start = False for line in self.file_obj...
PiscatorX/misc-scripts
clip.py
clip.py
py
989
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" } ]
41534071060
import pygame import constant from Card import Card from config import plant_name_list def getSunValueImage(sun_value): font = pygame.font.SysFont(None, 22) width = 32 # lấy gtrị, màu msg_image = font.render(str(sun_value), True, constant.NAVYBLUE, constant.LIGHTYELLOW) msg_rect = msg_image.get_r...
DucPham0119/plantvszombie
MenuBar.py
MenuBar.py
py
3,017
python
en
code
0
github-code
21
[ { "api_name": "pygame.font.SysFont", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 9, "usage_type": "attribute" }, { "api_name": "constant.NAVYBLUE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "constant.LI...
24924450943
import datetime from pandas import read_csv from pandas._testing import assert_frame_equal from pfit.CSVColMelter import CSVMelter import unittest class TestCSVMelter(unittest.TestCase): def setUp(self): self.csvMelter = CSVMelter() self.date = "2020-05-21" self.time = "08:37:55" se...
kabs31/hodomate
hodomateenv/Lib/site-packages/test/test_CSVColMelter.py
test_CSVColMelter.py
py
3,469
python
en
code
0
github-code
21
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pfit.CSVColMelter.CSVMelter", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "call" }, { "api_name": "da...
71011528054
#!/usr/bin/python3 # -*- coding: utf8 -*- import os import sys import re import uuid import requests import json import yaml from requests.packages.urllib3.exceptions import InsecureRequestWarning import subprocess import argparse import time import logging from datetime import datetime from colorama import Fore, Back...
GigaSpaces-ProfessionalServices/CSM-Magic-Tools
recovery_monitor/recovery_monitor.py
recovery_monitor.py
py
19,648
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 26, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 73, "usage_type": "attribute" }, { "api_na...
4990889292
import json import os import urllib.request from urllib import request headers = { "User-Agent":"User-Agent, Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11" } url='https://movie.douban.com/j/chart/top_list?type=11&interval_id=100%3A90&action=&sta...
liuxinfeng312/liuxinfengcode
douban.py
douban.py
py
1,184
python
en
code
0
github-code
21
[ { "api_name": "urllib.request.request.Request", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 11, "usage_type": "name" }, { "api_nam...
14932698805
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 17 10:05:34 2021 @author: sveter """ from wtforms import Form, StringField, SelectField, BooleanField from wtforms.fields.html5 import DateField # CREATE A GENERAL CLASS TO REMOVE DUPLICITIES? class GeneralSearchForm(Form): search_options = [...
SveterCZE/justice
forms.py
forms.py
py
6,688
python
cs
code
7
github-code
21
[ { "api_name": "wtforms.Form", "line_number": 14, "usage_type": "name" }, { "api_name": "wtforms.StringField", "line_number": 22, "usage_type": "call" }, { "api_name": "wtforms.SelectField", "line_number": 23, "usage_type": "call" }, { "api_name": "wtforms.SelectFi...
33587534075
#!/usr/bin/env python # encoding: utf-8 """ SB computation of PHAT fields. """ import argparse from collections import defaultdict from astropy import log import astropy.io.fits as fits from astropy.table import Table from starplex.utils.timer import Timer from m31hst import phat_field_path from synthsb.directsb im...
jonathansick/synthsb
synthsb/phatsb.py
phatsb.py
py
6,367
python
en
code
0
github-code
21
[ { "api_name": "astropy.log.setLevel", "line_number": 22, "usage_type": "call" }, { "api_name": "astropy.log", "line_number": 22, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "collections....
25537015052
""" ndalmia work post (main) view. URLs include: /w/ /w/delete/ """ from flask import request, redirect, url_for, render_template, make_response import pathlib import uuid import ndalmia @ndalmia.app.route('/w/', methods=['GET', 'POST']) def wpost(): """Display /w/ route.""" if request.method == 'POST' : ...
nishantdalmia/ndalmia
ndalmia/views/wpost.py
wpost.py
py
1,846
python
en
code
0
github-code
21
[ { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.request.files", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flas...
9528244103
import yaml import json import os from typing import Dict, Tuple from dotenv import load_dotenv from bson.json_util import ObjectId load_dotenv() DATABASE_URI = os.environ.get("MONGO_URI") class MongoEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, ObjectId): return str(ob...
CapstoneGroup1StClair/Capstone_cogni
utils.py
utils.py
py
2,367
python
en
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.JSONEncoder", ...
10966030104
import pyrealsense2 as rs import numpy as np import cv2 # import pyvirtualcam import math import random from scipy.spatial.transform import Rotation from math import floor, ceil from pythonosc import udp_client import serial ######################################## ######### open viewer ########## ####################...
Toms42/tetherball
realsensetest.py
realsensetest.py
py
9,605
python
en
code
0
github-code
21
[ { "api_name": "pyrealsense2.pipeline", "line_number": 17, "usage_type": "call" }, { "api_name": "pyrealsense2.config", "line_number": 18, "usage_type": "call" }, { "api_name": "pyrealsense2.pipeline_wrapper", "line_number": 21, "usage_type": "call" }, { "api_name"...
28807896432
from unipath import Path API_SERVER='http://127.0.0.1:8000' WORKER_KEY='uZ3uxJ6eaRxjTyX7uU1' BROKER_HOST = "127.0.0.1" BROKER_PORT = 5672 BROKER_USER = "ersatz" BROKER_PASSWORD = "ija9fj432ertuerthjfsa" BROKER_VHOST = "ersatz" S3_BUCKET = 'ersatzlabs' LOGLEVEL = 'INFO' PROJECT_DIR = Path(__file__).ancestor(2) SPEARMI...
deniskolokol/dlic
back_end/settings/local_setup.py
local_setup.py
py
627
python
en
code
0
github-code
21
[ { "api_name": "unipath.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "unipath.Path", "line_number": 21, "usage_type": "call" } ]
44052578268
# -*- coding:UTF-8 -*- ''' 网站访问流量作为衡量一个站点的价值、热度的重要标准,另外,在CDN服务中心流量会涉及计费,如何快速准确分析当前站点的流量数据至关重要。本实例精确到分钟统计网站访问流量,原理是在mapper操作时将Web日志中小时的每分钟作为key,将对应的发送字节数作为value, 在reducer操作时对相同key做累加(sum)统计。 ''' from mrjob.job import MRJob import re class MRCounter(MRJob): def mapper(self, key, line): i = 0; fo...
iwangchuanli/Project-experience
python/python-网站日志MR分析/website_logs/com/mr/job/mrjob_httpflow.py
mrjob_httpflow.py
py
1,497
python
zh
code
32
github-code
21
[ { "api_name": "mrjob.job.MRJob", "line_number": 12, "usage_type": "name" }, { "api_name": "re.match", "line_number": 23, "usage_type": "call" } ]
13572422293
from flask import Flask, render_template, url_for, request, redirect from flask_sqlalchemy import SQLAlchemy from datetime import datetime import re app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db' db = SQLAlchemy(app) class Todo(db.Model): id = db.Column(db.Integer, pri...
BrentGarcia/flask-scheduler
app.py
app.py
py
2,664
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 14, "usage_type": "attribute" }, { "api_name": "d...
21249381104
"""Additional validators for `matplotlib.rcsetup`. This module is used by a few other modules to provide validators for new rcParams they provide. ## Validator functions - `_validate_dict()`: validates a dictionary. - `_validate_fontdict()`: validates a dictionary with font properties. """ import matplotlib.rcsetu...
bendalab/plottools
plottools/rcsetup.py
rcsetup.py
py
1,532
python
en
code
5
github-code
21
[ { "api_name": "matplotlib.rcsetup.validate_float", "line_number": 48, "usage_type": "call" }, { "api_name": "matplotlib.rcsetup", "line_number": 48, "usage_type": "name" }, { "api_name": "matplotlib.rcsetup.validate_fontsize", "line_number": 50, "usage_type": "call" }, ...
14089797978
#Basic import tensorflow as tf import numpy as np #result visualization import matplotlib.pyplot as plt import math """ tensorflow use Graph to represent compution,a Node in Graph is represent a operation(Represents a graph node that performs computation on tensors). each op can receive 0 or more tensors ( have...
cool425589/tensorflow_example
tensorflow_basic operation.py
tensorflow_basic operation.py
py
11,074
python
en
code
0
github-code
21
[ { "api_name": "tensorflow.constant", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.constant", "line_number": 26, "usage_type": "call" }, { "api_name": "tensorflow.matmul", "line_number": 28, "usage_type": "call" }, { "api_name": "tensorflow....
17361139436
import logging log_format = '%(asctime)s %(levelname)-5s %(name)s: %(message)s' log_datefmt = '%y-%m-%d %H:%M:%S' def init_log(log_name: str, level: int = logging.INFO, formatting: str = log_format, datefmt: str = log_datefmt, save_to_file: bool = True, ...
suno09/meetup_streaming
app_log.py
app_log.py
py
759
python
en
code
0
github-code
21
[ { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 18, "usage_type": "call" }, { "api_name": "logging.ba...
5124410045
from lib.general.accepted_connections import AcceptedConnections from lib.go_back_n.gbn_sender import GbnSender from lib.stop_and_wait.sw_sender import StopAndWaitSender from lib.general.receiver import ClosedReceiverError, Receiver from lib.general.atomic_udp_socket import AtomicUDPSocket from lib.general.constants im...
gonzalomartinezs/FileTransfer-Intro
src/lib/general/reliable_udp_socket.py
reliable_udp_socket.py
py
9,534
python
en
code
0
github-code
21
[ { "api_name": "enum.Enum", "line_number": 24, "usage_type": "name" }, { "api_name": "lib.general.accepted_connections.AcceptedConnections", "line_number": 32, "usage_type": "call" }, { "api_name": "lib.general.atomic_udp_socket.AtomicUDPSocket", "line_number": 35, "usage_...
38385477250
import librosa import numpy as np import math from data_processing.feature_extractor import FeatureExtractor from utils import prepare_input_features import multiprocessing import os from utils import get_tf_feature, read_audio import tensorflow as tf from sklearn.preprocessing import StandardScaler #import tqdm np....
iwanko/MIL-audio-denoising-task
data_processing/dataset.py
dataset.py
py
5,958
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tensorflow.random.set_seed", "line_number": 16, "usage_type": "call" }, { "api_name": "tensor...
31205138351
import numpy as np import cv2 import os image_folder = 'single_png' video_name = 'single_train.avi' images = [img for img in os.listdir(image_folder) if img.endswith(".png")] sort_imgs = np.sort(images) frame = cv2.imread(os.path.join(image_folder, images[0])) height, width, layers = frame.shape video = cv2.VideoWr...
teopb/ode-net-examples
examples/img_to_video.py
img_to_video.py
py
488
python
en
code
3
github-code
21
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sort", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, ...
2920361150
from fastapi import APIRouter, HTTPException from fastapi.responses import FileResponse from utils.assets.asset_finder import find_files router = APIRouter() # orders @router.get("/{filename}") def direct_download(filename: str): target_file_list = find_files(filename) if not target_file_list: raise...
chemradio/cta-gfx-helper
dispatcher_engine/api_routers/web_api/direct_download.py
direct_download.py
py
496
python
en
code
2
github-code
21
[ { "api_name": "fastapi.APIRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "utils.assets.asset_finder.find_files", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.HTTPException", "line_number": 14, "usage_type": "call" }, { "api_n...
1661834060
import aiohttp import asyncio import ujson async def main(): async with aiohttp.ClientSession() as session: # async with session.get('/get'): # pass # async with session.post('/post', data=b'data'): # pass # async with session.put('/put', data=b'data'): # ...
DRAGONINWAVE/for_little_sun
my_work/spider/first_aiohttp_houbao.py
first_aiohttp_houbao.py
py
1,497
python
en
code
2
github-code
21
[ { "api_name": "aiohttp.ClientSession", "line_number": 6, "usage_type": "call" }, { "api_name": "asyncio.run", "line_number": 36, "usage_type": "call" } ]
8041327596
from .diff import parse_unified_diff from .linter import Linter, process_patch from .report import Report from .utils import run_command __all__ = [] DEFAULT_CONFIG = { # Filename filter rules 'filefilter': ['+ *.py', '+ bin/*'], # Optional path to the config file. 'config': None, # The python v...
theochem/cardboardlint
cardboardlint/linter_black.py
linter_black.py
py
1,515
python
en
code
2
github-code
21
[ { "api_name": "report.Report", "line_number": 20, "usage_type": "name" }, { "api_name": "utils.run_command", "line_number": 38, "usage_type": "call" }, { "api_name": "report.filenames", "line_number": 41, "usage_type": "attribute" }, { "api_name": "report.filename...
30218876667
"""Celery for pragati.""" from __future__ import absolute_import import os from celery import Celery from django.conf import settings # set the default Django settings module for the 'celery' program. os.environ.setdefault( 'DJANGO_SETTINGS_MODULE', 'todoapp.settings') broker_url = 'redis://localhost:6379/0' app...
Sreeharis25/todoapp
todoapp/todoapp/celery.py
celery.py
py
818
python
en
code
0
github-code
21
[ { "api_name": "os.environ.setdefault", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "celery.Celery", "line_number": 13, "usage_type": "call" }, { "api_name": "django.conf.setting...
13353765561
import json import subprocess import cv2 from core.temp_manager import TempFileManager from pydub import AudioSegment from collections import Counter FONT = cv2.FONT_HERSHEY_COMPLEX FONT_SCALE = 1 FONT_COLOR = (255, 255, 255) LINE_THICKNESS = 2 def get_duration(filename): command = f'ffprobe -i {filename} -show_e...
BrasD99/HeyGenClone
core/helpers.py
helpers.py
py
5,307
python
en
code
371
github-code
21
[ { "api_name": "cv2.FONT_HERSHEY_COMPLEX", "line_number": 8, "usage_type": "attribute" }, { "api_name": "subprocess.check_output", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "core....
34202562137
from PyQt5.QtCore import Qt, Signal from PyQt5.QtGui import QColor, QMouseEvent from PyQt5.QtWidgets import QColorDialog, QLabel, QWidget class ColorPicker(QLabel): color_changed = Signal(QColor) def __init__(self, parent: QWidget, initial_color: QColor): super().__init__(parent) self._set_colo...
miguel-martinr/Pycture
src/pycture/dialogs/widgets/color_picker.py
color_picker.py
py
1,291
python
en
code
1
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Signal", "line_number": 6, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QColor", "line_number": 6, "usage_type": "argument" }, { "api_name": "PyQt5....
16158599057
import numpy as np import scipy import scipy.signal import DAQ.mmt as mmt def find_peaks_cwt_refined(vector, widths, decimate, decimate_factor=10, noise_perc=10): # print("vector", vector) # print("widths", widths) if decimate: decimate_factor = int(decimate_factor) vector_decimate = scipy...
cdolopikos/Cardiac-Detection-Algorithm
DAQ/mmt/find_peaks/find_peaks_cwt_refined.py
find_peaks_cwt_refined.py
py
1,543
python
en
code
0
github-code
21
[ { "api_name": "scipy.signal.decimate", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", ...
38833372926
import json import numpy as np import os, os.path import matplotlib.pyplot as plt import hdbscan from sklearn.cluster import DBSCAN, dbscan from sklearn.cluster import HDBSCAN import pandas as pd from llama_cpp import Llama from sentence_transformers import SentenceTransformer from sentence_transformers.util import c...
Ryan-Alexander03/GENERALIZED-TASK-LEARNING-FOR-ROBOTS
NL2FL/largeclustertest_newMetric.py
largeclustertest_newMetric.py
py
3,189
python
en
code
0
github-code
21
[ { "api_name": "sentence_transformers.SentenceTransformer", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "o...
357541831
from flask import Flask, render_template from udlaan import UdlaanForm app = Flask(__name__) app.config['SECRET_KEY'] = 'noget_hemmeligt' @app.route('/', methods=['GET', 'POST']) def start(): uform = UdlaanForm() if uform.validate_on_submit(): print(uform.customerID.data) print...
kasper2507/flask_input
app.py
app.py
py
508
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "udlaan.UdlaanForm", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 18, "usage_type": "call" } ]
43708718250
import numpy as np import matplotlib.pyplot as plt from grid import KGRID2 from config import KMAX, KPTS_H from MCreplicas import MCReplicas from parser import Parser from config import params, exp_dict_list from data_kfold import DataKFold if __name__ == "__main__": # use Parser to read datasets parser = Pa...
andrey-jpm/prometheus
src/nntmd-0.71.py
nntmd-0.71.py
py
2,536
python
en
code
0
github-code
21
[ { "api_name": "parser.Parser", "line_number": 14, "usage_type": "call" }, { "api_name": "parser.parse", "line_number": 15, "usage_type": "call" }, { "api_name": "config.exp_dict_list", "line_number": 15, "usage_type": "argument" }, { "api_name": "data_kfold.DataKF...
341310378
# 爬取1号店 import re import time import requests from bs4 import BeautifulSoup def get_address(commodity_id): """通过while实现对配送地址的选择和得到地址对应的字符""" url = 'https://item.yhd.com/{}.html'.format(commodity_id) r = requests.get(url) soup = BeautifulSoup(r.text, 'lxml') address = soup.find_all('a', class_='sec_...
fengyangfifa/Crawler
1号店/spider.py
spider.py
py
3,412
python
en
code
1
github-code
21
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
32895119922
from shapely.geometry import Point from shapely.geometry import LineString from shapely.geometry import box from plotting import plot_env from plotting import LENGTH as vehicle_length import matplotlib.pyplot as plt def get_assignment2_environment(): env_multi = [ Point(0, -0.5).buffer(1.5, cap_style=3), ...
aabs7/RRT-and-RRT-with-Vehicle-Dynamics
environments.py
environments.py
py
3,958
python
en
code
1
github-code
21
[ { "api_name": "shapely.geometry.Point", "line_number": 10, "usage_type": "call" }, { "api_name": "shapely.geometry.Point", "line_number": 11, "usage_type": "call" }, { "api_name": "shapely.geometry.Point", "line_number": 12, "usage_type": "call" }, { "api_name": "...
13368030631
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import csv import json import os import sys from datetime import date, datetime,...
mozilla/bugbug
scripts/get_untriaged.py
get_untriaged.py
py
3,523
python
en
code
469
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path.append", ...
2968775852
# # build and deployment tool for the HOT # from __future__ import with_statement import os,sys,platform,zipfile from paver.easy import * from paver.setuputils import setup release_version = '1.0rc9' srcfiles = 'SOP_Cleave.C SOP_Ocean.C VEX_Ocean.C'.split() # work out what platform we're using if platform.system() ...
nyue/Houdini-Ocean-Toolkit
src/pavement.py
pavement.py
py
6,243
python
en
code
3
github-code
21
[ { "api_name": "platform.system", "line_number": 15, "usage_type": "call" }, { "api_name": "platform.machine", "line_number": 16, "usage_type": "call" }, { "api_name": "platform.system", "line_number": 25, "usage_type": "call" }, { "api_name": "platform.system", ...
34585890000
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon May 15 21:18:38 2017 @author: Falaize """ from ..tools import types def sumvecs(*args): """ sums vectors (list elements) """ args = list(args) v0 = args.pop() types.vector_test(v0) l = len(v0) for v in args: types.v...
pyphs/pyphs
pyphs/core/maths/_vectors.py
_vectors.py
py
463
python
en
code
39
github-code
21
[ { "api_name": "tools.types.vector_test", "line_number": 17, "usage_type": "call" }, { "api_name": "tools.types", "line_number": 17, "usage_type": "name" }, { "api_name": "tools.types.vector_test", "line_number": 20, "usage_type": "call" }, { "api_name": "tools.typ...
4122277535
import tkinter as tk from itertools import combinations from tkinter import ttk movies = [ {'title': 'The Shawshank Redemption', 'genres': ['Drama']}, {'title': 'The Godfather', 'genres': ['Crime', 'Drama']}, {'title': 'The Dark Knight', 'genres': ['Action', 'Crime', 'Drama']}, {'title': 'The Godfather...
vilceanurobert99/Data-Science-in-Industry-2022-2023
main.py
main.py
py
4,702
python
en
code
0
github-code
21
[ { "api_name": "itertools.combinations", "line_number": 31, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 88, "usage_type": "call" }, { "api_name": "tkinter.ttk.Style", "line_number": 92, "usage_type": "call" }, { "api_name": "tkinter.ttk", ...
19251671255
from typing import Any,Tuple import xmlrpc.client import logging import argparse from urllib.parse import urlparse, urlsplit, urljoin, ParseResult import functools COINPYCLI_VERSION = '0.0.1' logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) class CoinpyCLI(object): @staticmethod ...
mrkovec/coinpy
coinpycli.py
coinpycli.py
py
1,687
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.parse...
74108941814
import open3d as o3d import numpy as np def visualize_geometry(geo): o3d.visualization.draw_geometries([geo]) def poisson_reconstruction(pcd): pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.1, max_nn=30)) pcd.orient_normals_towards_camera_location() mesh, _ ...
samuelokpor/Poissoin-3D-reconstruction-using-landmarks
interpolation.py
interpolation.py
py
1,865
python
en
code
1
github-code
21
[ { "api_name": "open3d.visualization.draw_geometries", "line_number": 6, "usage_type": "call" }, { "api_name": "open3d.visualization", "line_number": 6, "usage_type": "attribute" }, { "api_name": "open3d.geometry.KDTreeSearchParamHybrid", "line_number": 9, "usage_type": "c...
40335665384
from settings import agent from settings import advesary def get_piece_count(pieces): from collections import defaultdict count = defaultdict(lambda:0) for location, piece in pieces.items(): type = piece.piece_type count[type] += 1 # print(count) return count class Node...
GatesWang/BoardGame
search.py
search.py
py
3,022
python
en
code
0
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "settings.agent", "line_number": 18, "usage_type": "argument" }, { "api_name": "settings.advesary", "line_number": 19, "usage_type": "argument" }, { "api_name": "heuri...
7655312773
import csv from django.core.exceptions import PermissionDenied from django.http import HttpResponse # European format: . -> , 15102021 def localize_floats(row): """ Function for switching . to , for csv export. :param row: current value row :returns: Corrected row. """ return [ str(el).r...
klkeusch/raklida
sensorvalues/util.py
util.py
py
1,611
python
en
code
0
github-code
21
[ { "api_name": "django.core.exceptions.PermissionDenied", "line_number": 29, "usage_type": "name" }, { "api_name": "django.http.HttpResponse", "line_number": 35, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 39, "usage_type": "call" } ]
18960543405
import requests from bs4 import BeautifulSoup headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" } url = "https://movie.douban.com/top250?start=0&filter=" def find_one_page(url): response = requests.get(url, headers...
yhtfly/spiderTest
top250.py
top250.py
py
804
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" } ]
1784758908
def mid_time2real_time(ticks, tempo): import mido real_time = mido.tick2second(1, ticks, tempo) return real_time def External_use(process_mid, ticks): middle_mid = [] for p in process_mid: middle = [] mid = p[1:] velocity = [0]*200 note = [0]*200 presen...
momongss/pianist_wav2mid
pianist/m5_2_mid_time2real_time.py
m5_2_mid_time2real_time.py
py
1,424
python
en
code
3
github-code
21
[ { "api_name": "mido.tick2second", "line_number": 5, "usage_type": "call" }, { "api_name": "mido.MidiFile", "line_number": 47, "usage_type": "call" }, { "api_name": "m5_1_D_midi.External_use", "line_number": 48, "usage_type": "call" } ]
26930494153
#!/usr/bin/env python2 from __future__ import print_function import sys import re import os import errno import argparse import pyparsing import collections def mkdir_p(path): try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: r...
andreasBihlmaier/ontoprog
python/ontoprog.py
ontoprog.py
py
8,926
python
en
code
1
github-code
21
[ { "api_name": "os.makedirs", "line_number": 16, "usage_type": "call" }, { "api_name": "errno.EEXIST", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
72443208693
import torch import torch.nn as nn import models.basicblock as B import functools import numpy as np #complex network structure class CI_CDNet(nn.Module): def __init__(self, in_nc=2, out_nc=1, nc=[64, 128, 256, 512], downsample_mode='strideconv', upsample_mode='convtranspose', bias=True): super(CI_CDNet, ...
bianlab/CI-CDNet
models/CI_CDNet.py
CI_CDNet.py
py
8,796
python
en
code
2
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "models.basicblock.conv", "line_number": 13, "usage_type": "call" }, { "api_name": "models.basicblock"...
7744929950
import glfw import gravithaum.engine.video as video _keys = [False] * glfw.KEY_LAST _binds = [] _binds_press = {} _binds_release = {} class bind: def __init__(self, key, func, data_list): self.key = key self.func = func self.data_list = data_list def execute(self): self.func...
tim-napoli/gravithaum
gravithaum/engine/keyboard.py
keyboard.py
py
1,519
python
en
code
0
github-code
21
[ { "api_name": "glfw.KEY_LAST", "line_number": 5, "usage_type": "attribute" }, { "api_name": "glfw.PRESS", "line_number": 26, "usage_type": "attribute" }, { "api_name": "glfw.RELEASE", "line_number": 31, "usage_type": "attribute" }, { "api_name": "glfw.KEY_LAST", ...
4806616222
# Author:zqbin # @Time:2023/10/9 15:38 # @Author:14988 # @Site: # @File:demo06_alert.py # @Software:PyCharm import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains driver = webdriver.Chrome() # 设置全局的隐式等待时间 driver.implicitly...
FoXM999/ceniu
p96/ui_day03/demo06_alert.py
demo06_alert.py
py
1,186
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.action_chains.ActionChains", "line_number": 18, "usage_type": "cal...
20823572935
from threading import Thread, Event from .events import ErrorEvent class GerritStream(Thread): """ Gerrit events stream handler. """ def __init__(self, gerrit, ssh_client): Thread.__init__(self) self.daemon = True self._gerrit = gerrit self._ssh_client = ssh_client s...
sonyxperiadev/pygerrit
pygerrit/stream.py
stream.py
py
1,630
python
en
code
52
github-code
21
[ { "api_name": "threading.Thread", "line_number": 6, "usage_type": "name" }, { "api_name": "threading.Thread.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 11, "usage_type": "name" }, { "api_name": "threading....
36874340081
from imutils import contours import imutils import cv2 import numpy as np wrap= cv2.imread("cyfry wszystkie.jpg") cv2.imshow('oryginal',wrap) output = wrap szary = cv2.cvtColor(wrap, cv2.COLOR_RGB2GRAY) cv2.imshow('szary', szary) retval, binarszary = cv2.threshold(szary, 150, 160, cv2.THRESH_BINARY_INV) cv2.imshow...
Morticus96/Git_Digits_Recognition.py
Wszystkie Cyfry.py
Wszystkie Cyfry.py
py
2,394
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_numbe...
11620396985
from kivy.graphics import Rectangle, Color from kivy.uix.widget import Widget from kivy.properties import * import numpy as np import pyaudio import wave import matplotlib.pyplot as plt import io import os from google.cloud import speech_v1 import colorsys import threading FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = ...
venkatesh-sivaraman/TeachAI
speech.py
speech.py
py
10,077
python
en
code
0
github-code
21
[ { "api_name": "pyaudio.paInt16", "line_number": 14, "usage_type": "attribute" }, { "api_name": "threading.Lock", "line_number": 25, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 30, "usage_type": "call" }, { "api_name": "google.cloud.spe...
29019456689
import bpy def add(object,data_path,callback): subscribe_to = object.path_resolve(data_path, False) bpy.msgbus.subscribe_rna( key=subscribe_to, owner=object, args=(object,data_path,), notify=callback, ) def remove(object): bpy.msgbus.clear_by_owner(object)
ZeronoFreya/BlenderAddons
shortcut_collection/addon/utils/msgbus.py
msgbus.py
py
318
python
en
code
0
github-code
21
[ { "api_name": "bpy.msgbus.subscribe_rna", "line_number": 5, "usage_type": "call" }, { "api_name": "bpy.msgbus", "line_number": 5, "usage_type": "attribute" }, { "api_name": "bpy.msgbus.clear_by_owner", "line_number": 13, "usage_type": "call" }, { "api_name": "bpy....
36874342771
from imutils import contours import imutils import cv2 import numpy as np CYFRY = { (1, 1, 1, 0, 1, 1, 1): 0, (0, 0, 1, 0, 0, 1, 0): 1, (1, 0, 1, 1, 1, 1, 0): 2, (1, 0, 1, 1, 0, 1, 1): 3, (0, 1, 1, 1, 0, 1, 0): 4, (1, 1, 0, 1, 0, 1, 1): 5, (1, 1, 0, 1, 1, 1, 1): 6, (1, 0, 1, 0, 0, 1, 0): 7, (1, 1, 1, 1, 1, 1,...
Morticus96/Git_Digits_Recognition.py
Wyswietlacz.py
Wyswietlacz.py
py
2,226
python
en
code
0
github-code
21
[ { "api_name": "cv2.imread", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_num...
37983018199
from tools import DecimalMath, Database from concurrent.futures import ThreadPoolExecutor from typing import List from tools import Schema from enum import Enum from web3 import Web3 import rapidjson import os class AcryptoS(Schema.Pair): ''' Has More than one pool But Since Curve algo is shit im denying it ...
shervin-h/MarketPriceService
app/tools/Dex/Curve/AcryptoS.py
AcryptoS.py
py
5,524
python
en
code
0
github-code
21
[ { "api_name": "tools.Schema.Pair", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tools.Schema", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 23, "usage_type": "name" }, { "api_name": "os.getenv", "line...
31943570162
from xaal.lib import Engine, tools,helpers from xaal.schemas import devices import platform #import pyautogui import time import logging import subprocess #pyautogui.FAILSAFE = False import argparse import json PKG_NAME = 'btn_darkvador ' helpers.setup_console_logger() logger = logging.getLogger(PKG_NAME) BTN0 = t...
dbouchabou/Experiment_HAAL_dataset
scripts/xaal_ir_camera.py
xaal_ir_camera.py
py
1,864
python
en
code
2
github-code
21
[ { "api_name": "xaal.lib.helpers.setup_console_logger", "line_number": 15, "usage_type": "call" }, { "api_name": "xaal.lib.helpers", "line_number": 15, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name...
4693506926
# -*- coding: utf-8 -*- from functools import reduce a = {1: 1, 2: 2, 3: 3} print(",".join(map(str, sorted(a.keys())))) b = "xyzwd" print(b[::2]) l = [] i = 0 while i < len(b): if i % 2 == 0: l.append(b[i]) i += 1 print("".join(l), "\n") # 请编写一个函数calc_prod(lst),它接收一个list,返回一个函数,返回函数可以计算参数的乘积。 def c...
caoxiaozhidezhi/study-test
return function.py
return function.py
py
1,036
python
en
code
0
github-code
21
[ { "api_name": "functools.reduce", "line_number": 24, "usage_type": "call" } ]
2982252753
#!/usr/bin/env python3 import os import json import pytest import hashlib import tempfile from validatum import simulate, error_check def verifyHash(data: dict, readSize: int = 4096): tf = tempfile.NamedTemporaryFile(delete=False) with open(tf.name, 'w') as fh: fh.write(json.dumps(data)) sha256Ha...
StephenRicher/validatum
tests/test_validatum.py
test_validatum.py
py
840
python
en
code
0
github-code
21
[ { "api_name": "tempfile.NamedTemporaryFile", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 15, "usage_type": "call" }, { "api_name": "os.remove", ...
21405107720
import itertools def maximize(lists, m): a = list(max(i)**2 for i in lists) b = list(x for x in itertools.accumulate(a)) ans = max(x % m for x in b) return ans lists = [ [5, 4], [7, 8, 9], [5, 7, 8, 9, 10] ] #print(maximize(lists,1000))
DariaPetrovaa/mipt_python
w8/tasks/task_9.py
task_9.py
py
284
python
en
code
0
github-code
21
[ { "api_name": "itertools.accumulate", "line_number": 6, "usage_type": "call" } ]
72774104054
import os import json from kafka import KafkaProducer from kafka.errors import NoBrokersAvailable from datetime import datetime from dotenv import load_dotenv load_dotenv('.env') class Producer: def __init__(self): try: servers = os.getenv('LOG_SERVERS').replace(' ', '').split(',') ...
JangasCodingplace/python-kafka-sandbox
producer.py
producer.py
py
1,338
python
en
code
0
github-code
21
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "kafka.KafkaProducer", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "lin...
70194933812
from django.urls import path from .views import * urlpatterns = [ path('listar', listar_investimentos, name='listar_investimentos'), path('cadastrar', cadastrar_investimentos, name='cadastrar_investimentos'), path('listar/<int:id>',listar_investimento_id, name='listar_investimento_id'), path('editar/<i...
onnigiri/django-Agenda-De-Investimentos
investimentos/urls.py
urls.py
py
458
python
pt
code
0
github-code
21
[ { "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", ...
72487226933
from django.db.models.signals import post_save from .models import User, Profile, Student, Professor def create_profile(sender, instance: User, created, **kwargs): if created: user = instance profile = Profile.objects.create( user=user, name=user.full_name ) ...
capamir/article
account/signals.py
signals.py
py
963
python
en
code
1
github-code
21
[ { "api_name": "models.User", "line_number": 5, "usage_type": "name" }, { "api_name": "models.Profile.objects.create", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Profile.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mo...
38428371991
#! /usr/bin/ python # -*- coding: utf-8 -*- ''' Created by: Cuahutli Miguel Ulloa Robles ''' db = None class Bd: ERR_ARRVACI = 'El arreglo de columnas/valores está vacío' ERR_ARRLONG = 'La longitud de los nombres de columna es diferente a la de los valores' ERR_CONXINI = 'La conexión no ha sido inicializada' ERR...
cuahutli/pyscit
scit/bd/bd.py
bd.py
py
2,609
python
es
code
0
github-code
21
[ { "api_name": "mysqldb.connect", "line_number": 40, "usage_type": "call" }, { "api_name": "mysqldb.Error", "line_number": 42, "usage_type": "attribute" }, { "api_name": "psycopg2.extras", "line_number": 66, "usage_type": "attribute" }, { "api_name": "mysqldb.curso...
32955992107
import os import sys import math import numpy as np import matplotlib.pyplot as plt import simulation import random import json import datetime PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) SAVE_DIR = os.path.join(PROJECT_ROOT, "data/") DATA_FILE = os.path.join(SAVE_DIR, "20200304_192852.json") with open...
tzmhuang/HMM_lc_prediction
simulation/data_labelling.py
data_labelling.py
py
1,909
python
en
code
0
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line...
21270841832
from datetime import date, datetime from django.contrib.auth import get_user_model from django.db import models from django.utils.translation import gettext_lazy as _ from django.urls import reverse User = get_user_model() class Task(models.Model): content = models.CharField(_('content'), max_length=250) no...
bro256/django03
django03/task_manager/models.py
models.py
py
3,211
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "ap...
75056060211
import h5py, numpy as numpy, math from os.path import join from .puz_utils import string2fill w2v_path = "data/w2v" # word2vec directory pfeat_path = "data/dictionaries/stringfeats.txt" # word prior feature file wfreq_path="data/blanks/unigram_freq.csv" idf_path = "data/idf.txt" wd2id, wvecs = None, None def get_w2v(...
lhlclhl/CP
cps/wfeats.py
wfeats.py
py
3,004
python
en
code
0
github-code
21
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "puz_utils.string2fill", "line...
32478347458
# Exploit Title: Magic Home Pro 1.5.1 - Authentication Bypass # Google Dork: NA # Date: 22 October 2020 # Exploit Author: Victor Hanna (Trustwave SpiderLabs) # Author Github Page: https://9lyph.github.io/CVE-2020-27199/ # Vendor Homepage: http://www.zengge.com/appkzd # Software Link: https://play.google.com/store/apps/...
ryanmrestivo/red-team
_Resources/Exploit DB 2021-12-11/exploits/android/webapps/49266.py
49266.py
py
10,943
python
en
code
91
github-code
21
[ { "api_name": "json.dumps", "line_number": 42, "usage_type": "call" }, { "api_name": "colorama.Fore.WHITE", "line_number": 53, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 53, "usage_type": "name" }, { "api_name": "requests.post", ...
23056934673
#-*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf-8') from random import randrange; from datetime import datetime from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from alchemy_citadel import Base, Profile, Message, Member, Thread engine = create_engine('mysql://ro...
jinhomang/proj_citadel
alchemy_insert.py
alchemy_insert.py
py
2,066
python
en
code
0
github-code
21
[ { "api_name": "sys.setdefaultencoding", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 13, "usage_type": "call" }, { "api_name": "alchemy_citadel.Base.metadata", "line_number": 15, "usage_type": "attribute" }, { ...
23305296907
import re from pathlib import Path from os import path from setuptools import find_packages, setup BUNDLES = () # -*- Installation Requires -*- def strip_comments(l): return l.split("#", 1)[0].strip() def _pip_requirement(req, *root): if req.startswith("-r "): _, path = req.split() return...
wlatanowicz/indipy
setup.py
setup.py
py
2,336
python
en
code
5
github-code
21
[ { "api_name": "os.path", "line_number": 18, "usage_type": "name" }, { "api_name": "os.path.split", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path", "line_number": 24, "u...