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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
43187275066 | from http import HTTPStatus
from typing import Any, Union, Optional, List, Dict
import allure
from assertions.constants import TYPE_NAMES
from assertions.formatters.assertions import MessageTemplate, AllureTemplates
from assertions.operators import Operators
from assertions.utils import prettify_json
def compare_ke... | Nikita-Filonov/assertions | assertions/assertions.py | assertions.py | py | 5,943 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number"... |
16954714999 | # Link For Problem: https://leetcode.com/problems/shortest-path-in-binary-matrix/
from collections import deque
class Solution:
"""
Apply Standard BFS Algorithm.
TC : O(mn)
SC : O(mn)
"""
def shortestPathBinaryMatrix(self, grid: list[list[int]]) -> int:
if grid[0][0] o... | loopclub2022/MonthLongChallenge | Anurag_19_CSE/Python/day16.py | day16.py | py | 1,171 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 23,
"usage_type": "call"
}
] |
34578145185 | import os, json, timeit
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.multiclass import OneVsRestClassifier
from sklearn.metrics import accuracy_score
from sklearn.manifold import TSNE
from param import *
with open(set_path) as json_file:
set_dict = json... | JeffT13/rd-diarization | RDSV/run_LR.py | run_LR.py | py | 2,632 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 39,
... |
9162161598 | """
Flask Documentation: http://flask.pocoo.org/docs/
Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
This file creates your application.
"""
import os
from werkzeug.utils import secure_filename
from app import app, db
from flask im... | kimkcharles/info3180-project1 | app/views.py | views.py | py | 3,783 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.render_template",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
... |
1801918096 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from django.utils.deprecation import MiddlewareMixin
from django.shortcuts import HttpResponse
import re
from django.conf import settings
class RbacMiddleware(MiddlewareMixin):
'''
1.获取当前用户的url
2.获取当前用户在session中的url权限列表
3.权限信息进行匹配
'''
def process... | yjiu1990/crm | rbac/middlewares/rbac.py | rbac.py | py | 2,340 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.utils.deprecation.MiddlewareMixin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.VALID_URL_LIST",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 27,
"usage_type":... |
18903749297 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('books', views.books),
path('register', views.register),
path('login', views.login),
path('logout', views.logout),
path('books/add', views.addBook),
path('submitBook', views.submitBook),
path('b... | LeuJames/dojoReadsProj | dojoReadsApp/urls.py | urls.py | py | 519 | python | en | code | 0 | github-code | 1 | [
{
"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",
... |
75121909153 | import math
import cv2
import mediapipe as mp
from pynput.keyboard import Key, Controller
import time
keyboard = Controller()
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_hands = mp.solutions.hands
font = cv2.FONT_HERSHEY_SIMPLEX
# 0 For webcam input:
cap = cv2.VideoCapt... | himanshurajofficials/Virtual-Steering | steering.py | steering.py | py | 6,093 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pynput.keyboard.Controller",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_n... |
17269321258 | import logging
from django.conf import settings
from sqlalchemy.exc import OperationalError
from receval.apps.explorer.experiments import BaseExperiment
from sqlalchemy import create_engine
from sqlalchemy.sql import text
logger = logging.getLogger(__name__)
class ZbMath(BaseExperiment):
db = None
def get... | gipplab/docker-receval | receval/apps/explorer/experiments/zbmath.py | zbmath.py | py | 2,774 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "receval.apps.explorer.experiments.BaseExperiment",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.ZBMATH_DATABASE_URL",
"line_number": 18,
"usage_t... |
4868259954 | from __future__ import print_function
import logging
import os
import random
import time
import signal
from relaax.client import rlx_client
from . import game_process
def run(rlx_server_url, env, seed):
n_game = 0
game = game_process.GameProcessFactory(env).new_env(_seed(seed))
def toggle_rendering():... | j0k/relaax | environments/OpenAI_Gym/environment.py | environment.py | py | 1,962 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "signal.signal",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "signal.SIGUSR1",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "signal.siginterrupt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "signal.SIGUSR1"... |
70544299234 | from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['keras','google-cloud-storage']
setup(
name='trainer',
version='0.1',
install_requires=REQUIRED_PACKAGES,
include_package_data=True,
description='My trainer application package.',
packages=find_packages()
)
| bsinger98/subreddit-simulator-dataminer | setup.py | setup.py | py | 320 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 12,
"usage_type": "call"
}
] |
28144864826 | #!/usr/bin/env python
# coding: utf-8
import pickle
import streamlit as st
st.set_page_config(page_title = 'Titanic Survival Predictor')
pickle_in = open("decision_tree.pkl","rb")
classifier=pickle.load(pickle_in)
def predict_survival(Pclass,sex,SibSp,Parch,Embarked,Age_band,Fare_band):
prediction=classi... | ryanwng12/TitanicAnalysis-Prediction | app.py | app.py | py | 3,859 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "streamlit.markdo... |
40834821563 | import os
import pandas as pd
import rampwf as rw
from rampwf.workflows import FeatureExtractorRegressor
from rampwf.workflows import FeatureExtractorClassifier
from rampwf.score_types.base import BaseScoreType
from sklearn.model_selection import GroupShuffleSplit
from sklearn.model_selection import StratifiedSh... | camcochet/Severity-Accident-Classification | problem.py | problem.py | py | 3,245 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "rampwf.prediction_types.make_multiclass",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rampwf.prediction_types",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "rampwf.workflows.FeatureExtractorClassifier",
"line_number": 24,
"us... |
73654171233 | import os
from qgis.PyQt.QtCore import Qt, QTimer
from qgis.gui import QgsRubberBand
from qgis.core import (
QgsCoordinateTransform,
QgsRectangle,
QgsPoint,
QgsPointXY,
QgsGeometry,
QgsWkbTypes,
QgsProject,
)
from qgis.PyQt import QtWidgets, uic
from qgis.PyQt.QtCore import pyqtSignal
from... | danylaksono/GeoKKP-GIS | modules/gotoxy.py | gotoxy.py | py | 3,135 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "qgis.PyQt.uic.loadUiType",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "qgis.PyQt.uic",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"li... |
6503914532 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: azure_rm_automationhybridrunbookworkergroup_facts
version_a... | testormoo/ansible-azure-complete | modules/library/azure_rm_automationhybridrunbookworkergroup_facts.py | azure_rm_automationhybridrunbookworkergroup_facts.py | py | 6,237 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ansible.module_utils.azure_rm_common.AzureRMModuleBase",
"line_number": 101,
"usage_type": "name"
},
{
"api_name": "azure.mgmt.automation.AutomationClient",
"line_number": 134,
"usage_type": "argument"
},
{
"api_name": "msrestazure.azure_exceptions.CloudError",
... |
3734379309 | from flask import Flask,request,render_template,flash,redirect
import requests
app=Flask(__name__)
app.secret_key="secret key"
@app.route("/",methods=['GET','POST'])
def main():
if request.method=='POST':
try:
city_name=request.form['name']
print(city_name)
url =... | Kalyug5/weather | app.py | app.py | py | 1,302 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.request.form",... |
72597110114 | from unittest.mock import call, ANY
import pytest
from pki_file import PKIFile, KEY_ALGORITHMS, SIGNING_ALGORITHMS
from cryptography.hazmat.primitives.asymmetric import rsa, ec
from cryptography.hazmat.primitives import serialization
CWD = 'zion'
CERT_FILE_PATH = 'matrix/trinity'
PRIV_KEY_PATH = 'matrix/neo'
CERTIFICA... | awslabs/aws-greengrass-labs-certificate-rotator | tests/artifacts/test_pki_file.py | test_pki_file.py | py | 8,688 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "pytest.fixture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pki_file.PKIFile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cryptography.hazmat.pr... |
24877079903 | import contextlib
from typing import Any, Generator
import pytest
import responses
from pyastrosalt.auth import login as auth_login
# Prevent accidental real HTTP requests.
# Source: https://blog.jerrycodes.com/no-http-requests/
from pyastrosalt.web import api_url
@pytest.fixture(autouse=True)
def no_http_requests... | saltastroops/PyAstroSALT | tests/conftest.py | conftest.py | py | 1,347 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pytest.fixture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "responses.Response",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pyastrosalt.web.api_url",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "responses.a... |
73033849633 | # -*- coding: utf-8 -*-
'''
Module for gathering and managing network information
'''
# Import python libs
from __future__ import absolute_import
import datetime
import hashlib
import logging
import re
import os
import socket
# Import salt libs
import salt.utils
import salt.utils.decorators as decorators
import salt.... | shineforever/ops | salt/salt/modules/network.py | network.py | py | 32,604 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "salt.utils.utils.is_windows",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "salt.utils.utils",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "s... |
3151897462 | import tkinter as tk
from tkinter import filedialog
from pynput.keyboard import Listener, Key
import datetime
# Set the maximum number of characters per line
max_characters_per_line = 50
current_line_length = 0
current_line = []
log_file_path = None
# Define a list of keys to exclude from recording
exclud... | DDimov03/Keylogger | keylogger.py | keylogger.py | py | 2,459 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pynput.keyboard.Key.shift",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pynput.keyboard.Key",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pynput.keyboard.Key.backspace",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
23131468885 | from django.contrib.auth import get_user_model
from django.db import transaction
from django.utils.translation import ugettext as _
from openslides.core.config import config
from openslides.utils.autoupdate import inform_changed_data
from openslides.utils.exceptions import OpenSlidesError
from openslides.utils.rest_ap... | chrmorais/OpenSlides | openslides/agenda/views.py | views.py | py | 9,795 | python | en | code | null | github-code | 1 | [
{
"api_name": "openslides.utils.rest_api.ListModelMixin",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "openslides.utils.rest_api.RetrieveModelMixin",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "openslides.utils.rest_api.UpdateModelMixin",
"line_numb... |
70524176993 | import rclpy
from rclpy.node import Node
import serial
import sys
import threading
import glob
from std_msgs.msg import String
class SerialRelay(Node):
def __init__(self):
# Initalize node with name
super().__init__("serial_publisher")
# Create a publisher to publish any output the pico ... | shorewind/shc-twomonth-rover | ros_ws/src/pico_relay/pico_relay/pico_relay.py | pico_relay.py | py | 2,749 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "rclpy.node.Node",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "std_msgs.msg.String",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "std_msgs.msg.String",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "seria... |
22026922508 | #coding:utf-8
import logging
import time
from Config.conf import *
def Logger(testlog): #测试的名称
#1、创建log
logg = logging.getLogger(testlog)
logg.setLevel(logging.INFO)#log等级的总开关
# 获取本地时间,转换成日志需要的格式
curTime = time.strftime("%Y%m%d%H%M", time.localtime(time.time()))
# 设置日志的文件名称
LogFileName = log... | joanguo123456/Python-selenium | Methods/log.py | log.py | py | 1,074 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "time.strftime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.localtime",
... |
3002917118 | #!/usr/bin/env python
# -*- coding: utf-8-*-
import xml.etree.ElementTree as ET
import tarfile
import zipfile
import re
from pathlib import Path
import shutil
import os
import pymysql
import sys
import traceback
import subprocess
import getpass
import Archive as archive
if __name__ in '__main__':
# xml用ルートディレクトリ
... | rise-pat/patent | fulltxt/ArchiveFiles.py | ArchiveFiles.py | py | 4,734 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": ... |
6493867382 | from msrest.service_client import ServiceClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from .operations.dictionary_operations import DictionaryOperations
from . import models
class AutoRestSwaggerBATdictionaryServiceConfiguration(Configuration):
"""Configuration fo... | testormoo/autorest.ansible | test/vanilla/Expected/AcceptanceTests/BodyDictionary/fixtures/acceptancetestsbodydictionary/auto_rest_swagger_ba_tdictionary_service.py | auto_rest_swagger_ba_tdictionary_service.py | py | 1,754 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "msrest.Configuration",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "version.VERSION",
"line_number": 24,
"usage_type": "argument"
},
{
"api_name": "msrest.service_client.ServiceClient",
"line_number": 43,
"usage_type": "call"
},
{
"api_n... |
17141535673 | import trends_data
import matplotlib.pyplot as plt
region = 'US'
n_hits = 4
keywords = trends_data.get_trending_keywords(n_hits)
hist_df_list = [trends_data.get_historical_data(keyword, region) for keyword in keywords]
scores_df = trends_data.compute_total_score(hist_df_list, keywords)
ax = scores_df.plot.pi... | kochlisGit/Data-Science-Algorithms | visualizations/pie_plot.py | pie_plot.py | py | 409 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "trends_data.get_trending_keywords",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "trends_data.get_historical_data",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "trends_data.compute_total_score",
"line_number": 9,
"usage_type": "call"
... |
5957018529 | """
aoe2netwrapper.converters
-------------------------
This module implements a high-level class with static methods to convert result of AoENetAPI methods to
pandas DataFrames.
"""
from typing import List
from loguru import logger
from aoe2netwrapper.models import (
LastMatchResponse,
LeaderBoardResponse,
... | fsoubelet/AoE2NetAPIWrapper | aoe2netwrapper/converters.py | converters.py | py | 16,817 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "loguru.logger.error",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "aoe2netwrapper.models.StringsResponse",
"line_number": 40,
"usage_type": "name"
},
{
"api_name"... |
28640282219 | from django.db import models
from users.models import BakeryUser
from django.utils import timezone
# Create your models here.
DISCOUNT_RULE = [
('based_on_order', 'Based On Order Amount'),
('based_on_quantity', 'Based On Quantity')
]
DISCOUNT_TYPE = [
('fixed_price', 'Fixed Price'),
('percentage', 'P... | deepvikas/bakery_management | bakery/models.py | models.py | py | 1,342 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Model",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
72858504034 | import os
from flask import Flask, render_template, redirect, url_for, request, flash
from flask_bootstrap import Bootstrap5
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired
import requests
app = Flask(__nam... | Developer122436/MyScrips | My Projects on Data Science, Web and more/Section 64 - My top 10 movies website with SQLite, API, Flask and Jinja/main.py | main.py | py | 4,112 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_bootstrap.Bootstrap5",
"lin... |
3156968114 | import requests
from bs4 import BeautifulSoup
import sys
import re
def get_bullet_points_from_url(url, tag):
response = requests.get(url)
response.raise_for_status()
soup = BeautifulSoup(response.text, 'html.parser')
# Use regular expression to match the tag, regardless of surrounding whitespace
... | SamTheSapiel/BrowserPi | soup.py | soup.py | py | 1,493 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.escape",
"line_number... |
70477488033 | # -*- coding: utf-8 -*-
from .conversion import check_type
from .filesystem import json_exporter, get_appdirs_path, sha256, json_importer
from .maps import Map
from .intersections import intersection_dispatcher
from .geometry import get_remaining
from .projection import project
from .rasters import gen_zonal_stats
from... | cmutel/pandarus | pandarus/calculate.py | calculate.py | py | 17,723 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "fiona.crs.from_string",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "maps.Map",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.base... |
11109751286 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Purchase Bot.
Usage: This bot records the spendings in the database and makes monthly and weekly reports.
Press Ctrl-C on the command line to stop the bot.
"""
import psycopg2
import logging
import re
import datetime
import random
import argparse
from telegram import ... | TaniaVK/purchase-bot | purchase-bot.py | purchase-bot.py | py | 14,087 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "psycopg2.conn... |
6690702578 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from dataloader.PennFudanPedDataset import PennFudanPedDataset
from model.deeplabv4 import Deeplabv4
device = tor... | wisnunugroho21/nugi_computer_vision | test.py | test.py | py | 1,518 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
8993383106 | from flask import Blueprint, session, render_template, flash, make_response, \
url_for
from werkzeug.utils import redirect
from flask import request
from dataengine.common.log import logger
from dataengine.server.routes.annotations import requires_auth
from dataengine.server.routes.validator.user_metric import (
... | apmaros/dataengine | dataengine/server/routes/user_metric.py | user_metric.py | py | 1,289 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dataengine.service.db.user_metric.get_user_metrics",
"line_number": 19,
"usage_type": "call"
},
{
"... |
11705085942 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
import psycopg2
from psycopg2.extensions import AsIs
from datetime import timedelta
sys.path.append('/home/mike/dsi/capstones/climbing_gym_checkins_eda')
def parse_datetime(df, col='index', hour=True, dow=True, date=True, w... | bakera81/weather_and_climbing_gym_checkins | src/funcs.py | funcs.py | py | 6,470 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.concat",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_n... |
17414175242 | from PySide2.QtCore import Qt
from PySide2.QtWidgets import QWidget, QMainWindow, QLabel, QApplication, QDockWidget, QPushButton, QGridLayout, \
QVBoxLayout, QTabWidget, QInputDialog
from PySide2.QtGui import QIcon
from gui.EditMenu import EditMenu
from gui.HelpMenu import HelpMenu
from gui.ViewMenu import ViewMenu... | dovvla/multimedia-book | MuMijA/gui/MainWindow.py | MainWindow.py | py | 4,723 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PySide2.QtWidgets.QMainWindow",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PySide2.QtGui.QIcon",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QLabel",
"line_number": 32,
"usage_type": "call"
},
{
"api_na... |
19686765177 | import matplotlib
import re
import os
import sys
import shutil
# get config file path
config_file = matplotlib.matplotlib_fname()
# move wenquanyi open source TTF font file in
if sys.platform == 'win32':
ttf_font_path = config_file.replace('\\matplotlibrc', '\\fonts\\ttf')
else:
ttf_font_path = config_fil... | wshuyi/demo-python-chinese-word-embedding | handle_matplotlib_chinese.py | handle_matplotlib_chinese.py | py | 819 | python | en | code | 34 | github-code | 1 | [
{
"api_name": "matplotlib.matplotlib_fname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "shutil.copy2",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.exp... |
6652507274 | # coding=utf-8
"""
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 ... | oceanbase/sql-lifecycle-management | src/common/logger.py | logger.py | py | 2,813 | python | en | code | 56 | github-code | 1 | [
{
"api_name": "logging.ERROR",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"l... |
73747256355 | from bson import ObjectId
from flask_restplus import abort, marshal
from rest.entities.templates.models import entity_template_response
from rest.entities.models import set_bson_object
from rest.common.constants import ENTITY_TEMPLATE_COLLECTION, ID
from rest.common.constants import META, IS_DELETED, UPDATED, INTERNAL... | samshinde/Flask-MVC | entity_mgmt_app/rest/entities/templates/service.py | service.py | py | 6,977 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest.entities.service.EntityService",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rest.utils.db_service.Base",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "rest.common.constants.ENTITY_TEMPLATE_COLLECTION",
"line_number": 28,
"usa... |
20524415029 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import ttk
from .Labeler import Labeler
from .LabeledMultiWidget import LabeledMultiWidgetMixin
from .SuperWidget import SuperWidgetMixin
from typing import Callable
class ActiveOptionMenu(ttk.OptionMenu, SuperWidgetMixin):
"""ttk.Optio... | AndrewSpangler/py_simple_ttk | src/py_simple_ttk/widgets/OptionMenuWidgets.py | OptionMenuWidgets.py | py | 3,012 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "tkinter.ttk.OptionMenu",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tkinter.ttk",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "SuperWidget.SuperWidgetMixin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "... |
11434781298 | import random
import math
from sympy import isprime, mod_inverse
from flask import Flask, request, jsonify
from flask_cors import CORS, cross_origin
app = Flask(__name__)
CORS(app, support_credentials=True, resources={r'/make_key': {'origins': '*'}})
@app.route("/make_key", methods=['GET'])
@cross_origin()
def make... | mazinal-ani/message-encryption-system | encryption.py | encryption.py | py | 3,454 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sympy.isprime",
"line_nu... |
26064585699 | import argparse
import os
import random
import shutil
import time
import warnings
from tqdm import tqdm
from typing import Callable, Optional
import faiss
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
from torch.utils.data im... | UCDvision/low-budget-al | trainer_DP.py | trainer_DP.py | py | 14,246 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Normalize",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 75,
"usage_type": "name"
},
{
"a... |
8490942134 | import pyposeidon.meteo as pmeteo
import pytest
import pandas as pd
import xarray as xr
import os
import numpy as np
import shutil
from . import DATA_DIR
METEO_NC = DATA_DIR / "meteo.nc"
ERA5_GRIB = DATA_DIR / "era5.grib"
DATASET = xr.Dataset(data_vars=dict(lat=(("node", [1, 2, 3]))))
def test_dispatch_meteo_sourc... | ec-jrc/pyPoseidon | tests/test_meteo.py | test_meteo.py | py | 3,426 | python | en | code | 17 | github-code | 1 | [
{
"api_name": "xarray.Dataset",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyposeidon.meteo.dispatch_meteo_source",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "p... |
37440654962 | from copy import deepcopy
import functools
from iceberg.api import DataOperations
from iceberg.api.expressions import Expressions, Literal, Operation, UnboundPredicate
from iceberg.api.types import TimestampType
from .manifest_group import ManifestGroup
from .util import str_as_bool
TIMESTAMP_RANGE_MAP = {Operation.... | wujiapei/alldata | oneLake/iceberg-versions/iceberg-0.13/python_legacy/iceberg/core/scan_summary.py | scan_summary.py | py | 15,929 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "iceberg.api.expressions.Operation.LT",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "iceberg.api.expressions.Operation",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "iceberg.api.expressions.Operation.LT_EQ",
"line_number": 12,
... |
27787721598 | import tweepy
import configparser
from datetime import datetime
import json
config = configparser.ConfigParser()
config.read('./twitter.ini')
ACCESS_TOKEN = config.get('twitter', 'ACCESS_TOKEN')
ACCESS_TOKEN_SECRET = config.get('twitter', 'ACCESS_TOKEN_SECRET')
API_KEY = config.get('twitter', 'API_KEY')
AP... | clairtonm/kafka-spark-course | kafka/twitter_batch.py | twitter_batch.py | py | 1,287 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tweepy.Cursor... |
39447744666 | #PYTHON 3
import urllib,json, time
from bs4 import BeautifulSoup
exec(open('/home/fbbot/cfb/sload.py').read())
confs_site=BeautifulSoup(urllib.urlopen('http://espn.go.com/college-football/standings?t='+str(time.time())),"html5lib")
conferences=confs_site.findAll('div',{'class':'responsive-table-wrap'})
confs={}
for ... | rankinr/FootballBot | updaters/confs.py | confs.py | py | 1,301 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "urllib.urlopen",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number... |
36262937913 | import math
import torch
from torch import nn
import torch.nn.functional as F
import torchvision
import torchaudio
from denoising_diffusion_pytorch import Unet, GaussianDiffusion
class DPTBlock(nn.Module):
def __init__(self, t_len, f_len, batch_first):
super(DPTBlock, self).__init__()
self.t_len = ... | GyoukChu/EE495 | DPTDiffSeg/DPTDiffSeg.py | DPTDiffSeg.py | py | 5,374 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.TransformerEncoderLayer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn... |
36524344047 | from datetime import datetime
from consulta.models import Agendamento
from consulta.ext.database import db
class AgendamentoService:
@staticmethod
def agendar_consulta(dados):
dados['data'] = datetime.strptime(dados['data'], '%Y-%m-%d %H:%M:%S')
agendamento = Agendamento(**dados)
db.s... | sabrinaa0408/agendamento-backend | consulta/blueprints/services/agendamento.py | agendamento.py | py | 617 | python | pt | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "consulta.models.Agendamento",
"line_number": 11,
"usage_type": "call"
},
{
"api_name... |
146107604 | # coding: utf-8
# This is the deepseg_gm model definition for the
# Spinal Cord Gray Matter Segmentation.
#
# Reference paper:
# Perone, C. S., Calabrese, E., & Cohen-Adad, J. (2017).
# Spinal cord gray matter segmentation using deep dilated convolutions.
# URL: https://arxiv.org/abs/1710.01269
import kera... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITHUB_REPOS/neuropoly@spinalcordtoolbox/spinalcordtoolbox/deepseg_gm/model.py | model.py | py | 6,230 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "keras.backend.flatten",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "keras.backend.flatten",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "keras.backe... |
41806562449 | # This file contains an attempt at actually putting the network trained in EncDec.py to practice
import keras
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Model, load_model
import pandas as pd
import pandas_ml as pdml
from matplotlib.widgets import Slider
def decode(onehot):
return n... | walterian/VLC-CAE | Implementation.py | Implementation.py | py | 3,348 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.argmax",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
... |
19025286012 | from pprint import pprint
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.metrics import roc_auc_score, r2_score, f1_score, recall_score, precision_score
from sklearn.model_selection import TimeSeriesSplit
from imblearn.over_sampling import... | vcerqueira/actionable_forecasting | experiments/forecasting_extremes.py | forecasting_extremes.py | py | 5,070 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.set_option",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "wave_height.confi... |
33969656326 | from scipy.interpolate import interp1d
import numpy as np
import pyglet
from board_colors import board_colors
from board_graphics import BoardBackground, BoardForeground
class ProbabilityDisplay:
def __init__(self, window_size, board_size, initial_probabilities):
self.window_size = window_size
self.board_siz... | lihmds/govis | probability_display.py | probability_display.py | py | 1,706 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "board_colors.board_colors",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "scipy.interpolate.interp1d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "board_graphics.BoardForeground.opacity_range",
"line_number": 13,
"usage_type": ... |
14993729383 | # -*- coding: utf-8 -*-
"""metrics module
Define our metrics module that encapsulates attributes and methods related to
the metrics we use for our lunar anomalies project.
"""
import matplotlib.pyplot as plt
import numpy as np
from inspect import signature
from sklearn.metrics import average_precision_score, auc
from s... | lesnikow/lunar-anomalies | lam/metrics.py | metrics.py | py | 9,530 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.title",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 83,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "ma... |
14839016648 | import numpy as np
from scipy.stats import multivariate_normal
from sklearn.cluster import KMeans
import cv2
np.random.seed(0)
def EM_Segmentation(data, parameters, epsilon):
mean_1 = parameters['mean_1']
mean_2 = parameters['mean_2']
covariance_1 = parameters['covariance_1']
covariance_2 = parameters[... | chenhuaizhen/Image_denoising_segmentation | EM-Segmentation.py | EM-Segmentation.py | py | 5,432 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats.multivariate_normal.pdf",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": ... |
21413137316 | import numpy
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from PIL import Image
import PIL.ImageOps
X= numpy.load("image.numpyz")['arr_0']
y = pd.read_csv("labels.csv")["labels"]
classes = ['A','B','C','D','E','F','G','H'... | SaanviSinha/Project-125 | program.py | program.py | py | 1,275 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "s... |
33468382901 | from __future__ import absolute_import, division
import time
import psychopy
from psychopy import sound, gui, visual, core, data, event
import pandas as pd
import numpy as np # whole numpy lib is available, prepend 'np.'
import os # handy system and path functions
import matplotlib.pyplot as plt
import math
import se... | ortegauriol/ShootingPy | ShootPy.py | ShootPy.py | py | 22,448 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_num... |
33880536633 | from collections import defaultdict
from utils import timeit
@timeit
def get_data():
data = []
with open('input.txt') as input_file:
for line in input_file:
value = line.strip().split()
data.append(value)
return data
def execute(program, default_registers=None):
# Do... | bdaene/advent-of-code | 2016/day23/solve.py | solve.py | py | 3,142 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "utils.timeit",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "utils.timeit",
"line_number": 95,
"usage_type": "name"
},
{
"api_name": "utils.timeit",
"... |
7487410735 | import datetime
import time
import tweepy as twitter
import keys
import random
auth = twitter.OAuthHandler(keys.api_key, keys.api_secret)
auth.set_access_token(keys.access_key, keys.access_secret)
api = twitter.API(auth)
def twitter_bot_retweet(hashtag, delay):
while True:
print(f'\n{datetime.datetime.... | mocnidule/twitterApiBot | main.py | main.py | py | 1,515 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keys.api_key",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "keys.api_secret",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "keys.access_k... |
22413513165 | from datetime import datetime
from enum import Enum
from typing import List
from fastapi import HTTPException
from pydantic import BaseModel, validator, root_validator
class SystemItemType(str, Enum):
FILE = "FILE"
FOLDER = "FOLDER"
class SystemItemTag(str, Enum):
Document = "Document"
Template = "... | Wintori/Electron | back/app/schems/item.py | item.py | py | 1,545 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_n... |
29675356473 | from dataclasses import dataclass
from datetime import datetime
from .. import db
@dataclass
class StockTimeline(db.Model):
__tablename__ = "stock_timeline"
id: int = db.Column(db.Integer, primary_key=True, autoincrement=True)
product_id: int = db.Column(db.Integer, db.ForeignKey("product.id"), nullable=... | CodePan1/VendingMachineFlask | src/models/stock_timeline.py | stock_timeline.py | py | 820 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 7,
"usage_type": "name"
}
] |
41695589361 | import os
import torch
from typing import Dict, List, Tuple, Optional
from dataclasses import dataclass
from src.dataType import State, Action
from src.animator.animator import Animator
from src.const import VNF_SELECTION_IN_DIM, VNF_PLACEMENT_IN_DIM
@dataclass
class DebugInfo:
timestamp: str
episode: int
... | euidong/sdn-lullaby | src/utils.py | utils.py | py | 6,070 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
881795625 | from django.shortcuts import render, get_object_or_404, redirect
from .models import Usuario
from .forms import UsuarioForm
def inicio(request) :
usuarios = Usuario.objects.all()
context = {
'usuarios' : usuarios
}
return render(request, 'usuarios/inicio.html', context)
def detail(request, id... | HugoMarquesz/cadastro_python | cadastro_python/usuarios/views.py | views.py | py | 1,443 | python | es | code | 1 | github-code | 1 | [
{
"api_name": "models.Usuario.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.Usuario.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.Usuario",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dj... |
72410596835 | import cv2 as cv
import numpy as np
import os
def dummy_resize(img, size):
_sz = np.shape(img)[:-1]
field = np.zeros((max(_sz), max(_sz), 3), dtype=np.uint8)
if _sz[0] > _sz[1]:
field[:, (_sz[0]-_sz[1])//2:(_sz[0]+_sz[1])//2+(_sz[1] % 2), :] = img
else:
field[(_sz[1]-_sz[0])... | onion-nikolay/cf-dataset-preprocessing | image_processing.py | image_processing.py | py | 3,981 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.shape",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_nu... |
15249763407 | import os
import numpy as np
from typing import Tuple, Dict
from nuscenes.utils.data_classes import Box, PointCloud, RadarPointCloud
from nuscenes.utils.geometry_utils import view_points, transform_matrix
from functools import reduce
from pyquaternion import Quaternion
# Taken from mrnabati/CenterFusion
class Radar... | robot-learning-freiburg/Batch3DMOT | batch_3dmot/utils/radar.py | radar.py | py | 6,959 | python | en | code | 28 | github-code | 1 | [
{
"api_name": "nuscenes.utils.data_classes.RadarPointCloud",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "... |
19816918134 | # -*- coding: utf-8 -*-
from django.contrib.sites.models import Site
from django.db import models
from django.db.models import Q
from django.utils import six
from cms.cache.permissions import get_permission_cache, set_permission_cache
from cms.exceptions import NoPermissionsException
from cms.models.query import PageQ... | farhan711/DjangoCMS | cms/models/managers.py | managers.py | py | 19,053 | python | en | code | 7 | github-code | 1 | [
{
"api_name": "cms.publisher.PublisherManager",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "cms.models.query.PageQuerySet",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.sites.models.Site.objects.get_current",
"line_number": 61,
"u... |
34865004001 | import numpy as np
import torch
import torch.nn as nn
# mix up
def mixup_data(x, y, alpha=0.4, device='cuda'):
'''
Compute the mixup data. Return mixed inputs, pairs of targets, and lambda
'''
if alpha > 0.:
lam = np.random.beta(alpha, alpha)
else:
lam = 1.
batch_size = x... | travisergodic/T-brain_STAS_Segmentation | utils.py | utils.py | py | 2,220 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "numpy.random.beta",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.randperm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.randperm",
... |
1158470099 | import cv2
import numpy as np
import argparse
import os
def draw_mask(event, x, y, flags, param):
if event == cv2.EVENT_LBUTTONDOWN:
param['drawing'] = True
param['current_contour'].append((x, y))
elif event == cv2.EVENT_MOUSEMOVE:
if param['drawing'] == True:
cv2.circle(par... | rawalkhirodkar/egohumans | egohumans/external/mmpose/tools/seg_vitpose/draw_seg_bbox.py | draw_seg_bbox.py | py | 3,281 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "cv2.EVENT_LBUTTONDOWN",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.EVENT_MOUSEMOVE",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.circle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.EVE... |
7486708725 | import sys,os
from os import scandir, getcwd
from os.path import abspath
import cv2
import numpy as np
import boto3
from botocore.client import Config
def ls(ruta = getcwd()):
return [abspath(arch.path) for arch in scandir(ruta) if arch.is_file()]
#from google.colab.patches import cv2_imshow
def draw_matches(img1... | geoinca/miniok | dockerimg/02warp2img.py | 02warp2img.py | py | 5,734 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.scandir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
72202901155 | import requests
from bs4 import BeautifulSoup
import csv
import json
class RokomaryBooks:
__url = ""
__data = ""
__wlog = None
__soup = None
def __init__(self, url,wlog):
self.__url = url
self.__wlog = wlog
def retrieve_webpage(self,x):
try:
... | ahasanhamza/rokomaryScrapping | wapscrap/wscrap.py | wscrap.py | py | 6,337 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_numb... |
70342944994 | import json
import logging
import os
from .threads import terminating
from .queueprocessor import QueueProcessor
logger = logging.getLogger(__name__)
BB_COVERAGE = 0
TB_COVERAGE = 1
class Coverage(QueueProcessor):
def __init__(self):
QueueProcessor.__init__(self)
# Split Bb and Tb coverage for... | S2E/s2e-env | s2e_env/server/coverage.py | coverage.py | py | 4,680 | python | en | code | 89 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "queueprocessor.QueueProcessor",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "queueprocessor.QueueProcessor.__init__",
"line_number": 17,
"usage_type": "call"
},
{
... |
25324472633 |
import asyncio as asy
class asyncIter:
def __init__(self):
self.item = None
self.itemSet = False
self.cond = asy.Condition()
self.stop = None
def __aiter__(self): return self
async def __anext__(self):
cond = self.cond
async with cond:
while not self.itemSet:
await cond.wait()
if self.s... | 8080509/GENERAL-PY | AsyncUtils.py | AsyncUtils.py | py | 1,830 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "asyncio.Condition",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "asyncio.CancelledError",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "asyncio.c... |
18534619427 | import numpy as np
import scipy.linalg as la
import matplotlib.pyplot as plt
import math as math
L = 1
E_I = 1
nes = [5, 10, 100]
nro_grupo = 18
def SOR(K, f, Imax, eps, u, omega):
D = np.diag(np.diag(K))
M = np.dot((1 / omega), D) + np.tril(K, -1)
N = M - K
r = np.dot(K, u) - f
x = u
i = 0
... | santiagoaso/numerico2018 | tp1.py | tp1.py | py | 3,328 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.diag",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.tril",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 15,
... |
2423327022 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_csv("survey_responses.csv")
# index refers to number of people getting correct for (question-1)
num_correct = []
for q_num in range(1,7):
correct_q = 0
for person_num in range(len(df)):
if df['PDDL Experience'][person_n... | reeceshuttle/966finalproject | analyze_survey_responses.py | analyze_survey_responses.py | py | 1,655 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.ara... |
31420316602 | from matplotlib import pyplot as plt
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn import metrics
import numpy as np
def best_forest(train_data, train_target, test_data, test_target):
"""
... | DavidLee233/randomforest | randomforest2.py | randomforest2.py | py | 3,091 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 31,
"usage_type":... |
22296950181 | from xml.etree.ElementTree import Element, SubElement, tostring
import os
mapLocal = Element('mapLocal')
toolEnabled = SubElement(mapLocal, 'toolEnabled')
toolEnabled.text = 'true'
mappings = SubElement(mapLocal, 'mappings')
webuiPath = '/Users/Ethan/QAD/src/service/webui/erp-service-webui'
resourceRelativePath = '/s... | putin266/worktools | localMapGen/gen.py | gen.py | py | 1,530 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "xml.etree.ElementTree.Element",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 7,
"usage_type": "call"
... |
22607295569 | import cv2
import os
import glob
import numpy as np
image_path=np.array(sorted(glob.glob(r"C:\Data\img\*.png")))
save_path=r"C:\Data\result"
def load_t(x):
img = cv2.imread(x,-1)
basename=os.path.basename(x)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
grad = grade(gray)
savepath=os... | liaochengcsu/jlcs-building-extracion | test_c4_vis.py | test_c4_vis.py | py | 748 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": ... |
39515075186 | from synapse_pay_rest.models.nodes import *
from synapse_pay_rest import User
from synapse_pay_rest import Client
from synapse_pay_rest import Node
from synapse_pay_rest import Transaction
from lib.wyre import wyre
import logging, graypy
import os, json
import threading
from requests import get
from pymongo import Mong... | todinhtan/vba_creator | create_transfer_queue.py | create_transfer_queue.py | py | 5,797 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.CRITICAL",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "graypy.GELFHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ... |
73670347555 | from kivy.uix.gridlayout import GridLayout
from kivy.uix.togglebutton import ToggleButton
from kivy.uix.image import Image, AsyncImage
from kivy.uix.widget import Widget
from kivy.metrics import dp
from typing import Callable, Dict
from lib.quest import Quest
import urllib
def _create_togglebutton(self, text: str, ... | malkavk/ValkyrieScenariosManager | lib/interface.py | interface.py | py | 4,955 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.Callable",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "kivy.uix.widget.Widget",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "kivy.uix.gridlayout.GridLayout",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": ... |
27957425720 | import numpy as np
from itertools import product
import random
class TicTacToe():
def __init__(self, N):
self.coords_list = [[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[2,0],[2,1],[2,2]]
self.alpha = 0.1
self.initialize_V()
self.eps = 0.1
self.games_won = 0
... | mjauza/AI_reinforcement_learning | tic-tac-toe.py | tic-tac-toe.py | py | 9,383 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 152,
"usage_type": "attribute"
},
{
"api_name": "random.randint"... |
40162630815 | # -*- coding: utf8 -*-
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: glycine
#
# Created: 13/01/2013
# Copyright: (c) glycine 2013
# Licence: <your licence>
#--------------------------------------------------------... | glycine/autoEncode | src/splitTs.py | splitTs.py | py | 10,355 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "optparse.OptionParser",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path.path.exists",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "os.path",... |
15971175771 | from base import BasicCalculation, Input
from aiida.orm import DataFactory
class NscfCalculation(BasicCalculation):
'''
Runs VASP with precalculated (from scf run) wave functions and charge densities.
Used to obtain bandstructures, DOS and wannier90 input files.
'''
charge_density = Input(types='v... | greschd/aiida-vasp | aiida/orm.calc.job.vasp/nscf.py | nscf.py | py | 5,256 | python | en | code | null | github-code | 1 | [
{
"api_name": "base.BasicCalculation",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "base.Input",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "base.Input",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "shutil.copyfile",
"lin... |
30040919497 | import time
import os
import re
import traceback
import sys
import getopt
from os.path import exists
from htmldocx import HtmlToDocx
import random
from xhtml2pdf import pisa
from gazpacho import Soup
from Md import Md
from Cd import Cd
class Main:
RET_ERROR_INVALID_ARGS = 1
RET_ERROR_PARSING_ARGS = 2
RET_... | AndersonPaschoalon/MdConv | Main.py | Main.py | py | 11,607 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.choice",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 94,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"lin... |
8197656719 | # -*- coding: utf-8 -*-
"""
Problem Set 2
"""
def crea_shift_func(bpsShort, bpsLong):
"""
Crea función desplazamiento.
Parámetros:
bpsShort : Puntós Básicos deplazamiento en tasa 0 días (parte corta)
bpsLong : Puntós Básicos deplazamiento en tasa 365 días (parte larga)
NOTA: 100 Punt... | FedericoMenendez22/pythonFinanzas | clases/Problemset2profe.py | Problemset2profe.py | py | 2,433 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 65,
"usage_type": "call"
}
] |
10218530153 | import scrapy
class PublikationenSpider(scrapy.Spider):
name = 'publikationen'
allowed_domains = ['blog.alexandria.unisg.ch']
start_urls = ['https://blog.alexandria.unisg.ch/2023/03/06/neue-hsg-publikationen-februar-2023/']
def parse(self, response):
articles = response.xpath('//*[@id="post-23... | ThesisCoacher/Data2DollarFS23 | 04_Abgabe Bonuspunkte/SimonettaFrancesco2.py | SimonettaFrancesco2.py | py | 673 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 3,
"usage_type": "attribute"
}
] |
29372887663 | import boto3
dynamodb = boto3.resource('dynamodb', region_name='us-west-2', endpoint_url='http://localhost:8000')
try:
resp = dynamodb.create_table(
AttributeDefinitions=[
{
"AttributeName": "LocationID",
"AttributeType": "S"
},
{
... | MathiasDarr/Snotel | usda_scrape/create_tables.py | create_tables.py | py | 1,684 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "boto3.resource",
"line_number": 2,
"usage_type": "call"
}
] |
31348168038 | import pandas as pd
import numpy as np
import tensorflow as tf
import random
import keras
from keras.callbacks import EarlyStopping
from keras import optimizers
import matplotlib.pyplot as plt
# read training data
print("Reading data...")
trainingData_RAW = pd.read_csv("optdigits/optdigits.tra",dtype = np.int32, hea... | jhtrzcinski/NN_Sandbox | Lab2_convoluted.py | Lab2_convoluted.py | py | 4,477 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"lin... |
23255146922 | from flask import Flask, render_template, jsonify, request
from flask_pymongo import PyMongo
from flask_cors import CORS, cross_origin
import json
import copy
import warnings
import re
import random
import math
import pandas as pd
pd.set_option('use_inf_as_na', True)
import numpy as np
import multiprocessing
from o... | angeloschatzimparmpas/VisRuler | run.py | run.py | py | 44,623 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.set_option",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "flask_pymongo.PyMongo",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",... |
34856065220 |
import seaborn as sns
import os
import pandas as pd
from IPython.display import Image
import json
import numpy as np
import natsort
from google.colab.patches import cv2_imshow
import cv2
import warnings
warnings.filterwarnings("ignore")
import matplotlib.pyplot as plt
from mtcnn import MTCNN
def get_video_Path(video... | khoatran02/Liveness_detection | crop_face.py | crop_face.py | py | 5,738 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
15122687987 | from numpy import linspace
from scipy import pi,sin,cos,sqrt,arctan2
import pylab as p
def ellipse(a,b,ang,x0,y0):
ca,sa=cos(ang),sin(ang)
t = linspace(0,2*pi,73)
X = x0 + a*cos(t)*ca - sa*b*sin(t)
Y = y0 + a*cos(t)*sa + ca*b*sin(t)
return X,Y
def decode_ee(e1,e2,scale=0.03):
#from: e = (a-... | Luhcile/Halo_matiere_noire | plotellipticity.py | plotellipticity.py | py | 1,698 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "scipy.cos",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "scipy.sin",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.pi",
"line_number": 7,
... |
21032849145 | from pygame_utilities import Sheet, Button, blit_alpha
import pygame as pg
import time
import random as r
import general as gral
class MainMenu:
def __init__(self):
self.img_bg = pg.image.load("data/images/main_menu/main_menu_bg.png")
# self.title = text(txt="No Dungeon RPG", font_style=info_font,... | hnezado/NoDungeonRPG | NoDungeonRPG/main_menu.py | main_menu.py | py | 4,895 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pygame.image.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
41054333536 | from botocore.exceptions import ClientError
import pytest
class MockManager:
def __init__(self, stub_runner, cluster_data, input_mocker):
self.cluster_data = cluster_data
self.db_engine = "test-engine"
self.group_name = "test-group"
self.group = {"DBClusterParameterGroupName": self... | awsdocs/aws-doc-sdk-examples | python/example_code/aurora/test/test_get_started_aurora_create_parameter_group.py | test_get_started_aurora_create_parameter_group.py | py | 3,350 | python | en | code | 8,378 | github-code | 1 | [
{
"api_name": "pytest.fixture",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "pytest.raises",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "botocore.exceptions.ClientError",
"line_number": 95,
"usage_type": "argument"
},
{
"api_name": ... |
16399864844 | import os
from glob import glob
from importlib import import_module
from django.urls import re_path as _re_path, path as _path
def _glob_init(name):
name = name.replace(".", os.sep)
path = os.sep + "**"
modules = []
for module in glob(name + path, recursive=True):
importable = os.path.splitex... | isik-kaplan/django-urls | django_urls/__init__.py | __init__.py | py | 1,940 | python | en | code | 39 | github-code | 1 | [
{
"api_name": "os.sep",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number"... |
32138672859 | # coding: utf-8
import os
import sys
from django.conf import settings
MIDDLEWARE = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'active_users.middleware.ActiveUsersSessionMiddleware',
... | n-elloco/django-active-users | tests/run_tests.py | run_tests.py | py | 1,618 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"l... |
32425704105 | from src.common.database import Database
import uuid
import datetime
class Post(object):
def __init__(self, blog_id, title, content, author, date_created=datetime.datetime.now(), _id=None):
self.blog_id = blog_id
self.title = title
self.content = content
self.author = a... | utpal-d4l/web_blog | src/models/post.py | post.py | py | 1,558 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "uuid.uuid4",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "src.common.data... |
31976366330 | from bs4 import BeautifulSoup
from urllib.parse import urlparse, parse_qs, unquote
input_tag_names = []
input_tag_ids = []
url_parameters=[]
# extract input tag names
def extract_input_tag_names(html_code):
soup = BeautifulSoup(html_code, 'html.parser')
for input_tag in soup.find_all('input', attrs={'name'... | arshiaor/elicit | htmlAttributeExtraction.py | htmlAttributeExtraction.py | py | 1,650 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "urllib.parse.ur... |
1585469939 | """Implements decorators used throughout the library."""
import json
from functools import wraps
from collections import UserDict
from validator_collection import checkers
from highcharts_core import errors, constants
def validate_types(value,
types = None,
allow_dict = True,
... | highcharts-for-python/highcharts-core | highcharts_core/decorators.py | decorators.py | py | 11,418 | python | en | code | 40 | github-code | 1 | [
{
"api_name": "highcharts_core.errors.HighchartsImplementationError",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "highcharts_core.errors",
"line_number": 70,
"usage_type": "name"
},
{
"api_name": "highcharts_core.errors.HighchartsImplementationError",
"line_numb... |
6445705454 | # -*- coding: UTF-8 -*-
"""Defines the CLI for creating a DataIQ instance"""
import click
from vlab_cli.lib.widgets import Spinner
from vlab_cli.lib.api import consume_task
from vlab_cli.lib.widgets import typewriter
from vlab_cli.lib.click_extras import MandatoryOption
from vlab_cli.lib.portmap_helpers import get_com... | willnx/vlab_cli | vlab_cli/subcommands/create/dataiq.py | dataiq.py | py | 4,594 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "vlab_cli.lib.portmap_helpers.network_config_ok",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "click.ClickException",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "vlab_cli.lib.api.consume_task",
"line_number": 51,
"usage_type": "cal... |
30051402329 | from torch import nn, optim
from transformers import BertModel
from transformers.models.bert.modeling_bert import BertModel,BertForMaskedLM
# TOKENIZACIÓN
PRE_TRAINED_MODEL_NAME = 'bert-base-cased'
# EL MODELO!
class BERTSentimentClassifier(nn.Module):
def __init__(self, n_classes):
super(BERTSent... | murdoocc/Sentiment_analysis | sentiment_analysis/primaryapp/BERTSentimentClassifier.py | BERTSentimentClassifier.py | py | 841 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "transformers.models.bert.modeling_bert.BertModel.from_pretrained",
"line_number": 11,
"usage_type": "call"
... |
22495049855 | # Time: 22/8/26 14:00
# Author: Haosen Luo
# @File: call_snp.py
import os
import configparser
from optparse import OptionParser
BIN = os.path.dirname(__file__) + '/'
file_config = configparser.ConfigParser()
file_config.read(BIN + 'config.ini')
class CorrectBase(object):
def __init__(self, bam_input... | Luosanmu/HostonBook | luohaosen_study_note/WES_2anno/script/correct_base.py | correct_base.py | py | 5,423 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
... |
69861207714 | #!/usr/bin/python3
"""Database Storage"""
# from sqlalchemy import
from sqlalchemy import create_engine
import os
from sqlalchemy.orm import sessionmaker, scoped_session, query
from models.base_model import Base
from models.city import City
from models.base_model import BaseModel
from models.state import State
from mod... | Tboy54321/airbnb_clone_v2_copy | models/engine/db_storage.py | db_storage.py | py | 2,250 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.amenity.Amenity",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "models.user.User",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.review.Review",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "models.p... |
16557361745 | # https://www.acmicpc.net/problem/16928
# Solved Date: 20.05.29.
import sys
import collections
read = sys.stdin.readline
MAX_BOARD = 100
DICE_NUM = 6
def explorer(board):
visit = [False for _ in range(len(board))]
queue = collections.deque()
# node, count
visit[1] = True
queue.append((1, 0))
... | imn00133/algorithm | BaekJoonOnlineJudge/CodePlus/600Graph/BFSPractice/baekjoon_16928.py | baekjoon_16928.py | py | 1,143 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 14,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.