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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72634199903 | import asyncio
from collections import namedtuple
import asyncpg
from asyncpg.pool import Pool
import logging
from decimal import Decimal
import yaml
from typing import List, Tuple, Dict, T, NamedTuple
from datetime import datetime, timedelta, timezone
from importlib import import_module
from dateutil import parser
imp... | ilyeong-minset/crypto_volume_stats | server/db.py | db.py | py | 7,780 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.NamedTuple",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "struct.pack",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "asyncpg.pool.Pool",
"... |
14023770757 | import inspect
from typing import Union
from .. import _LOGGER
from ..const import (
TEXT_UNKNOWN,
WISERDEVICE,
WiserAwayActionEnum,
WiserDeviceModeEnum,
WiserShutterAwayActionEnum,
)
from ..helpers.misc import is_value_in_list
from ..helpers.signal import _WiserSignalStrength
from ..rest_controlle... | msp1974/aioWiserHeatAPI | aioWiserHeatAPI/helpers/device.py | device.py | py | 7,723 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "rest_controller._WiserRestController",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "const.WISERDEVICE.format",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "const.WISERDEVICE",
"line_number": 41,
"usage_type": "name"
},
{
"a... |
28781132222 | from django.shortcuts import render, redirect
from .helpers import load_books_from_file, save_books_to_file, delete_book_from_file,get_book_index_by_id,search_books_in_file
from .models import Book
from django.shortcuts import redirect, HttpResponse
def book_list(request):
books = load_books_from_file()
return... | Buddhila/libraryManagement | LibraryManagement/library/views.py | views.py | py | 1,794 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "helpers.load_books_from_file",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "helpers.load_books_from_file",
"line_number": 18,
"usage_type": "call"
},
{
"a... |
70540698145 | import random
import math
import logging
import torch
import torch.nn as nn
import numpy as np
import networkx as nx
import pandas as pd
import pprint
from typing import List, Tuple, Dict, Union
from ..base import *
from .link_state import *
from ...constants import DQNROUTE_LOGGER
from ...messages import *
from ...me... | flyingleafe/dqnroute | src/dqnroute/agents/routers/dqn.py | dqn.py | py | 9,336 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "constants.DQNROUTE_LOGGER",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "torch.nn.... |
41088621971 | from uuid import UUID
from fastapi import Depends
from warehouse.api_client.client import WarehouseGeneralClient
from warehouse.models.warehouse import WarehouseListFilters, WarehouseModel
from svc.api.errors.warehouse import WarehouseNotFoundError
from svc.infrastructure.warehouse.models import WarehouseShortModel
... | VyachAp/FastAPISample | svc/infrastructure/warehouse/warehouse_manager.py | warehouse_manager.py | py | 1,623 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warehouse.api_client.client.WarehouseGeneralClient",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "warehouse.api_client.client.WarehouseGeneralClient.instance",
"line_number... |
71596445342 | #!/usr/bin/env python
"""PatternCalibration Detection Tests
use `python -m plant_detection.tests.test_pattern_detection /images/`
For Plant Detection.
"""
import os
import sys
import cv2
import numpy as np
from plant_detection.PatternCalibration import PatternCalibration
def result(found):
'Generate result tex... | gabrielburnworth/plant-detection | plant_detection/tests/test_pattern_detection.py | test_pattern_detection.py | py | 1,977 | python | en | code | 65 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
69957643745 | # 1. Імпортувати модуль pygame
import pygame
# 2. Імпортувати модуль os
import os
# 3. Імпортувати модуль random
import random
# 4. Ініціалізувати налаштування pygame
pygame.init()
# 5. Створити функцію create_path, що знаходить абсолютний шлях до файлу.
# Застосовуємо модуль os.path та його методи abspath(), join()
de... | dimasribnyj14/HomeWorksDimaSribnyj | Practice/Second Course Logika/lesson_pygame_three.py | lesson_pygame_three.py | py | 4,030 | python | uk | code | 2 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_numb... |
42841522959 | """ aoc_03_2.py
Solution for Advent of Code 2017 day 03 part 2
"""
import itertools
import aoc_03_input
def get_square(num):
''' get_square(num)
Return the numth square in the spiral.
'''
return list(generate_spiral(num))[num-1]
def generate_spiral(max_square):
''' spiral(max_square)... | ulel/advent_of_code | 2017/03/aoc_03_2.py | aoc_03_2.py | py | 2,795 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.product",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "aoc_03_input.get_input",
"line_number": 100,
"usage_type": "call"
}
] |
43539637043 | from PySide2.QtGui import QFontMetrics, QTextCursor
from PySide2.QtWidgets import QMainWindow, QLabel, QWidget, QVBoxLayout, \
QHBoxLayout, QPushButton, QTextEdit, QScrollBar
from PySide2.QtWidgets import QMainWindow, QLabel, QWidget, QVBoxLayout, \
QHBoxLayout, QPushButton, QStackedWidget
from matplotlib.bac... | robmsharp/frankenscan | frankenscan/controller/modules/viewFiles/cMatrixViewer.py | cMatrixViewer.py | py | 1,771 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.figure.Figure",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.confusion_matrix",
"line_number": 20,
"usag... |
38241711637 | import asyncio
import logging
from google.protobuf.empty_pb2 import Empty
from grpc import ServicerContext
from proto.messages.meteo.meteo_messages_pb2 import RawMeteoData, RawPollutionData
from proto.services.processing import processing_service_pb2_grpc
from server.processing_service import ProcessingService
logge... | bystepii/meteo | server/processing_service_servicer.py | processing_service_servicer.py | py | 1,452 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "proto.services.processing.processing_service_pb2_grpc.ProcessingServiceServicer",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "proto.services.processing.processing_servi... |
32380182748 | import os
import pymongo
# Grab the file that has the mongo URI data
if os.path.exists("env.py"):
import env
# Create constants for URI login data / database / collection in database
MONGO_URI = os.environ.get("MONGO_URI")
DATABASE = "FirstCluster"
COLLECTION = "myFirstMDB"
# Connect to mongo
def mongo_connect(ur... | KelvinHere/mongodb | mongo.py | mongo.py | py | 1,926 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.exists",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number... |
24798277927 |
import datetime
import glob
import math
import os
import traceback
import psutils.custom_errors as cerr
import psutils.globals as psu_globals
import psutils.argtype as psu_at
import psutils.script_action as psu_act
import psutils.string as psu_str
from psutils.print_methods import *
##############################
... | ehusby/pyscript-utils | psutils/tasklist.py | tasklist.py | py | 48,285 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.realpath",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"... |
42890626068 | from __future__ import print_function
import os
import re
import codecs
import copy
import numpy as np
np.random.seed(0)
import random
random.seed(0)
from collections import Counter
import torch
def create_dico(item_list):
"""
Create a dictionary of items from a list of list of items.
"""
assert type(i... | asiddhant/Active-NLP | neural_cls/util/utils.py | utils.py | py | 4,934 | python | en | code | 148 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"li... |
37999146208 | from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
import json
from controller import *
def checkParam(path, newPath):
pathArray = path.split('/')
newPathArray = newPath.split('/')
paramsMap = {}
if len(pathArray) != len(newPathArray):
return False
for index in range(len(pathArray)... | SoucupB/TradingAPP | HttpServer.py | HttpServer.py | py | 2,553 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.dumps... |
14566803836 | import argparse
import logging
import os
import signal
import config
from multiprocessing import Process, Event as MEvent
from threading import Thread, Event
from time import sleep
from typing import List, Union
from kafka.coordinator.assignors.range import RangePartitionAssignor
from kafka.coordinator.assignors.round... | Usernamelesss/py-concurrent-consumer | start_consumer.py | start_consumer.py | py | 4,410 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "config... |
71272717984 | #!/usr/bin/python3
"""
This module defines the BaseModel class.
"""
import uuid
from datetime import datetime
class BaseModel:
"""
A base class that defines common attributes
and methods for other classes.
"""
def __init__(self, *args, **kwargs):
"""Initialize instance attributes."""
... | DzidediSenaya/AirBnB_clone | models/base_model.py | base_model.py | py | 1,984 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
27768807269 | import collections
import contextlib
import cStringIO
import os
import sys
import textwrap
from googlecloudsdk.api_lib.storage import storage_util
from googlecloudsdk.command_lib.ml import flags
from googlecloudsdk.command_lib.ml import uploads
from googlecloudsdk.core import exceptions
from googlecloudsdk.core import... | twistedpair/google-cloud-sdk | google-cloud-sdk/lib/googlecloudsdk/command_lib/ml/jobs.py | jobs.py | py | 15,546 | python | en | code | 55 | github-code | 7 | [
{
"api_name": "googlecloudsdk.core.exceptions.Error",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "googlecloudsdk.core.exceptions",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "textwrap.dedent",
"line_number": 56,
"usage_type": "call"
},
... |
875015782 | #!/usr/bin/env python
from openpyxl import load_workbook
from pdb import set_trace as debug
import re
import os
from bs4 import BeautifulSoup as bs4
import sys
import logging as log
import traceback
os.chdir(os.path.dirname(os.path.abspath(sys.argv[0])))
log.basicConfig(filename='mailmerge.log',level=log.INFO)
log.inf... | leetncamp/mailmerge | send.py | send.py | py | 5,351 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.chdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_num... |
37920571305 | """
tianyi: 天一是三渣的早期作品:<贩罪>的主角,是像猫一样生活的男人,并且善于计算人心/性,做出各种冷静的数据分析
这里存一些数据分析相关的东西
"""
import decimal
from typing import List
import pendulum
from django.conf import settings
from django.db import models
from apps import utils
from apps.proxy import models as pm
from apps.sspanel import models as sm
from apps.stats.mode... | Ehco1996/django-sspanel | apps/tianyi.py | tianyi.py | py | 8,022 | python | en | code | 3,002 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pendulum.DateTime",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "apps.stats.models.DailyStats.get_date_str_dict",
"line_number": 25,
"usage_type": "call"
},
{
... |
9211761657 | from boggle import Boggle
from flask import Flask,session,render_template,redirect,Request,request,jsonify
boggle_game = Boggle()
app = Flask(__name__)
app.config['SECRET_KEY'] = 'the random string'
boggle = Boggle()
@app.route('/')
def start_game():
board = boggle.make_board()
session['board'] = board
... | DomenicWolf/Boggle | app.py | app.py | py | 907 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boggle.Boggle",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boggle.Boggle",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "boggle.make_board",
"line_nu... |
30328385400 | """ARP Scanner."""
# In future, we may want to import asyncio
import logging
import click
from scapy import all as sc
from scapy import config as conf
conf.verb = 0
logger = logging.getLogger(__name__)
@click.command('arp')
# @click.option('--quiet', default=False, is_flag=True)
@click.option('-t', '--target', requ... | Searge/netscan | src/icmp_scanner.py | icmp_scanner.py | py | 884 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scapy.config.verb",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "scapy.config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scapy.all.ARP",
... |
1173745606 | from communities import views
from django.conf.urls import url
urlpatterns = [
url(r'^$', views.GroupListView.as_view(), name='list'),
url(r'^create/$', views.GroupCreateView.as_view(), name='create'),
url(r'^(?P<pk>\d+)/$', views.GroupDetailView.as_view(), name='detail'),
url(r'^(?P<pk>\d+)/edit/$', ... | nonZero/OpenCommunity | src/communities/group_urls.py | group_urls.py | py | 372 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "communities.views.GroupListView.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "communities.views.GroupListView",
"line_number": 6,
"usage_type": "attribute"
... |
14983452465 | # 特定のディレクトリにある画像を別のディレクトリへ移動させる
import os
import argparse
from typing import Tuple
import shutil
def count_images(path: str) -> int:
"""ディレクトリ内の画像数を調べる
Args:
path (str): 画像数を調べるフォルダのパス
Returns:
int: 画像数
"""
return sum(os.path.isfile(os.path.join(path, name)) for name in os.listdir(path))
de... | Iroha71/ai-scripts | image-folder-composer.py | image-folder-composer.py | py | 1,624 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "os.path.isfile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_numbe... |
69926329502 | import asyncio
import time
from threading import Event
import signal
from libs.utils import get_logger
from libs.senzing_libs.senzing_init import SenzingInit
class Worker(SenzingInit):
def __init__(self, ex_ev):
self.ex_ev = ex_ev
self.log = get_logger()
super(Worker, self).__init__(self... | gidno/ftm-senzing-docker | redo_worker.py | redo_worker.py | py | 2,000 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "libs.senzing_libs.senzing_init.SenzingInit",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "libs.utils.get_logger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 23,
"usage_type": "call"
},
{
"ap... |
7043777588 | # ___ ___ ___ ___ ___ ___
# /\ \ /\ \ /\ \ /\ \ /\ \ /\ \
# /::\ \ /::\ \ \:\ \ /::\ \ /::\ \ /::\ \
# /:/\:\ \ /:/\:\ \ \:\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \
# /:/ \:\ \ /:/ \... | amirhosseindavoody/discretize | discretize/TreeMesh.py | TreeMesh.py | py | 24,494 | python | en | code | null | github-code | 7 | [
{
"api_name": "tree_ext._TreeMesh",
"line_number": 109,
"usage_type": "name"
},
{
"api_name": "base.BaseTensorMesh",
"line_number": 109,
"usage_type": "name"
},
{
"api_name": "InnerProducts.InnerProducts",
"line_number": 109,
"usage_type": "name"
},
{
"api_name": ... |
17405095471 | """Flask app for Cupcakes"""
from flask import Flask, request, jsonify, render_template
from models import Cupcake, db, connect_db
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql:///cupcake'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SECRET_KEY'] = '123456789'
connec... | thomurie/cupcakes | app.py | app.py | py | 1,891 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.connect_db",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Cupcake.que... |
73938923744 | from numpy.lib.function_base import blackman
import pygame
import numpy as np
import random
from numpy import array as Vec
from pygame import Vector2, draw
import matplotlib.pyplot as plt
import copy
from model import DQN
import torch
import math
pygame.init()
Board_size=4
PixelPerBlock = 100
screen = pygame.displ... | kangjoseph90/AI6-DKSH-Hackathon | 2048.py | 2048.py | py | 6,147 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pygame.DOUBLE... |
1041742074 | import sqlite3
import json
from lxml import etree
def get_vehicle_score(vehicle, route_length=450):
consumption = (int(vehicle['fuel_consumption']) / 100) * route_length
number_of_pit_stops = consumption // int(vehicle['engine_capacity'])
score = 0
# Truck capacity. If the capacity is 20 tones or more... | achimoraites/Convoy-Shipping | database.py | database.py | py | 4,847 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sqlite3.IntegrityError",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "json.dump... |
33675038462 | import cffi
import os
ffi = cffi.FFI()
cur_dir = os.path.dirname(os.path.abspath(__file__))
src_dir = os.path.join(cur_dir, "appimageupdate")
with open(os.path.join(src_dir, "_wrapper.h")) as f:
ffi.cdef(f.read())
extra_compile_args = []
extra_args = {
"include_dirs": [],
"library_dirs": [],
}
def... | TheAssassin/python-appimageupdate | build_extension.py | build_extension.py | py | 1,441 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "cffi.FFI",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number... |
29852448990 | import logging
import os
import shutil
from abc import ABC, abstractmethod
from pyalfe.interfaces.greedy import Greedy
from pyalfe.tools import GREEDY_PATH
try:
import ants
except ImportError:
pass
class ImageRegistration(ABC):
@abstractmethod
def register_rigid(self, fixed, moving, transform_output... | reghbali/pyalfe | pyalfe/image_registration.py | image_registration.py | py | 6,527 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
... |
30017835565 | import streamlit as st;
import controllers.ClienteController as ccon
import pandas as pd
import models.recebedor as recebedor
import models.doador as doador
import pages.pcadastroDoador as pageCadastroDoador
st.header("Alterar Doador")
with st.container():
###################################
############ Doa... | aliriaaamorim/api-bd | pages/alterar.py | alterar.py | py | 5,377 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "streamlit.header",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.container",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "controllers.ClienteController.consultarDoadoresbyCpf",
"line_number": 15,
"usage_type": "call"
},
... |
29351022171 | # 序列化
"""
我们把变量从内存中变成可存储或传输的过程称之为序列化,在Python中叫pickling,
在其他语言中也被称之为serialization,marshalling,flattening等等,都是一个意思。
序列化之后,就可以把序列化后的内容写入磁盘,或者通过网络传输到别的机器上。
反过来,把变量内容从序列化的对象重新读到内存里称之为反序列化,即unpickling。
Python提供了pickle模块来实现序列化。
"""
# 首先,我们尝试把一个对象序列化并写入文件:
import pickle
d = dict(name='Bob', age=20, score=... | sssssssshao/PythonStudyProj | study/IOProgram/serializeDemo.py | serializeDemo.py | py | 5,461 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "pickle.dump",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 62... |
33144804635 | from flask import Blueprint, request, jsonify, render_template
from server.inputProcessing.inputProcessing import createInputFile
from server.python2java.python2java import python2java
from server.outputProcessing.outputProcessing import readOutputFile
from server.modelsDB.FeedbackDB import Feedback, addFeedback, getFe... | KevinH48264/code-translate | server/routes/routes.py | routes.py | py | 3,654 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask.req... |
70961776542 | from logging import getLogger
from django.contrib import admin
from integrations.base import BaseIntegrationError
from services.orders import OrderSchema, get_order_placement_service
from .models import StoreOrder
logger = getLogger(__name__)
class StoreAdmin(admin.ModelAdmin):
def has_change_permission(self... | Nekustetnaz/Store_and_warehouse | store/admin.py | admin.py | py | 895 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 13,
"usage_type": "name"
},
{
"api_n... |
25751748422 | from mitmproxy.http import HTTPFlow
from xepor import InterceptedAPI, RouteType
HOST_HTTPBIN = "httpbin.org"
api = InterceptedAPI(HOST_HTTPBIN)
@api.route("/get")
def change_your_request(flow: HTTPFlow):
"""
Modify URL query param.
Test at:
http://httpbin.org/#/HTTP_Methods/get_get
"""
flow... | xepor/xepor-examples | httpbin/httpbin.py | httpbin.py | py | 815 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "xepor.InterceptedAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "mitmproxy.http.HTTPFlow",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "mitmproxy.http.HTTPFlow",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "x... |
38710519456 | import numpy as np
import pandas as pd
import torch
import torch.utils.data as Data
from graphset import *
from scipy.sparse import coo_matrix
def CalculateGraphFeat(feat_mat,adj_list):
assert feat_mat.shape[0] == len(adj_list)
adj_mat = np.zeros((len(adj_list), len(adj_list)), dtype='float32')
for i in ra... | BioMedicalBigDataMiningLab/GraphCDR | prog/data_process.py | data_process.py | py | 4,821 | python | en | code | 21 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.allclose",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number... |
21922449975 | import os
import argparse
import torch
import matplotlib
import matplotlib.pyplot as plt
from detr.models.detr import buildLines
from dataloaders import CustomDataset, prepare_dataloaders, TuSimpleDataset
from torch.utils.data import DataLoader
from collections import OrderedDict
from scipy.optimize import linear_sum_... | TimStolp/pix2vec | src/get_accuracy.py | get_accuracy.py | py | 11,330 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.use",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplo... |
7655362628 | from django.forms import ModelForm
from django.contrib.auth.forms import UserCreationForm
from .models import *
from django import forms
class LoginForm(UserCreationForm):
pass
# https://www.youtube.com/watch?v=TBGRYkzXiTg&ab_channel=Codemy.com
class SignUpForm(UserCreationForm):
class Meta:
model = U... | Islaster/Union-Catalogue | main_app/forms.py | forms.py | py | 2,217 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm",
"line_number": 15,
"usage_t... |
71309512542 | # 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 t... | openstack/openstacksdk | openstack/tests/functional/baremetal/test_baremetal_chassis.py | test_baremetal_chassis.py | py | 2,911 | python | en | code | 245 | github-code | 7 | [
{
"api_name": "openstack.tests.functional.baremetal.base.BaseBaremetalTest",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "openstack.tests.functional.baremetal.base",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "openstack.exceptions.ResourceNotFound"... |
25532276703 | import numpy as np
import pandas as pd
from sklearn import tree
from sklearn.metrics import accuracy_score
from sklearn.ensemble import RandomForestClassifier
import random
import math
from torch.utils.tensorboard import SummaryWriter
from matplotlib import pyplot
from pathlib import Path
import requests
import pickle
... | sorensenmarius/fedavg | server/server.py | server.py | py | 6,423 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.options",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "torch.optim.SGD",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.CrossEn... |
16263663814 | import unittest
import numpy as np
import tensorflow as tf
from keras.models import Model
from keras.layers import Input
from keras.layers.core import Lambda
from keras.layers.embeddings import Embedding
from gather_emb import gather3
from gather_emb import gather_output_shape3
class GatherTestCase(unittest.TestCase... | mynlp/ccg2lambda | scripts/gather_test.py | gather_test.py | py | 9,394 | python | en | code | 215 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "keras.layers.embeddings.Embedding",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "... |
15361190335 | import scrapy
class FictionSpider(scrapy.Spider):
name = "fiction"
start_urls = ["http://www.shuquge.com/txt/8659/index.html"]
def parse(self, response):
for chapter in response.xpath("//div[@class='listmain']//a"):
href = chapter.xpath(".//@href").get()
chapter_... | wwwcomcn/scrapy_tutorial | fiction_spider.py | fiction_spider.py | py | 728 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scrapy.Spider",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 12,
"usage_type": "call"
}
] |
26180254666 | import numpy as np
from sklearn.metrics import accuracy_score
from utils import baseline, compute_cost, load_data, sigmoid, sigmoid_prime
np.random.seed(1)
def init_parameters(n_x: int, n_h: int, n_y: int = 1) -> dict:
"""
Initialise parameters (weights/biases) to be learnt by the neural network.
Param... | saikatkumardey/dl | src/shallow_nn.py | shallow_nn.py | py | 5,370 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randn",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
1407164975 | __all__ = ["SqlConfigClient"]
from typing import Dict, Any
from dbacademy.clients.rest.common import ApiClient, ApiContainer
DATA_ACCESS_CONTROL = "DATA_ACCESS_CONTROL"
SECURITY_POLICIES = [DATA_ACCESS_CONTROL]
class SqlConfigClient(ApiContainer):
def __init__(self, client: ApiClient):
self.client = cl... | databricks-academy/dbacademy | src/dbacademy/clients/databricks/sql/config.py | config.py | py | 1,975 | python | en | code | 42 | github-code | 7 | [
{
"api_name": "dbacademy.clients.rest.common.ApiContainer",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "dbacademy.clients.rest.common.ApiClient",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 18,
"usage_type": "name"
... |
29635503173 | #Imported modules
from tkinter import messagebox, font
import tkinter as tk
import requests
#Class called GUI
class GUI:
#initializes the instance of the class
def __init__(self):
#Constants and our root/main_window
self.SCREEN_WIDTH = "600"
self.SCREEN_HEIGHT = "500"
self.root... | TobiasOmdal/Weather_GUI_TKINTER | main.py | main.py | py | 3,916 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.Tk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.PhotoImage",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line... |
7589290698 | import matplotlib.pyplot as plt
import matplotlib as mp
import numpy as np
def f(x,y):
return (1- x/2 + x**5 + y**3) * np.exp(-x**2-y**2)
n = 256
x = np.linspace(-3,3,n)
y = np.linspace(-3,3,n)
# 用meshgrid在二维平面中将每一个x和每一个y分别对应起来,编织成网格
X,Y = np.meshgrid(x,y)
# 使用plt.contourf进行颜色填充,从cmap中寻找f(X,y)对应的颜色,8代表将等高线分成1... | AdamFeng/learning_mofan | matplotlib/10_matplotlib_contours.py | 10_matplotlib_contours.py | py | 686 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "numpy.exp",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_numb... |
22352303905 | import os
from dotenv import load_dotenv, find_dotenv
ENV_FILE = find_dotenv()
if ENV_FILE:
load_dotenv(ENV_FILE)
ETHERSCAN_API_KEY = os.environ.get('ETHERSCAN_API_KEY')
CONTRACT_ADDRESS = os.environ.get('CONTRACT_ADDRESS')
START_BLOCK = int(os.environ.get('START_BLOCK'))
NUMBER_OF_LAST_BLOCKS = 10
BLOCKS_PROC... | cofablab/tokenscan | config.py | config.py | py | 681 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "dotenv.find_dotenv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"l... |
41565133945 | from model.db_connect import pyodbc_connect as odbc
import logging
from datetime import datetime
import pandas as pd
import numpy as np
from datetime import datetime
from azure.logging_setup import setup_azure_logger
logger = setup_azure_logger(__name__)
def select_dantai_nm(dantai_cd):
query = "SELECT dantai_nm "... | mtglovesurf/online_work | 本業/中央システム/test/model/tr_toukibo.py | tr_toukibo.py | py | 7,671 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "azure.logging_setup.setup_azure_logger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "model.db_connect.pyodbc_connect.exec_query",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "model.db_connect.pyodbc_connect",
"line_number": 15,
"us... |
73759966624 | #!/usr/bin/env python3
import sys
import numpy as np
import scipy.interpolate
import matplotlib
import matplotlib.pyplot as plt
vmin = -0.03
vmax = 0.03
# 0.3
# 0.1
# 0.1
alnmethods = ["aligned_clustalw",
"aligned_mafft",
"aligned_msaprobs",
"aligned_muscle",
... | bryankolaczkowski/airas | data/three_taxon_simulations/analysis/plotMainFigure.py | plotMainFigure.py | py | 2,323 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "numpy.meshgrid",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "numpy.ara... |
315988055 | from __future__ import division
__author__ = 'Perkel'
from scripts.utils.graphics_sound_handling import load_image
from scripts.utils.graphics_sound_handling import CreateSprite
import pygame
def sprite_sheet(name, nr_of_frames):
"""
:param name: Takes spritesheet name without whole path just spritesheet.jpg... | perkel666/The-Wanderer | scripts/utils/spritesheets.py | spritesheets.py | py | 2,615 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scripts.utils.graphics_sound_handling.load_image",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "storage.System",
"line_number": 31,
"usage_type": "attribute"
},
{
... |
71674969503 | import json
import os
import pickle
import re
import string
import requests
import zhconv
import jieba
from keras.preprocessing import sequence
from config import config
class Result:
label2zh = {'location_traffic_convenience': '交通是否便利',
'location_distance_from_business_district': '距离商圈远近',
... | YangBin1729/nlp_demo | nlp/sentiment_classification.py | sentiment_classification.py | py | 6,323 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "config.config",
"line_number": 73,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number... |
24403305317 | import gc
import time, datetime
import os, sys
import numpy as np
import pandas as pd
import math
import random
import argparse
from argparse import RawTextHelpFormatter
from pyspark import SparkContext, StorageLevel
from pyspark.sql import SparkSession
import pyspark_cassandra
sys.path.append(
os.path.abspath(os... | gdamaskinos/isim | backend.py | backend.py | py | 13,906 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
12437507435 | from pyspark import SparkConf, SparkContext
import sys
import random
import time
import json
import math
import csv
import itertools
from pyspark.sql import SparkSession
# print('System arguments --> ',sys.argv)
# Initializing input variables
stime = time.time()
out_dict = dict()
delm = ','
#ct_dict = {}
#case = int(s... | anshul151991/Homework-DM | Assignment3/tas2predict.py | tas2predict.py | py | 2,123 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.getOrCreate",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pysp... |
39309098198 | from django.db import models
from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.dispatch import receiver
class AuditLog(models.Model):
timestamp = models.DateTimeField(auto_now=True)
user = models.CharField(max_length=250, null=False, blank=False)
user_ip = models.CharFiel... | Sakhawat238/bibaho-ovijan | AUTH/LogWithAudit/models.py | models.py | py | 1,976 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateTimeField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name... |
23544772987 | # -*- coding: utf-8 -*-
import logging
import phonenumbers
from datetime import datetime, timedelta
from dateutil import tz
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth import authenticate
from django.db import transaction
from django.db.models import Q, Prefetc... | over55/workery-django | workery/tenant_api/serializers/task_crud/task_item_available_associate_list_create.py | task_item_available_associate_list_create.py | py | 4,268 | python | en | code | 10 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 43,
"usage_type": "name"
... |
20761561800 | import cv2 as cv
import numpy as np
img = cv.imread('../photos/big-bang.jpg')
cv.imshow('Bang',img)
blank = np.zeros(img.shape[:2], dtype='uint8')
mask = cv.circle(blank, (img.shape[1]//2,img.shape[0]//2),100,255,-1)
cv.imshow('Mask',mask)
masked = cv.bitwise_and(img,img,mask=mask)
cv.imshow('Masked image',maske... | GraniteMask/OpenCv-basic2advanced-tools | masking.py | masking.py | py | 337 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.circle",
"line_number": 9,
... |
36085431845 | from flask import Flask, render_template, request, Response, make_response, jsonify
from functools import wraps
from datetime import datetime, timedelta
app = Flask(__name__)
SECRET="redteam rocks!"
# Decorator function to check if the request's host matches the required host
def check_host_decorator(required_host):... | A11riseforme/CORS-Workshop | app/app.py | app.py | py | 8,533 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.headers",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "functools.wraps",... |
13280962173 | # File Created:
# Modifications and additions to code by brooksandrew
import itertools
import networkx as nx
import matplotlib.pyplot as plt
from postman_problems.turn_graph import turn_weight_function_distance, create_turn_weight_edge_attr
from postman_problems.graph import get_shortest_paths_distances, create_comple... | jackwackus/directed_rpp | postman_problems/solver_lib.py | solver_lib.py | py | 5,898 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "networkx.draw_networkx_edges",
"line_number": 42,
"usage_type": "call"
},
{
"api_nam... |
12496353782 | from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
import skimage
import glob
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import torch.utils.data
i... | immuno121/audio_source_classification | Deep_Learning/models/vanilla_cnn/trainer.py | trainer.py | py | 2,664 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.swapaxes",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "torch.no_grad",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.swapaxes",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_num... |
37948595787 | import ast
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import dash_table_experiments as dt
import io
import json
from lmfit.model import load_modelresult
from lmfit.model import save_modelresult
import numpy as np
import os
import... | nicolet5/DiffCapAnalyzer | diffcapanalyzer/app_helper_functions.py | app_helper_functions.py | py | 5,488 | python | en | code | 28 | github-code | 7 | [
{
"api_name": "diffcapanalyzer.databasewrappers.get_filename_pref",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "diffcapanalyzer.databasewrappers.if_file_exists_in_db",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "diffcapanalyzer.databasefuncs.get_file_f... |
42131669470 | # crawling용 모듈
from urllib.request import urlopen
from bs4 import BeautifulSoup
import urllib
import requests
def musicChart():
RANK = 10 ## 멜론 차트 순위가 1 ~ 100위까지 있음
header = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko'}
req = requests.get('https://www.melon.com/chart/week/index.h... | kuyang95/1319_KakaoChatBot | informationPart/m_musicChart.py | m_musicChart.py | py | 1,199 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
}
] |
27265726248 | from numbers import Real
from typing import Tuple
from . import bounds
from .hints import (Expansion,
Point)
def fast_two_sum(left: Real, right: Real) -> Tuple[Real, Real]:
estimation = left + right
right_virtual = estimation - left
tail = right - right_virtual
return tail, estima... | atk81/machine-learning | iris/venv/lib/python3.7/site-packages/robust/utils.py | utils.py | py | 8,536 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numbers.Real",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numbers.Real",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number"... |
20688888667 | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
# local model
import sys
sys.path.append("../network")
from lstm import LSTMHardSigmoid
class cnnblstm(nn.Module):
def __init__(self, time_steps = 800, n... | NorbertZheng/Air-Writing-with-TL | cnnblstm/cnnblstm.py | cnnblstm.py | py | 8,022 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"li... |
35915894685 | import time
import utilities.customer_logger as cl
import logging
from time import sleep
from base.basepage import BasePage
class ComparisonPage(BasePage):
log = cl.customLogger(logging.DEBUG)
def __init__(self, driver):
super().__init__(driver)
self.driver = driver
# Locators
_prem... | joselitan/selenium-python-framework | pages/comparisonPage/trash/comparison_page.py | comparison_page.py | py | 9,277 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "base.basepage.BasePage",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utilities.customer_logger.customLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utilities.customer_logger",
"line_number": 10,
"usage_type": "name"
},
{... |
25563956780 | from __future__ import division
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.ensemble import Ran... | chris7175/Thesis_Morphine | Popluation_model.py | Popluation_model.py | py | 4,932 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 55,
"usage_type": "cal... |
33817482028 | """
Series of tests and example code to run elecsus via the API
Last updated 2018-07-04 MAZ
"""
# py 2.7 compatibility
from __future__ import (division, print_function, absolute_import)
import matplotlib.pyplot as plt
import numpy as np
import time
import sys
sys.path.append('../')
import elecsus_methods as EM
sys.p... | durham-qlm/ElecSus | elecsus/tests/fitting_tests.py | fitting_tests.py | py | 5,577 | python | en | code | 33 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
41098873612 | import string
from collections import deque
def algo() -> int:
heights = dict()
start_point = (-1, -1)
end_goal = (-1, -1)
result = -1
directions = [(0, 1), (0, -1), (1, 0), (-1, 0)]
print("hello, day 12: Hill Climbing Algorithm")
# you'll need to find the shortest path from any square a... | bzawadka/python-advent | day12_part2.py | day12_part2.py | py | 2,348 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "string.ascii_lowercase.index",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "string.ascii_lowercase",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 36,
"usage_type": "call"
}
] |
11112988947 | #!/usr/bin/env python
# encoding: utf-8
# Before running this program, first Start HFO server:
# $> ./bin/HFO --offense-agents 1
import itertools
import math
from hfo import *
import argparse
"""
Possible game statuses:
[IN_GAME] Game is currently active
[GOAL] A goal has been scored by the offense
[CAPTURED_... | RubenvanHeusden/HFO-Robotkeeper | example/test_keepers/q_agent.py | q_agent.py | py | 1,548 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "hfo.connectToServer",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "hfo.getState",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "hfo.step",
... |
42529889001 | import cv2
import numpy as np
from PIL import Image
import os
# from matplotlib import pyplot as plt
dir = '/test/nPCR'
image_path = 'D:/Study/Dataset/medicaldata_uint16_png_3_2_1' + dir
outputpath = 'D:/Study/Dataset/medicaldata_uint16_png_3_2_2' + dir
outputpath = outputpath + '/'
#outputpath = 'D:/Study... | Lan-yi/Hello | 2DResNet_Classification/data_set/data_process/medical_rotate.py | medical_rotate.py | py | 918 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.rotate",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.ROTATE_180",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cv2.imwrite",
"line_num... |
75088644704 | # encoding: utf-8
'''
@author: jinjin
@contact: cantaloupejinjin@gmail.com
@file: expanddata.py
@time: 2019/5/10 11:13
'''
import pandas as pd
from imblearn.over_sampling import SMOTE
filePath = "preprocess/test1.csv"
df = pd.read_csv(filePath,names=['sentiment','review'])
x = df["review"].tolist() #x
y = df["sentime... | cantaloupeJinJin/SmartContractsDetector | SmartContractsDetector/VulBLSTM/expanddata.py | expanddata.py | py | 1,245 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "imblearn.over_sampling.SMOTE",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.... |
34729389336 | from setuptools import setup
def required_packages():
deps = [
'pandas',
'numpy',
'matplotlib',
'torch',
'torchvision',
'pillow',
'seaborn',
]
setup(name='roofnet',
version='0.1',
description='Code for RoofNet',
url='http://github.com... | MishaLaskin/roofnet | setup.py | setup.py | py | 522 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "setuptools.setup",
"line_number": 16,
"usage_type": "call"
}
] |
72845119902 | import os
import sys
import glob
import random
from pathlib import Path
from argparse import ArgumentParser
import numpy as np
import torch
from mmcv.onnx import register_extra_symbolics
from mmocr.apis import init_detector
sys.path.append('mmocr/tools')
from deployment.pytorch2onnx import _convert_batchnorm
def cre... | Ascend/ModelZoo-PyTorch | ACL_PyTorch/contrib/nlp/SDMGR/sdmgr_pth2onnx.py | sdmgr_pth2onnx.py | py | 2,676 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_... |
10565504009 | # Author: Andrey Boytsov <andrey.boytsov@uni.lu> <andrey.m.boytsov@gmail.com>
# License: BSD 3 clause (C) 2017
# Fitting iris dataset (from sklearn). Generating embedding function and using it to visualize smooth transition from
# one value to another. Comparing to embedding_close, explores way more options, different... | andreyboytsov/LION-tSNE | Experiments/EmbeddingApproximation/iris_embedding_smooth_transition_embedded.py | iris_embedding_smooth_transition_embedded.py | py | 3,805 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
6777228179 | #!/usr/bin/env python3
import argparse
import logging
from time import sleep
import json
from market_data import MarketDataListener
from trading_client import TradingClientFactory
from candle import CandleManager
from tick import TickManager
from collections import OrderedDict
import os
from os import path
from utils... | khandelwalbharat/tradingbot | main.py | main.py | py | 2,615 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "utils.get_workdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
... |
34980907174 | import torch
import numpy as np
from functions import plot_results
def training_loop(num_epochs, model, trainloader, valloader, optimizer, save_path):
val_loss_n = [100000, 99999]
train_loss_n = [100000, 99999]
for epoch in range(num_epochs):
print(f'Epoch {epoch+1}/{num_epochs}')
... | zklaw/pills-detection | loops.py | loops.py | py | 2,237 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.no_grad",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 44,
... |
37597303394 | from django.urls import path
from . import views, auth
urlpatterns = [
path('', views.index),
path('administrador/', views.administrador),
path('registro/', auth.registro),
path('login/', auth.login),
path('logout/', auth.logout),
path('mensaje', views.nuevo_mensaje),
path('comentario/<int... | jemm2008/django-el-muro | app01/urls.py | urls.py | py | 361 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 4,
"usage_type": "call"
},
{
"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",
... |
38753341653 | import json
import requests
from common import get_token
BASE = "<>"
PASS = "<>"
USER = "<>"
COLLECTION = "<>"
def headers():
return {"X-Metabase-Session": get_token(BASE, USER, PASS)}
def get_collection(old):
collections = requests.get(f"{BASE}/api/collection/", headers=headers()).json()
collections ... | vinitjogani/metabase-upload-download | upload.py | upload.py | py | 4,217 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "common.get_token",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"li... |
21022714922 | from ..pages.product_page import ProductPage
from ..pages.main_page import MainPage
from ..pages.login_page import LoginPage
from ..pages.basket_page import BasketPage
from ..pages.locators import ProductPageLocators
from pytest import mark, param, fixture
from time import sleep, time
PROD_PAGE_LINK = "http://selenium... | stepik0rn/stepik_module4 | tests/test_product_page.py | test_product_page.py | py | 3,486 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pages.product_page.ProductPage",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pages.login_page.LoginPage",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "p... |
10423052423 | import openai as ai
completion = ai.Completion()
def chatbot_interface(description, history, sentence, api_key):
ai.api_key = api_key
chat_log = description + "\n" + history + "\n"
prompt = f"{chat_log}Human: {sentence}\nAI:"
response = completion.create(
model="text-davinci-002",
prom... | MinhuiLIANG/GPT3_Tools | free_chat.py | free_chat.py | py | 1,416 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "openai.Completion",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "openai.api_key",
"line_number": 6,
"usage_type": "attribute"
}
] |
74688506463 | import os
import tempfile
import numpy as np
import numpy.testing as npt
import pytest
from pygt3x.reader import FileReader
from paat import io, preprocessing
@pytest.fixture
def unscaled_data(file_path):
return io.read_gt3x(file_path, rescale=False, pandas=True)
def test_loading_data(file_path, load_gt3x_fil... | Trybnetic/paat | tests/test_io.py | test_io.py | py | 1,288 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "paat.io.read_gt3x",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "paat.io",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "paat.io.read_gt3x",
... |
36172482883 | from inspect import classify_class_attrs
import numpy
import cv2
import customtkinter
import pickle
from PIL import ImageTk, Image
import pandas
import mediapipe
import tkinter
from sample_landmarks import landmarks
app = tkinter.Tk()
customtkinter.set_appearance_mode("dark")
app.title("Computer Vision Wo... | mannysingh24/computervisiondeadliftapp | main.py | main.py | py | 4,256 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.Tk",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_B... |
26875961383 | """
Created on Sat Mar 7 08:48:27 2020
@author: SamKoebrich
"""
import os
from pathlib import Path
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~ GENERAL SETTINGS ~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- Number of generators for training set ---
# - most downloads are cached, ... | skoeb/tycho | tycho/config.py | config.py | py | 3,810 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path.home",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_... |
74913227102 | import pytest
from django.urls import reverse
from cars.models import Order, OrderLine
@pytest.mark.django_db
def test_delete(user_client, color_factory, brand_factory, car_model_factory, order_line_factory, order_factory):
color = color_factory()
brand = brand_factory()
model = car_model_factory(brand=b... | ArtemyDrzhn/cars | backend/cars/tests/views/order_view_set/test_delete.py | test_delete.py | py | 615 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.reverse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cars.models.Order.objects.exists",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cars.models.Order.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
... |
27953408511 | import weakref
import importlib
class Component(object):
__slots__ = [
'_entity',
'typeid',
'synchronize',
'_is_unique',
'_import_string',
]
def __init__(self):
self._is_unique = False
self.synchronize = False
self._import_string = self.__cl... | Moguri/blender | ecs.py | ecs.py | py | 7,409 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "weakref.ref",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 150,
"usage_type": "call"
}
] |
10726107773 | import sys
sys.path.append("src")
import numpy.testing as npt
from geometry.smooth import surfaces
import numpy as np
from geometry.discrete.surfaces import TriangleMesh
import math
from thirdparty.octasphere import octasphere, icosphere
import open3d
sphere = TriangleMesh.from_o3d(open3d.geometry.TriangleMesh.create... | Chandler/cba-shape | tests/test_discrete.py | test_discrete.py | py | 2,347 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "geometry.discrete.surfaces.TriangleMesh.from_o3d",
"line_number": 12,
"usage_type": "call"
},
{
"api_... |
36829109243 | import os
import torchaudio as ta
from Demucs import *
import scipy.io.wavfile
import numpy as np
def create_noise_file(audio_clean,noise_path,output):
noise, _ = ta.load(str(noise_path), normalize=True)
audio_length = audio_clean.shape[-1]
noise_length = noise.shape[-1]
if noise_length > audio_lengt... | XernPLL/AudioDenoising | inference.py | inference.py | py | 4,456 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torchaudio.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.io.wavfile.write",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sci... |
2716038424 | import base64
import binascii
import struct
from typing import Union
from crc16 import crc16xmodem
from .exceptions import (
Ed25519SecretSeedInvalidError,
Ed25519PublicKeyInvalidError,
MuxedEd25519AccountInvalidError,
ValueError,
TypeError,
)
from .xdr import Xdr
__all__ = ["StrKey"]
_version_b... | emtech-services/py-stellar-base | stellar_sdk/strkey.py | strkey.py | py | 10,550 | python | en | code | null | github-code | 7 | [
{
"api_name": "binascii.a2b_hex",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "binascii.a2b_hex",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "binascii.a2b_hex",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "binascii.a2b_hex",... |
36154806887 | import mediapipe as mp
import numpy as np
import cv2
import torch
import pyvirtualcam as pv
from os import system
from time import sleep
from tha2.poser.modes import mode_20
from tha2.util import resize_PIL_image, \
extract_PIL_image_from_filelike, \
extract_pytorch_image_from_PIL_image, \
convert_output_i... | tcy2002/mediapipe-anime | main.py | main.py | py | 4,352 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "mediapipe.solutions.face_mesh.FaceMesh",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "config.min_detection_confidence",
"line_number": 27,
"usage_type": "attri... |
26086330625 | import dataclasses
import importlib
import logging
from typing import Dict
from typing import Iterable
from typing import Optional
from typing import Tuple
from typing import Union
import OpenGL.GL
import OpenGL.GL.NV.conservative_raster
import glcontext
import moderngl
import numpy as np
import torch as t
from coren... | google-research/corenet | src/corenet/gl/rasterizer.py | rasterizer.py | py | 7,945 | python | en | code | 92 | github-code | 7 | [
{
"api_name": "importlib.reload",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "corenet.gl.egl_context.monkey_patch_moderngl",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "corenet.gl.egl_context",
"line_number": 20,
"usage_type": "name"
},
{
... |
34595344008 | #!/usr/bin/env python3
import database
import time
import json
import math
import random
"""
ideas:
- nose size = throw radius
- limb size = speed
- ear size = evade chance / defense
- eye size = hit chance / attack
- primary = 100% attack (or heal)
- secondary = 50% attack and 50% defense
0 ... | allefant/krampus18 | server.py | server.py | py | 11,497 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "database.access_db",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number"... |
2184432411 | import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
import sys
import json
import numpy as np
import multiprocessing
import username_generate
manager = multiprocessing.Manager()
shared_dict = manager.dict()
# {sub_name: [(og_pos... | BarrettSeanBatten/web-scraper-python | materials-web-scraping-tutorial/scrape_selenium.py | scrape_selenium.py | py | 6,928 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "multiprocessing.Manager",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 27,
"usage_type": "call"
}... |
23482693165 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, obs_dim, act_dim, max_action):
super().__init__()
self.policy = FCPolicy(obs_dim, act_dim, max_action)
self.value = FCValue(obs_dim, act_dim)
class FCPolicy(nn.Module):
def _... | tanzeyy/DDPG | model.py | model.py | py | 1,118 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
21009165450 | import copy
import pytest
import torch
import nni
from torch import nn
from nni.common.serializer import is_traceable
from nni.mutable import Categorical, ExpressionConstraint, ensure_frozen, frozen_context, label_scope, auto_label, SampleMissingError
from nni.mutable.mutable import _mutable_equal
from nni.nas.nn.pyt... | microsoft/nni | test/ut/nas/nn/test_base.py | test_base.py | py | 17,401 | python | en | code | 13,409 | github-code | 7 | [
{
"api_name": "nni.nas.nn.pytorch.base.strict_label_scope",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nni.mutable.Categorical",
"line_number": 20,
"usage_type": "call"
},
{
"... |
16119450228 | # DRF
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
# Serializers
from .serializers import ReadUserProfileSerializer
# Library: drf-yasg more details at https://drf-yasg.readthedocs.io/en/stable/custom_spec.html
from drf_ya... | jovenntann/django-template-project | api/authenticated/user/profile/views.py | views.py | py | 912 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 18,
"usage_type": "name"
},
... |
8157370332 | """Convert CSV string to Python dict using ../../tapshex/template.py."""
# pylint: disable=unused-import,unused-argument,import-error
import pytest
from tapshex.classes import Shape, StatementTemplate
from tapshex.config import tapshex_config
from tapshex.csvreader import dctap_csvreader
NONDEFAULT_CONFIGYAML_STR = "... | tombaker/tapshex | tests_primer/todo_42_negative_triple_constraints/test_csv_to_dict.py | test_csv_to_dict.py | py | 2,925 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tapshex.config.tapshex_config",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tapshex.csvreader.dctap_csvreader",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "tapshex.classes.Shape",
"line_number": 60,
"usage_type": "name"
},
{
... |
1406955155 | from typing import Dict
from dbacademy_jobs.cloudlabs.lab_specs.lab_specs import load_lab_specs, LabSpec
from dbacademy.clients import databricks
lab_specs: Dict[str, LabSpec] = load_lab_specs("C:/Users/JacobParr/.cloudlabs/lt_user_acceptance.json")
for name, lab_spec in lab_specs.items():
if lab_spec.enabled:
... | databricks-academy/dbacademy | jobs/dbacademy_jobs/cloudlabs/lab_specs/validate_workspaces.py | validate_workspaces.py | py | 988 | python | en | code | 42 | github-code | 7 | [
{
"api_name": "typing.Dict",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "dbacademy_jobs.cloudlabs.lab_specs.lab_specs.LabSpec",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "dbacademy_jobs.cloudlabs.lab_specs.lab_specs.load_lab_specs",
"line_number": 5... |
24737392465 | import cv2 as cv
import numpy as np
def getContours(imagen):
contours,hierarchy = cv.findContours(imagen, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_NONE) #puntos (x,y) de los contornos sin aproximacion
for cnt in contours:
area = cv.contourArea(cnt) #are... | luciadelacaridad/OpenCvPython | chapter8.py | chapter8.py | py | 2,430 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "cv2.findContours",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.RETR_EXTERNAL",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.CHAIN_APPROX_NONE",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.c... |
20926883673 | import csv
from guideline.models import Patientdata, Patientguidelines, Recommendations
with open('Patient_data.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter = ',')
next(csv_reader)
for row in csv_reader:
date, name, gender,systolic_BP,diastolic_BP,smoking_years,no_of_packs,fasti... | pankajmandrai/dj | CSV_TABL/guideline/abc.py | abc.py | py | 1,754 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "csv.reader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.http.admin.Model... |
72759425824 | import cv2
import os
from pathlib import Path
import random
import sys
import time
# TODO :
# Pretty much done with the wallet check -> Detect if we failed to press the button and went out of the wallet activity
# Possible solution : Check the ad 3 times, then CV2 recognition, if it fails, relaunch wallet activity <- ... | Anti9929/Amino-Coin-Farmer | farm.py | farm.py | py | 7,474 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "os.popen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 61,
... |
6815740996 | import speech_recognition as sr
recognizer = sr.Recognizer()
microphone = sr.Microphone()
recognizer.recognize_sphinx()
print("Input: ")
while(True):
ff7 = sr.AudioFile('')
with ff7 as source:
audio = recognizer.record(source)
with microphone as source:
audio = recognizer.l... | mostaste/Simple-Python-Exercises | BasicSpeechRecognition.py | BasicSpeechRecognition.py | py | 472 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "speech_recognition.AudioFile",
"line_number": 11,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.