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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6188382936 | import discord
import json
import sys
class rolepinger():
async def pinger(self, message):
# Checks for Admin
with open('settings.json') as json_file:
settingsFile = json.load(json_file)
if settingsFile["adminRoleId"] in str(message.author.roles):
# Makes the Pings ... | 18swenskiq/Squidski-Bot-PY | SquidskiBot/SquidskiBotMain/Commands/rolepinger.py | rolepinger.py | py | 914 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.utils.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.utils",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "discord.utils.get",
... |
29637390079 | import requests
from datetime import datetime
class Conversor:
url = "http://economia.awesomeap.com.br/json/last/USD-BRL"
def __init__(self,valor) -> None:
self.__valor = valor
self.__data = datetime.now()
@staticmethod
def verificar_disponibilidade():
try:
cotaca... | TatianaAlves1/ConversorPython | conversor.py | conversor.py | py | 833 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
70151725160 | import pandas as pd
import numpy as np
import os,time,sys
from IPython import embed
import matplotlib.pyplot as plt
import torch
from mpl_toolkits.mplot3d import Axes3D
import copy
import glob
import tqdm
#import textract
import xml.etree.ElementTree as ET
def show_me_input_data(pd_data):
del(pd_data['Temp'])
... | leemengwei/project_utilities | all_with_dataset/my_analyzer.py | my_analyzer.py | py | 7,559 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.core",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotli... |
3999750584 | import enum
from tensorflow.python.autograph.pyct import anno
from tensorflow.python.autograph.pyct import ast_util
from tensorflow.python.autograph.pyct import parser
from tensorflow.python.autograph.pyct import templates
from tensorflow.python.autograph.pyct import transformer
from tensorflow.python.util.tf_export i... | tensorflow/tensorflow | tensorflow/python/autograph/core/converter.py | converter.py | py | 8,224 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "enum.Enum",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.util.tf_export.tf_export",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.autograph.pyct.parser.parse_expression",
"line_number": 139,
... |
38213459779 | from collections import namedtuple
from inflection import camelize, singularize, pluralize, underscore
from rest_framework.relations import PrimaryKeyRelatedField, ManyRelatedField
from rest_framework.serializers import ListSerializer
from rest_framework.utils.serializer_helpers import BoundField
from ember_drf.seria... | g-cassie/ember-drf | ember_drf/utils.py | utils.py | py | 6,270 | python | en | code | 22 | github-code | 18 | [
{
"api_name": "inflection.camelize",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "inflection.underscore",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "rest... |
72920919720 | import sqlite3
# Connect the DB
conn = sqlite3.connect('FloraCostaricensisDB.db')
print("Connected to FloraCostaricensis data base")
# SQLite cursor
cursor = conn.cursor()
# create a table
def table_creator():
print ("What is the table name?")
tableName = input()
command = """CREATE TABLE %s
... | estebretarg/Flora-costaricensis | APP/FCDB.py | FCDB.py | py | 1,222 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
}
] |
13601509138 | from tqdm import tqdm
import time
import numpy as np
import torch
import torch.nn as nn
from utils.accuracy_score_compute import Evaluate
#https://blog.csdn.net/u012370185/article/details/94409933
def evaluate(model, val_dataloader, log, args):
"""Runs official COCO evaluation.
limit: if not 0, it's t... | yannqi/RefineNet-pytorch | model/evaluate.py | evaluate.py | py | 1,785 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "utils.accuracy_score_compute.Evaluate",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.no_gr... |
35009070002 | import subprocess
from pathlib import Path
from abc import ABC, abstractmethod
from colorama import Style, Fore
import settings
from common.media import AudioFile, VideoFile
class VoiceOver(AudioFile):
_preprocessed: bool
def __init__(self, path: Path, autopreprocess=True):
super(VoiceOver, self)._... | dukensk/smg | translator/media.py | media.py | py | 7,014 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "common.media.AudioFile",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "settings.TEMP_PATH",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "pathlib.P... |
6867261093 | from email import encoders
from email.mime.base import MIMEBase
from email.mime.audio import MIMEAudio
import mimetypes
from email.mime.multipart import MIMEMultipart
import cx_Oracle
from os import listdir
from os.path import isfile, join
from email.mime.text import MIMEText
import numpy as np
import matplotlib.pyplot... | Shane230/SamplePython | Chart/database.py | database.py | py | 3,597 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cx_Oracle.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number... |
22017268465 | from datetime import date
import functools
import gzip
import json
from miracle.stream.frontend_s3 import (
main,
validate,
validate_user,
)
from miracle.stream.tests.conftest import make_record
def _payload(crypto, data):
data = json.dumps(data).encode('utf-8')
return crypto.encrypt(data).encode... | crankycoder/miracle | miracle/stream/tests/test_frontend_s3.py | test_frontend_s3.py | py | 2,940 | python | en | code | null | github-code | 18 | [
{
"api_name": "json.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "miracle.stream.frontend_s3.validate_user",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "miracle.stream.frontend_s3.validate_user",
"line_number": 21,
"usage_type": "call"
... |
16532554742 | from cleo import Command
from snakeye.common.toml import update_config
from snakeye.dep.add import add_dep
class AddDep(Command):
"""
Add Dependency to Current Project
add
{name? : Dependency Name?}
{version? : Version Number?}
"""
def handle(self):
path = "./pyproject.t... | valutac/snakeye | snakeye/cli/command/add_dep.py | add_dep.py | py | 577 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "cleo.Command",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "snakeye.dep.add.add_dep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "snakeye.common.toml.update_config",
"line_number": 21,
"usage_type": "call"
}
] |
74113776039 | from __future__ import absolute_import
from irods.message import iRODSMessage, StringStringMap, RodsHostAddress, STR_PI, MsParam, MsParamArray, RuleExecutionRequest
from irods.api_number import api_number
import irods.exception as ex
from io import open as io_open
from irods.message import Message, StringProperty
impor... | irods/python-irodsclient | irods/rule.py | rule.py | py | 7,443 | python | en | code | 58 | github-code | 18 | [
{
"api_name": "irods.message.Message",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "irods.message.StringProperty",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "irods.message.iRODSMessage",
"line_number": 61,
"usage_type": "call"
},
{
"api_... |
71427190440 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
# read_csv without arguments
nf = pd.read_csv('/kaggle/input/netflix-shows/netflix_titles.csv')
nf.head()
# Parse dates with "parse_dates" argument
nf = pd.read_csv('/kaggle/input/netflix-shows/netflix_titles.csv', parse_dates=['date... | aorursy/new-nb-3 | holfyuen_minimalist-guide-to-reading-data-in-any-format.py | holfyuen_minimalist-guide-to-reading-data-in-any-format.py | py | 6,016 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
3136419390 | from classic.sql_storage import TransactionContext
from sqlalchemy import create_engine
from exhauster.adapters import database, log, sensor_storage, settings, web_api
from exhauster.adapters.database import dashboard as dashboard_repos
from exhauster.application.dashboard import services
class Settings:
db = da... | AlexTolmy/hackaton | components/exhauster_backend/exhauster/composites/web_api.py | web_api.py | py | 1,763 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "exhauster.adapters.database.Settings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "exhauster.adapters.database",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "exhauster.adapters.settings.Settings",
"line_number": 11,
"usage_type": ... |
11683393883 | #!/usr/bin/env python
#
# Author: Harrison Chapman
# This file will hold parent classes of types of models
from __future__ import with_statement
# GAE Imports
from google.appengine.api import memcache
from google.appengine.ext import db, ndb
from google.appengine.ext import blobstore
from google.appengine.api import ... | hchapman/WBOR | models/base_models.py | base_models.py | py | 10,686 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "unicodedata.normalize",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"li... |
24143861243 | import pandas
import matplotlib.pyplot as plt
from fcmeans import FCM
from sklearn import metrics
from sklearn.metrics import silhouette_score
from sklearn.cluster import KMeans, SpectralClustering, AgglomerativeClustering
from sklearn.mixture import GaussianMixture
from scipy.cluster.hierarchy import dendrogram... | Yoavpich/Unsupervised-Learning-Semifinal-Assignment | ClusteringMethods.py | ClusteringMethods.py | py | 7,729 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotl... |
23375842198 | import os
import pandas as pd
import warnings
from datetime import datetime
from typing import Union, Tuple
from constants import Models
from utils import read_dataframe_input, filter_df_between
warnings.simplefilter("ignore")
class DataBuilder:
"""Class to interact with data model for budget
Attributes
... | coperyan/personal-budget-builder | personal_budget_tool/data.py | data.py | py | 12,475 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "warnings.simplefilter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "utils.read_dataframe_input",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "co... |
27054446626 | from PIL import Image
import os, sys
path = os.getcwd()
dirs = os.listdir( path )
def resize():
for item in dirs:
print(item)
if item.endswith('.png'):
im = Image.open(path+'/'+item)
f, e = os.path.splitext(path+'/'+item)
imResize = im.resize((480,344), Image.ANTIALIAS)
imResize.save(f + '_resized.pn... | nostalgia-cnt/vibe | helpers/resize.py | resize.py | py | 352 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "os.getcwd",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 11,
... |
18522315385 | import sys
from comtypes.client import CreateObject
engine = CreateObject("SAPI.SpVoice")
stream = CreateObject("SAPI.SpFileStream")
from comtypes.gen import SpeechLib
sys.argv.append('CleanCode_ch5.txt')
#engine = CreateObject("SAPI.SpVoice")
#stream = CreateObject("SAPI.SpFileStream")
outfile = input("Ent... | kalabquake/Projects | Python/TextToMP3/TextToMP3.py | TextToMP3.py | py | 651 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "comtypes.client.CreateObject",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "comtypes.client.CreateObject",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.argv.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name":... |
32512142058 | import logging.config
import tornado
import os
from tornado.options import define, options
define('port', default=5000, help="run on the given port", type=int)
define("config", default=None, help="tornado config file")
define("debug", default=False, help="debug mode")
tornado.options.parse_command_line()
f = open(o... | dhanzhelo/Throttler | throttler/settings.py | settings.py | py | 1,329 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tornado.options.define",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tornado.options.define",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tornado.options.define",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tor... |
30668937921 | import json
import os
import discord
from discord.ext import commands
from discord.utils import get
with open('config.json', 'r') as detailsFile:
details_data = json.load(detailsFile)
prefix = details_data.get('prefix')
class Welcome(commands.Cog):
def __init__(self, bot):
self.bot = bot
@c... | Code-Cecilia/BotMan.py-legacy | Cogs/welcome.py | welcome.py | py | 4,351 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "discord.E... |
30368830761 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^routes/$', views.dailyRoutes, name='dailyRoutes'),
url(r'^fees/$', views.feesTable, name='feesTable'),
url(r'^routeAllocation$', views.routeAllocations, name='routeAllocation'),
url(r'^v... | scroogeT/Decision-Support-System | dssWeb/urls.py | urls.py | py | 446 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
23234662840 | from flask import Flask
from flask_login import LoginManager
import os, functools
# create application
application = Flask(__name__)
application.secret_key = os.urandom(24)
# create and configure LoginManager object
login_manager = LoginManager()
login_manager.login_view = 'auth.login'
login_manager.init_app(applica... | benjaminaho/ChanceBlocks | application.py | application.py | py | 1,287 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_login.LoginManager",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "procedures.Query",
... |
36977617284 | import numpy as np
import math
import random
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.mlab as mlab
from scipy.integrate import odeint
#import matplotlib.animation as animation
#fig=plt.figure()
#fig.set_dpi(100)
#fig.set_size_inches(7,6.5)
#### Datos ... | Blitzman/physics | fisica_2/practica_1/espectrometro_g.py | espectrometro_g.py | py | 5,167 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.linspace",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.odeint",
"line_number": 121,
"usage_type": "call"
},
{
"api_name": "scipy.integrate.odeint",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "scipy... |
37847816240 | import numpy as np
from numpy.linalg import norm
import typing
from skimage.feature import peak_local_max
from defenses.detection.frequency.spectrum.utils import f_utils
from .ScoringStrategy import ScoringStrategy
class PeakDistanceStrategy(ScoringStrategy):
"""
Wrapper for different scoring strategies wh... | EQuiw/2023-detection-scalingattacks | scaleatt/defenses/detection/frequency/spectrum/scoring/PeakDistanceStrategy.py | PeakDistanceStrategy.py | py | 2,089 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "ScoringStrategy.ScoringStrategy",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "... |
11129159735 | import socket
import struct
import os
import threading
import time
import cv2
from PIL import Image,ImageFile
import cv2 as cv
import io
import numpy as np
import sys
from pynput import keyboard
ImageFile.LOAD_TRUNCATED_IMAGES = True # permit sending large file on multicast
MULTICAST_GROUP = '224.1.1.1'
SERVER_ADDRESS... | idan157001/multicast | receiver.py | receiver.py | py | 2,296 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFile",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "socket.socket",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "... |
1268144287 | from django.shortcuts import render, HttpResponse
from .task import test_func, send_func
from send_mail_app.task import send_mail_func
from django.core.mail import send_mail
# Create your views here.
import requests
import json
from send_mail_app.models import RegisteredUser
# Create your views here.
def home(request... | ManjulMittal/CF-rating | mainapp/views.py | views.py | py | 1,198 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "send_mail_app.models.RegisteredUser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.co... |
39212824458 | from aiogram import types
from aiogram.types import LabeledPrice
from loader import db
from utils.misc.product import Product
python_book = Product(
title="Biror bir mahsulot bo'lishi garak adi",
description="Mahsulotga to'lov qilish uchun quyidagi tugmani bosing.",
currency="USD",
prices=[
Lab... | bekzod818/eBozor-Bot | data/products.py | products.py | py | 1,643 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "utils.misc.product.Product",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "aiogram.types.LabeledPrice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "aiogram.types.LabeledPrice",
"line_number": 15,
"usage_type": "call"
},
{
"a... |
32759032952 | import torch
from diffusers import StableDiffusionInpaintPipeline
from PIL import Image
import pickle
# Load the model
pipe = StableDiffusionInpaintPipeline.from_pretrained(
"runwayml/stable-diffusion-inpainting"#,
# revision="fp16", #darsh custom
# torch_dtype=torch.float16 #darsh custom
)
pipe.safety_che... | Gazi10/snap-gui | server/flask/back-end/Inpainting/main.py | main.py | py | 1,048 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "diffusers.StableDiffusionInpaintPipeline.from_pretrained",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "diffusers.StableDiffusionInpaintPipeline",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 20,
"usag... |
43423849818 | import unittest
from io import StringIO
from weblogo.seq_io import plain_io, table_io
class test_table_io(unittest.TestCase):
def test_read(self) -> None:
f = StringIO(table_io.example)
seqs = table_io.read(f)
self.assertEqual(len(seqs), 10)
self.assertEqual(seqs[2].name, "EC0003"... | WebLogo/weblogo | tests/test_table_io.py | test_table_io.py | py | 842 | python | en | code | 128 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "weblogo.seq_io.table_io.example",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "... |
74734609640 | from flask import Flask, render_template, request, flash, Response, url_for
import json
import pickle
import pandas as pd
import numpy as np
from appFunctions import *
import os
from dotenv import load_dotenv
load_dotenv()
app = Flask(__name__)
app.secret_key=os.getenv('FLASK_SECRET')
datasets=get_datase... | ReginaldLeigh/recipeRecommendations | app.py | app.py | py | 1,886 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number... |
43188133270 | """Jinja filter functions for use in configuration templates"""
import base64
import hashlib
import ipaddress
import re
from typing import Any, Callable, Optional, Union
# This global dict can be used to update the Jinja environment filters dict to include all
# registered template filter function
FILTERS = {}
def ... | SUNET/cnaas-nms | src/cnaas_nms/tools/jinja_filters.py | jinja_filters.py | py | 6,579 | python | en | code | 66 | github-code | 18 | [
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "ipaddress.IPv6Address",
... |
41763654448 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import urllib.request
import yaml
import sys
import html
import re
from bs4 import BeautifulSoup
from lxml import html
from libhtml import cleanSectionName, cleanProperty, cleanName, html2text, getValidSource, mergeYAML
URL = "https://www.pathfinder-fr.org/Wiki/Pathfinder-R... | SvenWerlen/pathfinderfr-data | scraping/extract-heroic.py | extract-heroic.py | py | 3,577 | python | fr | code | 7 | github-code | 18 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_... |
5732576049 | import logging
import re
from aiogram import Bot, Dispatcher, executor, types
from what_is_tak_bot.config import settings
# Configure logging
logging.basicConfig(format=settings.LOG_FORMAT, level=settings.LOG_LEVEL)
logger = logging.getLogger(__name__)
# Initialize bot and dispatcher
bot = Bot(token=settings.BOT_TO... | aK0nshin/what-is-tak-bot | what_is_tak_bot/main.py | main.py | py | 2,062 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "what_is_tak_bot.config.settings.LOG_FORMAT",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "what_is_tak_bot.config.settings",
"line_number": 9,
"usage_type": "name... |
38267055333 | # -*- coding: utf-8 -*-
"""
@author: Daniel
@contact: 511735184@qq.com
@file: util.py
@time: 2017/5/31 16:08
"""
import os
import codecs
import json
import yaml
from utils.i18n import gettext
def load_config(config_path, loader=yaml.Loader):
if config_path is None:
return {}
if not os.path.exists(con... | hhuhhu/trade | util.py | util.py | py | 837 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "yaml.Loader",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "utils.i18n.gettext",
... |
28709810921 | # Create your views here.
from django.shortcuts import render
from django.http.response import JsonResponse
from rest_framework import status
from .serializer import TokensSerializer
from .models import Tokens
from rest_framework.decorators import api_view
from rest_framework.generics import get_object_or_404
from djan... | vkpillania/tokens | random_tokens/views.py | views.py | py | 4,715 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "secrets.token_hex",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "serializer.TokensSerializer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.http.response.JsonResponse",
"line_number": 19,
"usage_type": "call"
},
{
"a... |
3011046468 | import requests
from local.secrets import TIMESTATION_API_KEY
class Client:
DEFAULT_OPTIONS = {
'base_url': 'https://api.mytimestation.com/v1.1/',
}
def __init__(self, session=None, auth=None, **options):
self.session = session or requests.Session()
self.auth = auth
sel... | drkinder/TimeStationPythonSDK | client.py | client.py | py | 2,199 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.Session",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_... |
31490627844 | import cv2
import numpy as np
import face_recognition
import os
class FaceRec:
def __init__(self, path):
images = []
self.avgfd = []
self.classNames = []
myList = os.listdir(path)
print(myList)
for cl in myList:
curImg = cv2.imread(f'{path}/{cl}')
... | JJangMos/video-meeting | Client/face_recog.py | face_recog.py | py | 1,677 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
17566095698 | # Stdlib imports
# Core Django imports
from django.contrib.auth import get_user_model
from django.contrib.gis.db import models
from django.contrib.postgres.fields import CICharField
from django.db.models.signals import m2m_changed
from django.dispatch import receiver
from django.utils.translation import gettext_lazy as... | julienpaul/django-weathervis | src/stations/models.py | models.py | py | 5,589 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.contrib.gis.db.models.Model",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.gis.db.models",
"line_number": 22,
"usage_type"... |
39733016496 | """
Project by Clinton Anani
A simple intro to openCV
This project demonstrates reading images and videos, as
well as writing them to local storage
github: yendiDev
email: kceequan01@gmail.com
"""
import cv2
# load image
img = cv2.imread('lena.jpg', -1)
# show image
# cv2.imshow('Lena Image', img)
# cv2.waitKey(20... | yendiDev/Reading-Writing-Images-OpenCV | main.py | main.py | py | 1,196 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PRO... |
41495660680 | from typing import Optional
class FhirSenderException(Exception):
def __init__(
self,
exception: Exception,
url: str,
json_data: str,
response_text: Optional[str],
response_status_code: Optional[int],
message: str,
) -> None:
self.exception: Exce... | icanbwell/SparkPipelineFramework | spark_pipeline_framework/utilities/fhir_helpers/fhir_sender_exception.py | fhir_sender_exception.py | py | 542 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "typing.Optional",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
}
] |
23275999989 | # -*- coding: utf-8 -*-
import calendar
import stripe
from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.translation import ugettext as _
from .models import BillingSettings, Plan
from .factories import Billing... | dwebdevcore/BoardDirector_dashboard | apps/billing/tests.py | tests.py | py | 10,884 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "common.utils.BaseTestCase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "factories.BillingSettingsFactory",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "factories.InvoiceFactory",
"line_number": 23,
"usage_type": "call"
},
{
... |
71938051881 | # -*- coding: utf-8 -*-
import cv2,os
import copy
import numpy as np
from lmfit.models import GaussianModel, LorentzianModel, LinearModel, PolynomialModel
from lmfit.printfuncs import getfloat_attr
def np_resize_max_size(img,max_size):
height, width, channel = img.shape
# magnify image size
tar... | JoeyChennn/TennisPoint | lib_tennis.py | lib_tennis.py | py | 7,362 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "cv2.resize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_LINEAR",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.circle",
"line... |
9646353800 | import redis
import random
# 连接redis
# r = redis.StrictRedis(host='localhost', # 主机ip
# port=6379, # 端口
# db=0, # 数据库索引
# password="", # 密码
# decode_responses=True) # 设置解码,因为使用get()方法获取出来的值是一个字节类型,这个设置为get()方法获取的值是字符串类型
# 使用连接... | pandatools/getbilibili | redistest.py | redistest.py | py | 664 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "redis.StrictRedis",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
}
] |
1675908008 | from django.contrib import admin
from django.urls import include, path, re_path
from rest_framework import routers
from meraki.core.views import UserViewSet, GroupViewSet
from product.views import CategoryViewSet, ProductViewSet
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from dr... | SphericalKat/meraki | meraki/urls.py | urls.py | py | 1,341 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "drf_yasg.views.get_schema_view",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi.Info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "drf_yasg.openapi",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": ... |
29111182959 | import os
import config
import pandas as pd
import utils
from sklearn.metrics import mean_squared_error
class ErrorReviewer(object):
def __init__(self):
self.full_results = self.load_results()
self.calculate_errors()
self.biggest_errors = self.get_biggest_errors()
self.in... | gabriellamiles/Eye_Centre_Localisation_V2 | src/models/review_training_process.py | review_training_process.py | py | 4,350 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 39,
"usage_type": "call"
},
{
... |
14245844918 | import datetime as dt
import logging
import os.path
import sqlite3
import typing as tp
from contextlib import closing
class Database:
def __init__(self):
self.logger = logging.getLogger('discord')
self.connection_url: str = os.path.abspath(os.path.join('db', 'corgi.db'))
self.server_id_co... | Duke02/Corgi-Discord-bot | database.py | database.py | py | 6,012 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path",
... |
651007250 | from django import forms
from django.db.models import fields
from django.forms import widgets
from .models import Artikel, Comment
class ArtikelForms(forms.ModelForm):
class Meta:
model = Artikel
fields = ('judul', 'body', 'kategory', 'img')
widgets = {
"judul" : forms.TextInpu... | reykaralo/filemcu | blog/forms.py | forms.py | py | 1,506 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.Artikel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models... |
70599448999 | import argparse
from random import randrange
from multiprocessing import Process, Array
parser = argparse.ArgumentParser()
parser.add_argument("--input_file")
args = parser.parse_args()
def mergeSort(arr):
mergeSort_(0, arr, 0, len(arr)-1)
def mergeSort_(id, arr, i, j):
if j-i > 0:
median = (i+j) // ... | litcoderr/AlgorithmArchive | 4.sorting/python/main.py | main.py | py | 1,826 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
20607197193 | import flask
from flask import Flask, render_template, request
from lib.preprocessing import *
val_dict = {'Gender': {'NaN': 1, 'male': 1, 'female': 0},
'Married': {'NaN': 1, 'yes': 1, 'no': 0},
'Dependents': {'NaN': 1},
'Education': {'NaN': 1, 'graduated': 1, 'not graduated': 0},
... | ShanmukhP/Loan_Approval_Prediction | webapp/app.py | app.py | py | 2,049 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
38507011502 | from collections import Counter
def canConstruct(ransomNote: str, magazine: str) -> bool:
c1, c2 = Counter(ransomNote), Counter(magazine)
# Counts the number of times a specific letter matched
count = 0
for letter in ransomNote:
# Count only characters lower than letters in magazine
... | tabers77/LeetCode | Python excersises/383. Ransom Note.py | 383. Ransom Note.py | py | 570 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 5,
"usage_type": "call"
}
] |
3681577391 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import find_packages
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['pytz']
setup_... | redkoi2/jsoner | setup.py | setup.py | py | 1,737 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 43,
"usage_type": "call"
}
] |
4820168232 | """
1060. Missing Element in Sorted Array
Given an integer array nums which is sorted in ascending order and all of its elements are unique and given also an integer k, return the kth missing number starting from the leftmost number of the array
Example1:
Input: nums = [4, 7, 9, 10], k = 1
Output: 5
Explanation: The f... | tkwang0530/LeetCode | 1060.py | 1060.py | py | 2,073 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "unittest.main",
"line_number": 76,
"usage_type": "call"
}
] |
261689023 | from django.urls import path
from . import views
urlpatterns = [
path('power/<int:input_number>', views.first_task, name='firstTask'),
path('multiply/<int:first_number>/<int:second_number>', views.second_task, name='secondTask'),
path('primes/<int:first_number>/<int:second_number>', views.third_task, name=... | mohvari/Django_Course | mathapp/urls.py | urls.py | py | 496 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
812218869 | import torch.nn as nn
from collections import OrderedDict
import torch
import torch.nn.functional as F
import torchvision
import math
class VGGFeatureExtractor(nn.Module):
def __init__(self,
feature_layer=34,
use_bn=False,
use_input_norm=True,
dev... | lizhangray/MTKDSR | Model/block.py | block.py | py | 16,975 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torchvision.models.vgg19_bn"... |
13632651444 | # coding:utf-8
'''
表格生成线条坐标
'''
import cv2
import numpy as np
import os
import pytesseract
import uuid
# 图像切割模块
class cutImage(object):
def __init__(self, img, **settings):
'''
:param img: 输入图像
:param bin_threshold: 二值化的阈值大小
:param kernel: 形态学kernel
:param iterations: 迭代次数... | chen1tian/pdf2tables | pdf2tables/image_tables.py | image_tables.py | py | 11,305 | python | en | code | 13 | github-code | 18 | [
{
"api_name": "numpy.ones",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "cv2.circle",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number... |
26148339120 | import serial
import paho.mqtt.client as mqtt
# MQTT 브로커 설정
broker_address = 'test.mosquitto.org' # MQTT 브로커 주소
broker_port = 1883 # MQTT 브로커 포트
# Arduino 시리얼 포트 설정
port = 'tty.usbserial-1130' # Arduino가 연결된 포트 이름
baudrate = 9600 # 시리얼 통신 속도
def on_connect(client, userdata, flags, rc):
print('Connected to M... | ahhnchangjun/capstone_design | mqtt_publisher.py | mqtt_publisher.py | py | 1,266 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "serial.Serial",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client.Client",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "serial.SerialE... |
37669192079 | import json
from flask import Flask, request, Response
from azure.eventhub import EventHubClient, Offset
from ast import literal_eval
import logging
import cherrypy
import os
from uamqp import types, errors
app = Flask(__name__)
logger = logging.getLogger('service')
logging.basicConfig(level=logging.ERROR)
# Access ... | sesam-community/azure-eventhub-source | azure-event-hub-master/service/service.py | service.py | py | 2,820 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
... |
69821527721 | from django.http import HttpResponse
from .models import OrderInformation, OrderLineItem
from products.models import Product
from profiles.models import UserProfile
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.conf import settings
import json
import time
class... | RyanLovell89/Top-Football | checkout/webhook_handler.py | webhook_handler.py | py | 6,111 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.template.loader.render_to_string",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.template.loader.render_to_string",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.DEFAULT_FROM_EMAIL",
"line_number": 28,
... |
11465864345 | import os
import requests
from app.utils import load_json_file
def get_expressions_data(source):
files = os.listdir(source)
for filename in files:
file_item = os.path.join(source, filename)
if filename == 'expressions.json':
return load_json_file(file_item)
return None
def... | bothub-it/bothub-accuracy-evaluator | app/wit.py | wit.py | py | 978 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "app.utils.load_json_file",
"l... |
26856720935 | #!/usr/bin/python3
"""sends a request to the URL and displays
the body of the response."""
import requests
from sys import argv
if __name__ == "__main__":
val = requests.get(argv[1])
if val.status_code >= 400:
print("Error code: {}".format(val.status_code))
else:
print(val.text)
| duvanjm/holbertonschool-higher_level_programming | 0x11-python-network_1/7-error_code.py | 7-error_code.py | py | 311 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "name"
}
] |
32169839390 | import os
import sys
import time
import pygame
import torch
from simple import MaxAgent
import numpy as np
import random
from gymenv import MancalaEnv
from deepq import MancalaAgentModel, DeepQAgent, MaxQStrategy
'''
Sometimes select a random action
0 -> always follow agent policy
1 -> fully random
'''
RANDOMIZE_ACT... | muellerberndt/mancala-deepq | agent_vs_agent.py | agent_vs_agent.py | py | 2,788 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "numpy.flip",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 49,
... |
15807965582 | ############################################################
# -*- coding: utf-8 -*-
#
# # # # # # ####
# ## ## # ## # #
# # # # # # # # # ###
# # ## # ## ## #
# # # # # # ####
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 ... | sayitfast/MountWizzard3 | mountwizzard3/imaging/maximdl_camera.py | maximdl_camera.py | py | 7,609 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QMutex",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "platform.syst... |
75168699241 | from setuptools import find_packages, setup
with open('README.rst', 'r') as f:
readme = f.read()
setup(
name='cueillette',
packages=find_packages(exclude=['docs', 'tests*']),
version='0.1.0',
description=(
"Access content from websites who have a fucking proprietary API,"
" or webs... | ducdetronquito/cueillette | setup.py | setup.py | py | 575 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 8,
"usage_type": "call"
}
] |
21395730421 | import sys
import pygame
from blocks import Block
from time import sleep
def check_keydown(event, bird):
if event.key == pygame.K_UP:
bird.moving_up = True
if event.key == pygame.K_DOWN:
bird.moving_down = True
def check_key_up(event, bird):
if event.key == pygame.K_UP:
... | juer-joker/Bird-game | functions.py | functions.py | py | 2,119 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.K_UP",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_DOWN",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_UP",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_DOWN",
... |
14068899410 | from PIL import Image, ImageOps, ImageFont, ImageDraw
from google.cloud.vision import AnnotateImageResponse
import os
import cv2
import imutils
import numpy as np
import json
import pdfplumber
# ------------ Global Tools ------------ #
def pretty_save_json(file: str, data: dict) -> None:
with open(fil... | ModzabazeR/DocJuice | utils.py | utils.py | py | 5,473 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.dump",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pdfplumber.open",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number... |
18052149116 | import wx
from myglcanvas import myGLCanvas
from renderer import Renderer
class MouseEventHandler:
def __init__(self, frame):
self.frame = frame
self.old_x = 0
self.old_y = 0
def on_mouse_motion(self, event):
new_x, new_y = event.GetPosition()
if event.Dragging():
... | VonZeeple/Anno1800-Model-Viewer | gui.py | gui.py | py | 6,745 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "wx.DirDialog",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "wx.DD_DEFAULT_STYLE",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "wx.ID_OK",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "wx.FileDialog",
... |
22806734945 |
import json, csv, io, codecs, os, docx, re, urllib3
from bs4 import BeautifulSoup
csv_dir = './csv'
files = [
{'filename': 'FSCB_High.csv', 'Impact': 'High'},
{'filename': 'FSCB_Moderate.csv', 'Impact': 'Moderate'},
{'filename': 'FSCB_Low.csv', 'Impact': 'Low'}
]
def find_enhancement_by_control_id(id... | louissimps/fedramp_parser | cleanup_csv.py | cleanup_csv.py | py | 7,564 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "re.split",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "re.split",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number... |
34212437089 | import io
import sys
_INPUT = """\
963761198400
"""
sys.stdin = io.StringIO(_INPUT)
n = int(input())
ans = 0
i = 1
while i*i <= 2*n:
if 2*n%i == 0:
x = i
y = 2*n//i
if x % 2 != y % 2:
ans += 2
i += 1
print(ans)
| kkchart9/atcoder | ABC/190_d.py | 190_d.py | py | 261 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 7,
"usage_type": "call"
}
] |
7536823439 | import datetime
import json
import os
import random
import uuid
import boto3
import requests
from api import util
boto3.setup_default_session(region_name="sa-east-1")
dynamodb = boto3.client("dynamodb")
table_name = os.environ["ORDER_TABLE"]
warehouse_api = os.environ["WAREHOUSE_API"]
def lambda_handler(event: dic... | mateoSerna/playvox-core-restaurant | core-kitchen/api/create_order.py | create_order.py | py | 1,853 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.setup_default_session",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",... |
29197887119 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 2 13:33:42 2021
@author: gamet
"""
from stock_frame_pull import *
import matplotlib.pyplot as plt
import time
import os
clear=lambda:os.system('cls')
tickers=input('What tickers would you like to watch? : ').upper().split(' ')
def keyword_check(tickers):
placehold... | frostcow0/python-projects | general_data/stocks/stockmarket.py | stockmarket.py | py | 2,609 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.system",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"... |
9684446980 | # this script performs a manual training process on the XNLI dataset to enable more control
from args import parse_args
import logging
import os
import paddle
from experiments.xnli.xnli_utils import XNLI_Dataset, convert_examples, convert_example
from infoxlm_paddle import (
InfoXLMTokenizer,
InfoXLMModel,
... | jiamingkong/infoxlm_paddle | trainer_manual.py | trainer_manual.py | py | 10,900 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
19073383403 | from cffi import FFI
ffibuilder = FFI()
ffibuilder.set_source(
"_hello",
"""
#include <hello.h>
""",
extra_objects=["build-meson/libhello.a"],
include_dirs=["."],
)
ffibuilder.cdef("""
int answer(void);
char* greet(void);
""")
if __name__ == "__main__":
ffibuilder.compile(verbose=True)
| dmerejkowsky/hello-cffi | build_hello.py | build_hello.py | py | 319 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "cffi.FFI",
"line_number": 2,
"usage_type": "call"
}
] |
35219118555 | import pandas as pd
from alpha_vantage.timeseries import TimeSeries
from functools import reduce
# We can pull technical indicators as well from alpha_vantage using alpha_vantage.technicalindicators
# The equities we want
tickers = ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'FB']
# Your key here
key = 'TUFG6CJ46YJKR38I'
# Chos... | zawwarkamran/Project | data_file.py | data_file.py | py | 1,682 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "alpha_vantage.timeseries.TimeSeries",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 31,
"usage_type": "call"
}
] |
2411044587 | # -*- coding: utf-8 -*-
"""
Created on Mon May 6 11:10:35 2019
@author: Hima_Gundlapalli
"""
import requests
from flask import Flask,request,make_response
import os,json
import re
app = Flask(__name__)
#To be modified based on the process to run
releaseKey = None
robotId = None
@app.route('/webhoo... | infystp/Orchestrator_API | OrchestratorAPI.py | OrchestratorAPI.py | py | 7,114 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"li... |
42629274933 | from functools import reduce
import os
from typing import List
from uuid import uuid4
from generation.GenerationConfiguration import GenerationConfigurationDto
from environment import END_TIME_OFFSET, tmp_dir
from subprocess import check_call
import logging
from common.SentenceInfo import SentenceInfo
from .ffmpeg_hel... | GeorgeF23/video_generator | src/video_generator/generation/generation.py | generation.py | py | 1,651 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "common.SentenceInfo.SentenceInfo",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "functools.reduce",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "generat... |
23244075068 | import argparse
import time
import torch
from torch import nn
from modules.gpt_modules import GPTTransformerLayer
def benchmark_transformer_layer_load_save(args, device):
module_list = []
for _ in range(args.num_layers):
module_list.append(GPTTransformerLayer(args.embedding_dim, args.num_heads,
... | FMInference/DejaVu | Decentralized_FM_alpha/unit_tests/micro_benchmark_transformer_load_save.py | micro_benchmark_transformer_load_save.py | py | 3,519 | python | en | code | 86 | github-code | 18 | [
{
"api_name": "modules.gpt_modules.GPTTransformerLayer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "... |
38566438891 | import json
class CDS:
def __init__(self):
try:
with open("cds.json", "r") as f:
self.cds = json.load(f)
except FileNotFoundError:
self.cds = []
try:
with open("favorites_cds.json", "r") as f:
self.favorites_cds = json.lo... | adis5433/cd_collection_api | models.py | models.py | py | 1,344 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 50,
"... |
24003962486 | import csv
import vobject
class Astreint:
"""Somebody conscripted to civil protection"""
def __init__(self, row):
self.name = row[0]
self.first_name = row[1]
self.function = row[2]
self.phone = row[3]
def as_vcard(self):
j = vobject.vCard()
j.add('n')
... | sebug/astreints-import | create_vcards.py | create_vcards.py | py | 1,098 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "vobject.vCard",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "vobject.vcard.Name",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "vobject.vcard",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "csv.reader",
... |
72655124199 | from random import choice
from flask import url_for
from pytest import mark
from shorter.start.environment import CRAWLERS
ENDPOINT = "side.robots"
EP_FVICO = "side.favicon"
EP_IMAGE = "side.logo"
EP_INDEX = "main.index"
EP_PAGES = "side.page"
EP_SHORT = "main.short"
@mark.usefixtures("session")
class TestSideRobo... | spookey/shorter | tests/views/test_side_robots.py | test_side_robots.py | py | 1,228 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "flask.url_for",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pytest.mark.usefixtures",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "flask.url_for",
... |
40374697237 | from datetime import datetime as dt
class DateTime:
"""
Class represent a date-time object.
"""
req_fields = ("year", "month", "day", "hour", "minute", "second")
# private methods =============================================================
def __init__(self, year=None, month=None, day=None, ... | psv-git/labs | KPO/Lab5/date_time.py | date_time.py | py | 7,842 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 121,
"usage_type": "argument"
},
{
"api_name": "date... |
27521210208 | import torchvision.models
import torch
from torch import nn
class PerceptualLoss():
def __init__(self, aux_loss_fn=nn.MSELoss(), lam=0.006):
self.aux_loss_fn = aux_loss_fn
self.lam = lam
def contentFunc(self):
conv_3_3_layer = 14
cnn = torchvision.models.vgg19(pretrained=T... | cianhwang/bigpic_sr | losses.py | losses.py | py | 1,364 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.MSELoss",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torchvision.models.models.vgg19",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torchvision.m... |
9065528996 | from fastapi import FastAPI,Body,status
from .models import PostSchema,UserLoginSchema,UserSchema
from .auth.auth_handler import signJWT
from typing import List
app=FastAPI()
posts=[
{
"id":1,
"title":"JWT Authentication with FastAPI",
"content":"Lorem Ipsum whatever"
}
]
users=[]
... | jod35/fastapi-JWT-authetication | app/api.py | api.py | py | 1,476 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.UserSchema",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "models.PostSchema",
... |
43002114389 | """Module containing the logic for XML instance as dot object"""
from xml.etree import ElementTree
from dgspoc.utils import DotObject
class DotElement(ElementTree.Element):
def __init__(self, tag, attrib=None, **extra):
attrib = attrib or {}
if 'raw_element' in extra:
self.raw_elem... | Geeks-Trident-LLC/dgspoc | dgspoc/dotxml.py | dotxml.py | py | 8,926 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "xml.etree.ElementTree.Element",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dgspoc.utils.DotObject",
"line_number": 27,
"usage_type": "call"
},
{
"api... |
438104512 | """ Handles processing calibration grids """
import cv2
import numpy as np
TEST_GRID = 'C:\\Users\\smerk\\Pictures\\10--_1537.tif'
img = cv2.imread(TEST_GRID)
img = cv2.resize(img, (500, 500))
cv2.imshow('okay', img)
mean = np.mean(img)
img = cv2.medianBlur(img, 5)
cont = np.clip(((img.astype(np.int32) - mean) * 10) ... | smerkousdavid/membrane-analysis | structure/analysis/calibration_grid.py | calibration_grid.py | py | 464 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 10,
... |
12590572251 | from random import choice
from random import randint
import time
import sys
import pyfiglet
from speech import print_speech
from clear import clear_screen
from tabulate import tabulate
## Classes ##
# The Character Class has 6 attributes: name, age, shape, tries, coins and result.
# The shape determins ... | ellyrose/Digiland-command-line-game- | digiland.py | digiland.py | py | 58,757 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.sleep",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "speech.print_speech",
"line_numb... |
34849829897 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 15 16:08:25 2021
@author: whmcilha
Drawing a triangle in opengl with vertex attribute (colour)
"""
import pyglet
from pyglet import gl
import pyshaders
from cauldron import VertexArrayObject
window = pyglet.window.Window(width=600, height=600)
# SHADERS - color and lo... | w-mcilhagga/opengl | triangles/triangle2/triangle2.py | triangle2.py | py | 1,576 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyglet.window.Window",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyglet.window",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pyshaders.from_string",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "cauldro... |
13478761753 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import cv2
import random
import tensorflow as tf
import tflearn
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers import regression
from tflearn.data_utils i... | khangpropk123/handwriting-detection | ProcessImg.py | ProcessImg.py | py | 6,600 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "tflearn.layers.core.input_data",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tflearn.layers.conv.conv_2d",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tflearn.layers.conv.max_pool_2d",
"line_number": 26,
"usage_type": "call"
},... |
72895396519 | import glob
import json
from pathlib import Path
import pytest
PATH = Path(__file__)
TEST_DIR = PATH.parent
ALL_CONFIGURATION_FILES = glob.glob(str(TEST_DIR) + "/data/configurations/*.txt")
ALL_TOKEN_FILES = glob.glob(str(TEST_DIR) + "/data/tokens/*.json")
SET_CONFIGURATIONS = [filepath for filepath in ALL_CONFIGURATI... | saidvandeklundert/premonition | test/conftest.py | conftest.py | py | 2,510 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 13,... |
11536866965 | import numpy
from lookup_table import LookupTable
from lswt_quality_check import QualityCheck
from lswt_quality_check_mono import QualityCheckMono
from utils import Utils
from mono import Mono
from snappy import jpy
Float = jpy.get_type('java.lang.Float')
class SplitWindowAlgo:
def __init__(self, a0, a1, a2, a3... | odermatt/snap-musenalp | src/main/python/lswt_algo.py | lswt_algo.py | py | 5,904 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "snappy.jpy.get_type",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "snappy.jpy",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_... |
34841106404 | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import pytorch_lightning as pl
from backbones.resnet import ResNet, ResidualBlock
from utils import save_example
class ObjectDetector(pl.LightningModule):
def __init__(self, save_imgs=False):
super().__init__... | oleksiiudod/ad-nn-workshop | Task2_Car_Detector_Answers/module.py | module.py | py | 4,754 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "backbones.resnet.ResNet",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "backbones.resnet.ResidualBlock",
"line_number": 25,
"usage_type": "argumen... |
14618904798 | from __future__ import absolute_import, division, print_function
"""
eg danex full.cert.getdnsapi.net 443 tcp
"""
import sys
from twisted.internet import task, threads, defer
from . import _dane, _tls
def printResult(res):
(trusted, tlsaRecords), serverCertificate = res
numRecs = len(tlsaRecords)
pri... | hynek/tnw | danex/__main__.py | __main__.py | py | 1,441 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "twisted.internet.defer.gatherResults",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "twisted.internet.defer",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "twisted.internet.threads.deferToThread",
"line_number": 46,
"usage_type": "ca... |
23414252544 | import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
import webbrowser
import os
import smtplib
mail_contacts = {'admin': 'abcdef@yahoo.com', 'dad': 'xyze@gmail.com'}
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
engine.... | Dr-Groot/Little-Jarvis | main.py | main.py | py | 4,006 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pyttsx3.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "speech_reco... |
26419095690 | #!./venv/bin/python
import time
import numpy as np
# import matplotlib.pyplot as plt
import asyncio
from time import *
from serial import Serial
from random import randrange
from pyramid import *
from dodecahedron import *
from enum import IntEnum
from time import time
from math import sqrt
import random
from head impo... | simonuks221/13.7-commander-sbc-feature-white | main.py | main.py | py | 1,937 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "serial.Serial",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "random.randint",
"lin... |
198490163 | import requests
from bs4 import BeautifulSoup
import json
url = "https://www.ptt.cc/bbs/Gossiping/index.html"
#只有首次點選才會post cookie
form_data={
'from': '/bbs/Gossiping/index.html',
'yes' : 'yes'
}
#session->在此程式中持續記住header的東東
#基本參數
r = requests.session()
#詢問是否18頁網址 點選'是'後會post一個from_data 把這個dat... | shiro-wang/Ptt_crawler | ptt/pttcrawler.py | pttcrawler.py | py | 4,526 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSou... |
15324825439 | from collections import defaultdict
from re import L
import main
class Graph:
def __init__(self, sz):
self.sz = sz
self.graph = defaultdict(list)
self.matrix = [] * sz
for i in range(sz):
temp = [0] * sz
self.matrix.append(temp)
def add_edge(self, u, v):
self.graph[u].append(v)
self.matrix[u][v] =... | sarapmagcode/Patrick-Star-DSA-System | Python/graph.py | graph.py | py | 2,715 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "main.prompt",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "main.generate_menu_header",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "main.pro... |
29492218945 | from tuning import Tuning
import usb.core
import usb.util
import time
import sounddevice as sd
import numpy as np
import socket
# now support python 3
# adding networking
#V0.1
"""
requires
sudo apt-get install libportaudio2
sounddevice
numpy
pyusb
"""
#config
addr = ("192.168.1.67", 12000)
average_val = .8
#m... | gittb/Seismic-Data-FollowUp | v01/client.py | client.py | py | 1,451 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "socket.socket",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "usb.core.cor... |
17939424833 | import pandas as pd
from alpha_vantage.timeseries import TimeSeries
import time
import stockanalysis
api_key = "3UJ0X4P2FAGE2DOV"
timeSeries = TimeSeries(key = api_key, output_format='pandas')
data = timeSeries.get_daily(symbol = [0], outputsize='compact')
stockdata = stockanalysis.processlist()
for i in ra... | yashchellani/SimuVest | dbStuff/alphavantage API sample.py | alphavantage API sample.py | py | 652 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "alpha_vantage.timeseries.TimeSeries",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "stockanalysis.processlist",
"line_number": 9,
"usage_type": "call"
}
] |
24653559828 | import argparse
from loguru import logger
from tweepipe import settings
from tweepipe.db import db_schema
from tweepipe.legacy import client
def main(env_file):
"""Run the hydration process with the legacy client."""
settings.load_config(env_file=env_file)
datasets = ["panacea", "echen", "geocov"]
... | sachalevy/tweepipe | example/covid_datasets/download_tweets.py | download_tweets.py | py | 1,146 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tweepipe.settings.load_config",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tweepipe.settings",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "tweepipe.legacy.client.Client",
"line_number": 15,
"usage_type": "call"
},
{
"api... |
75026195879 | # -*- coding: utf-8 -*-
"""
@Time : 2021/12/15 23:21
@Auth : maomao
@File :jyu疫情.py
@IDE :PyCharm
@Motto:ABC(Always Be Coding)
"""
import re
import random
import base64
list_nv = ['黄若菡', '张盼灵', '陈语蓉', '黄巧晴', '黄芷梦', '黄晓萱', '黄紫汶']
list_nan = ['黄昭南', '黄玄羽', '黄泽禹', '黄绅绮', '黄沐锋', '黄志文', '黄翔宇']
nanNAME = list_nan[random.ra... | Charles-Hello/jyu_scripts | epidemic_random.py | epidemic_random.py | py | 823 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.