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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27756401926 | import sys, os, json, types, unittest
for i in ["/task", "/workspace", "/program"]:
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + i)
import taskManager as TM, workspaceManager as WM, programManager as PM
commands = WM.commands + TM.commands + PM.commands
class Commands(unittest.TestCase):
de... | legit-programming/Todo-App | tests.py | tests.py | py | 1,860 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
29244918906 | # postpone and is in UTC
# If program re-run, no job but present in db
# postpone the next day's class
# postponing on sat and sun shouldnt be allowed
# add cancel button to postpone, cancel and events
from replit import db
import credentials as crd
from apscheduler.schedulers.background import BackgroundScheduler
f... | Tibin-Saji/ClassAssistant_TeleBot | main.py | main.py | py | 18,095 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "credentials.ADMINS",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "credentials.CREATOR_USER_ID",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "credentials.CREATOR_USER_NAME",
"line_number": 34,
"usage_type": "attribute"
}... |
18163845793 | from sys import argv, stderr
from json import load
json_fname = argv[1]
# load json
with open(json_fname) as f:
j = load(f)
# create list of existing input-output pairs
pairs_list = []
for e in j:
for f in e['flows']:
if 'inputPort' in f and 'outputPort' in f:
pair = (f['inputPort'], f['outputPort'])
... | giditre/unibo-agh_monitoring | old_stuff_2018/sflowtest/pp_avgDatarate.py | pp_avgDatarate.py | py | 1,076 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sys.stderr",
"line_number": 20,
"... |
45870824361 | from numpy import linspace
from sympy import symbols
from math import *
# Definição da variável em uso -> f(x): x
x = symbols('x')
def Simpson(f, a, b, e):
#Um numero muito pequeno
d = 0.0001
#Vetor de m pontos cobrindo o intervalo [a,b]
xd = []
yd = []
for i in linspace(a,b,round((b-... | iOsnaaente/Faculdade_ECA-UFSM | Metodos Numericos/Integrais/integral_Simpson.py | integral_Simpson.py | py | 2,772 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "sympy.symbols",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line... |
22462482103 | import pyautogui
from tkinter import *
import pyperclip3 as pc
import keyboard
janela = Tk()
janela.title("Collor Micker")
janela.geometry('250x58')
janela.configure(bg='#FFFFFF')
janela.iconbitmap("icon.ico")
global pixelColorHEX
def atualizar_cor():
x, y = pyautogui.position()
print(f"x:{x} y:{y}")
pi... | mayconvs/color_micker | color_micker.py | color_micker.py | py | 1,387 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pyautogui.position",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pyautogui.screenshot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keyboard.is_pressed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyperclip... |
22235661224 | from flask import Blueprint, jsonify
from backend.app import db
from backend.models.listings import Listings
from backend.models.staff import Staff
from backend.models.staffapplication import StaffApplication
updateStaffApplicationBP = Blueprint("updateStaffApplication", __name__)
@updateStaffApplicationBP.route("/ap... | darylcwx/skillbasedroleportal | backend/routes/post/updateStaffApplication.py | updateStaffApplication.py | py | 1,492 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "backend.models.staff.Staff.query.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "backend.models.staff.Staff.query",
"line_number": 12,
"usage_type": "attribute"
},
... |
41054626746 | from unittest.mock import MagicMock
from botocore.exceptions import ClientError
import pytest
class MockManager:
def __init__(self, stub_runner, scenario_data, input_mocker):
self.scenario_data = scenario_data
self.instance_id = "test-instance"
self.scenario_data.scenario.inst_wrapper.inst... | awsdocs/aws-doc-sdk-examples | python/example_code/ec2/test/test_stop_and_start_instance.py | test_stop_and_start_instance.py | py | 2,740 | python | en | code | 8,378 | github-code | 1 | [
{
"api_name": "unittest.mock.MagicMock",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 35,
"usage_type": "call"
},
{
"api_name"... |
24875016673 | import hashlib
import os
import pathlib
import random
import re
import string
import uuid
from datetime import datetime, timedelta
from typing import List, NamedTuple, Optional, Tuple
import astropy.units as u
from astropy.units import Quantity
from dateutil import tz
from faker import Faker
from ssda.observation imp... | saltastroops/data-archive-database | src/ssda/util/dummy.py | dummy.py | py | 14,081 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.NamedTuple",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "ssda.util.types.Institution",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "ssda.util.types",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "ty... |
29732225856 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
def get_version():
"""Gets the repository version."""
import subprocess
proc = subprocess.Popen('hg log -r tip --template "{latesttagdistance}"',
shell=True,
stdout=subproce... | iamFIREcracker/strappon | setup.py | setup.py | py | 574 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "subprocess.Popen",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "setuptools.setup",
"line_number": 18,
"usage_type": "call"
}
] |
20741853198 | import json
import unittest.mock
from typing import List
import pytest
from pytest_httpx import HTTPXMock
from world_boss.app.data_provider import DATA_PROVIDER_URLS
from world_boss.app.enums import NetworkType
from world_boss.app.kms import MINER_URLS, signer
from world_boss.app.models import Transaction, WorldBossR... | planetarium/world-boss-service | tests/tasks_test.py | tasks_test.py | py | 10,833 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pytest_httpx.HTTPXMock",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "world_boss.app.data_provider.DATA_PROVIDER_URLS",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "world_boss.app.enums.NetworkType.MAIN",
"line_number": 33,
"usage_... |
73034193633 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Libs
from salt.states import http
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspa... | shineforever/ops | salt/tests/unit/states/http_test.py | http_test.py | py | 1,499 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "salttesting.helpers.ensure_in_syspath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "salt.states.http.__salt__",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "salt.states.http",
"line_number": 23,
"usage_type": "name"
},
{
... |
73645659875 | #!/usr/bin/env python3
import unittest
try:
from packaging.version import Version as LV
except ImportError:
from distutils.version import LooseVersion as LV
print('WARNING: using distutils version check, not packaging!')
import os
nvidia = False # if running within NVIDIA container
nvidia_skip = False
m... | CSCfi/puhti-ml | tests/pytorch.py | pytorch.py | py | 9,647 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.__version__",
"l... |
22419684025 | #!/usr/bin/python2.7
import os
# We'll render HTML templates and access data sent by POST
# using the request object from flask. Redirect and url_for
# will be used to redirect the user once the upload is done
# and send_from_directory will help us to send/show on the
# browser the file that the user just uploaded
from... | pkraison/Resize | app.py | app.py | py | 6,779 | python | en | code | 4 | github-code | 1 | [
{
"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_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_... |
18266456013 | import sys
import optparse
from os import stat
from os.path import exists, join as pathjoin
from eventlet import wsgi, listen
from swift.common.exceptions import LockTimeout
from swift.common.utils import split_path, readconf, lock_parent_directory
from srm.utils import Daemon, get_md5sum, get_file_logger
class FileI... | pandemicsyn/swift-ring-master | srm/ringmasterwsgi.py | ringmasterwsgi.py | py | 6,717 | python | en | code | 11 | github-code | 1 | [
{
"api_name": "srm.utils.get_file_logger",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "os.stat",
"... |
17591144969 | import streamlit as st
import streamlit.components.v1 as components
import pandas as pd
import plotly.express as px
import webbrowser
# Page configuration
st.set_page_config(page_title='Archdaily Statistics')
st.title('Archdaily Statistics')
st.markdown('This app is showing various statistics of projects on ArchDaily.... | mariovalkovic/archdaily_statistics | app.py | app.py | py | 1,647 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.... |
19841378208 | import random
import string
import urllib2
import json
import time
import csv
from PIL import ImageDraw
from PIL import Image
from PIL import ImageFont
def createImage():
name = raw_input("What is your name?\n")
size = (240,280)
color = "#%06x" % random.randint(0, 0xFFFFFF)
font = ImageFont.truetype("Arial.ttf",2... | reispedro/CS1122 | hw02.py | hw02.py | py | 2,162 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.ImageFont.truetype",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.ImageFont",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
... |
1914844296 | # import necessary packages
from __future__ import print_function
import sys
import os
sys.path.append('../web')
from sense_hat import SenseHat
from app.doctor.doctor_services import DoctorService
import aiy.assistant.auth_helpers
from aiy.assistant.library import Assistant
import aiy.audio
import aiy.voicehat
from goo... | jasonshere/MAPS | maps_assis/assistant.py | assistant.py | py | 4,775 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numb... |
2598741828 | from git import Repo
import os, shutil
import pathlib
repos = ["C:/Users/jrami/VSCodeProjects/JoseRamirez", "C:/Users/jrami/VSCodeProjects/AlannaPasco"]
for repo_dir in repos:
repo = Repo(repo_dir)
readme_file = "C:/Users/jrami/VSCodeProjects/RHS_Helper_Scripts/README.md"
readme_filename = pathlib.Path(rea... | jramirez857/RHS_Helper_Scripts | push_file.py | push_file.py | py | 763 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "git.Repo",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "shutil.copy",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 1... |
74934250594 | from generic_scripts.tools import ToolsCmd, ssh_cli
from generic_scripts.global_var import logger, console, dbaas
from nginx import set_nginx
import time
import re
import random
import inspect
import os
def login_mysql(inst_info):
norms = {1: 'master', 2: 'slave', 3: 'logger'}
console.print('************** 请输... | xxyhhd/my_scripts | new/db_scripts/mysql.py | mysql.py | py | 11,543 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "generic_scripts.global_var.console.print",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "generic_scripts.global_var.console",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "generic_scripts.global_var.console.print",
"line_number": 15,
... |
12429395250 | #! /usr/bin/env python3
import sys
import argparse
import expand
def go(args):
expander = expand.Expander()
if args['bundles']:
print('Querying bundles')
print(expander.getGeneBounds(args['compressed'], args['chrom'], args['start'], args['end']))
if args['coverage']:
print('Querying... | jpritt/boiler | query.py | query.py | py | 1,734 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "expand.Expander",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 24,
"usage_type": "attribute"
},
{
"... |
32486140161 | from collections import deque
def bfs(r, c):
visited[r][c] = 1
s = 1
queue.append((r, c))
while queue:
i, j = queue.popleft()
if visited[i][j] == L:
return s
for k in range(4):
ni = i + drc[k][0]
nj = j + drc[k][1]
cur = grid[i][j... | CrimsonTheLegoBuilder/MyBaekjoonSolve | hw/sw1953_2.py | sw1953_2.py | py | 1,163 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 28,
"usage_type": "call"
}
] |
4719188304 | import requests
import os
from twilio.rest import Client
API_KEY = os.environ["API_OWN"]
LAT = 19.432680
LONG = -99.134209
ENDPOINT = "https://api.openweathermap.org/data/2.5/onecall"
account_sid = "ACd913eab39082ec0af0593f7f6f8a4252"
auth_token = os.environ["AUTH_TOKEN"]
parameters = {
"lat": LAT,
... | tomagent/python-playground | twilio_bot.py | twilio_bot.py | py | 1,073 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "twilio.rest.Client",
... |
3667530119 | from email.mime import image
import cv2
import numpy as np
from PIL import Image as image
def scaleImage(array : np.ndarray,old_wdith: int,old_height: int,new_width: int,new_height :int):
newarr = np.split(ary= array,indices_or_sections=[3,1],axis=2)
# split rgb and alpha
# opencv need GBk ,... | 1641585051/UVTexture | tools/uv_cv_tools.py | uv_cv_tools.py | py | 1,341 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.ndarray",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_nu... |
22291648102 | from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.aml_record import AMLRecord
from ..models.taa_acceptance import TAAAcceptance
from ..models.taa_record import TAARecord
from ..types import UNSET, Unset
T = TypeVar("T", bound="TAAInfo")
@attr.s(auto_attribs=True)
class TAAInfo:
... | Indicio-tech/acapy-client | acapy_client/models/taa_info.py | taa_info.py | py | 3,665 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "typing.TypeVar",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "models.aml_record.AMLRecord",... |
13786554227 | # -*- coding: utf-8 -*-
"""
Created on Sat Sep 10 16:32:02 2022
@author: Metehan
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
resim=cv2.imread("araba.png")
plt.imshow(resim)
plt.show()
cv2.imshow("orjinal",resim)
print(resim.shape)
yükseklik,genişlik,kanal=resim.shape
... | MetehanYildiz25/ImageProcessing | Görüntü İşleme/4_farkli_renkte_foto.py | 4_farkli_renkte_foto.py | py | 991 | python | tr | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
11651554942 | #!/usr/bin/python3
"""
DESCRIPTION:
Template code for the SECOND Advanced Question of the Hidden Markov Models
assignment in the Algorithms in Sequence Analysis course at the VU.
INSTRUCTIONS:
Complete the code (compatible with Python 3!) upload to CodeGrade via
corresponding Canvas assignment. Note t... | violehtone/HMM | advanced/viterbi_training.py | viterbi_training.py | py | 4,025 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "argparse.RawTextHelpFormatter",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "hmm.viterbi",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "hmm... |
1420645747 | """Diagnose the feature model."""
import pandas as pd
import matplotlib.pyplot as plt
from collections import Counter
class STATS(object):
"""Mesh object."""
def __init__(self, fname='xxx'):
"""
Init the MESH2D.
fname: str, filename of xxx_Species.csv.
"""
# s... | buckees/Langmuir | packages/Model/Feature2D/Feature2D_stats.py | Feature2D_stats.py | py | 3,441 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
5638412335 | from collections import deque
import numpy as np
import torch
import logging
logger = logging.getLogger(__name__)
def cem(agent, params):
"""PyTorch implementation of a cross-entropy method.
Params
======
agent (object) --- the agent to train
params (dict) --- a dictionar of pa... | dahlem/deep-reinforcement-learning-navigation | rl/mc/cem.py | cem.py | py | 2,100 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random.randn",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
21002769573 | import re
from common.db import models
from django.conf import settings
from protobufs.services.file import containers_pb2 as file_containers
import service.control
def _safe_int(value):
if value is not None:
return int(value)
class File(models.UUIDModel, models.TimestampableModel):
as_dict_value_... | getcircle/services | file/models.py | models.py | py | 2,507 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "common.db.models.UUIDModel",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "common.db.models",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "common.db.models.TimestampableModel",
"line_number": 14,
"usage_type": "attribute"
},
... |
42174288140 | import numpy as np
import json as j
def get_counts(json_anno, size=(100,70,100)):
count = np.zeros(size, dtype=np.int)
for img_name in json_anno:
for relation in json_anno[img_name]:
sub = relation['subject']['category']
pred = relation['predicate']
obj = relation['o... | econser/active_refer | vrd_analysis.py | vrd_analysis.py | py | 793 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.int",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
}
] |
4341262058 | # Databricks notebook source
# MAGIC %pip install pdfplumber
# MAGIC %pip install psycopg2-binary==2.9.5
# MAGIC %pip install sqlalchemy
# COMMAND ----------
containerName = "landing"
storageAccountName = "sharifstdataplatform"
sas = "?sv=2022-11-02&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2023-07-05T11:28:04Z&st=2023-07-... | shxr3f/DatabricksScripts | ges/test.py | test.py | py | 4,220 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pdfplumber.open",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_nu... |
1706993556 | from sqlalchemy import CHAR, ForeignKey, String
from sqlalchemy.orm import relationship
from giges.db import db
from giges.models.mixins import UUIDMixin
class Ritual(db.Model, UUIDMixin):
name = db.Column(
String,
nullable=False,
unique=True,
index=True,
doc="Name of the... | tesselo/giges | giges/models/ritual.py | ritual.py | py | 883 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "giges.db.db.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "giges.db.db",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "giges.models.mixins.UUIDMixin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "giges.d... |
25266075341 | from discord.ext import commands
import traceback
class ErrorHandler(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_command_error(self, ctx, error):
print(error)
def setup(bot):
bot.add_cog(ErrorHandler(bot))
| jamesreprise/dante-lite | src/cogs/errorhandler.py | errorhandler.py | py | 291 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Cog.listener",
"line_number": 9,
"usage_type": "call"
},
{
... |
73571817314 | # random agent on Taxi-v2
import gym
env = gym.make("Taxi-v2")
P = env.env.P
# P[s][a] contains array of tuples.
# each of them is in form of (p, next_s, r, done)
# where "p" is the transition probability of
# going from "s" to "next_s" with action "a" getting "r" reward;
# "done" denotes whether the episode is finis... | Alef125/AI_and_Learning | AI/AI_HW4/Taxi.py | Taxi.py | py | 1,134 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gym.make",
"line_number": 4,
"usage_type": "call"
}
] |
39481078969 | import os
import tweepy
def get():
with open(os.path.join(os.path.dirname(__file__), "template.html")) as f:
return f.read()
def post(screen_name=""):
CK = os.getenv("TW_CK")
CS = os.getenv("TW_CS")
AT = os.getenv("TW_AT")
AS = os.getenv("TW_AS")
auth = tweepy.OAuthHandler(CK, CS)
... | laddge/myapi | tw_sn2id/__init__.py | __init__.py | py | 745 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number":... |
40785965866 | from typing import Any, Dict
from app.app import db
Model: Any = db.Model
class Camera(Model):
__tablename__ = 'cameras'
Name = db.Column(db.String(10), unique=True)
images = db.relationship('Image', backref='camera', lazy=True)
@classmethod
def from_dict(cls, camera_dict: Dict[s... | percurnicus/opportunity | app/app/models.py | models.py | py | 3,649 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Any",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "app.app.db.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "app.app.db",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "app.app.db.Column",
"lin... |
31602808719 | import numpy as np
import cv2
from matplotlib import pyplot as plt
import random
from PIL import Image
img = Image.open('original.jpg')
img1 = cv2.imread('original.jpg')
img1 = cv2.cvtColor(img1, cv2.COLOR_BGR2RGB)
h, w, _ = img1.shape
print('width: ', w)
print('height:', h)
count = 0
w1 = w2 = int(w/20)
h1 = h2 = ... | XYZ121212/issre2020 | deadpixel200.py | deadpixel200.py | py | 919 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 10... |
11910532003 | from flask import jsonify, request
from app.models import Pharmaceutical_info, Token
from app import db
def updatePharmaceuticalInfo():
'''update pharmaceutical info record'''
data = request.get_json()
token = request.headers['TOKEN']
id=int(data['id'])
t=Token.query.filter_by(token=token).fi... | the1Prince/drug_repo | app/updates/updatePharmaceuticalInfo.py | updatePharmaceuticalInfo.py | py | 1,655 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.request.get_json",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.request.headers",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask.re... |
4523232392 | import datetime
name = str(input('Name: '))
c = int(input('Age: '))
e = int(input("Number: "))
def years(age):
d = datetime.date.today().year
a = d+(100-c)
for i in range(e):
print("You're gonna be 100 yrs old the year:", a)
return(a)
def main():
return
if __name__ == '__main__':
... | gezdank/Pair-programming-excercises | years_module.py | years_module.py | py | 577 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.date.today",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 9,
"usage_type": "attribute"
}
] |
23273915225 | from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
QApplication, QWidget,
QHBoxLayout, QVBoxLayout,
QGroupBox, QButtonGroup, QRadioButton,
QPushButton, QLabel)
from random import shuffle, randint
class Question():
def __init__(self, question, right_answer, wrong1... | Sashapavl/MemoryCard | MemoryCard.py | MemoryCard.py | py | 8,000 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 40,
"usage_type": "call"
},
{
"a... |
73033759393 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import os
from salt.utils import parsers
from salt.utils.verify import verify_env, verify_files
from salt.config import _expand_glob_path
import salt.cli.caller
class SaltCall(parsers.SaltCallOptionParser):
'''
... | shineforever/ops | salt/salt/cli/call.py | call.py | py | 2,215 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "salt.utils.parsers.SaltCallOptionParser",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "salt.utils.parsers",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "salt.utils.verify.verify_env",
"line_number": 24,
"usage_type": "call"
... |
20843298303 | #!/usr/bin/env python3
from __future__ import print_function
from bcc import BPF, USDT
import argparse
import ctypes as ct
import time
import os
import io
import ipaddress
import socket
from collections import defaultdict
# globals
SYSCALLS = ["socket", "socketpair", "bind", "listen", "accept", "accept4",
... | factorysh/PHP-tracing-tool | php_tool.py | php_tool.py | py | 18,131 | python | en | code | 29 | github-code | 1 | [
{
"api_name": "ctypes.Structure",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "ctypes.c_ulonglong",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "ctypes.c_ulonglong",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": ... |
17617060348 | import json
with open("pokemons.json") as file:
pokemons = json.load(file)["results"]
# ACESSAR UMA CHAVE
# print(pokemons[0]["evolution"])
grass_type_pokemons = [
pokemon for pokemon in pokemons if "Grass" in pokemon["type"]
]
with open("grass_pokemons.json", "w") as file:
# json.dumps joga numa variav... | ricardorosa-dev/Curso-Trybe | 35.2_entrada_saida_arq/json_escrita.py | json_escrita.py | py | 523 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 19,
"usage_type": "call"
}
] |
30422431342 | import c_a_parameters_bible as pb
import sqlite3
from sqlite3 import Error
conn = sqlite3.connect(pb.BIBLE_ID + '/f_c_db_'+pb.BIBLE_ID+'.sqlite')
cur = conn.cursor()
cur.execute(''' SELECT book,token, count(*) as 'count' FROM wordtokens GROUP BY book,token ORDER by 1,3 desc; ''')
old_book = ""
token_count = 0
line = ... | murillocjr/theophilusnlp | bible/f_e_print_word_frequency_by_book.py | f_e_print_word_frequency_by_book.py | py | 613 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "c_a_parameters_bible.BIBLE_ID",
"line_number": 5,
"usage_type": "attribute"
}
] |
11397140123 | from soc import debug_messages
from playing import get_all_messages
from collections import Counter
from edtext import clean
from more_itertools import unique_everseen
import json
def main():
messages_json = get_all_messages()
start = 3 * 1500
finish = start + 1500
messages_chunk = messages_... | komap2017/soc | debug.py | debug.py | py | 1,075 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "playing.get_all_messages",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "more_itertools.unique_everseen",
"line_number": 16,
"usage_type": "call"
},
{
"api_na... |
71786006115 | from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.http import Http404
from django.shortcuts import render
from .models import Movie
# data = {
# 'movies': [
# {
# 'id': 5,
# 'title': 'Jaws',
# 'year': 1669,
# },
# ... | anmolbansal7/django-init | movies/views.py | views.py | py | 1,362 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Movie.objects.all",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "models.Movie.objects",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "models.Movie",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "djang... |
73111178594 | # -*- coding: utf-8 -*-
import scrapy
import time
from scrapy.http import Request
from loguru import logger
from urllib.parse import urljoin
from SafetyInformation.items import SafeInfoItem
from SafetyInformation.settings import SLEEP_TIME, TOTAL_PAGES
class Myhack58Spider(scrapy.Spider):
name = 'myhack58'
a... | Silentsoul04/SafetyInformation | SafetyInformation/spiders/myhack58.py | myhack58.py | py | 2,133 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "loguru.logger.info",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "SafetyInformation... |
10147080980 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import magic
import datetime
import logging
from pastefile import utils
from jsondb import JsonDB
from flask import send_from_directory, abort
from werkzeug import secure_filename
LOG = logging.getLogger(__name__)
def get_infos_file_from_md5(md5, db... | guits/pastefile | pastefile/controller.py | controller.py | py | 8,324 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jsondb.JsonDB",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_... |
16073390395 | from wall import views
from django.urls import path
urlpatterns = [
path('deer/',views.deerList.as_view(), name='deerlist'),
path('realwreath/',views.RealWreathView.as_view(), name ="realwreathview"),
path('ornament/',views.OrnamentView.as_view(), name ='ornament_list'),
path('solvequestion/',views.SolveQuestion.... | MinJae00/santa-back_distribute | wall/urls.py | urls.py | py | 481 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "wall.views.deerList.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "wall.views.deerList",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "wa... |
27271986726 | # 실버 1
# 14716. 현수막
import sys
from collections import deque
input = sys.stdin.readline
n, m = map(int, input().split())
mtx = [list(map(int, input().split())) for _ in range(n)]
q = deque()
dx = [-1, 0, 1, 0, -1, 1, -1, 1]
dy = [0, -1, 0, 1, -1, 1, 1, -1]
def bfs(i, j):
q.append([i, j])
mtx[i][j] = 0
... | honggom/TIL | problem-solving/baekjoon/graph/14716-bfs.py | 14716-bfs.py | py | 722 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 11,
"usage_type": "call"
}
] |
7029239081 | import asyncio
import dbus_next
from dbus_next.aio import MessageBus
import socket
import enum
import logging
import common
class BtConnectionRole(enum.Enum):
Master = 1
Slave = 2
NotConnected = 3
class BtClient(object):
BT_CONTROL_PORT = 17 # Service port - control port specified in the bluetooth HI... | BLeeEZ/rpi-kvm | rpi_kvm/bt_client.py | bt_client.py | py | 9,585 | python | en | code | 27 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "asyncio.Queue",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "asyncio.create_tas... |
9396199673 | from nltk.corpus import stopwords
from tensorflow.keras.preprocessing.text import Tokenizer
import gensim
import pandas as pd
from preprocess import process_text_data
from utils import load_epub
from word2vec import Word2Vec
def remove_stopword(book):
corpus = list()
stopword = stopwords.words('english')
... | dhsong95/the-catcher-in-the-rye | question3.py | question3.py | py | 2,342 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.preprocessing.text.Tokenizer",
"line_number": 27,
"usage_type": "call"... |
25337349664 | import pygame
import random
WIDTH = 480
HEIGHT = 600
FPS = 60
# Задаем цвета
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
# Создаем игру и окно
pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Star De... | anvartdinovtimurlinux/Star_Defender | game.py | game.py | py | 2,775 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mo... |
32067083979 | import pathlib
import sys
import xml.etree.ElementTree as ET
from typing import Final
NAMESPACES: Final[dict[str, str]] = {
"": "http://www.w3.org/2000/svg",
"xlink": "http://www.w3.org/1999/xlink",
}
for prefix, uri in NAMESPACES.items():
ET.register_namespace(prefix, uri)
def urlize(s: str) -> str:
... | rpetchler/galant-schemata | src/postprocess/scores.py | scores.py | py | 1,249 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Final",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.register_namespace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 12,
"usage_type": "name"
},
{
"api_na... |
13610057864 | import json
from asyncio import sleep
from contextlib import asynccontextmanager
from logging import getLogger
from os import remove
from pathlib import Path
import aiofiles
import aiohttp
from aiogram import Bot
from aiogram.types import Downloadable
from ..settings import get_settings
logger = getLogger("tools.fil... | Ramnck/stats_bot | app/src/tools/file_manager.py | file_manager.py | py | 2,348 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "settings.get_settings",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "aiofiles.open",
... |
3142224224 | ######################################################################
# File: retrieval_model.py
# Author: Vishal Dey
# Created on: 11 Dec 2019
#######################################################################
'''
Synopsis: Create w2v for corresponding string description of each problem
Reads in pretrianed Wor... | Phybiolo57/MathWordProblemSolver | 3_T-RNN_&_baselines/src/retrieval_model.py | retrieval_model.py | py | 5,525 | python | en | code | 18 | github-code | 1 | [
{
"api_name": "numpy.random.choice",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
2960278008 | from astropy.io import fits
import numpy as np
import astropy.units as u
from agpy import cubes
from FITS_tools import cube_regrid
import agpy
#f2 = fits.open('H2CO_22_speccube.fits')
dpath = '/Volumes/128gbdisk/w51/'
#f2 = fits.open('Darray_H2CO_22_speccube_uniform_contsub_justspw19.image.fits')
f2 = fits.open(dpath+... | keflavich/w51evlareductionscripts | make_taucube_vla_ku_bd_22.py | make_taucube_vla_ku_bd_22.py | py | 2,920 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "astropy.io.fits.getdata",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "astropy.... |
39441347670 | from flask import Flask, render_template, request, redirect
from models import db, EmployeeModel
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///data.db"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.init_app(app)
@app.before_first_request
def create_table():
db.create_all()
... | reinisdreska/flask-crud | app.py | app.py | py | 2,578 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "models.db.init_app",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.db",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.db.create_all",
"lin... |
30267363694 | import json
import time
import psycopg
from datetime import date, timedelta
from dateutil.relativedelta import relativedelta
from pgvector.psycopg import register_vector
from chatgpt import chatgpt_api
from ny_times import times_api
connection_string = ''
start_date = date(2020, 5, 27)
end_date = date(2000, 1, 1)
de... | TheItCrOw/VecTop | src/embedder/times_embedder.py | times_embedder.py | py | 4,512 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.date",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "psycopg.connect",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pgvector.psycopg.register... |
22942264952 | import json
import logging
import os
from typing import Dict
import lib.configs
from lib.activelearning import Last
from lib.infers.deepgrow_pipeline import InferDeepgrowPipeline
from lib.infers.vertebra_pipeline import InferVertebraPipeline
import monailabel
from monailabel.interfaces.app import MONAILabelApp
from m... | Project-MONAI/MONAILabel | sample-apps/radiology/main.py | main.py | py | 13,473 | python | en | code | 472 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "monailabel.interfaces.app.MONAILabelApp",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name":... |
73820024992 | ## 다종목 스윙(해당일 종가매수 해당일 종가매도) 백테스팅 템플릿
import create_data_base
import logic
import config
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import win32com
from datetime import datetime
import time
import sqlite3
resultdata = []
flag = 0
class Core():
## 파라미터 설정
... | lyy9257/Haymanbacktester | 0.1.0/swing_basket.py | swing_basket.py | py | 4,529 | python | ko | code | 9 | github-code | 1 | [
{
"api_name": "config.trade_fee",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "config.trade_tax",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "config.position_size",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": ... |
31990513040 | # mod1.py
# loop comprehensions
loop = [[(num1, num2) for num2 in range(5)] for num1 in range(5)]
print(type(loop))
print(loop)
loop2 = [i for i in range(0, 50)]
print(loop2)
# loop comprehension with mixed list/tuples
movies = [("Gump", 1941), ("Terry", 2001), ("Wind", 1986), ("Gary", 1976),
("Tom", 1934... | carlabbasi/essentials2 | mod1.py | mod1.py | py | 1,767 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "pygame.font.S... |
36412945847 | import argparse
import tensorflow as tf
import numpy as np
from models.model_builder import ModelBuilder
import cv2
import timeit
import pathlib
parser = argparse.ArgumentParser()
parser.add_argument("--batch_size", type=int,
help="Evaluation batch size", default=1)
parser.add_argument("--num_c... | chansoopark98/Tensorflow-Keras-Semantic-Segmentation | export_tflite.py | export_tflite.py | py | 3,233 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.model_zoo.PIDNet.PIDNet",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "te... |
6033750954 | import typing as t
# TODO: Good idea to maintain a count (length of ll) that gets updated with
# each operation
class IndexOutOfRangeError(Exception):
pass
class Node:
def __init__(self, value: t.Any) -> None:
self.value = value
self.next = None
class LinkedList:
def __init__(
... | EvgeniiTitov/coding-practice | coding_practice/data_structures/linked_lists/singly_ll_implementation_1.py | singly_ll_implementation_1.py | py | 6,944 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "typing.Sequence",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "typing.Any"... |
2573942818 | from sdv.model import Service
from sdv_model.proto.seats_pb2 import (
CurrentPositionRequest,
MoveComponentRequest,
MoveRequest,
Seat,
SeatComponent,
SeatLocation,
)
from sdv_model.proto.seats_pb2_grpc import SeatsStub
class SeatService(Service):
"""
Seats service for getting and cont... | eclipse-velocitas/vehicle-model-python | sdv_model/Cabin/SeatService/__init__.py | __init__.py | py | 3,463 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sdv.model.Service",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "sdv_model.proto.seats_pb2_grpc.SeatsStub",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sdv_model.proto.seats_pb2.Seat",
"line_number": 41,
"usage_type": "name"
},
... |
72895042593 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | CiscoSystems/avos | openstack_dashboard/dashboards/project/data_processing/clusters/tabs.py | tabs.py | py | 6,455 | python | en | code | 47 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "horizon.tabs.Tab",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "horizon.tabs",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "django.utils.tra... |
16248264600 | from dataclasses import dataclass
from typing import List
@dataclass
class Book:
title:str
author:str
borrower_name:str
def add_books(book_log: List[Book])->None:
print("Title?")
title = input("> ")
print("Author(s)?")
author = input("> ")
book_log.append(Book(title,author,""))
def vi... | MariannM22/Library | Mock Library/main.py | main.py | py | 1,840 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_... |
73152353635 | """
credit to https://github.com/PredatH0r/XonStat/blob/master/xonstat/elo.py .
ELO algorithm to calculate player ranks
"""
from datetime import datetime
import logging
import math
from botocore.exceptions import ClientError
import json
import boto3
from collections import namedtuple
import time as _time
log_level =... | donkz/rtcwprostats | lambdas/postprocessing/elo/elo_calc.py | elo_calc.py | py | 21,386 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.INFO",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
15858709562 | ''' Inference for the DreamBooth model. '''
import os
import zipfile
import predictor
import runpod
from runpod.serverless.utils import download, upload, validator, rp_cleanup
MODEL = predictor.Predictor()
MODEL.setup()
def run(job):
'''
Run inference on the model.
input format:
{
"instanc... | sascha1337/serverless-workers | dreambooth-v1/infer.py | infer.py | py | 4,027 | python | en | code | null | github-code | 1 | [
{
"api_name": "predictor.Predictor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "runpod.serverless.utils.download.download_input_objects",
"line_number": 46,
"usage_type": "call"
},
{... |
18404151650 | #!/usr/bin/env python3
import csv
import glob
import os
import json
us_states_and_territories = [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"Florida",
"Georgia",
"Hawaii",
"Idaho",
"Illinois",
"Indiana",
... | llimllib/covidgraph | etl.py | etl.py | py | 4,851 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "glob.glob",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 154,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 173,
"usage_type": "call"
}
] |
21268856479 | import uuid
import os
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_clients.KBaseReportClient import KBaseReport
from installed_clients.WorkspaceClient import Workspace
from shutil import copyfile
class htmlreportutils:
def __init__(self):
pass
def create_html_report(se... | kbasecollaborations/kb_gsea | lib/kb_gsea/Utils/htmlreportutils.py | htmlreportutils.py | py | 1,435 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "installed_clients.DataFileUtilClient.DataFileUtil",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "installed_clients.KBaseReportClient.KBaseReport",
"line_number": 18,
"usage_... |
72780138915 | import math
import overpy.exception
import holoviews
import datashader.geo
import sonar.lowrance_log_parser
import logging
logger = logging.getLogger('sonar_map')
def AdjustToIncludeNearestLandmark(lon_min, lon_max, lat_min, lat_max):
orig_lon_min = lon_min
orig_lon_max = lon_max
orig_lat_min = lat_min... | bjcosta/sonar | src/sonar/map.py | map.py | py | 8,566 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sonar.lowrance_log_parser.lowrance_log_parser.meters_to_lnglat",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sonar.lowrance_log_parser.lowrance_log_parser",
"line_number"... |
8138869558 | from itertools import combinations
class Solution:
def readBinaryWatch(self, num: int) -> list:
hours = [8, 4, 2, 1]
mins = [32, 16, 8, 4, 2, 1]
ans = []
for i in range(num+1):
if num - i > 6: continue
hour = list(combinations(hours, i))
minute... | MinecraftDawn/LeetCode | Easy/401. Binary Watch.py | 401. Binary Watch.py | py | 632 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "itertools.combinations",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 14,
"usage_type": "call"
}
] |
72239822113 | # !/usr/bin/env python3
# @file example2_drawing_circle.py
# SCRP: Example 2 - Drawing Circle
# Daryl Dang
"""
Example 2 - Drawing Circle
--------------------------
This example goes over a simple way to draw a circle with the pygame.draw library.
"""
import pygame
# GLOBALS
WHITE = (255, 255, 255)
# Initialize pyg... | dellod/pygame_examples | Session2/example2_drawing_circle/example2_drawing_circle.py | example2_drawing_circle.py | py | 1,157 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
26666123586 | import math
import random
class Dataset:
def __init__(self, samples, batch_size, multim=False, audiovid=False, audiotext=False, textvid=False, exp3=False,
decision_level=False):
self.samples = samples
self.batch_size = batch_size
self.num_batches = math.ceil(len(self.samp... | xctpto/Multimodal-DialogueGCN | helpers.py | helpers.py | py | 7,241 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "math.ceil",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "utils.get_logger",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_... |
13574528250 | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from highlight_text import ax_text
def get_rolling_data(team, window, data):
df_team = data[data['Team'] == team]
df_team_for = df_team.groupby('Round_ID')['Score', 'xScore'].sum().rename(columns={'Score':"For",
... | ciaran-grant/expected-score-model | notebooks/visualisations/rolling_expected_score/rolling_expected_score.py | rolling_expected_score.py | py | 12,461 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "pandas.merge",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.axvspan",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
37369940242 | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
GUEST = 0
OPERATOR = 1
LAWYER = 2
ADMIN = 99
ROLE_CHOICES = (
(GUEST, "guest"),
(LAWYER, "lawyer"),
(OPERATOR, "operator"),
(ADMIN, "admin"),
)
phone ... | wujiapei/alldata | dataHub/backend/common/models.py | models.py | py | 733 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 17,
"usage_type": "name"
},
{
... |
71913968353 | import tornado.web
import mallory
class HeartbeatHandler(tornado.web.RequestHandler):
def initialize(self, circuit_breaker):
self.circuit_breaker = circuit_breaker
@tornado.web.asynchronous
@tornado.gen.engine
def get(self):
if self.circuit_breaker.is_tripped():
self.set_st... | braintree/mallory | mallory/heartbeat_handler.py | heartbeat_handler.py | py | 580 | python | en | code | 57 | github-code | 1 | [
{
"api_name": "tornado.web.web",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "tornado.web",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "mallory.Version",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tornado.web.web",... |
73767652832 | import json, pytz
from dotenv import load_dotenv
from datetime import datetime
from dagster import sensor, RunRequest, SkipReason, get_dagster_logger
from models.cancel_queue import CancelQueue
from ops.helpers.db_config import db_conn
conn = db_conn()
load_dotenv()
my_logger = get_dagster_logger()
@sensor(job_name... | aman-saleem-qbatch/dagster-cloud-dev | sensors/amz_submit_cancel_order_sensor.py | amz_submit_cancel_order_sensor.py | py | 2,125 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ops.helpers.db_config.db_conn",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dagster.get_dagster_logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_nam... |
23787064831 |
import logging
def get_logger(name, path):
logger = logging.getLogger(name)
if len(logger.handlers) > 0:
return logger # Logger already exists
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(asctime)s - %(message)s")
console = logging.StreamHandler()
file_handl... | venzino-han/graph-transfer | igmc/utils.py | utils.py | py | 2,872 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.StreamH... |
24946949793 | from selenium import webdriver
from time import sleep
import csv
from selenium.webdriver.chrome.options import Options
import threading
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from MyClasses impo... | Namgiangvt12/Upwork | 40.0065.py | 40.0065.py | py | 1,495 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "threading.Lock",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "M... |
8966512697 |
from pos.kernal.models import Product
from pos.kernal.models import InStockBatch, InStockRecord
from pos.kernal.models import OutStockRecord
from pos.kernal.models import Product
from pos.kernal.models import Product
# import the logging library
import logging
# Get an instance of a logger
logger = logg... | 13devlin247/py-pos | kernal/store.py | store.py | py | 2,618 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pos.kernal.models.InStockRecord",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "... |
14246232189 | # coding: utf-8
import pytest
import numpy as np
from imageio import imread
from AxonDeepSeg.data_management.data_augmentation import *
class TestCore(object):
def setup(self):
# Remember that the stop value in "arrange" is not included
x = np.arange(0, 16, dtype='uint8')
y = np.arange(0,... | sophie685/newfileplzworklord | test/data_management/test_data_augmentation.py | test_data_augmentation.py | py | 3,908 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.arange",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_numbe... |
70983109473 | from django.urls import path
from . import views
app_name = "api"
urlpatterns = [
path("create/", views.create, name="create"),
path("read/", views.read, name="read"),
path("update/", views.update, name="update"),
path("delete/", views.delete, name="delete"),
path("read/<int:transaction_id>/", vie... | tranlong58/django_mysql_project | api/urls.py | urls.py | py | 357 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
39917897402 | import os
import sublime
import unittest
from ..consts import INFO, WARNING, ERROR
from ..utils import (
find,
get_default_python_command,
get_severity_status_string,
get_error_count,
)
def merge_two_lists(fst, snd):
return fst + list(set(snd) - set(fst))
class TestUtils(unittest.TestCase):
... | figure0/sublime-plugin | tests/test_utils.py | test_utils.py | py | 3,179 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sublime.error_message",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "con... |
33612464774 | from openeis.applications import DriverApplicationBaseClass, InputDescriptor, \
OutputDescriptor, ConfigDescriptor, Descriptor
from openeis.applications import reports
import logging
import datetime as dt
from django.db.models import Avg
from openeis.applications.utils.baseline_models import day_time_temperature_mo... | VOLTTRON/openeis | openeis/applications/whole_building_energy_savings.py | whole_building_energy_savings.py | py | 11,502 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "openeis.applications.DriverApplicationBaseClass",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 34,
"usage_type": "attribut... |
9618296830 | from collections import Counter
mn = input()
m_n = mn.split(' ')
m = int(m_n[0])
n = int(m_n[1])
input_array = input()
input_array_list = input_array.split(' ')
input_array_set = set(input_array_list)
like_set = input()
input_like_set = set(like_set.split(' '))
dislike_set = input()
input_dislike_set = set(dislike_se... | hemantkgupta/Python3 | basics/genral_test.py | genral_test.py | py | 617 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 20,
"usage_type": "call"
}
] |
36806627348 | import requests
from bs4 import BeautifulSoup
import time, uuid
from datetime import datetime, timedelta
from database import connectToDatabase
def time24hrsback(): #gives the timestamp before 24 hrs
before24Hours = datetime.today() - timedelta(days=1)
return before2... | AgrawalRiya/python-web-crawler | crawler.py | crawler.py | py | 2,483 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.today",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "database... |
36795695184 | import PySimpleGUI as sg
from signup import sign_up_gui
def driver_gui(db):
sg.theme('LightGrey1') # Add a touch of color
# All the stuff inside your window.
# get the list of cars that belong to the driver
username = db.get_username()
print(username)
user_data = db.get_driver_info(username)
... | ardaa/CS281 | driver.py | driver.py | py | 3,780 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PySimpleGUI.theme",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Image",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Butto... |
29831680533 | import torch
import torch.nn as nn
from mmcv.runner import BaseModule
from ..builder import NECKS
def gen_dx_bx(xbound, ybound, zbound):
# xbound: [low_bound, upper_bound, size]
# 'xbound': [-51.2, 51.2, 0.8]
# 'ybound': [-51.2, 51.2, 0.8]
# 'zbound': [-10.0, 10.0, 20.0]
dx = torch.Tensor([row[2] ... | jjw-DL/Code_Analysis | BEVDet/mmdet3d/models/necks/view_transformer.py | view_transformer.py | py | 10,709 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.Tensor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number"... |
15797910187 | #!/usr/bin/python3
"""
prints the first State object from the database hbtn_0e_6_us
"""
from model_state import Base, State
from sqlalchemy import (create_engine)
from sys import argv
from sqlalchemy.orm import sessionmaker
if __name__ == "__main__":
engine = create_engine(
'mysql+mysqldb://{}:{}@localhost... | Just-Akinyi/alx-higher_level_programming | 0x0F-python-object_relational_mapping/9-model_state_filter_a.py | 9-model_state_filter_a.py | py | 635 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "model_state.Base.metadata.create_all",
"line_number": 14,
"usage_type": "call"
},
{
"api_name":... |
43736645697 | import streamlit as st
import cv2
from PIL import Image
import numpy as np
import copy
st.markdown("<h1 style='text-align: center; color: white;'>Color Image</h1>", unsafe_allow_html=True)
st.markdown("<p style='text-align: center; color: white; letter-spacing: 2px'>Praktikum 1 Pengolahan Citra Digital</p>", unsafe_a... | wwdnn/PCD_STREAMLIT | Pages/🎒Pertemuan1.py | 🎒Pertemuan1.py | py | 1,654 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.markdown",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"li... |
31851902810 | import pprint
import re # noqa: F401
import six
from asposeslidescloud.models.fill_format import FillFormat
class PictureFill(FillFormat):
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key ... | aspose-slides-cloud/aspose-slides-cloud-python | asposeslidescloud/models/picture_fill.py | picture_fill.py | py | 11,032 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "asposeslidescloud.models.fill_format.FillFormat",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "six.iteritems",
"line_number": 321,
"usage_type": "call"
},
{
"api_name": "pprint.pformat",
"line_number": 343,
"usage_type": "call"
}
] |
44691722041 | import speech_recognition as sr # recognise speech
import playsound # to play an audio file
from gtts import gTTS # google text to speech
import random
from time import ctime # get time details
import webbrowser # open browser
import ssl
import certifi
import time
import os # to remove created audio files
import dateti... | NidhalBB/Back-end-iCareApp | icare/main.py | main.py | py | 4,635 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "speech_recognition.UnknownValueError",
"line_number": 39,
"usage_type": "attr... |
15981241751 | import cv2
import numpy as np
from classes.camera import Camera
from classes.trackbars import Trackbars
from utils.utils import get_resize_picture
class Inklinometer:
def __init__(self, camera: Camera, trackbars: Trackbars, options: dict):
self.gray = None
self.REL_FROM_CENTER_TO_FIRST_HATCH = op... | DoubleCitizen/Inklinometer | classes/inklinometer.py | inklinometer.py | py | 15,130 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "classes.camera.Camera",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "classes.trackbars.Trackbars",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cv2.resize",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "cv2.imsh... |
16557402095 | #
# Solved Date: 20.04.22.
import sys
import collections
sys.setrecursionlimit(10 ** 4)
read = sys.stdin.readline
DXY = ((1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1))
def dfs(land, y, x):
land[y][x] = 0
count = 1
for dy, dx in DXY:
new_y = y + dy
new_x = x + dx
... | imn00133/algorithm | BaekJoonOnlineJudge/CodePlus/600Graph/Main/baekjoon_4963.py | baekjoon_4963.py | py | 1,667 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 24,
"usage_type": "call"
}
] |
30598209481 | import whisper
import numpy as np
class WhisperModel():
def __init__(self, model_type="large"):
print("loading whisper")
self.model = whisper.load_model(model_type, download_root="/app/model/whisper/")
self.language = 'en'
self.task = 'transcribe'
async def set_model_settings(s... | ricard-inho/live_translator | backend/app/model/whisper/model.py | model.py | py | 857 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "whisper.load_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.int16",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.frombuffer",
... |
439382080 | """
Contains the abstract class of a probability distrobution and associated marginals.
"""
import numpy as np
from ..utilities import utils
from ..utilities.profiler import profile
from .variable import RandomVariableCollection
from . import variable_sort
from functools import reduce
import math
from ..utilities.const... | tcfraser/quantum_tools | code/quantum_tools/statistics/probability.py | probability.py | py | 9,480 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "numpy.asarray",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.all",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.all",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 28... |
41763662332 | from opentrons import robot, containers, instruments
robot.head_speed(x=18000, y=18000, z=5000, a=400, b=400)
class Vector(object):
def tolist(self):
return list(self.input_list)
def astype(self, input_type):
if input_type == int:
return Vector([int(float(x)) for x in self.input_... | PanoptoSalad/OT1_jmx | PHIP/coupling_sequence_phip - Try2/13_SC1000_1amine_dispense_24To1times96_col.py | 13_SC1000_1amine_dispense_24To1times96_col.py | py | 3,470 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "opentrons.robot.head_speed",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "opentrons.robot",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "opentrons.containers.load",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "op... |
72512669155 | from datetime import datetime, timedelta
from discord import Embed
from discord.ext import commands
import re
import discord
from discord.ext.commands import Cog
from discord.ext.commands import command, has_permissions
from ..db import db
time_regex = re.compile(r"(?:(\d{1,5})(h|s|m|d))+?")
time_dict = {'h': 3600... | LazyBuds/tommy-discord | lib/cogs/reactions.py | reactions.py | py | 6,421 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Converter",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.