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
9388340974
"""Functions and constants used in several modules of the gtphipsi package. This module exports the following functions: - get_name_from_badge (badge) - get_all_big_bro_choices () - create_user_and_profile (form_data) - log_page_view (request, name) This module exports the following constant definitio...
will2dye4/gtphipsi
common.py
common.py
py
5,867
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "gtphipsi.brothers.bootstrap.INITIAL_BROTHER_LIST", "line_number": 31, "usage_type": "argument" }, { "api_name": "gtphipsi.brothers.bootstrap.INITIAL_BROTHER_LIST", "line_number": 36, ...
27391300473
# flake8: NOQA; import os import sys from collections.abc import Generator import pytest from fastapi import FastAPI from fastapi.testclient import TestClient current: str = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(os.path.join(current, "src")) from database import Database from ...
ebysofyan/dcentric-health-hometest
chatroom-backend/tests/conftest.py
conftest.py
py
868
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path.append", "...
73111312187
from langchain.document_loaders import TextLoader from langchain.text_splitter import CharacterTextSplitter, NLTKTextSplitter import glob import os from transformers import AutoModel, AutoTokenizer from dotenv import load_dotenv from langchain.embeddings import HuggingFaceEmbeddings from langchain.vectorstores import C...
shaunxu/try-langchain
injest.py
injest.py
py
1,703
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
73798071227
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.http import HttpResponse, HttpResponseRedirect, QueryDict from django.core.serializers.json import DjangoJSONEncoder from django.contrib.auth import authenticate, login, logout from django.views.generic import View, TemplateView from d...
alfonsoolavarria/cm
maracay/views.py
views.py
py
34,284
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.TemplateView", "line_number": 31, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 33, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView", "line_number": 36, "usage_type": "name" }...
6713641650
""" Utilities for dictionaries of xy tuple values. """ from __future__ import print_function, division import random from collections import defaultdict def center(pos, dimensions): x = [p[0] for p in pos.values()] y = [p[1] for p in pos.values()] minx, maxx = min(x), max(x) miny, maxy = min(y), max(y...
joel-simon/evo_floorplans
floor_plans/pos_utils.py
pos_utils.py
py
1,635
python
en
code
84
github-code
6
[ { "api_name": "random.seed", "line_number": 28, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 29, "usage_type": "call" }, { "api_name": "random.random", "line_number": 30, "usage_type": "attribute" } ]
7781848764
import imutils import cv2 import numpy as np class DistanceCalculator: def __init__(self, distance_ref, width_ref, pixels): self.distance_ref = distance_ref self.width_ref = width_ref self.focal_ref = (pixels*distance_ref)/width_ref def find_object(self, original): """ ...
tarekbrahmi/Open-cv-project
MyProjects/distance-calculator/example2/DistanceCalculator.py
DistanceCalculator.py
py
1,870
python
en
code
0
github-code
6
[ { "api_name": "cv2.cvtColor", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 22, "usage_type": "attribute" }, { "api_name": "cv2.GaussianBlur", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.Canny", ...
7711698828
from PyPDF2 import PdfReader def get_pdf_text(pdfs): """ Get the pdf and extract the text content Parameters: pdf_docs (pdf) : all the pdfs Returns: string : returns text from the pdfs """ text = "" for pdf in pdfs: pdf_reader = PdfReader(pdf) for page in pdf...
arunavabasu-03/PDFAssist
src/helpers/getPdf.py
getPdf.py
py
399
python
en
code
0
github-code
6
[ { "api_name": "PyPDF2.PdfReader", "line_number": 17, "usage_type": "call" } ]
73016495228
from tkinter import * from tkinter import ttk import sqlite3 import time #-------------------------------------- # DEFININDO MODULO HORA E DATA #-------------------------------------- time = time.localtime() hour = ('{}:{}'.format(time[3], time[4])) date = ('{}/{}/{}'.format(time[0], time[1], time[2])) #---------...
S4UDeveloper/MDI
DB/Database.py
Database.py
py
5,792
python
en
code
1
github-code
6
[ { "api_name": "time.localtime", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 18, "usage_type": "call" }, { "api_name": "tkinter.ttk.Treeview", "line_number": 171, "usage_type": "call" }, { "api_name": "tkinter.ttk", ...
25687922492
import astroid from hypothesis import assume, given, settings, HealthCheck from .. import custom_hypothesis_support as cs from typing import Any, Dict, List, Set, Tuple settings.load_profile("pyta") @given(cs.subscript_node()) @settings(suppress_health_check=[HealthCheck.too_slow]) def test_index(node): module, ...
ihasan98/pyta
tests/test_type_inference/test_literals.py
test_literals.py
py
772
python
en
code
null
github-code
6
[ { "api_name": "hypothesis.settings.load_profile", "line_number": 6, "usage_type": "call" }, { "api_name": "hypothesis.settings", "line_number": 6, "usage_type": "name" }, { "api_name": "astroid.Index", "line_number": 13, "usage_type": "attribute" }, { "api_name": ...
34714688235
import argparse import torch import torch.utils.data import src.utils as utils from src.utils import alphabet from src.utils import strLabelConverterForAttention as converter import src.dataset as dataset import model parser = argparse.ArgumentParser() parser.add_argument('--testList', default='label/test_label.txt')...
WANGPeisheng1997/HandwrittenTextRecognition
cnn+lstm+attention/test.py
test.py
py
5,492
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.set_device", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.u...
12918395650
#!/usr/bin/env python3 """ Import build-in and custom modules to check system utilization and connection""" import shutil import psutil import network site_name = "http://www.google.com" # Verifies that there's enough free space on disk. def check_disk_usage(disk): du = shutil.disk_usage(disk) free = du.free /...
TyapinIA/Coursera_Google_IT_Automation_with_Python
psutil_shutil/health_check.py
health_check.py
py
803
python
en
code
0
github-code
6
[ { "api_name": "shutil.disk_usage", "line_number": 10, "usage_type": "call" }, { "api_name": "psutil.cpu_percent", "line_number": 16, "usage_type": "call" }, { "api_name": "network.check_localhost", "line_number": 23, "usage_type": "call" }, { "api_name": "network....
35069305556
from enum import unique from flask_sqlalchemy import SQLAlchemy from .utils import utcnow db = SQLAlchemy() class Home(db.Model): __tablename__ = "home" id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(120), unique=False, nullable=False) content = db.Column(db.String(250), uniq...
jgustavoj/midwestern-project
src/api/models.py
models.py
py
1,995
python
en
code
0
github-code
6
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 5, "usage_type": "call" }, { "api_name": "utils.utcnow", "line_number": 14, "usage_type": "name" }, { "api_name": "utils.utcnow", "line_number": 15, "usage_type": "name" }, { "api_name": "utils.utcnow", ...
37663232255
# -*- coding: utf-8 -*- """ Created on Sat Feb 13 02:55:11 2021 @author: Anato """ from pathlib import Path source_path = Path(__file__).resolve() source_dir = source_path.parent main_dir = str(source_dir.parent) info_dir = main_dir + '/info/' def open_info(file_name, mode): return open(info_dir + file_name + ...
Anatoly7/codeforces-spider
tutorial/spiders/codeforces_spider.py
codeforces_spider.py
py
1,714
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "scrapy.Spider", "line_number": 23, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 40, "usage_type": "call" }, { "api_name": "urllib.parse.urljoin",...
26416473947
# -*- coding: UTF-8 -*- from flask import Flask from flask import request from flask import json import requests app = Flask(__name__) # http://blog.luisrei.com/articles/flaskrest.html @app.route('/oslh2b', methods=['POST']) def oslh2b(): if request.method == 'POST': json_headers = request.headers ...
elmanytas/osl-computer
ansible-flask/roles/flaskapp/files/flaskapp/flaskapp/__init__.py
__init__.py
py
12,045
python
en
code
2
github-code
6
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 14, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.request.head...
24796364963
from __future__ import division import os import re import sys import struct import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np def load(fname): color = None width = None height = None scale = None endian = None file = open(fname) header = file.readline().rstrip() i...
kbatsos/CBMV
pylibs/pfmutil.py
pfmutil.py
py
1,781
python
en
code
52
github-code
6
[ { "api_name": "re.match", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.fromfile", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.flipud", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number...
4669072111
from Bio.Seq import Seq def get_pattern_count(text, pattern): seq = Seq(text) return seq.count_overlap(pattern) with open('rosalind_ba1e.txt') as file: genome = file.readline().rstrip() k, l, t = map(lambda x: int(x), file.readline().rstrip().split(' ')) genome_len = len(genome) clump = [] for i ...
Partha-Sarker/Rosalind-Problems
Lab Assignment - 1/chapter 1/ba1e Find Patterns Forming Clumps in a String.py
ba1e Find Patterns Forming Clumps in a String.py
py
802
python
en
code
0
github-code
6
[ { "api_name": "Bio.Seq.Seq", "line_number": 5, "usage_type": "call" } ]
3977389831
import psycopg2 import csv from db.create_connection import create_connection as create_connection def import_menu_from_csv(): conn = create_connection() cursor = conn.cursor() with open("menu.csv", mode="r", encoding="utf-8") as csv_file: csv_reader = csv.DictReader(csv_file) ...
Tolik1923/restaurantordertaker
Back-end/db/exsport_menu.py
exsport_menu.py
py
1,024
python
en
code
0
github-code
6
[ { "api_name": "db.create_connection.create_connection", "line_number": 6, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 10, "usage_type": "call" }, { "api_name": "db.create_connection.create_connection", "line_number": 23, "usage_type": "call" }...
30950783677
import numpy as np import sys import matplotlib.pyplot as plt sys.path.append('../../analysis_scripts') from dumpfile import DumpFile from pickle_dump import save_obj, load_obj from spatialcorrelations import calculate_items if __name__ == "__main__": rho = sys.argv[1] fps = np.array([0])#,1,5,10,20,4...
samueljmcameron/ABPs_coarse_graining
experiments/2020_03_19/correlations/plot_correlations.py
plot_correlations.py
py
686
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_num...
25692788695
# !/urs/bin/env python3 # -*- coding: utf-8 -*- """ Project: LAGOU Spider @author: Troy @email: ots239ltfok@gmail.com """ # 项目构架: # p1: 依据搜索关键词 城市 职业, 爬取索引页, 解析并获取相关岗位url接连 # p2: 解析url链接, 获取数据 # p3: 存储到MongoDB # 技术路径: requests urllib json re pq pymongo import requests from requests.exceptions import ConnectionError...
Troysps/spider
lagou/spider.py
spider.py
py
6,376
python
en
code
1
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 29, "usage_type": "call" }, { "api_name": "urllib.parse.urlencode", "line_number": 59, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 59, "usage_type": "attribute" }, { "api_name": "requests...
17657067303
from tkinter import * import pygame from tkinter import filedialog import time from mutagen.mp3 import MP3 import random from AudioFile import AudioFile, Song, Podcast from Exceptions import * from Playlist import Playlist from Artist import Artist from User import User from LastFmConnection import LastFmC...
ydamirkol/music-player
play mode3.py
play mode3.py
py
13,889
python
en
code
0
github-code
6
[ { "api_name": "pygame.mixer.init", "line_number": 38, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 38, "usage_type": "attribute" }, { "api_name": "AudioFile.Song", "line_number": 57, "usage_type": "call" }, { "api_name": "AudioFile.Song", ...
69900225789
import enum from PySide2 import QtCore from PySide2.QtCore import QPoint from PySide2.QtGui import QColor, QFont, QFontDatabase from PySide2.QtWidgets import QGraphicsSceneMouseEvent, QGraphicsItem class NodeState(enum.Enum): normal = 0 used = 1 highlight = 2 class Node(QGraphicsItem): Type = QGrap...
JIuH4/KB_V2
ui_elements/graph_items/node.py
node.py
py
2,560
python
en
code
0
github-code
6
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PySide2.QtWidgets.QGraphicsItem", "line_number": 15, "usage_type": "name" }, { "api_name": "PySide2.QtWidgets.QGraphicsItem.UserType", "line_number": 16, "usage_type": "attribute" }...
8773605987
import streamlit as st from utils import get_modelpaths from Scripts.video_processor import webcam_input def main(): model_list = ["AnimeGANv2_Hayao","AnimeGANv2_Shinka","AnimeGANv2_Paprika"] st.title("Real-time Anime to Anime Converter") model_name = st.selectbox("Select model name", model_list) mod...
avhishekpandey/RealTime_video-to-anime
app.py
app.py
py
427
python
en
code
0
github-code
6
[ { "api_name": "streamlit.title", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.selectbox", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.get_modelpaths", "line_number": 11, "usage_type": "call" }, { "api_name": "Scripts.video...
21325562870
import pytest from pysyncgateway import Database, Query @pytest.fixture def database(admin_client): """ Returns: Database: 'db' database written to Sync Gateway. """ database = Database(admin_client, 'db') database.create() return database @pytest.fixture def query(database): ""...
constructpm/pysyncgateway
tests/query/conftest.py
conftest.py
py
3,136
python
en
code
1
github-code
6
[ { "api_name": "pysyncgateway.Database", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pysyncgateway.Query", "line_number": 23, "usage_type": "call" }, { "api_name": "pytest....
44701138323
import os import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib.gridspec as gridspec def plot(samples): x_dim=samples.shape[1] color=samples.shape[3] fig = plt.figure(figsize=(4, 4)) gs = gridspec.GridSpec(4, 4) gs.update(wspa...
adityagarg/improvedWGANs
utils.py
utils.py
py
2,488
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.gridspec.GridSpec", "line_number": 13, "usage_type": "call" }, { "api_name"...
74055844987
import torch import torch.nn as nn import numpy as np import torch.nn.functional as F from collections import namedtuple from .set2set import Set2Vec ReadoutConfig = namedtuple( 'ReadoutConfig', [ 'hidden_dim', 'readout_hidden_dim', 'mode', 'target_dim', ...
isaachenrion/gcn
models/mpnn/readout/readout.py
readout.py
py
3,763
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.LeakyReL...
22755470032
from collections import namedtuple import time from .utils import ( client_array_operation, make_valid_data, create_host_urn, create_resource_arn, create_hash, set_required_access_v2, transformation, ipaddress_to_urn ) from .registry import RegisteredResourceCollector from schematics imp...
StackVista/stackstate-agent-integrations
aws_topology/stackstate_checks/aws_topology/resources/ec2.py
ec2.py
py
14,997
python
en
code
1
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 17, "usage_type": "call" }, { "api_name": "schematics.Model", "line_number": 20, "usage_type": "name" }, { "api_name": "schematics.types.StringType", "line_number": 21, "usage_type": "call" }, { "api_name": "s...
28194386524
from __future__ import print_function, division import os import time import random import numpy as np from base import BaseModel from replay_memory import ReplayMemory from utils import save_pkl, load_pkl import tensorflow as tf import matplotlib.pyplot as plt class Agent(BaseModel): def __init__(self, config, e...
BandaidZ/OptimizationofSEandEEBasedonDRL
agent.py
agent.py
py
18,757
python
en
code
13
github-code
6
[ { "api_name": "base.BaseModel", "line_number": 13, "usage_type": "name" }, { "api_name": "time.strftime", "line_number": 19, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 19, "usage_type": "call" }, { "api_name": "time.time", "line_num...
5272336888
import gradio as gr import pytesseract from langchain import PromptTemplate from langchain.chains import RetrievalQA from langchain.chat_models import ChatOpenAI from langchain.embeddings import OpenAIEmbeddings from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain.vectorstores import Chroma...
motomk/pdf_gpt
main.py
main.py
py
2,156
python
ja
code
0
github-code
6
[ { "api_name": "langchain.PromptTemplate", "line_number": 18, "usage_type": "call" }, { "api_name": "pdf2image.convert_from_path", "line_number": 25, "usage_type": "call" }, { "api_name": "pytesseract.image_to_string", "line_number": 29, "usage_type": "call" }, { "...
24143273312
from selenium.webdriver import Chrome,ChromeOptions from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import xlsxwriter opts = ChromeOptions() opts.add_experimental_option("detach", True) driver = Chrome(chrome_options=opts) driver.get("https://google.com") driver.maximize_...
keremguzel/selenium-excel-import
main.py
main.py
py
2,595
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.common.by.By.CLASS_NAME", "line_number": 15, "usage_type": "a...
17034031092
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
satishgoda/fluid-designer-scripts
scripts/startup/fluid_ui/space_fluid_view3d_tools.py
space_fluid_view3d_tools.py
py
7,224
python
en
code
1
github-code
6
[ { "api_name": "bpy.types.Panel", "line_number": 69, "usage_type": "name" }, { "api_name": "bpy.types.Panel", "line_number": 113, "usage_type": "name" }, { "api_name": "fd_datablocks.const.icon_world", "line_number": 125, "usage_type": "attribute" }, { "api_name": ...
34373278865
import os from unittest import TestCase import jinja2 from apply.issue.issure_js_auto_code.db_util import res_to_dict from config.db_conf import localhost_oa_engine from util.str_util import to_lower_camel, to_snake, to_upper_camel class Form: @staticmethod def get_tables(db): sql = "select TABLE_N...
QQ1134614268/PythonTemplate
src/apply/issue/issure_js_auto_code/js_auto_code_v0.py
js_auto_code_v0.py
py
3,508
python
en
code
2
github-code
6
[ { "api_name": "config.db_conf.localhost_oa_engine.execute", "line_number": 16, "usage_type": "call" }, { "api_name": "config.db_conf.localhost_oa_engine", "line_number": 16, "usage_type": "name" }, { "api_name": "apply.issue.issure_js_auto_code.db_util.res_to_dict", "line_num...
32585270834
import cv2 import numpy as np from .base import BaseTask class BlurAndPHash(BaseTask): def __init__(self): super().__init__(taskID=4, taskName='BlurAndPHash') self.thresholdLaplacian = 120 self.thresholdDiffStop = 120 self.thresholdDiffPre = 25 self.hashLen = 32 se...
Cloudslab/FogBus2
containers/taskExecutor/sources/utils/taskExecutor/tasks/blurAndPHash.py
blurAndPHash.py
py
2,292
python
en
code
17
github-code
6
[ { "api_name": "base.BaseTask", "line_number": 7, "usage_type": "name" }, { "api_name": "cv2.Laplacian", "line_number": 49, "usage_type": "call" }, { "api_name": "cv2.CV_64F", "line_number": 49, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_num...
58242642
try: from zohocrmsdk.src.com.zoho.crm.api.exception import SDKException from zohocrmsdk.src.com.zoho.crm.api.util import Constants except Exception: from ..exception import SDKException from ..util import Constants class Backup(object): def __init__(self): """Creates an instance of Backup""" self.__rrule = ...
zoho/zohocrm-python-sdk-5.0
zohocrmsdk/src/com/zoho/crm/api/backup/backup.py
backup.py
py
4,949
python
en
code
0
github-code
6
[ { "api_name": "exception.SDKException", "line_number": 40, "usage_type": "call" }, { "api_name": "util.Constants.DATA_TYPE_ERROR", "line_number": 40, "usage_type": "attribute" }, { "api_name": "util.Constants", "line_number": 40, "usage_type": "name" }, { "api_nam...
3831338977
# encoding=utf-8 import logging import logging.config import os import sys import time import traceback import datetime def init_log(name='root'): path = os.path.dirname(__file__) config_file = path + os.sep + 'logger.conf' log_path = os.path.join(os.path.abspath(__file__ + ('/..' * 3)), 'zz_logs') i...
charliedream1/ai_quant_trade
tools/log/log_util.py
log_util.py
py
3,053
python
en
code
710
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.sep", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
45413329386
import os import pathlib import pandas as pd import keyring import dropbox from dropbox.exceptions import AuthError # Directory BASE_DIR = os.path.dirname(os.path.abspath(__file__)) dropbox_home = "https://www.dropbox.com/home/" dropbox_app = "MAD_WahooToGarmin" dropbox_app_dir = "/Apps/WahooFitness/" DROPBOX_ACCESS_...
michaeladavis10/WahooToGarmin
dropbox_utils.py
dropbox_utils.py
py
2,994
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "keyring.get_password", ...
29685980647
import re import pep8 import six """ Guidelines for writing new hacking checks - Use only for Octavia specific tests. OpenStack general tests should be submitted to the common 'hacking' module. - Pick numbers in the range O3xx. Find the current test with the highest allocated number and then pick the next va...
BeaconFramework/Distributor
octavia/hacking/checks.py
checks.py
py
7,161
python
en
code
1
github-code
6
[ { "api_name": "re.compile", "line_number": 21, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "six.iteritems", "line_number": 3...
42399945606
"""empty message Revision ID: a5cfe890710d Revises: 7352c721e0a4 Create Date: 2023-05-28 16:47:42.177222 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a5cfe890710d' down_revision = '7352c721e0a4' branch_labels = None depends_on = None def upgrade(): # ...
RBird111/capstone-yelp-clone
migrations/versions/20230528_164742_.py
20230528_164742_.py
py
1,132
python
en
code
1
github-code
6
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.batch_alter_table", "line_number": 31, "usage_type": "call" }, { "api_name": "...
32166211761
import requests from bs4 import BeautifulSoup import json def get_description(url): response = requests.get(url) if response is not None: soup = BeautifulSoup(response.text, 'html.parser') description = {} l1 = [] l2 = [] for item in soup.find_all("span", class_="adPage__content__fea...
Drkiller325/PR_Lab2
homework.py
homework.py
py
1,157
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 45, "usage_type": "call" } ]
7437025622
"""Module containing class `UntagClipsCommand`.""" import logging import random import time from django.db import transaction from vesper.command.clip_set_command import ClipSetCommand from vesper.django.app.models import Job, Tag, TagEdit, TagInfo import vesper.command.command_utils as command_utils import vesper....
HaroldMills/Vesper
vesper/command/tag_clips_command.py
tag_clips_command.py
py
7,835
python
en
code
47
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "vesper.command.clip_set_command.ClipSetCommand", "line_number": 22, "usage_type": "name" }, { "api_name": "vesper.command.command_utils.get_optional_arg", "line_number": 32, "usag...
38368937564
import string, itertools ascii_lowercases = list(string.ascii_lowercase) MAX_WORD_LENGTH = 5 for i in range(1, MAX_WORD_LENGTH + 1): charlist = [[x for x in ascii_lowercases]] * i for combinations in itertools.product(*charlist): combinations = "".join(combinations) with open("../wordlist.tx...
1LCB/hash-cracker
complement/wordlist generator.py
wordlist generator.py
py
407
python
en
code
2
github-code
6
[ { "api_name": "string.ascii_lowercase", "line_number": 3, "usage_type": "attribute" }, { "api_name": "itertools.product", "line_number": 10, "usage_type": "call" } ]
30804267516
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression if __name__ == '__main__': # 将csv数据读取为pandas对象 fund = pd.read_csv('./csv/001112.csv', dtype={'fcode': str}) # 转化时间字符串为时间 fund['fdate'] = pd.to_datetime(fund['fdate']) #...
bobchi/learn_py
23.py
23.py
py
1,416
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.int64", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sklearn.linear_mod...
43447079150
import sys, re from argparse import ArgumentParser #import the library parser = ArgumentParser(description = 'Classify a sequence as DNA or RNA') #create one ArgumentParser parser.add_argument("-s", "--seq", type = str, required = True, help = "Input sequence") #add the first argument parser.add_argument("-m", "--mot...
stepsnap/git_HandsOn
seqClass.py
seqClass.py
py
1,881
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.exit", "line_num...
23682024390
import datetime def rest_sec_of_day(): """ :return: 截止到目前当日剩余时间 """ today = datetime.datetime.strptime(str(datetime.date.today()), "%Y-%m-%d") tomorrow = today + datetime.timedelta(days=1) nowTime = datetime.datetime.now() return (tomorrow - nowTime).seconds # 获取秒
peacefulyin/gh
BackEnd/util/common.py
common.py
py
339
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.strptime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "attribute" }, { "api_name": "datetime.date.today", "line_number": 8, "usage_type": "call" }, { "api_name": "da...
8670124375
import pandas as pd import pickle df=pd.read_csv(r'C:/Users/SAIDHANUSH/spam-ham.csv') df['Category'].replace('spam',0,inplace=True) df['Category'].replace('ham',1,inplace=True) x=df['Message'] y=df['Category'] from sklearn.feature_extraction.text import CountVectorizer cv=CountVectorizer() x=cv.fit_tra...
dhanush77777/spam-messages-classification-app
nlp_model.py
nlp_model.py
py
770
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 3, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 16, "usage_type": "call" }, { "api_na...
40411312041
#!/usr/bin/env python3 """ Name: bgp_neighbor_prefix_received.py Description: NXAPI: display bgp neighbor summary info """ our_version = 109 script_name = "bgp_neighbor_prefix_received" # standard libraries import argparse from concurrent.futures import ThreadPoolExecutor # local libraries from nxapi_netbox.args.args_...
allenrobel/nxapi-netbox
scripts/bgp_neighbor_prefix_received.py
bgp_neighbor_prefix_received.py
py
4,416
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 33, "usage_type": "call" }, { "api_name": "nxapi_netbox.args.args_cookie.ArgsCookie", "line_number": 35, "usage_type": "name" }, { "api_name": "nxapi_netbox.args.args_nxapi_tools.ArgsNxapiTools", "line_number": 35, "...
26189029070
import datetime import table import restaurant class Restaurant: def __init__(self): self.tables = [] self.name = "Restaurant Dingo" for i in range(8): self.tables.append(table.Table(i)) def get_tables(self): return self.tables def print_tables(self): for i in range(8):...
jemmajh/Reservation_system_Y2
restaurant.py
restaurant.py
py
560
python
en
code
0
github-code
6
[ { "api_name": "table.Table", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" } ]
40033463881
import json from pathlib import Path import numpy as np import torch import torch.utils.data from PIL import Image from panopticapi.utils import rgb2id from utils.utils import masks_to_boxes from dataset.utils import make_coco_transforms city2int = { "aachen": 0, "bremen": 1, "darmstadt": 2, "erfurt"...
adilsammar/detr-fine
archived/dataset/cts_dataset.py
cts_dataset.py
py
5,196
python
en
code
4
github-code
6
[ { "api_name": "json.load", "line_number": 63, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 83, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 85, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number...
17466316782
#!/usr/bin/env python # -*- coding: UTF-8 -*- # File: cifar-convnet.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import tensorflow as tf import argparse import numpy as np import os from tensorpack import * import tensorpack.tfutils.symbolic_functions as symbf from tensorpack.tfutils.summary import * from tensorpack.ut...
jxwufan/NLOR_A3C
tensorpack/examples/cifar-convnet.py
cifar-convnet.py
py
5,549
python
en
code
16
github-code
6
[ { "api_name": "tensorflow.float32", "line_number": 31, "usage_type": "attribute" }, { "api_name": "tensorflow.int32", "line_number": 32, "usage_type": "attribute" }, { "api_name": "tensorflow.constant", "line_number": 38, "usage_type": "call" }, { "api_name": "ten...
20894068105
import cv2 import math import monta import numpy as np import matcompat from scipy import signal import matplotlib.pyplot as plt lammbda=6 pi = math.pi theta = np.arange(0, (np.pi-np.pi/8)+(np.pi/8), np.pi/8) psi = 0 gamma = np.linspace(.4,1,4) gamma = np.arange(.4, 1.2, .2) b = 4 sigma = (1/pi)*math.sqrt((math.log(2)...
ErickJuarez/AtencionSelectiva
Python/main.py
main.py
py
2,566
python
en
code
0
github-code
6
[ { "api_name": "math.pi", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_nu...
36030730386
"""Timezones lookup.""" import concurrent.futures import os import shutil import subprocess import sys import time import traceback from datetime import datetime from multiprocessing import cpu_count from pathlib import Path import pytz import requests import tzlocal from fuzzywuzzy import process import pycountry i...
ppablocruzcobas/Dotfiles
albert/timezones/__init__.py
__init__.py
py
7,290
python
en
code
2
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 33, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 35, "usage_type": "call" }, { "api_name": "albert.cacheLocation", "line_number": 35, "usage_type": "call" }, { "api_name": "pathlib.Path", "li...
15917643475
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, get_object_or_404 from .models import * from .forms import * from .models import Product from .forms import ProductUpdateForm from .models import Category from django.http import JsonResponse # libraries for Im...
elumes446/Store-Management-System
Store Managment System/main/views.py
views.py
py
7,245
python
en
code
0
github-code
6
[ { "api_name": "models.Category.objects.all", "line_number": 25, "usage_type": "call" }, { "api_name": "models.Category.objects", "line_number": 25, "usage_type": "attribute" }, { "api_name": "models.Category", "line_number": 25, "usage_type": "name" }, { "api_name...
34228406110
from pymongo.collection import Collection from bson.objectid import ObjectId def insert_object(obj: dict, collection: Collection): """Вставка объекта в коллекцию""" obj['fields'] = list(obj['fields'].items()) return collection.insert_one(obj).inserted_id def delete_object(object_id: str, collection: Col...
AKovalyuk/test-task
app/db/crud.py
crud.py
py
1,341
python
ru
code
0
github-code
6
[ { "api_name": "pymongo.collection.Collection", "line_number": 5, "usage_type": "name" }, { "api_name": "pymongo.collection.Collection", "line_number": 11, "usage_type": "name" }, { "api_name": "bson.objectid.ObjectId", "line_number": 13, "usage_type": "call" }, { ...
7985866436
import numpy as np import cv2 import time def my_padding(src, filter): (h, w) = src.shape if isinstance(filter, tuple): (h_pad, w_pad) = filter else: (h_pad, w_pad) = filter.shape h_pad = h_pad // 2 w_pad = w_pad // 2 padding_img = np.zeros((h+h_pad*2, w+w_pad*2)) ...
201402414/CG
[CG]201402414_장수훈_5주차_과제/[CG]201402414_장수훈_5주차_과제/integral_image_report.py
integral_image_report.py
py
8,317
python
en
code
0
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 47, ...
37055851732
from unittest.runner import TextTestRunner import urllib.request import unittest from typing import TypeVar, Callable, List T = TypeVar('T') S = TypeVar('S') ################################################################################# # EXERCISE 1 #################################################################...
saronson/cs331-s21-jmallett2
lab03/lab03.py
lab03.py
py
8,672
python
en
code
2
github-code
6
[ { "api_name": "typing.TypeVar", "line_number": 6, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Callable", "line_n...
39441402911
from mlearn import base from functools import reduce from datetime import datetime from mlearn.data.dataset import GeneralDataset from mlearn.data.batching import Batch, BatchExtractor from sklearn.feature_extraction import DictVectorizer from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer de...
zeeraktalat/mlearn
mlearn/utils/pipeline.py
pipeline.py
py
2,898
python
en
code
2
github-code
6
[ { "api_name": "mlearn.data.dataset.GeneralDataset", "line_number": 10, "usage_type": "name" }, { "api_name": "mlearn.base.DataType", "line_number": 10, "usage_type": "attribute" }, { "api_name": "mlearn.base", "line_number": 10, "usage_type": "name" }, { "api_name...
34196938558
#!/user/bin/env python # -*- coding:utf-8 -*- import numpy as np import matplotlib.pyplot as plt import h5py #一个HDF5文件就是一个容器,用于储存两类对象:datasets,类似于数组的数据集合;groups,类似于文件夹的容器,可以储存datasets和其它groups。 from lr_utils import load_dataset train_set_x_orig , train_set_y , test_set_x_orig , test_set_y , classes = load_dataset() # i...
CheQiXiao/cfair
fc_net.py
fc_net.py
py
11,968
python
zh
code
0
github-code
6
[ { "api_name": "lr_utils.load_dataset", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 63, "usage_type": "call" }, { "api_name": "numpy.dot", "line_numb...
74377247228
''' @Author: Never @Date: 2020-06-13 11:02:05 @Description: @LastEditTime: 2020-07-14 15:20:19 @LastEditors: Never ''' #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020/4/27 19:47 # @Author : Shark # @Site : # @File : lepin1.py # @Software: PyCharm import csv import requests import json import ...
gitxzq/py
lepin1.py
lepin1.py
py
2,131
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 24, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 24, "usage_type": "call" }, { "api_name": "csv.reader", "line_number"...
41211987806
import matplotlib.pyplot as plt import librosa import librosa.display import os import torch from torch.distributions.beta import Beta import numpy as np from pytorch_lightning.callbacks import Callback import torch.nn as nn from einops import rearrange from tqdm import tqdm from helpers import nessi image_folder = "...
CPJKU/cpjku_dcase22
helpers/utils.py
utils.py
py
4,903
python
en
code
18
github-code
6
[ { "api_name": "os.makedirs", "line_number": 16, "usage_type": "call" }, { "api_name": "pytorch_lightning.callbacks.Callback", "line_number": 19, "usage_type": "name" }, { "api_name": "helpers.nessi.get_model_size", "line_number": 35, "usage_type": "call" }, { "api...
21672470765
#!/usr/bin/python #coding:utf-8 """ Author: Andy Tian Contact: tianjunning@126.com Software: PyCharm Filename: get_heatMap_html.py Time: 2019/2/21 10:51 """ import requests import re def get_html(): ''' 获取百度热力图demo的源代码 :return: h5代码 ''' url = "http://lbsyun.baidu.com/jsdemo/demo/c1_15.htm" he...
tianzheyiran/HeatMap
get_heatMap_html.py
get_heatMap_html.py
py
2,229
python
en
code
1
github-code
6
[ { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 47, "usage_type": "call" } ]
35347629144
import json with open('mahasiswa.json', 'r') as file: a = json.load(file) b = dict() c = int(input("Masukkan Jumkah Mahasiswa baru : ")) for i in range(c): nm = input("Masukkan nama anda: ") hb = [] untuk_hobi = int(input("Masukkan jumlah hobi: ")) for j ...
TIRSA30/strukdat_04_71210700
ug4.py
ug4.py
py
705
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 4, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 27, "usage_type": "call" } ]
20914243110
"""added columns to Places Revision ID: cba44d27f422 Revises: 061ea741f852 Create Date: 2023-06-28 15:56:11.475592 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'cba44d27f422' down_revision = '061ea741f852' branch_labels = None depends_on = None def upgrade...
choihalim/halfway
server/migrations/versions/cba44d27f422_added_columns_to_places.py
cba44d27f422_added_columns_to_places.py
py
1,294
python
en
code
0
github-code
6
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy....
74693961467
import torch import time import torch.nn.functional as F def train(model, device, train_loader, optimizer, epoch): # 训练模型 model.train() best_acc = 0.0 for batch_idx, (x1, x2, x3, y) in enumerate(train_loader): start_time = time.time() x1, x2, x3, y = x1.to(device), x2.to(device), x3.to(d...
Huasheng-hou/r2-nlp
src/utils.py
utils.py
py
2,866
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn.functional.cross_entropy", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 15, "usage_type": "name" }, { "api_name": "torch...
19274830613
#!/usr/bin/env python ''' Created on Jun 28, 2016 @author: isvoboda ''' from __future__ import print_function import sys import multiprocessing import logging import yaml import argparse from collections import OrderedDict import cnn_image_processing as ci import signal signal.signal(signal.SIGINT, lambda x, y: sys...
DCGM/cnn-image-processing
bin/train_cnn.py
train_cnn.py
py
5,210
python
en
code
0
github-code
6
[ { "api_name": "signal.signal", "line_number": 19, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.getLogger", "li...
36014041676
import torch.nn as nn import tqdm import torch class ANN(nn.Module): def __init__(self, input=4): super().__init__() # self.relu1 = nn.ReLU(inplace=True) self.liner1 = nn.Linear(input,128) self.relu = nn.ReLU() self.liner2 = nn.Linear(128,8) self.liner3 = nn.Linear(8...
infinity-linh/Bot_Inf
scripts/model_ANN.py
model_ANN.py
py
539
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
70103613629
#!/usr/bin/env python3 """ Example for Implied Volatility using the NAG Library for Python Finds implied volatilities of the Black Scholes equation using specfun.opt_imp_vol Data needs to be downloaded from: http://www.cboe.com/delayedquote/QuoteTableDownload.aspx Make sure to download data during CBOE Trading Hours. ...
cthadeufaria/passport
investing/impliedVolatility.py
impliedVolatility.py
py
9,398
python
en
code
0
github-code
6
[ { "api_name": "sys.exit", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 47, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 48, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_num...
2778228066
import types from imp import reload def print_status(module): print(f'reloading {module.__name__}') def try_reload(module): try: reload(module) except Exception as e: print(f'FAILED {e.__repr__()} : {module}') def transitive_reload(module, visited): if not module in visited: p...
Quessou/quessoutils
qssmodules/reloadall.py
reloadall.py
py
967
python
en
code
0
github-code
6
[ { "api_name": "imp.reload", "line_number": 9, "usage_type": "call" }, { "api_name": "types.ModuleType", "line_number": 19, "usage_type": "attribute" }, { "api_name": "types.ModuleType", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
35717342742
import torch import torch.nn as nn from utils.resnet_infomin import model_dict import torch.nn.functional as F from collections import OrderedDict class RGBSingleHead(nn.Module): """RGB model with a single linear/mlp projection head""" def __init__(self, name='resnet50', head='linear', feat_dim=128): ...
VirtualSpaceman/ssl-skin-lesions
utils/build_backbone_infomin.py
build_backbone_infomin.py
py
10,323
python
en
code
7
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "utils.resnet_infomin.model_dict", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn....
8267132836
import logging import os import pytest import yaml from cekit.config import Config from cekit.descriptor import Image, Overrides from cekit.descriptor.resource import create_resource from cekit.errors import CekitError try: from unittest.mock import call except ImportError: from mock import call config = Co...
cekit/cekit
tests/test_unit_resource.py
test_unit_resource.py
py
11,760
python
en
code
70
github-code
6
[ { "api_name": "cekit.config.Config", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.remove", "line...
14159066621
import tkinter as tk from tkinter import ttk import pyautogui import pygetwindow # The app was developed by Tom Girshovksi. class CenterWindowGUI: def __init__(self, master): self.master = master master.title("Center Window") # Create the frame self.frame = ttk.Frame(master, paddin...
R1veltm/WindowCenterizer
main.py
main.py
py
3,398
python
en
code
2
github-code
6
[ { "api_name": "tkinter.ttk.Frame", "line_number": 13, "usage_type": "call" }, { "api_name": "tkinter.ttk", "line_number": 13, "usage_type": "name" }, { "api_name": "tkinter.ttk.Label", "line_number": 22, "usage_type": "call" }, { "api_name": "tkinter.ttk", "li...
28924320598
import os from flask import Flask, request, abort, jsonify from flask_sqlalchemy import SQLAlchemy from flask_cors import CORS import random from sqlalchemy import func from models import setup_db, Question, Category QUESTIONS_PER_PAGE = 10 # Create APP and settings cors headers def create_app(test_config=None): ...
steffaru/udacity-trivia-api-project
starter/backend/flaskr/__init__.py
__init__.py
py
8,097
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "models.setup_db", "line_number": 15, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.args.get", ...
14471351413
''' Given a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account. Now, we would like to merge these accounts. Two accounts definitely belong to the same person if there is some email th...
loganyu/leetcode
problems/721_accounts_merge.py
721_accounts_merge.py
py
2,893
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 29, "usage_type": "call" } ]
42891510827
#PYTHON CAMERA MODEL import cv2 import numpy as np i=0 def capturing(event,x,y,flags,param): global i if event==cv2.EVENT_LBUTTONUP: name="photo_"+str(i)+".png" wname="CAPTURED IMAGE" cv2.imwrite(name,frame) h=cv2.imread(name) cv2.namedWindow(wname) cv2.imshow(wn...
NamrithaGirish/LiveCam
cam.py
cam.py
py
1,003
python
en
code
0
github-code
6
[ { "api_name": "cv2.EVENT_LBUTTONUP", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.imwrite", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.namedWindow", ...
7911525547
import nltk from collections import Counter nltk.download('vader_lexicon') from nltk.sentiment import SentimentIntensityAnalyzer #Зчитуємо файл який дали в завданні filename = "data.csv" with open(filename, 'r') as f: reviews = f.readlines() # ініціалізуємо SentimentIntensityAnalyzer (бібліотека для визначення...
Stepanxan/home_task-2
app.py
app.py
py
3,167
python
uk
code
0
github-code
6
[ { "api_name": "nltk.download", "line_number": 4, "usage_type": "call" }, { "api_name": "nltk.sentiment.SentimentIntensityAnalyzer", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 33, "usage_type": "call" } ]
36347951264
import random import numpy as np from scipy.optimize import fsolve # velocity upper bound from Wu et al (https://flow-project.github.io/papers/wu17a.pdf ) # This is an approximation def v_eq_max_function(v, *args): """Return the error between the desired and actual equivalent gap.""" num_vehicles, length = a...
poudel-bibek/Beyond-Simulated-Drivers
flow/density_aware_util.py
density_aware_util.py
py
7,049
python
en
code
0
github-code
6
[ { "api_name": "scipy.optimize.fsolve", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 73, "usage_type": "call" }, { "api_name": "numpy.random",...
20182818588
# File: utils.py # Name: Sergio Ley Languren """Utility for wordle program""" from WordleDictionary import FIVE_LETTER_WORDS from WordleGraphics import CORRECT_COLOR, PRESENT_COLOR, MISSING_COLOR, UNKNOWN_COLOR, N_COLS, N_ROWS, WordleGWindow from random import choice from typing import Type, Union, Optional from copy...
SLey3/Project-1
utils.py
utils.py
py
4,316
python
en
code
0
github-code
6
[ { "api_name": "random.choice", "line_number": 28, "usage_type": "call" }, { "api_name": "WordleDictionary.FIVE_LETTER_WORDS", "line_number": 28, "usage_type": "argument" }, { "api_name": "typing.Optional", "line_number": 37, "usage_type": "name" }, { "api_name": "...
35968448866
from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import ui from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import...
surbhikhandelwal/Python-Projects
CWTV/cwtv.py
cwtv.py
py
3,267
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 20, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 20, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 22, "usage_type": "call" }, { "api...
7998902064
import os from bson.json_util import dumps from dotenv import load_dotenv # from flask import jsonify import pymongo load_dotenv() # use dotenv to hide sensitive credential as environment variables DATABASE_URL = f'mongodb+srv://{os.environ.get("user")}:{os.environ.get("passwort")}' \ '@flask-mongodb-a...
rosemaxio/flauraBackend
plants/db.py
db.py
py
1,326
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pymongo.MongoClient", ...
37182795454
import os import re from typing import Tuple from transformers import pipeline # type: ignore MODEL_PATH = os.environ.get("MODEL_PATH", "./distilbert-base-cased-distilled-squad") class CardSourceGeneratorMock: def __call__(self, text: str, question: str) -> Tuple[int, int]: return 0, len(text) // 2 c...
MoShrank/card-generation-service
text/CardSourceGenerator.py
CardSourceGenerator.py
py
1,408
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "typing.Tuple", "line_number": 11, "usage_type": "name" }, { "api_name": "transformers.pipeline", ...
9264192052
import mne import numpy as np import pandas as pd from mne.beamformer import make_lcmv, apply_lcmv, apply_lcmv_cov from scipy.stats import pearsonr import config from config import fname, lcmv_settings from time_series import simulate_raw, create_epochs # Don't be verbose mne.set_log_level(False) fn_stc_signal = fna...
wmvanvliet/beamformer_simulation
lcmv.py
lcmv.py
py
6,703
python
en
code
4
github-code
6
[ { "api_name": "mne.set_log_level", "line_number": 12, "usage_type": "call" }, { "api_name": "config.fname.stc_signal", "line_number": 14, "usage_type": "call" }, { "api_name": "config.fname", "line_number": 14, "usage_type": "name" }, { "api_name": "config.vertex"...
6193427862
""" Main script: Autonomous Driving on Udacity Simulator @author : nelsoonc Undergraduate Thesis Nelson Changgraini - Bandung Institute of Technology, Indonesia """ # Throttle 0 - 1 will produce speed 0 - 30 mph # Steering -1 - 1 will produce angle -25 - 25 degrees import os import numpy as np import so...
zhouzheny1/Conditional_Imitation_Learning
simulation/main.py
main.py
py
2,123
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "socketio.Server", "line_number": 34, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 36, "usage_type": "call" }, { "api_name": "tensorflow.function", ...
7965704838
from pathlib import Path from promtail_ops_manager import PromtailOpsManager # The promtail release file. resource = "./promtail.zip" manager = PromtailOpsManager() # manager.install(resource) # Setup for local tests such that installation of binaries etc. # will not mess up your local client. manager.promtail_home ...
erik78se/promtail-vm-operator
tests/testlib.py
testlib.py
py
839
python
en
code
0
github-code
6
[ { "api_name": "promtail_ops_manager.PromtailOpsManager", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "path...
29401120526
import json import os from googleapiclient.discovery import build class Channel: """Класс для ютуб-канала""" def __init__(self, channel_id: str) -> None: """Экземпляр инициализируется id канала. Дальше все данные будут подтягиваться по API.""" self.__channel_id = channel_id api_key: ...
AnastasiaLykova/youtube-analytics-project
src/channel.py
channel.py
py
4,052
python
ru
code
null
github-code
6
[ { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "googleapiclient.discovery.build", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 76, "usage_type": "call" }, { "api_name": "googleapiclient.d...
10996457940
import time import pyrealsense2 as rs import numpy as np import cv2 import os import open3d as o3d intrinsics = np.array([ [605.7855224609375, 0., 324.2651672363281, 0.0], [0., 605.4981689453125, 238.91090393066406, 0.0], [0., 0., 1., 0.0], [0., 0., 0., 1.],]) ROOT_DIR ...
midea-ai/CMG-Net
utils/get_points.py
get_points.py
py
6,789
python
en
code
3
github-code
6
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_n...
18155298342
import customtkinter as ctk from PIL import Image root = ctk.CTk() root.title("IRIS") root.geometry("1080x720") root._set_appearance_mode("dark") frame = ctk.CTkFrame(master=root) frame.pack(pady=20) logo = ctk.CTkImage(Image.open( "/home/nabendu/Documents/MCA/projects/python-speechRecongition-desktop-AI-project/...
Nandy1002/python-speechRecongition-desktop-AI-project
main/gui.py
gui.py
py
906
python
en
code
0
github-code
6
[ { "api_name": "customtkinter.CTk", "line_number": 3, "usage_type": "call" }, { "api_name": "customtkinter.CTkFrame", "line_number": 8, "usage_type": "call" }, { "api_name": "customtkinter.CTkImage", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Ima...
42488414261
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 23 12:34:08 2018 @author: michal """ import networkx as nx from networkx.algorithms.isomorphism import GraphMatcher from networkx.readwrite.json_graph import node_link_data from os.path import isdir, join, isfile from os import mkdir import json fr...
chemiczny/PDB_supramolecular_search
anionTemplateCreator.py
anionTemplateCreator.py
py
10,065
python
en
code
1
github-code
6
[ { "api_name": "networkx.algorithms.isomorphism.GraphMatcher", "line_number": 18, "usage_type": "name" }, { "api_name": "networkx.Graph", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 112, "usage_type": "call" }, { "api_nam...
3777146121
from django.shortcuts import render from cowsay_app.models import Input from cowsay_app.forms import InputForm import subprocess # I mainly used this source to figure out subprocess: # https://linuxhint.com/execute_shell_python_subprocess_run_method/ # I also used Stackoverflow and Python docs # Also found some usefu...
pokeyjess/cowsay
cowsay_app/views.py
views.py
py
1,247
python
en
code
0
github-code
6
[ { "api_name": "cowsay_app.forms.InputForm", "line_number": 14, "usage_type": "call" }, { "api_name": "cowsay_app.forms.InputForm", "line_number": 15, "usage_type": "call" }, { "api_name": "cowsay_app.models.Input.objects.create", "line_number": 18, "usage_type": "call" ...
25993011459
import urllib from flask import Blueprint, request, render_template, flash, redirect, url_for from orders_tracker.blueprints.clients.service import add_client, update_client, remove_client, search_clients, \ get_form_fields, get_path_args, \ get_clients_count, render_empty, get_pagination_metadata, paginate_c...
1Lorde/orders-tracker
orders_tracker/blueprints/clients/routes.py
routes.py
py
4,565
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "orders_tracker.forms.NewClientForm", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 18, "usage_type": "attribute" }, { "api_...
38899572282
import pygame import time import random pygame.init() pygame.font.init() myfont = pygame.font.SysFont('Comic Sans MS', 30) screen = pygame.display.set_mode((1280,720)) done = False p1_x=30 p1_y= screen.get_height()-60 #make player class Player: def __init__(self,x,y): self.x=x self.y=y def move...
mahi-pas/Egg-Catcher
catcher.py
catcher.py
py
1,381
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.font.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont", ...
6815148797
import pygame import numpy as np import pickle import datetime import os from snake import Snake from map import Map from agent import Agent # Version 1.1 MODEL_DIR = "models" MODEL_NAME = "model_1v7" # Name of the pickle file in which we store our model. MODEL_PATH = os.path.join(MODEL_DIR, MODEL_NAME) # MODEL_NAME ...
Dawir7/Reinforcement-Learing-Bot-to-play-Snake-game
Reinforcement_learninig/main_learning.py
main_learning.py
py
6,247
python
en
code
0
github-code
6
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
7804756691
from jinja2 import Environment, FileSystemLoader import yaml import os.path ENV = Environment(loader=FileSystemLoader('./')) script_path = 'SCRIPTS/' script = os.path.join(script_path, 'script.txt') with open("config.yaml") as _: yaml_dict = yaml.load(_) template = ENV.get_template("template.text") with open...
dancwilliams/Prefix_List_Script
EXTRA_SCRIPTS/MANUAL_CREATE/generate_config.py
generate_config.py
py
416
python
en
code
0
github-code
6
[ { "api_name": "jinja2.Environment", "line_number": 5, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.pat...
811133362
import pygame from pygame.locals import * from entities import User, Enemy from fonctions import * from stage import * from hud import * import random import time import zmq import threading from stage import * from tkinter import * from playsound import playsound def choix1(): global perso perso=1 b...
ZeProf10T/projet-isn
server.py
server.py
py
8,030
python
en
code
0
github-code
6
[ { "api_name": "playsound.playsound", "line_number": 63, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 69, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 70, "usage_type": "call" }, { "api_name": "pygame.displa...
43011396057
"""Calculate various statistics for the CEA playerbase, and stores in a spreadsheet. Attributes: counts (Counter): counting number of games EXTRA_GAMES_FILE (str): File to be used if we need to input extra games K (int): K-value used for elo ratings. """ import csv import json import os import re...
carsonhu/cea-elo
calculate_elo.py
calculate_elo.py
py
16,986
python
en
code
3
github-code
6
[ { "api_name": "sc2reader.engine.register_plugin", "line_number": 31, "usage_type": "call" }, { "api_name": "sc2reader.engine", "line_number": 31, "usage_type": "attribute" }, { "api_name": "sc2reader.engine.plugins.APMTracker", "line_number": 31, "usage_type": "call" },...
16816563467
import json import requests from django.http import JsonResponse from django.shortcuts import render import numpy as np # Create your views here. from django.template.defaultfilters import upper from django.template.loader import render_to_string from apps.utils.cases import get_scenario_on_day from apps.utils.dat...
Akijunior/corona-relatorio
src/apps/core/views.py
views.py
py
2,580
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "django.template.defaultfilters.upper", "line_number": 25, "usage_type": "call" }, { "api_name": "django.template.loader.render_to_string", "line_number": 28, "usage_type": "call" }, ...
16106099445
#import logging class stopwatch: """usage: swgen = stopwatch.template("[INTEGRATION]") ... with swgen("Running xxx") as _: run_stuff() with swgen("Finalizing xxx") as _: finish_stuff() """ def __init__(self, message, logger): self.logger ...
KellisLab/benj
benj/timer.py
timer.py
py
1,382
python
en
code
2
github-code
6
[ { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "tqdm.auto.tqdm", "line_number": 27, "usage_type": "call" }, { "api_name": "tqdm.auto.tqdm.tqdm", "line_number": 29, "usage_type": "call" }, { "api_name": "tqdm.auto.tqdm", "li...
21397154599
import os import backoff import pytest from racetrack_commons.dir import project_root from racetrack_client.client.deploy import send_deploy_request from racetrack_client.client_config.auth import set_user_auth from racetrack_client.client_config.client_config import ClientConfig from racetrack_client.utils.request i...
TheRacetrack/racetrack
tests/e2e/test_auth.py
test_auth.py
py
6,570
python
en
code
27
github-code
6
[ { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.mark.skipif", "line_number": 19, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 19, "usage_type": "attribute" }, { "api_name": "e2e.utils._configure_en...
12836912861
import sys from typing import Optional import PySide6 from PySide6 import QtWidgets from qt_material import QtStyleTools, list_themes from safebox.gui.widgets import cycle_generator, CreatorWidget class MainWindow(QtWidgets.QMainWindow, QtStyleTools): def __init__(self, parent: Optional[PySide6.QtWidgets.QWidget]...
pouralijan/SafeBox
safebox/gui/safebox_creator_main_window.py
safebox_creator_main_window.py
py
829
python
en
code
2
github-code
6
[ { "api_name": "PySide6.QtWidgets.QMainWindow", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PySide6.QtWidgets", "line_number": 9, "usage_type": "name" }, { "api_name": "qt_material.QtStyleTools", "line_number": 9, "usage_type": "name" }, { "api_na...
36388156115
from typing import Union import psutil def get_cpu_temp() -> Union[float, None]: temperature_file_path = "/sys/class/thermal/thermal_zone0/temp" try: raw_temp = None with open(temperature_file_path) as f: raw_temp = f.readline().strip("\n") return float(raw_temp) / 1000 ...
noahtigner/homelab
api/diagnostics/retrieval.py
retrieval.py
py
1,365
python
en
code
0
github-code
6
[ { "api_name": "typing.Union", "line_number": 6, "usage_type": "name" }, { "api_name": "psutil.cpu_count", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 23, "usage_type": "name" }, { "api_name": "psutil.cpu_percent", "l...
74525063866
import argparse from datetime import datetime import os import sys import time import random from Classifier_3d_v1 import Classifier import tensorflow as tf from util import Visualizer import numpy as np from dataset_classifier import LungDataset import torch from ops import load,save,pixelwise_cross_entropy import tor...
jimmyyfeng/Tianchi-1
Tianchi_tensorflow/train_classifier.py
train_classifier.py
py
3,980
python
en
code
5
github-code
6
[ { "api_name": "util.Visualizer", "line_number": 26, "usage_type": "call" }, { "api_name": "torchnet.meter.AverageValueMeter", "line_number": 31, "usage_type": "call" }, { "api_name": "torchnet.meter", "line_number": 31, "usage_type": "attribute" }, { "api_name": "...
44757415813
from telegram.ext import * from telegram import * import openai openai.api_key = "YOUR OPENAI API KEY" # Enter your OpenAI Secret Key. telegram_token = "YOUR TELEGRAM BOT TOKEN" # Enter your Telegram Bot Token. conversation=[{"role": "system", "content": "You are a helpful assistant."}] # Define...
muhammetharundemir/Telegram-ChatGPT
telegramChatGPT.py
telegramChatGPT.py
py
3,703
python
en
code
1
github-code
6
[ { "api_name": "openai.api_key", "line_number": 5, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletion.create", "line_number": 21, "usage_type": "call" }, { "api_name": "openai.ChatCompletion", "line_number": 21, "usage_type": "attribute" } ]
24890875535
#!/bin/env python # -*- coding: UTF-8 -*- import wx import os import sys import shutil import re import math from bqList import MyBibleList from exhtml import exHtmlWindow class MyApp(wx.App): path = None def __init__(self, *args, **kwds): wx.App.__init__ (self, *args, **kwds) def OnInit(self): self....
noah-ubf/BQTLite
pybq.py
pybq.py
py
19,493
python
en
code
1
github-code
6
[ { "api_name": "wx.App", "line_number": 13, "usage_type": "attribute" }, { "api_name": "wx.App.__init__", "line_number": 18, "usage_type": "call" }, { "api_name": "wx.App", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_...