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
22439203560
import ttkbootstrap as ttk from ttkbootstrap.constants import * from ttkbootstrap.dialogs import Dialog from gui.realtime_graph import RealTimeGraph import matplotlib.animation as animation from gui.animation import Animation, network_traffic_in_filler, network_traffic_out_filler from models.agents import Agent from ...
MatheusWoeffel/TeutoMonitor
src/gui/window.py
window.py
py
6,033
python
en
code
1
github-code
36
[ { "api_name": "gui.animation.Animation", "line_number": 27, "usage_type": "call" }, { "api_name": "gui.animation.network_traffic_in_filler", "line_number": 30, "usage_type": "argument" }, { "api_name": "gui.animation.Animation", "line_number": 32, "usage_type": "call" }...
36351466606
from flask import Blueprint, render_template, request import logging import functions loader_blueprint = Blueprint('loader_blueprint', __name__, template_folder="templates") logging.basicConfig(filename="basic.log") @loader_blueprint.route("/post") def post_page(): return render_template("post_form.html") @load...
PetrGurev/Lesson_121_homework
loader/views.py
views.py
py
1,229
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request...
7256329607
import random import sys from tkinter.messagebox import QUESTION import inquirer words = open("words.txt", "r") words_two = words.read() word_bank = words_two.split() hell = [] str = ' ' WRONG = [] past_guesses = [] difficulty = [ inquirer.List('mode', message = "Choose Your Difficulty", choices = ['Hell',...
Momentum-Team-13/python-mystery-word-samrespass
mystery_word.py
mystery_word.py
py
3,941
python
en
code
0
github-code
36
[ { "api_name": "inquirer.List", "line_number": 14, "usage_type": "call" }, { "api_name": "inquirer.List", "line_number": 21, "usage_type": "call" }, { "api_name": "inquirer.prompt", "line_number": 28, "usage_type": "call" }, { "api_name": "random.choice", "line...
70807032423
import sys from collections import deque sys.stdin = open('input.txt') def bfs(start): global answer q = deque(start) while q: node = q.popleft() answer += visited[node[0]][node[1]] for k in range(4): y = node[0] + dr[k] x = node[1] + dc[k] i...
unho-lee/TIL
CodeTest/Python/SWEA/10966.py
10966.py
py
1,161
python
en
code
0
github-code
36
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" } ]
41571056432
import lightgbm as lgb from sklearn.linear_model import LogisticRegression import pandas as pd import numpy as np #读取数据 file_dir='E:\\GDBT_LR\\loan\\' train_data='gbdt_train.csv' test_data='gdbt_test.csv' train=pd.read_csv(file_dir+train_data) test=pd.read_csv(file_dir+test_data) #删除无用参数 del train['Unnamed: 0'] del te...
hu-minghao/my_program
贷款违约预测/LGB_LR.py
LGB_LR.py
py
3,631
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "lightgbm.Dataset", "line_number": 29, "usage_type": "call" }, { "api_name": "lightgbm.Dataset", ...
26620703554
import matplotlib.pyplot as plt from matplotlib import style import matplotlib.dates as mdates import mpl_finance as mpl from tkinter import * from yahoo_fin.stock_info import get_data import pandas as pd import plotly.graph_objects as go class AutoPlot: def __init__(self): master = Tk() Label(mas...
MihaiGroza/Automated-Candlestick-Chart-Plot
CandleStick_Chart_Building.py
CandleStick_Chart_Building.py
py
1,397
python
en
code
0
github-code
36
[ { "api_name": "yahoo_fin.stock_info.get_data", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 38, "usage_type": "call" }, { "api_name": "plotly.graph_objects.Figure", "line_number": 40, "usage_type": "call" }, { "api_...
28919190196
from PIL import Image import glob import random import os from collections import defaultdict ################################# test_percentage = 0.20 def partitionRankings(rawRatings, testPercent): # https://stackoverflow.com/questions/23299099/trying-to-split-list-by-percentage howManyNumbers = int(round(t...
melissadale/YouTubeTutorials
TF-Records/DivideData.py
DivideData.py
py
2,165
python
en
code
1
github-code
36
[ { "api_name": "random.shuffle", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 22, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.exists", "...
70447240745
import os import shutil import subprocess import random import string from cdifflib import CSequenceMatcher from pathlib import Path from typing import Any from urllib.request import urlopen import numpy as np from rich import print as print from shapely.geometry import MultiPolygon from sqlalchemy import text from sr...
goat-community/data_preparation
src/utils/utils.py
utils.py
py
23,625
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "time.time", "line_number": 31, "usage_type": "call" }, { "api_name": "rich.print", "line_number": 42, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 2...
21120525047
# coding: utf-8 import torch import sys from torch import nn from TTS.utils.text.symbols import symbols from TTS.layers.tacotron import Prenet, Encoder, Decoder, PostCBHG class Tacotron(nn.Module): def __init__(self, embedding_dim=256, linear_dim=1025, mel_dim=80...
JRC1995/Chatbot
TTS/models/tacotron.py
tacotron.py
py
1,644
python
en
code
79
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
74579426342
#generali from django.views.generic import ListView from django.shortcuts import render, get_object_or_404, redirect from django.http import HttpResponse from django.template import loader from django.db.models import Count from django.contrib import messages from django.contrib.auth import get_user_model from dj...
gitsh1t/vetrina_test
landing_page/views.py
views.py
py
12,116
python
en
code
0
github-code
36
[ { "api_name": "rest_framework.generics.ListAPIView", "line_number": 33, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 33, "usage_type": "name" }, { "api_name": "models.Post.objects.all", "line_number": 35, "usage_type": "call" }, ...
5657068183
import json import os import requests from utils import is_snapshot_week, get_dependency_version, get_latest_tag, get_snapshot_branch, \ get_dependency_version_from_tags github_token = os.getenv("GITHUB_TOKEN") headers = {"Authorization": "Bearer " + github_token} def build_message(): message = '@navigatio...
mapbox/mapbox-navigation-ios
scripts/snapshot/pre-snapshot-check.py
pre-snapshot-check.py
py
2,170
python
en
code
821
github-code
36
[ { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.is_snapshot_week", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line...
24842877273
# -*- coding: utf-8 -*- from os import path import os from wordcloud import WordCloud, STOPWORDS import requests import matplotlib.pyplot as plt # from scipy.misc import imread import numpy as np from PIL import Image import jieba import jieba.posseg as pseg import jieba.analyse def makeCiyun(file_name): d = path...
Montage-LSM/ciyun
index_jieba.py
index_jieba.py
py
2,267
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19,...
27006538329
"""Pytest fixtures for huesensors tests.""" from copy import deepcopy from unittest.mock import MagicMock, patch import pytest from aiohue import Bridge from aiohue.sensors import GenericSensor from homeassistant.components.hue import DOMAIN as HUE_DOMAIN from homeassistant.components.hue import HueBridge from homeass...
robmarkcole/Hue-sensors-HASS
tests/conftest.py
conftest.py
py
3,842
python
en
code
346
github-code
36
[ { "api_name": "custom_components.huesensor.data_manager.HueSensorData", "line_number": 32, "usage_type": "name" }, { "api_name": "custom_components.huesensor.data_manager.HueSensorBaseDevice", "line_number": 33, "usage_type": "name" }, { "api_name": "custom_components.huesensor.d...
74791355622
import constant from loguru import logger from managers import AudioManager from threading import Event, Thread class Autonomous(object): def __init__(self, audio_manager: AudioManager): self.audio_manager = audio_manager self.event: Event = Event() self.event.set() self.thread: ...
dezil/R2
autonomous.py
autonomous.py
py
1,035
python
en
code
1
github-code
36
[ { "api_name": "managers.AudioManager", "line_number": 10, "usage_type": "name" }, { "api_name": "threading.Event", "line_number": 12, "usage_type": "name" }, { "api_name": "threading.Thread", "line_number": 14, "usage_type": "name" }, { "api_name": "loguru.logger....
24454040368
import time from tqdm.auto import tqdm def show_info_me(): """ Показывает инфо о коллеге """ about_me = { 'ФИО': 'Левченко Алексей', 'Должность': 'Ведущий исследователь данных', 'Блок': 'Технологии', 'Делаю': 'рекомендательные системы в HR', } for k, v in about_me.ite...
kcundel/python_da_course
Lesson1/about.py
about.py
py
5,203
python
ru
code
0
github-code
36
[ { "api_name": "tqdm.auto.tqdm", "line_number": 172, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 173, "usage_type": "call" } ]
37039563232
from django.contrib.gis.db import models from django.contrib.auth.models import AbstractUser from django.utils.encoding import smart_str from django.utils.translation import gettext_lazy as _ # Create your models here. class Country(models.Model): """Class for country info""" name = models.CharField(max_leng...
EUROMAMMALS/website
core/models.py
models.py
py
4,541
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.gis.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.contrib.gis.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.contrib.gis.db.models.CharField", "line_number": 11, "usage_typ...
8522405005
import unittest from BaseTestCases.BaseTestCase import BaseTestCase, os from Pages.Deployment_Group import DG_Create from Pages.LoginPage import LoginPage from DataSource.read_excel import read_excel from time import sleep from ddt import ddt,data,unpack @ddt class test_DG_Create (BaseTestCase): @data(*read_exce...
EFarag/ACE_Project
TestCases/test_DG_Valid_create.py
test_DG_Valid_create.py
py
1,130
python
en
code
0
github-code
36
[ { "api_name": "BaseTestCases.BaseTestCase.BaseTestCase", "line_number": 11, "usage_type": "name" }, { "api_name": "Pages.LoginPage.LoginPage.login", "line_number": 18, "usage_type": "call" }, { "api_name": "Pages.LoginPage.LoginPage", "line_number": 18, "usage_type": "nam...
34627321771
from pathlib import Path import os import datetime import json import h5py import numpy as np import pandas as pd import click import tensorflow as tf from src.data.tf_data_hdf5 import get_tf_data, RandomStandardization from src.models.models import unet_model, unetclassif_model from src.models.losses import CustomLo...
voreille/plc_segmentation
src/models/train_model.py
train_model.py
py
9,009
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 50, "usage_type": "attribute" }, { "api_name": "h5py.File", "line_number": 51, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_nu...
24844526241
from django.contrib import admin from .models import PrivateChat, Message # Register your models here. @admin.register(PrivateChat) class PrivateChatAdmin(admin.ModelAdmin): """Filters, displays and search for django admin""" list_filter = ('user1', 'user2', ) list_display = ('user1', 'user2') search_f...
lexach91/DateLoc
chat/admin.py
admin.py
py
605
python
en
code
1
github-code
36
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 5, "usage_type": "call" }, { ...
20087427863
from argparse import ArgumentParser from copy import deepcopy from pathlib import Path def build_parser(): parser = ArgumentParser() parser.add_argument( '-i', '--input-filename', type=Path, required=True ) return parser def string_to_integer_list(string): return list(map(int, s...
reynoldscem/aoc2022
day_08/part2.py
part2.py
py
2,023
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 73, "usage_type": "call" } ]
33646432106
import asyncio import threading import time import speech_recognition as sr r = sr.Recognizer() # def do(audio): def srcVoice(n, audio): for i in range(n, 0, -1): print('sssssss') # threading.Thread(target=r.recognize_google, args=(audio)) words = r.recognize_google(audio) print(...
giribabu22/assistant-Nikki-python
thread_voice_src/script.py
script.py
py
770
python
en
code
4
github-code
36
[ { "api_name": "speech_recognition.Recognizer", "line_number": 6, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 24, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 31, "usage_type": "call" } ]
27653577571
from pages.courses.register_courses_page import Register_courses_page import unittest import pytest from utilities.teststatus import StatusVerify @pytest.mark.usefixtures("oneTimeSetUp", "setUp") class Register_course_tests(unittest.TestCase): @pytest.fixture(autouse=True) def classSetup(self, oneTimeSetUp): ...
akanksha2306/selenium_python_practice
tests/courses/test_register_courses.py
test_register_courses.py
py
1,073
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pages.courses.register_courses_page.Register_courses_page", "line_number": 11, "usage_type": "call" }, { "api_name": "utilities.teststatus.StatusVerify", "line_number": 12, "u...
1243604019
from math import cos, pi, sin import pygame as pg from constants import consts as c from id_mapping import id_map from images import img as i from ui.game_ui import ui def move_player(keys_pressed): if keys_pressed[pg.K_UP] or keys_pressed[pg.K_w]: c.player_y -= c.player_speed * c.dt if c.player_...
chanrt/py-factory
utils.py
utils.py
py
5,214
python
en
code
11
github-code
36
[ { "api_name": "pygame.K_UP", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.K_w", "line_number": 11, "usage_type": "attribute" }, { "api_name": "constants.consts.player_y", "line_number": 12, "usage_type": "attribute" }, { "api_name": "const...
5066258041
import math import numpy as np from queue import Queue, PriorityQueue import time import networkx as nx import pymysql def read_file(edges, degree, g_dict, connected_fields): w = [] edge = {} visit = {} cnt = 1 sum = 0 n = 0 m = 0 for item in edges: a = ite...
ryy980622/Hi-PART
src/graph_augmentation.py
graph_augmentation.py
py
22,560
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 85, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 86, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 88, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": ...
70774463784
from artist_data import ArtistData import numpy as np import igraph class Network: def __init__(self, data): self._data = data self._graph = igraph.Graph() def graph(self): return self._graph def init(self): self._graph.add_vertices(list(self._data.artists.keys())) ...
jakubsob/SpotifyArtistsNetwork
network.py
network.py
py
2,904
python
en
code
0
github-code
36
[ { "api_name": "igraph.Graph", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.quantile", "line_number": 37, "usage_type": "call" }, { "api_name": "igraph.plot", "line_number": 44, "usage_type": "call" }, { "api_name": "artist_data.ArtistData", "...
12087063894
import os import json import argparse from multiprocessing import Pool import string import shutil # external libraries from numpy import argmax from rouge import Rouge from tqdm import tqdm def ROUGE(hypsumm, refsumm): rouge = Rouge() rouge.metrics = ['rouge-2'] rouge.stats = ['r'] ...
Law-AI/summarization
extractive/abs_to_ext/extractive_labels.py
extractive_labels.py
py
9,688
python
en
code
139
github-code
36
[ { "api_name": "rouge.Rouge", "line_number": 16, "usage_type": "call" }, { "api_name": "rouge.metrics", "line_number": 17, "usage_type": "attribute" }, { "api_name": "rouge.stats", "line_number": 18, "usage_type": "attribute" }, { "api_name": "rouge.get_scores", ...
71591819304
from django.shortcuts import render from django.http.response import JsonResponse from rest_framework.parsers import JSONParser from rest_framework import status from rest_framework.decorators import api_view from rest_framework.permissions import IsAuthenticated from rest_framework.authentication import TokenAuthenti...
Gabospa/Rest_Framework_API
catalog/views.py
views.py
py
2,419
python
en
code
0
github-code
36
[ { "api_name": "models.Album.objects.all", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Album.objects", "line_number": 19, "usage_type": "attribute" }, { "api_name": "models.Album", "line_number": 19, "usage_type": "name" }, { "api_name": "seria...
37339853215
from collections import deque infinity = float("inf") def make_graph(): # identical graph as the YouTube video: https://youtu.be/Tl90tNtKvxs return [ [0, 10, 0, 10, 0, 0], [0, 0, 4, 2, 8, 0], [0, 0, 0, 0, 0, 10], [0, 0, 0, 0, 9, 0], [0, 0, 6, 0, 0, 1...
msambol/dsa
maximum_flow/ford_fulkerson.py
ford_fulkerson.py
py
1,683
python
en
code
211
github-code
36
[ { "api_name": "collections.deque", "line_number": 20, "usage_type": "call" } ]
10204405519
from flask import Flask,request,jsonify from flask_mysqldb import MySQL app = Flask(__name__) app.config['MYSQL_HOST'] = 'localhost' app.config['MYSQL_USER'] = 'root' app.config['MYSQL_PASSWORD'] = '' app.config['MYSQL_DB'] = 'library' mysql = MySQL(app) def getQuery(sql): cursor = mysql.connection.cursor() ...
EdgarPozas/APILibraryInFlask
app.py
app.py
py
1,832
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_mysqldb.MySQL", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.form.get", "line_number": 46, "usage_type": "call" }, { "api_name": "flask.request.f...
7880901877
import json from enum import Enum from typing import Union from pyspark.sql import Column import pyspark.sql.functions as F class ModelType(Enum): CLASSIFICATION = 1 REGRESSION = 2 class _Singleton(type): """ A metaclass that creates a Singleton base class when called. """ _instances = {} def ...
maxpumperla/elephas
elephas/utils/model_utils.py
model_utils.py
py
2,344
python
en
code
1,568
github-code
36
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "json.JSONEncoder", "line_number": 58, "usage_type": "attribute" }, { "api_name": "json.JSONEncoder.default", "line_number": 62, "usage_type": "call" }, { "api_name": "json.JSONEnco...
11712750390
import pyautogui import pyperclip import time import schedule # 카카오톡에 메시지를 보내는 코드를 send_message 함수로 생성 def send_message(): threading.Timer(10, send_message).start() # KakaoPicture1.png 파일과 동일한 그림을 찾아 좌표 출력 picPosition = pyautogui.locateOnScreen(r'11. PC_Kakao_Talk_Automation_Using_Automouse\KakaoPictu...
WoojinJeonkr/Python-and-40-works-to-learn-while-making
11. PC_Kakao_Talk_Automation_Using_Automouse/ScheduleRunAutomationKakaoTalk.py
ScheduleRunAutomationKakaoTalk.py
py
1,883
python
ko
code
1
github-code
36
[ { "api_name": "pyautogui.locateOnScreen", "line_number": 11, "usage_type": "call" }, { "api_name": "pyautogui.locateOnScreen", "line_number": 16, "usage_type": "call" }, { "api_name": "pyautogui.locateOnScreen", "line_number": 21, "usage_type": "call" }, { "api_na...
70858172905
from functools import reduce, wraps import tensorflow as tf from tensorflow.keras.layers import Add, BatchNormalization, LeakyReLU, Conv2D, ZeroPadding2D, UpSampling2D from tensorflow.keras.layers import Concatenate from keras.layers.merge import add from tensorflow.keras.regularizers import l2 L2_FACTOR = 1e-5 def ...
jmajumde/MyMScProj
jmod/onestage/yolov3/models/layers.py
layers.py
py
6,268
python
en
code
2
github-code
36
[ { "api_name": "functools.reduce", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.BatchNormalization", "line_number": 29, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.LeakyReLU", "line_number": 30, "usage_type": "call" ...
497207117
import abc import six from dagster_spark.configs_spark import spark_config from dagster_spark.utils import flatten_dict from pyspark.sql import SparkSession from dagster import Field, check, resource def spark_session_from_config(spark_conf=None): spark_conf = check.opt_dict_param(spark_conf, 'spark_conf') ...
helloworld/continuous-dagster
deploy/dagster_modules/libraries/dagster-pyspark/dagster_pyspark/resources.py
resources.py
py
1,647
python
en
code
2
github-code
36
[ { "api_name": "dagster.check.opt_dict_param", "line_number": 12, "usage_type": "call" }, { "api_name": "dagster.check", "line_number": 12, "usage_type": "name" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 13, "usage_type": "attribute" }, { "...
21877547543
from TeamCloud_Modul.Blockchain import Transaction import requests import json import os from TeamCloud_Modul.Node import Node from TeamCloud_Modul.json_parser import Message, JSON_Parser, get_checksum from cryptography.hazmat.primitives import serialization from requests.api import request from create_Keys import c...
Marcus11Dev/Blockchain_Lesson_Agent
agent.py
agent.py
py
13,436
python
en
code
0
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 19, "usage_type": "call" }, { "api_name": "TeamCloud_Modul.json_par...
35319837996
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: mcxiaoke # @Date: 2015-08-18 20:14:05 from __future__ import unicode_literals, division, absolute_import, print_function import requests import shutil import sys import signal import os import traceback import time import logging import bs4 from lxml import html ...
mcxiaoke/python-labs
lib/commons.py
commons.py
py
5,317
python
en
code
7
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "fake_useragent.UserAgent", "line_number": 31, "usage_type": "call" }, { "api_name": "const.DEFAULT_REQUEST_TIMEOUT", "line_number": 32, "usage_type": "name" }, { "api_name...
2671254266
from typing import TypeAlias, Union from const import MAX_SLOT_NUM, DiffusionSVCInferenceType, EnumInferenceTypes, EmbedderType, VoiceChangerType from dataclasses import dataclass, asdict, field import os import json @dataclass class ModelSlot: slotIndex: int = -1 voiceChangerType: VoiceChangerType | None =...
w-okada/voice-changer
server/data/ModelSlot.py
ModelSlot.py
py
6,366
python
en
code
12,673
github-code
36
[ { "api_name": "const.VoiceChangerType", "line_number": 13, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 19, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 10, "usage_type": "name" }, { "api_name": "const....
72000657063
# -*- coding: utf-8 -*- # French language sounds configuration from tts import filename, NO_ALTERNATE, PROMPT_SYSTEM_BASE, PROMPT_CUSTOM_BASE systemSounds = [] sounds = [] for i in range(100): systemSounds.append((str(i), filename(PROMPT_SYSTEM_BASE + i))) for i in range(10): systemSounds.append((str(100 *...
Ingwie/NextStepRc-2.18
radio/util/tts_fr.py
tts_fr.py
py
4,215
python
en
code
14
github-code
36
[ { "api_name": "tts.filename", "line_number": 12, "usage_type": "call" }, { "api_name": "tts.PROMPT_SYSTEM_BASE", "line_number": 12, "usage_type": "name" }, { "api_name": "tts.filename", "line_number": 14, "usage_type": "call" }, { "api_name": "tts.PROMPT_SYSTEM_BA...
10829429705
#!/usr/bin/env python import os, sys, pkg_resources import json from collections import namedtuple from functools import partial import html5lib from ..vendor.pluginbase.pluginbase import PluginBase Key = namedtuple("Key", ["name","version"]) __all__ = ['plugins_get_mgr', 'plugins_load', 'plugins_show', '...
pingali/dgit
dgitcore/plugins/common.py
common.py
py
7,921
python
en
code
15
github-code
36
[ { "api_name": "collections.namedtuple", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.path.dirname",...
34228583172
# -*- coding: utf-8 -*- """ Application Factory This is the entry point to the entire application. """ import os import json from flask import Flask, render_template, jsonify, flash, redirect, url_for def create_app(test_config=None): """Create an instance of Wallowa Wildlife Checklists""" app = Flask(__nam...
wicker/Wallowa-Wildlife-Checklist-App
wallowawildlife/__init__.py
__init__.py
py
4,136
python
en
code
1
github-code
36
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number":...
37360525865
import argparse import glob import json import logging import os import platform import re import traceback from pathlib import Path import fitz if platform.system() == "Windows": logdir = Path(os.environ['USERPROFILE']) / ".pdf_guru" else: logdir = Path(os.environ['HOME']) / ".pdf_guru" logdir.mkdir(parents=...
kevin2li/PDF-Guru
thirdparty/convert_external.py
convert_external.py
py
5,838
python
en
code
941
github-code
36
[ { "api_name": "platform.system", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line...
28299895707
from train import get_model from torchvision import transforms from PIL import Image import matplotlib.pyplot as plt import torch import os from torchvision.models import resnet18, ResNet18_Weights import torch.nn as nn import numpy as np class Make_Test(nn.Module): def __init__(self, weight_path): super(...
kienptitit/Dog_Cat_Classification
image_test.py
image_test.py
py
1,821
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torchvision.transforms.Compose", "line_number": 15, "usage_type": "call" }, { "api_name": "torchvis...
1763129188
""" Implements a mixin for remote communication. """ import re import json import socket whitespace_re = re.compile(r"\s+") class RemoteActor: ENCODING = "utf-8" DECODER = json.JSONDecoder() def __init__(self, socket): """ Creates a new remote actor able to send and receive from the given s...
lukasberger/evolution-game
evolution/common/remote_actor_2.py
remote_actor_2.py
py
2,413
python
en
code
0
github-code
36
[ { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "json.JSONDecoder", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 44, "usage_type": "call" }, { "api_name": "socket.timeout", "line_numb...
26255667961
""" Here I will read access tokens from txt file for safety """ import json class Token: def __init__(self): with open('tokens.json', 'r') as f: data = json.loads(f.readline()) self.community = data['comm_token'] self.user = data['usr_token'] self.comm_id = -167621445 ...
maxikfu/community
auth.py
auth.py
py
393
python
en
code
0
github-code
36
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" } ]
25418445648
#!/usr/bin/env python from utils.analysis import AbsMovingAvg, Threshold, Derivative from utils.chaser import Chaser import os import sys parentDir = os.path.dirname(os.getcwd()) sys.path.append(parentDir) def checkImport(lib): if not os.path.exists(os.path.join(parentDir, lib)): print("%s library not fou...
andrewbooker/audiotomidi
scanWavFile.py
scanWavFile.py
py
1,495
python
en
code
1
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path.append", "line_numbe...
72170355625
import pandas as pd import pickle from pathlib import Path def preprocess_test_df(test_clin_df, test_prot_df, test_pep_df, save_data=False): if 'upd23b_clinical_state_on_medication' in test_clin_df.columns: # drop the medication column test_clin_df = test_clin_df.drop(columns=['upd23b_clini...
dagartga/Boosted-Models-for-Parkinsons-Prediction
src/data/pred_pipeline.py
pred_pipeline.py
py
2,509
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "pathlib.Path", "l...
40306775358
import numpy as np import pandas as pd from collections import OrderedDict import matplotlib as mlt import matplotlib.pyplot as plt from scipy import optimize def get_data(): data = OrderedDict( amount_spent = [50, 10, 20, 5, 65, 70, 80, 81, 1], send_discount = [0, 1, 1, 1, 0, 0, 0, ...
guruprasaad123/ml_for_life
from_scratch/logistic_regression/Newtons method/optimize.py
optimize.py
py
2,692
python
en
code
4
github-code
36
[ { "api_name": "collections.OrderedDict", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "attribute" }, { "api_name"...
86340516810
from openpyxl import load_workbook # from openpyxl.cell import Cell if __name__ == '__main__': wb = load_workbook('data/FINODAYS_Доп. материал для Почта Банк_Диалоги.xlsx') for sn in wb.sheetnames: print(sn) marks = [] for row in wb[sn]: if row[1].value == 'CLIENT': ...
eivankin/finodays-2nd-stage
get_user_messages.py
get_user_messages.py
py
546
python
en
code
0
github-code
36
[ { "api_name": "openpyxl.load_workbook", "line_number": 5, "usage_type": "call" } ]
432875678
import numpy as np from torch.utils import data import torch as t import matplotlib.pyplot as plt import h5py from .utils.utils import mat2gray_nocrop, plot_img_with_labels import os import random import ipdb from .visualize_predictions import draw_label_img from scipy.ndimage import gaussian_filter import monai def ...
SalamanderXing/dna_foci_detection
dna_foci_detection/data_loaders/foci/dataset.py
dataset.py
py
4,646
python
en
code
0
github-code
36
[ { "api_name": "torch.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.rand", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.fliplr", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.fliplr", "line_number...
20871041067
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import logic UI_BOARD_SIZE = (8, 6) UI_BOARD_OFFSET = 0.25 UI_BOARD_CELL_COLORS = [(0,0,0,0.4), (0,0.9,1,0.7)] ''' UI front-end implementation ''' class Board: def __init__(self): # Create figure and axes sel...
manu-ho/game_of_life
board.py
board.py
py
5,007
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.axes", "line_number": 43, "usage_type": "call" }, { "api_name": "m...
31063851875
from ..utils import Object class MessageReplyInfo(Object): """ Contains information about replies to a message Attributes: ID (:obj:`str`): ``MessageReplyInfo`` Args: reply_count (:obj:`int`): Number of times the message was directly or indirectly replied recent...
iTeam-co/pytglib
pytglib/api/types/message_reply_info.py
message_reply_info.py
py
2,077
python
en
code
20
github-code
36
[ { "api_name": "utils.Object", "line_number": 6, "usage_type": "name" }, { "api_name": "utils.Object.read", "line_number": 44, "usage_type": "call" }, { "api_name": "utils.Object", "line_number": 44, "usage_type": "name" } ]
5538635649
# drawing the Earth on equirectangular projection import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.feature as cfeature import numpy import matplotlib.ticker as mticker fig = plt.figure(figsize=(64,32), frameon=False) ax = fig.add_subplot(1,1,1, projection=ccrs.PlateCarree(central_longitude=18...
shuyo/xr
earth.py
earth.py
py
1,349
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "cartopy.crs.PlateCarree", "line_number": 10, "usage_type": "call" }, { "api_name": "cart...
4313052823
import torch from gms_loss import * from PIL import Image from torchvision import transforms from gms_loss import MSGMS_Loss image_path_1= './lj_test_image/1118_visdon_HR_downsampling_2loss_visstyle/0_SR_x_1105_4.png' image_path_2 = './lj_test_image/1116_tcl_bright/6_SR_x_1105_4.png' img_ycbcr_1 = Image.open(image_pa...
JOY2020-Mh/SR_2.0
gsmd_LOSS/image_calculate_gmsd.py
image_calculate_gmsd.py
py
795
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
13168287871
import numpy as np import matplotlib from matplotlib import pyplot as plt plt.switch_backend('agg') import matplotlib.patches from scipy import stats import pandas as pd import math from mpi4py import MPI import sys import itertools import glob import os plt.ioff() design = str(sys.argv[1]) all_IDs = ['3600687', '70...
antonia-had/rival_framings_demand
output_analysis/shortage_duration_curves.py
shortage_duration_curves.py
py
5,340
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ioff", "line_number": 15, "usage_type": "call" }, { "api_name"...
31352733665
# Import all the modules to determine the cofusion matrix import itertools import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix import os # This function calculates the confusion matrix and visualizes it def plot_confusion_matrix(y_test, y_pred, file_path, ...
martinferianc/PatternRecognition-EIE4
Coursework 2/post_process.py
post_process.py
py
1,935
python
en
code
1
github-code
36
[ { "api_name": "matplotlib.pyplot.cm", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "sklearn.metrics.confusion_matrix", "line_number": 38, "usage_type": "call" }, { "api_...
30600682231
from django.dispatch import receiver from django.db.models.signals import post_save from expensense.models import Expense, ApprovalConditions from django.utils import timezone @receiver(post_save, sender=Expense) def auto_approve_expense(sender, instance, **kwargs): """ Method to auto approve expense requests """...
praharsh05/ExpenSense
expensense_main/expensense/signals.py
signals.py
py
2,303
python
en
code
0
github-code
36
[ { "api_name": "expensense.models.ApprovalConditions.objects.get", "line_number": 13, "usage_type": "call" }, { "api_name": "expensense.models.ApprovalConditions.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "expensense.models.ApprovalConditions", "li...
20219614528
# match close atoms in two moleculas by maximum weighted bipartite matching import numpy as np import logging # weights - numpy 2-dimensional array def wbm(weights): import pulp pulp.LpSolverDefault.msg = False prob = pulp.LpProblem("WBM_Problem", pulp.LpMinimize) m,n = weights.shape # ...
gudasergey/pyFitIt
pyfitit/wbm.py
wbm.py
py
2,829
python
en
code
28
github-code
36
[ { "api_name": "pulp.LpSolverDefault", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pulp.LpProblem", "line_number": 10, "usage_type": "call" }, { "api_name": "pulp.LpMinimize", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.ar...
70323989225
#Menggambar graf dengan 8 nodes import matplotlib import networkx as nx import itertools G = nx.Graph() #Menambah node L = ['a','b','c','d','e','f','g','h'] G.add_nodes_from(L) ''' Kak ini kenapa nodesnya selalu kerandom ya? :( ''' #Menambah edge pairs = itertools.combinations(L,2) edges = list() ...
dionesiusap/matplotlib-networkx-example
graph.py
graph.py
py
515
python
en
code
0
github-code
36
[ { "api_name": "networkx.Graph", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 16, "usage_type": "call" }, { "api_name": "networkx.draw_circular", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotli...
18896618824
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^johnjot/', include('johnjot.foo.urls')), (r'^api/', include('core.api.urls')), (r'^admin/', include(admin.site.u...
maraca/JohnJot
core/urls.py
urls.py
py
329
python
en
code
4
github-code
36
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.site", "line_number": 11, "usage_type": "attribute" }, { ...
23048227631
#!/usr/bin/env python # coding: utf-8 # # 積み上げ棒グラフを作成する # In[1]: get_ipython().run_line_magic('matplotlib', 'inline') from matplotlib import pyplot as plt import numpy as np #数値は適当 bar1 = [100, 50, 200] #積み上げ棒グラフの一段目 bar2 = [100, 200, 50] #積み上げ棒グラフの二段目 bar3 = [100, 250, 100] #積み上げ棒グラフの三段目 bar3_st = np.add(bar1, b...
workskt/book
_build/jupyter_execute/python_plot_cumulativebar.py
python_plot_cumulativebar.py
py
5,462
python
ja
code
0
github-code
36
[ { "api_name": "numpy.add", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.pyplo...
12212813324
#!/usr/bin/env python ''' This is the parallel recursive solution to the Tower of Hanoi and is copied from the code written in the parallel/rebuilding-the-tower-of-hanoi/ page of www.drdobbs.com. The solution has been modified from drdobbs' solution to work with my limited knowledge of mpi4py. If you use the sleep() f...
icluster/demos
hanoi/src/hanoi_soln_par.py
hanoi_soln_par.py
py
4,912
python
en
code
0
github-code
36
[ { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 27, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 27, "usage_type": "name" }, { "api_name": "mpi4py.MPI.Get_processor_name", "line_number": 30, "usage_type": "call" }, { "api_name": "m...
20707090879
import os, time from Crypto.Random import get_random_bytes, random from lib.logger import * log = Logger() ''' This class handles the BLE Beacon Transmission (TX). Because after some time of BLE advertising, a restart of the BLE stack (hciconfig hci0 down / up) might be required, and because the pybleno class can't be...
mh-/exposure-notification-ble-python
lib/en_tx_service.py
en_tx_service.py
py
2,883
python
en
code
28
github-code
36
[ { "api_name": "time.time", "line_number": 26, "usage_type": "call" }, { "api_name": "Crypto.Random.get_random_bytes", "line_number": 35, "usage_type": "call" }, { "api_name": "Crypto.Random.random.randint", "line_number": 41, "usage_type": "call" }, { "api_name": ...
70744489704
import fileinput import glob import os import random import time import re from urllib.error import HTTPError from arghandler import ArgumentHandler, subcmd from google import search from subprocess import call from procurer import ultimate_guitar, lastfm, postulate_url from rules import rules, clean from songbook...
arpheno/songbook
main.py
main.py
py
4,443
python
en
code
0
github-code
36
[ { "api_name": "google.search", "line_number": 24, "usage_type": "call" }, { "api_name": "procurer.ultimate_guitar", "line_number": 56, "usage_type": "call" }, { "api_name": "writer.FileWriter", "line_number": 57, "usage_type": "call" }, { "api_name": "urllib.error...
70913641705
import cv2 import numpy as np import os import path import face_recognition import getopt, sys def getOriginalData(file): count_vertices = 0 count_faces = 0 original_coordinates = [] faces_indices = [] texture_coordinates = [] texture_indices = [] oc_file = open("Original_Vertices.txt", "w"...
liyanxiangable/3DFaceAlignment
FaceAlignment.py
FaceAlignment.py
py
20,504
python
en
code
3
github-code
36
[ { "api_name": "numpy.array", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 55, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.int32", "line_nu...
35872181243
__author__ = 'Dennis Qiu' from PIL import Image def de_steg(encrypted_file): f, e = encrypted_file.split('.') steg = Image.open(encrypted_file) out = Image.new('RGB', (steg.width,steg.height)) for x in range(steg.width): for y in range(steg.height): r, g, b = steg.getpixel(...
denqiu/Python-ImageProcessing
image_steg.py
image_steg.py
py
1,570
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 6, "usage_type": "name" }, { "api_name": "PIL.Image.new", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 7,...
2820524990
from django.contrib import admin from .models import CalendarEvent, CalendarEventAttendee, UserCalendar class CalendarEventAttendeeInline(admin.TabularInline): model = CalendarEventAttendee extra = 0 autocomplete_fields = ( 'user', ) class UserCalendarInline(admin.TabularInline): model...
rimvydaszilinskas/organize-it
apps/calendars/admin.py
admin.py
py
584
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "models.CalendarEventAttendee", "line_number": 7, "usage_type": "name" }, {...
3903968215
#!/usr/bin/env python from __future__ import with_statement import logging import logging.handlers LOG_FILE_HDL = '/tmp/logging_example.out' mylogger = logging.getLogger("MyLogger") mylogger.setLevel(logging.DEBUG) ch_handler = logging.StreamHandler() ch_handler.setLevel(logging.DEBUG+1) mylogger.addHandler(ch_han...
bondgeek/pythonhacks
recipes/logger_example.py
logger_example.py
py
756
python
en
code
3
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.DEB...
33759274918
import json import codecs import sys if len(sys.argv) != 3: print('Usage: ' + sys.argv[0] + " <input json path> <output csv path>") exit() infilename = sys.argv[1] outfilename = sys.argv[2] sep = "|" out = open(outfilename, 'w') def processSource(sourceStr): source = sourceStr.lower() listOfAppleDe...
ador/trial
scripts/twitterJsonToCsv.py
twitterJsonToCsv.py
py
4,212
python
en
code
1
github-code
36
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number":...
72738108584
#!/bin/python3 import os import sys import pathlib from amp_database import download_DRAMP def check_samplelist(samplelist, tools, path): if(samplelist==[]): print('<--sample-list> was not given, sample names will be inferred from directory names') for dirpath, subdirs, files in os.walk(path): ...
Darcy220606/AMPcombi
ampcombi/check_input.py
check_input.py
py
5,496
python
en
code
4
github-code
36
[ { "api_name": "os.walk", "line_number": 11, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "u...
31064957465
from ..utils import Object class ThemeParameters(Object): """ Contains parameters of the application theme Attributes: ID (:obj:`str`): ``ThemeParameters`` Args: background_color (:obj:`int`): A color of the background in the RGB24 format secondary_background_...
iTeam-co/pytglib
pytglib/api/types/theme_parameters.py
theme_parameters.py
py
2,062
python
en
code
20
github-code
36
[ { "api_name": "utils.Object", "line_number": 6, "usage_type": "name" } ]
41165253893
# -*- coding: utf-8 -*- ''' This file is part of Habitam. Habitam 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 option) any later version. Habitam is distr...
habitam/habitam-core
habitam/ui/forms/fund.py
fund.py
py
3,821
python
en
code
1
github-code
36
[ { "api_name": "django.utils.translation.ugettext", "line_number": 34, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext", "line_number": 35, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext", "line_number": 38, "usage_type": ...
12366447292
import glob import os import shutil import tempfile import unittest from ample import constants from ample.testing import test_funcs from ample.util import ample_util, spicker @unittest.skip("unreliable test cases") @unittest.skipUnless(test_funcs.found_exe("spicker" + ample_util.EXE_EXT), "spicker exec missing") cl...
rigdenlab/ample
ample/util/tests/test_spicker.py
test_spicker.py
py
2,160
python
en
code
6
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.dirname",...
39400543792
import numpy as np; import cv2; #load image from file #cv2.imwrite('imageName.png', img); rgb_red_pos = 2; rgb_blue_pos = 0; rgb_green_pos = 1; img_1 = cv2.imread('red1.png',1); ##img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY); ##extract the red component image 1 red_only1 = np.int16( np.matrix(img_1[:,:,rgb_red_pos]))...
botchway44/computer-Vision
image diffrencing.py
image diffrencing.py
py
2,160
python
en
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.int16", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.matrix", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": ...
35397910028
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import glob import os from textwrap import dedent import xml.dom.minidom as DOM import coverage from pants.backend.python.targets.python_library import PythonLibrary...
fakeNetflix/square-repo-pants
tests/python/pants_test/backend/python/test_test_builder.py
test_test_builder.py
py
8,998
python
en
code
0
github-code
36
[ { "api_name": "pants_test.base_test.BaseTest", "line_number": 19, "usage_type": "name" }, { "api_name": "pants.backend.python.test_builder.PythonTestBuilder", "line_number": 21, "usage_type": "call" }, { "api_name": "pants.util.contextutil.pushd", "line_number": 22, "usag...
417814461
import os from collections import defaultdict def file_statistics(parent_dir): files_dict = defaultdict(list) for root, dirs, files in os.walk(parent_dir): for file in files: stat = os.stat(os.path.join(root, file)) if stat.st_size <= 100: files_dict[100].append...
Shorokhov-A/practical_tasks
Shorokhov_Andreiy_dz_7/task_7_4.py
task_7_4.py
py
747
python
en
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 7, "usage_type": "call" }, { "api_name": "os.stat", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
25084775362
# This Golf class will be responsible for scraping the latest # Trump golf outing located on trumpgolfcount.com from bs4 import BeautifulSoup import requests import json import twitter import lxml import pyrebase def main(): get_latest_outing() def push_db(data): # db.child("time").push(data) db.child("t...
navonf/isTrumpGolfing
Golf.py
Golf.py
py
2,033
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" } ]
71252887144
from datetime import datetime import glob import os import time import anim import threading print(datetime.timestamp(datetime.now())) class User: def __init__(self, name: str): self.name = name class Chat: def __init__(self, username: str, text: str, score: int = 0): self.author = User(usern...
ij5/ace-ainize
app.py
app.py
py
1,475
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime.timestamp", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "flas...
15775777498
from enum import Enum from dataclasses import dataclass class TokenType(Enum): NUMBER = 0 PLUS = 1 MINUS = 2 ASTERISK = 3 SLASH = 4 LPAR = 5 RPAR = 6 @dataclass class Token: type: TokenType value: str def __repr__(self) -> str: return f"({self.type.name}, '{self.valu...
ricdip/py-math-interpreter
src/model/token.py
token.py
py
326
python
en
code
0
github-code
36
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 15, "usage_type": "name" } ]
36955207429
import random, string import wiredtiger, wttest from helper import copy_wiredtiger_home from wtdataset import SimpleDataSet from wtscenario import filter_scenarios, make_scenarios # test_cursor12.py # Test cursor modify call class test_cursor12(wttest.WiredTigerTestCase): keyfmt = [ ('recno', dict(keyfm...
mongodb/mongo
src/third_party/wiredtiger/test/suite/test_cursor12.py
test_cursor12.py
py
15,173
python
en
code
24,670
github-code
36
[ { "api_name": "wttest.WiredTigerTestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "wtscenario.filter_scenarios", "line_number": 24, "usage_type": "call" }, { "api_name": "wtscenario.make_scenarios", "line_number": 24, "usage_type": "call" }, { ...
4738433123
from operator import attrgetter from django.contrib.auth import get_user_model from django.db.models import ( CASCADE, SET_NULL, BooleanField, CharField, CheckConstraint, DateTimeField, F, ForeignKey, IntegerChoices, IntegerField, JSONField, ManyToManyField, Model, Q, SlugField, TextField, UniqueConstraint...
x-yzt/mixtures
drugcombinator/models.py
models.py
py
12,000
python
en
code
7
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 22, "usage_type": "name" }, { "api_name": "django.db.models.DateTimeField", "line_number": 23, "usage_type": "call" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 25, "usage_type": "call" }...
8368222279
from itertools import groupby def checkgroup(word): group = [key for key, item in groupby(word)] values =[(k, [i for i in range(len(word)) if word[i] == k]) for k in group] groupword = 0 for items in values: if items[1].__len__() == 0: groupword += 1 continue ...
hyelimchoi1223/Algorithm-Study
백준/[백준]1316 그룹 단어 체커/python.py
python.py
py
789
python
en
code
1
github-code
36
[ { "api_name": "itertools.groupby", "line_number": 3, "usage_type": "call" } ]
8342129346
from django.http import request from django.http.response import HttpResponse from django.shortcuts import redirect, render from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from core.models import Medico, Hora, Cita, Paciente from core.forms import Pa...
felipe-quirozlara/arquit-proyect
arquitGalenos/pages/views.py
views.py
py
7,814
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "django.http.request", "line_number": 15, "usage_type": "argument" }, { "api_name": "django.http.request.method", "line_number": 20, "usage_type": "attribute" }, { "a...
34981855639
from flask import Flask, request, render_template from googlesearch import search app = Flask(__name__) def search_pdfs(query, num_results=5): search_results = [] try: for j in search(query + " filetype:pdf", num_results=num_results): search_results.append(j) return search_results...
suryagowda/booksearcherr
booksearcher/app.py
app.py
py
764
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "googlesearch.search", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 20, "usage_type": "attribute" }, { "api_name": "flask.reques...
39260413778
# import system modules import traceback import os import sys import errno import subprocess import time import signal import functools # import I/O modules import RPi.GPIO as GPIO import smbus2 import spidev # import utility modules import math import numpy as np import scipy.constants as const from dataclasses import...
ExplodingONC/Flash_LiDAR_Microscan
LidarControl.py
LidarControl.py
py
10,164
python
en
code
0
github-code
36
[ { "api_name": "os.strerror", "line_number": 21, "usage_type": "call" }, { "api_name": "errno.ETIME", "line_number": 21, "usage_type": "attribute" }, { "api_name": "signal.signal", "line_number": 28, "usage_type": "call" }, { "api_name": "signal.SIGALRM", "line...
5259209115
# import libraries import datetime from airflow import DAG from airflow.contrib.operators.emr_create_job_flow_operator import EmrCreateJobFlowOperator from airflow.contrib.operators.emr_add_steps_operator import EmrAddStepsOperator from airflow.contrib.sensors.emr_step_sensor import EmrStepSensor from airflow.contrib.o...
stefanjaro/data-engineering-nanodegree-capstone-project
airflow/dags/prepare-data-for-redshift.py
prepare-data-for-redshift.py
py
8,900
python
en
code
0
github-code
36
[ { "api_name": "airflow.DAG", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "datetime.tim...
74087426982
import requests, datetime, csv from flask import Flask from flask import request, render_template response = requests.get("http://api.nbp.pl/api/exchangerates/tables/C?format=json") data_as_json= response.json() app = Flask(__name__) for item in data_as_json: only_rates = item.get('rates') current_date = ite...
gorkamarlena/currency_calculator
app.py
app.py
py
1,803
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.request.method", "lin...
73335571623
import unittest from pathlib import Path from tempfile import TemporaryDirectory import pytest from tpk.hypervalidation.hyperparameter_search import ( run_model_cmd_parallel, run_study, ) from tpk.torch import TSMixerModel @pytest.mark.asyncio async def test_num_workers() -> None: results = await run_mo...
airtai/temporal-data-kit
tests/hypervalidation/test_hyperparameter_search.py
test_hyperparameter_search.py
py
1,039
python
en
code
2
github-code
36
[ { "api_name": "tpk.hypervalidation.hyperparameter_search.run_model_cmd_parallel", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 14, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 23, "usage_type": "c...
32417088655
import json from typing import Dict from influxdb_client import InfluxDBClient, Point, WritePrecision from influxdb_client.client.write_api import SYNCHRONOUS import pandas as pd import logging class InfluxDB: def __init__(self, local) -> None: # Create a config.json file and store your INFLUX token as a k...
pattty847/Crypto-Market-Watch
app/api/influx.py
influx.py
py
3,453
python
en
code
2
github-code
36
[ { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "influxdb_client.client.write_api.SYNCHRONOUS", "line_number": 14, "usage_type": "name" }, { "api_name": "influxdb_client.InfluxDBClient", "line_number": 19, "usage_type": "call" }, { ...
18394317715
import sys import numpy as np import tiledb # Name of the array to create. array_name = "reading_dense_layouts" def create_array(): # The array will be 4x4 with dimensions "rows" and "cols", with domain [1,4]. dom = tiledb.Domain( tiledb.Dim(name="rows", domain=(1, 4), tile=2, dtype=np.int32), ...
TileDB-Inc/TileDB-Py
examples/reading_dense_layouts.py
reading_dense_layouts.py
py
2,729
python
en
code
165
github-code
36
[ { "api_name": "tiledb.Domain", "line_number": 13, "usage_type": "call" }, { "api_name": "tiledb.Dim", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tiledb.Dim", "line_numb...
32072082706
from flask import Flask, request, jsonify from sklearn.ensemble import GradientBoostingRegressor import pickle import matplotlib import joblib import pandas as pd from sklearn.preprocessing import LabelEncoder from load_data import ( get_binance_dataframe, get_bingx_dataframe, get_bitget_dataframe, get_...
PhatcharaNarinrat/adamas-arbitrage
prediction.py
prediction.py
py
2,279
python
en
code
0
github-code
36
[ { "api_name": "joblib.load", "line_number": 15, "usage_type": "call" }, { "api_name": "load_data.get_binance_dataframe", "line_number": 26, "usage_type": "call" }, { "api_name": "load_data.get_bitget_dataframe", "line_number": 28, "usage_type": "call" }, { "api_na...
36613114839
import os import enum # Folder projet interphone LOG_DIR = "src_backend/Repport/" # Information des trace d'erreur ERROR_TRACE_FILE_PATH = os.path.join(LOG_DIR, 'Error.trace') # Information des logs pour des log général LOG_FILENAME = "APP_Window.log" #Structure du code LOG_FORMAT = "%(asctime)s [%(lev...
ClemGRob/InterPhoneVisiaScan
src_backend/constants_log.py
constants_log.py
py
745
python
fr
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "enum.Enum", "line_number": 18, "usage_type": "attribute" } ]
73424753064
# -*- coding: utf-8 -*- from __future__ import print_function import os import re import json from importlib import import_module from inspect import stack from traceback import print_exc from urllib.parse import unquote from utils import * from config import * @retry(Exception, cdata='method={}'.format(stack()[0...
belodetek/unzoner-api
src/vpns.py
vpns.py
py
16,340
python
en
code
3
github-code
36
[ { "api_name": "json.loads", "line_number": 26, "usage_type": "call" }, { "api_name": "traceback.print_exc", "line_number": 36, "usage_type": "call" }, { "api_name": "inspect.stack", "line_number": 18, "usage_type": "call" }, { "api_name": "traceback.print_exc", ...
11612639350
# -*- coding:utf-8 -*- # ========================================== # author: ZiChen # mail: 1538185121@qq.com # time: 2021/05/03 # 歌词下载脚本 # ========================================== # 请求及数据处理库 import re from urllib import request import json import traceback import os # 本...
Zichen3317/demo18-lyricsDownloader
fc_lyricsDownloader.py
fc_lyricsDownloader.py
py
17,698
python
en
code
0
github-code
36
[ { "api_name": "re.search", "line_number": 44, "usage_type": "call" }, { "api_name": "re.search", "line_number": 46, "usage_type": "call" }, { "api_name": "re.search", "line_number": 48, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_num...
23210851418
from config import Config import requests, json from app.models import news_article, news_source MOVIE_API_KEY = Config.API_KEY News_Article = news_article.Article News_Source = news_source.Source def configure_request(app): global api_key api_key = app.config['API_KEY'] def get_news(): request = reque...
Joshua-Barawa/news-app
app/requests.py
requests.py
py
1,570
python
en
code
1
github-code
36
[ { "api_name": "config.Config.API_KEY", "line_number": 5, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 5, "usage_type": "name" }, { "api_name": "app.models.news_article.Article", "line_number": 6, "usage_type": "attribute" }, { "api_na...
70891405863
from flask import Flask, render_template, request from transformers import VisionEncoderDecoderModel, ViTFeatureExtractor, AutoTokenizer import torch from PIL import Image import io import base64 app = Flask(__name__) model = VisionEncoderDecoderModel.from_pretrained("nlpconnect/vit-gpt2-image-captioning") feature_ex...
AtchayaPraba/Listed-Inc-image-captioning
app.py
app.py
py
2,759
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "transformers.VisionEncoderDecoderModel.from_pretrained", "line_number": 10, "usage_type": "call" }, { "api_name": "transformers.VisionEncoderDecoderModel", "line_number": 10, "usage_type...
15589484398
import requests from lxml import etree import os '''if __name__=='__main__': try: url='https://pic.netbian.com/4kmeinv/' headers={'user-agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} response=requests.get(url=url,h...
BrotherIsHere/pythonProject
7.xpath解析案例-下载图片数据.py
7.xpath解析案例-下载图片数据.py
py
1,746
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "line_number": 29, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 29, "usage_type": "name" }, { "api_name": "os.path.exists", "line_nu...
28231150156
#!/usr/bin/env python # -*- coding: utf-8 -*- import netCDF4 from utils import * def write_jules_overbank_props_1d(overbank_fn, overbank_maps, grid_dim_name): nco = netCDF4.Dataset(overbank_fn, 'w', format='NETCDF4') mask = LAND_FRAC > 0. nland = mask.sum() for key, value in overbank_maps.items()...
simonmoulds/jamr
src/python/write_jules_overbank_props.py
write_jules_overbank_props.py
py
2,611
python
en
code
0
github-code
36
[ { "api_name": "netCDF4.Dataset", "line_number": 9, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 32, "usage_type": "call" } ]
33540666683
"""HTTP Archive dataflow pipeline for generating HAR data on BigQuery.""" from __future__ import absolute_import import json import logging from copy import deepcopy from hashlib import sha256 import apache_beam as beam from modules import utils, constants, transformation # BigQuery can handle rows up to 100 MB. M...
HTTPArchive/data-pipeline
modules/non_summary_pipeline.py
non_summary_pipeline.py
py
17,297
python
en
code
3
github-code
36
[ { "api_name": "logging.warning", "line_number": 39, "usage_type": "call" }, { "api_name": "logging.warning", "line_number": 46, "usage_type": "call" }, { "api_name": "logging.warning", "line_number": 69, "usage_type": "call" }, { "api_name": "logging.warning", ...
7813600766
"""add region column for sample Create Date: 2021-04-05 17:09:26.078925 """ import enumtables # noqa: F401 import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "20210405_170924" down_revision = "20210401_211915" branch_labels = None depends_on = None def upgrade(): ...
chanzuckerberg/czgenepi
src/backend/database_migrations/versions/20210405_170924_add_region_column_for_sample.py
20210405_170924_add_region_column_for_sample.py
py
1,818
python
en
code
11
github-code
36
[ { "api_name": "alembic.op.create_table", "line_number": 18, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 18, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.Strin...
26424981939
#coding: utf-8 # # example 11.4 # import numpy as np from geothermal_md import * from matplotlib.pyplot import * from scipy.optimize import curve_fit # # donnees du probleme # gam = 0.5772157 M = np.loadtxt("..\\data\\pumping_test2.txt") t = M[:,0] # time in minutes sf = M[:,1] # drawndown in meters nt = len(...
LouisLamarche/Fundamentals-of-Geothermal-Heat-Pump-Systems
chapter11/Example11_4.py
Example11_4.py
py
1,363
python
en
code
1
github-code
36
[ { "api_name": "numpy.loadtxt", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.vectorize", "line_number": 27, "usage_type": "call" }, { "api_name": "scipy.optimize.curve_fit", "line_number": 41, "usage_type": "call" } ]
15019927918
# This is a sample Python script. import pandas as pd import csv from datetime import datetime import json import paho.mqtt.client as mqtt from itertools import count import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation # Press Mayús+F10 to execute it or replace it with your code. # Press Dou...
JordiLazo/embedded_and_ubiquitous_systems_103056
ReceiverMQTT/main.py
main.py
py
1,463
python
en
code
0
github-code
36
[ { "api_name": "csv.DictWriter", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datet...