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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19772051757 | from colorama import Fore, Style, init as colorama_init
"""
Module dedicated to produce all program
output if option "-nogui" is enabled by the
user in the command line.
"""
class TextualInterface:
def __init__(self, ans):
# Maximum PC value of the input instruction set
max_pc = max(ans["inst_status"])
# D... | FelSiq/scoreboarding-for-dynamic-instruction-scheduling | modules/interface.py | interface.py | py | 12,815 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "colorama.Fore.RED",
"line_number": 121,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 121,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.GREEN",
"line_number": 121,
"usage_type": "attribute"
},
{
"api_name": "colo... |
18767909726 | import argparse
import json
import logging
import os
import ssl
import bps.apply
import requests
import requests.adapters
import tempfile
logging.basicConfig(level="INFO", format="%(message)s")
logger = logging.getLogger("main.py")
logger.setLevel("INFO")
parser = argparse.ArgumentParser(description="... | msurkein/alttpr_scraper | main.py | main.py | py | 11,373 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "request... |
46902870074 | import os
import requests
from datetime import datetime
import re
from sqlalchemy import *
from sqlalchemy.exc import *
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait as... | UVA-DSI-2019-Capstones/CvilleData | scraper.py | scraper.py | py | 5,832 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path"... |
25986484383 | # -*- coding: utf-8 -*-
import argparse
import numpy as np
import pickle as pkl
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
CONSTANTS_PATH = 'constants'
CLASSES_NAMES = ['No Diacritic', 'Fatha', 'Fathatan', 'Damma', 'Dammatan', 'Kasr... | AliOsm/shakkelha | helpers/build_confusion_matrix.py | build_confusion_matrix.py | py | 4,940 | python | en | code | 72 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.cm",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "sklearn.utils.multiclass.unique_labels",
"line_number": 49,
"usage_type": "call"
},
{
... |
20117482728 | from itertools import permutations
with open('input.txt') as f:
people = {}
for data in f.readlines():
line = data.split('.\n')[0].split(' ')
p1 = line[0]
p2 = line[-1]
op = line[2]
value = int(line[3])
if p1 in people.keys():
people[p1][p2] = {'op': ... | rubengrootroessink/AdventOfCode | 2015/13/2.py | 2.py | py | 1,588 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "itertools.permutations",
"line_number": 25,
"usage_type": "call"
}
] |
278350921 | import os, time, sys
import colorama as C
from colorama import Fore as F
DEFAULT = F.LIGHTWHITE_EX
green = '\033[1;32m'
red ='\33[31;1m'
white = '\33[37;1m'
blue = '\33[36;1m'
yellow = '\33[1;33m'
red2 = '\33[6;31m'
def slowprint(s):
for c in s:
sys.stdout.write(c)
sys.stdout.flush()
time.sleep(1./50)
def ... | Hasirasenju/hack21 | main.py | main.py | py | 1,852 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "colorama.Fore.LIGHTWHITE_EX",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sys.stdout.write",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.std... |
22504448849 | #!/usr/bin/env python3
import argparse
import time
import os
import sys
import re
import pygraphviz as pgv
from dataclasses import dataclass
import types
import subprocess
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib.ticker import ScalarFormatter
import numpy as np
FTRACE_DIR = ... | hgn/ftrace-callgrapher | kernel-magnifier.py | kernel-magnifier.py | py | 20,345 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "os.path.getsize",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 147,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplo... |
41868134087 | import streamlit as st
import pandas as pd
import plotly.express as px
# Running Totals
data = pd.read_csv("2022_playoff_progressive.csv", parse_dates=True)
data.Date = data.Date = pd.to_datetime(data.Date)
data = data.set_index("Date")
# Daily Picks
daily_picks_df = pd.read_csv("2022_playoff_picks.csv", parse_dates=... | salmonsd/nba-playoff-progressive | app.py | app.py | py | 803 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",... |
8598873137 | # 0. Import sample images and tag list
# 1. Change to gray scale
# 2. Enhancement
# 3. Extract LBP feature
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from skimage import io
from skimage.color import rgb2gray
from skimage import exposure as ep
from skimage import featur... | wayfarerjing/rainforestfootprint | explore/RT_explore_lbp.py | RT_explore_lbp.py | py | 3,062 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "skimage.io.imread",
"line_nu... |
70504876533 | #!/usr/bin/env python
import sys
from datetime import datetime as dt
from operator import itemgetter
import logging
import json
import requests
AUTH_TOKEN = sys.argv[1]
HEADER = {'Authorization': AUTH_TOKEN}
INVESTOR_ID = sys.argv[2]
LOG_LOCATION = sys.argv[3]
VERSION = 'v1'
def get_balance():
r = requests.get(... | jdfoote/LendingClubInvestor | invest.py | invest.py | py | 3,644 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_nu... |
33017089982 | from django.urls import path
from personal import views
urlpatterns = [
path('', views.index, name='index'),
path('projects/', views.projects, name='projects'),
# path('blogs/', views.blogs, name='blogs'),
path('aboutme/', views.aboutme, name='aboutme'),
path('projects/<int:project_id>/', views.proje... | louieManuel238/personal-website | public_html/website/personal/urls.py | urls.py | py | 463 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "personal.views.index",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "personal.views",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.urls.pa... |
38401350948 | from django import forms
from django.forms import widgets
# 注册
class RegisterForm(forms.Form):
name = forms.CharField( widget=forms.TextInput(
attrs={'placeholder': '请输入用户名', 'value': '', 'required': 'required',}
),
max_length=20,
error_messages={'required': '用户名不能为空',}
)
pw =... | sawatariyuki/django_AM | user/forms.py | forms.py | py | 7,296 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.forms.Form",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
34346985630 | from collections import Counter
from json.decoder import JSONDecodeError
from logging import info
from flask import jsonify, redirect, request, url_for
from flask_login import current_user
from sqlalchemy import and_
from eNMS import db
from eNMS.base import bp
from eNMS.base.classes import classes
from eNMS.base.help... | amessick/eNMS | eNMS/base/routes.py | routes.py | py | 3,432 | python | en | code | null | github-code | 21 | [
{
"api_name": "flask.redirect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.url_for",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "eNMS.base.bp.route",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "eNMS.base.bp",
"l... |
33257425348 | """The :mod:`streamlit_app` serves as a demo application to show the poetry generation API system at work.
This runs on sreamlit
"""
# Author: Xinkai Chen
import requests
import streamlit as st
import SessionState
import datetime
base_url = "http://127.0.0.1:8080"
retrieval_endpoint = "retrieve"
def a... | mfogelson/11-785_project | app_update/app_turing.py | app_turing.py | py | 2,794 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "streamlit.title",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "SessionState.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "streamlit.button",
... |
73029514293 | import unittest
from pydicom.dataelem import DataElement
from pydicom.dataelem import RawDataElement, DataElement_from_raw
from pydicom.dataset import Dataset
from pydicom.tag import Tag
from pydicom.uid import UID
class DataElementTests(unittest.TestCase):
def setUp(self):
self.data_elementSH = DataElem... | LiuFang816/SALSTM_py_data | python/darcymason_pydicom/pydicom-master/tests/test_dataelem.py | test_dataelem.py | py | 7,169 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pydicom.dataelem.DataElement",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pydicom.dataelem.DataElement",
"line_number": 13,
"usage_type": "call"
},
{
"... |
27588901325 | ## Script for performing PCA and visualizing the results
# Data should be found in this repository under:
# 'data/SCLC_study_output_filtered_2.csv'
#
# PCA implementation form scikit-learn
# Created on January 16, 2020
# Author: Chris Avery
import numpy as np
import loadTestData as load_data
i... | rasmuserlemann/ADAP-ML | python_scripts/performPCA.py | performPCA.py | py | 4,126 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.empty",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"... |
10495315074 | # Author: Moahammad Javad Maheronnaghsh
# Email: mjmaher987@gmail.com | m.j.maheronnaghsh@gmail.com
from __future__ import unicode_literals
import math
class Event_EDF:
def __init__(self, arrival=None, duration=None, deadline=None):
self.arrival = int(arrival)
self.duration = int(... | mjmaher987/Real-Time-Embedded-Systems | EDF_RMS Scheduler/main.py | main.py | py | 8,300 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "math.lcm",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "math.inf",
"line_number": 177,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.xticks",
"line_number": 222,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
1557803517 | import flask
import uuid
from flask import session, redirect, url_for, Markup
from main import app, db
from main.models import Comment
@app.route('/')
def index():
comments = Comment.query.all()
return flask.render_template('index.html', comments=comments)
@app.route('/add_comment', methods=['POST'])
def add_co... | yuucu/burp_test | flask-app/main/views.py | views.py | py | 733 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "main.models.Comment.query.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "main.models.Comment.query",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "main.models.Comment",
"line_number": 10,
"usage_type": "name"
},
{
"... |
18139434273 | import random
import networkx as nx
import numpy as np
random.seed(11859)
def initialize_random_scalar_network(N, M, bias=0.5):
choices = [-1, 1]
probabilities = [1 - bias, bias]
network = np.random.choice(choices, size=(N, M), p=probabilities)
return network
def initialize_circular_scalar_network(... | cmnarrillos/uned_Sociophysics | Opinion_Dynamics_models/aux_functions.py | aux_functions.py | py | 6,568 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.where",
"l... |
19129792912 | import logging as logger
from typing import Callable
from termcolor import colored
class menu:
def __init__(self, options = {}):
self.options = options
def add_option(
self, option_id, option_text: str, option_fn=None, params=None
) -> None:
self.options[option_id] = {
... | Nikol-Hodos-Forter/cgm | menu.py | menu.py | py | 1,978 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.debug",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
... |
33171103245 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description: Seg shp
Author: yulu_ye16@163.com
'''
import os
import shapefile
import shutil
if __name__ == '__main__':
wd_path = 'F:/yeyulu/biomass'
date = '20220705'
mapBasePolyShpFile = os.path.join(wd_path, date, 'RGB/shp_3d/samples.shp')
# 目标文... | YuluYe16/PhenoUAV | PCD/0.SegShp.py | 0.SegShp.py | py | 1,618 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
16300461670 | # -*- coding: utf-8 -*-
"""
Created on Sun May 22 21:11:11 2022
@author: nagra
"""
#The duration is equal to the number of frames divided by the framerate (frames per second):
import sys
import os
import wave
import contextlib
from utils import *
import numpy as np
import matplotlib.pyplot as plt
impor... | MikeCamp1998/Machine-Learning | Language_Detection/data_preprocessing/generate_mfccs.py | generate_mfccs.py | py | 9,982 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "os.path.isdir",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
28601072923 | from lowpass import LowPassFilter
from yaw_controller import YawController
from pid import PID
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicleMass, breakDeadband, decLimit, accLimit,
wheelRadius, wheelBase, steerRatio, maxLatAcc, maxS... | jakubkid/ROS_Full_Self_Driving_Car | ros/src/twist_controller/twist_controller.py | twist_controller.py | py | 1,955 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pid.PID",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lowpass.LowPassFilter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "yaw_controller.YawController",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rospy.get_... |
23715212472 | from django.shortcuts import render
from MokaApp.models import Mascotas, Cuidadores,Reservas
from MokaApp.forms import cuidador_formulario, mascota_formulario, reserva_formulario,UserRegisterForm, UserEditForm
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import login, authenticate
... | tomifernandez1/Coder_Python_ProyectoFinal_Fernandez | MokaApp/views.py | views.py | py | 11,045 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 14,
"usage_type": "name"
... |
24234116160 | from common import PETSc, norm, dx, DumbCheckpoint, sin, inner, grad, avg, jump, ds, dS, FacetNormal, action
from common import FunctionSpace, SpatialCoordinate, Function, Projector, NonlinearVariationalProblem, NonlinearVariationalSolver
from common import TestFunction, pi, TrialFunction
from common import ds_v, ds_t,... | celdred/themis | examples/sipdghelmholtz/sipdg.py | sipdg.py | py | 5,240 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "common.PETSc.Options",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "common.PETSc",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "common.PETSc.Sys.Print",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "common.PETSc.S... |
32462592213 | from flask import Flask, request, session, render_template
import sqlite3
import datetime
import socket
import pickle
import time
from threading import Thread, get_ident, RLock
from copy import deepcopy
from Crypto.Cipher import AES
from databank.monitor import loginsert, logdelete, logreturn, loginput, logsanitize, l... | databank-anon/databank | src/databank/application.py | application.py | py | 24,063 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "databank.monitor.lock",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "databank.calls.Server",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "Cry... |
39734205686 | import datetime
import math
from collections import namedtuple
from typing import Generator, Iterable, Optional, Sequence, Union
import numpy as np
import PIL.Image
import torch
import torch.utils.data
from sqlalchemy import func, orm, select, update
from torch import nn
from torchvision import transforms
from trapda... | RolnickLab/ami-data-companion | trapdata/ml/models/tracking.py | tracking.py | py | 27,462 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "math.ceil",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_numb... |
41975118252 | import json
from dorna2 import Dorna
"""
Use play method to send command to the robot.
There are many ways to call this method
"""
def main(robot):
# send a command and wait for its completion, by setting the time_out parameter to 0. The default value for time_out is 0.
arg = {"cmd": "jmove", "rel": 1, "j0":50, "vel"... | Echxvx2610/app_dornaGUI | play_test.py | play_test.py | py | 1,351 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "json.load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "dorna2.Dorna",
"line_number": 36,
"usage_type": "call"
}
] |
31795262481 | """
Critic-network
"""
import os
import numpy as np
import torch as T
import torch.nn as nn
import torch.optim as optim
from torch.distributions.categorical import Categorical
class CriticNetwork(nn.Module):
def __init__(self, input_dims, alpha, fc1_dims=10, fc2_dims=10,
chkpt_dir='./tmp/ppo'):
... | ivanbalak/BFW-PPO | PPO/lib/criticNetwork.py | criticNetwork.py | py | 1,673 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
74534202292 | import logging
import json
import re
from urllib.parse import urlparse
from django.shortcuts import get_object_or_404
from django.http.response import HttpResponse, HttpResponseNotAllowed, HttpResponseGone, HttpResponseNotFound, HttpResponseBadRequest
from django.views.decorators.csrf import csrf_exempt
from django.c... | YuzuRyo61/CrossPlan | fediverse/views/Inbox.py | Inbox.py | py | 7,383 | python | en | code | 8 | github-code | 21 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "fediverse.models.User",
"line_number": 35,
"usage_type": "argument"
},
{
"api_name": "django.http.response.HttpResponseGone",
"line_number": 37,
"usage_type": "ca... |
32116504798 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
import math
import pdb
import torch.utils.model_zoo as model_zoo
__all__ = ['ResNet', 'resnet18', 'resnet... | jiasenlu/NeuralBabyTalk | misc/resnet.py | resnet.py | py | 9,370 | python | en | code | 525 | github-code | 21 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_nu... |
610062804 | from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter(name='replace')
@stringfilter
def replace(value, arg):
if value:
value = value.upper()
return value
@register.filter(name='add_label')
def add_label(value, arg):
new... | mugbug/django-course | fleet_control/resources/templatetags/resources_extras.py | resources_extras.py | py | 380 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.template.defaultfilters.stringfilter",
"line_number": 7,
"usage_type": "name"
}
] |
7167040113 | # Importing required modules
from fastapi import APIRouter, HTTPException
import requests
# Importing controllers and requests module
from controllers.CountryController import CountryController
# Create an instance of the APIRouter class
router = APIRouter()
# Define the routes in the router instance:
# World stati... | ZoranUTF8/CovidStatMonitor | backend/router/countryRouter.py | countryRouter.py | py | 1,181 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "controllers.CountryController.CountryController.get_all_countries_data",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "controllers.CountryController.CountryController",
"li... |
72201858294 |
from openpyxl import load_workbook
class DoExcel:
"""读写Excel文件"""
def get_data(self,filename,sheetname):
wb=load_workbook(filename)
sheet=wb[sheetname]
test_data=[]
#读取Excel数据存入列表
for i in range(2,sheet.max_row+1):
row_data={}
row_data['case_id'] = sheet.cell(i, 1).value #第一列... | 2504973175/API_test | common/doExcel.py | doExcel.py | py | 1,555 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 32,
"usage_type": "call"
}
] |
5681183467 | import json
from io import BytesIO
from django import template
from django.contrib import messages
from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.shortcuts import HttpResponse
from django.shortcuts import redirect
from... | Tejaso7/Employees-Management-System-Django | EMS/employee_information/views.py | views.py | py | 40,691 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 66,
"usage_type": "call"
},
{
"api_nam... |
19613339068 | # %%
import tensorflow as tf
from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2
from faces_module import Embedding
from modules.models import ArcFaceModel
from centernet import Detector
import cv2
import numpy as np
import glob
from sklearn.metrics.pairwise import cosine_simi... | nguyenhuunam852/AttendanceSystem | load_model.py | load_model.py | py | 3,030 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "modules.models.ArcFaceModel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.latest_checkpoint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 15,
"usage_type": "attribute"
},
{
... |
26494827131 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from common.baseutil.g_function import sigmoid
from init_data import init_cat_data
print("这是一个识别小猫的Ai算法,基于stand NN")
# step2: 定义预测函数
def predict(X, W, b):
z = np.dot(W.T, X) + b # 用每一个权重乘以每一个特征值计算出每一个Z值: 1行M列
A... | StevenZhou5/StudyApplication | MyAiProject/python-dnn/main.py | main.py | py | 2,935 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.dot",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "common.baseutil.g_function.sigmoid",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.log",
... |
2495104513 | import numpy as np
import random
from tqdm import tqdm
import networkx as nx
from Src.utilities import alias_setup,alias_draw
from gensim.models import Word2Vec
''' This module concentrates on building the second order Random walks needed for Node2vec alogorithm to work'''
'''This Class describes the Node2vec impleme... | srimouli04/my_node2vec | Src/graph_algos.py | graph_algos.py | py | 4,372 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "Src.utilities.alias_draw",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "Src.utilities.alias_draw",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "random.sh... |
72236101812 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from utils import get_model
from losses import SCELoss, GCELoss, DMILoss
from tqdm import tqdm
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
class StandardCE... | chengtan9907/Co-learning-Learning-from-noisy-labels-with-self-supervision | algorithms/StandardCE.py | StandardCE.py | py | 3,364 | python | en | code | 107 | github-code | 21 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.get_model"... |
24078852051 | import pymongo
import ssl
class log_insertion_to_db:
"""
This class shall be used to create connection to the
database and create necessary tables.
Written By: Shahriar Sourav
Version: 1.0
Revisions: None
"""
def __in... | shahriarkasib/cementStrengthPrediction | log_insertion_to_db/log_insertion_to_db.py | log_insertion_to_db.py | py | 1,403 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ssl.CERT_NONE",
"line_number": 20,
"usage_type": "attribute"
}
] |
74676363251 | from paho.mqtt.client import Client
import paho.mqtt.client as mqtt
from json import dumps, loads
import time
import math
from hashlib import sha256, sha384, sha512, md5
from mmh3 import hash, hash128
from zlib import crc32
import datetime
from threading import Thread
from subprocess import run
CONNECT_RESULT_CODES = ... | teutoniclongboat/Visual-Perception | tb_program/ota/mqtt_firmware_client.py | mqtt_firmware_client.py | py | 13,643 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "paho.mqtt.client.MQTT_ERR_CONN_LOST",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "paho.mqtt.client",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "paho.mqtt.client.MQTT_ERR_SUCCESS",
"line_number": 30,
"usage_type": "attribute... |
2949580016 | from enum import Enum
from django.contrib.auth.models import AbstractUser
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from .validators import validate_username
Limit_on_the_number_of_characters = 30
class Role(Enum):
USER = 'user', 'Аутентифицированный по... | iamzanuda/api_yamdb | api_yamdb/reviews/models.py | models.py | py | 6,106 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 20,
"usage_type": "call"
},
{
"api_... |
74504489971 | import config, os
from Core import Utils
class Plugin(object):
parameterHook = "--squid"
parameterDescription = "Reconfigure Squid"
parameterArgs = ""
autoRun = True
configFiles = [
"/etc/squid/allow_dst",
"/etc/squid/allow_hosts",
"/etc/squid/allow_domains",
"/etc... | belasin/tums | tums/trunk/etch-release/plugins/Squid.py | Squid.py | py | 12,939 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.system",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 26,
... |
70902898932 | import cv2
import matplotlib
import numpy as np
import math
from matplotlib import pyplot as plt
import imutils
from graphManager import Graph
import scipy
import networkx
import difflib
def borders(x, y, width, height):
isNorth = False
isSouth = False
isEast = False
isWest = False
borderData = []... | Federickg23/naturalLangPathGen | main.py | main.py | py | 24,745 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.fitEllipse",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "cv2.ellipse",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "cv2.boundingRect",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_nu... |
71579399412 | from Crypto import Random
from Crypto.Cipher import AES
import base64
BS = AES.block_size
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[:-ord(s[len(s)-1:])]
key = f'{SECRETKEY}'.encode()
iv = f'{INITIALIZATION_VECTOR}'.encode()
print(key, iv)
def encrypt(message):
message =... | husnulhidayat/aes_cbc_encdec | enc_dec.py | enc_dec.py | py | 679 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "Crypto.Cipher.AES.block_size",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "Crypto.Cipher.AES",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 16,
"usage_type": "call"
},
{
"api_name"... |
25331065875 | ### This is source code used for an invited lecture on Data Mining using Python for
### the Institute of Technology at Blanchardstown, Dublin, Ireland
### Lecturer and presenter: Dr. Peter Mooney
### email: peter.mooney@nuim.ie
### Date: November 2013
###
### The purpose of this lecture is to provide students with an ... | petermooney/datamining | plotExample2.py | plotExample2.py | py | 2,502 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.pie",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.axis",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplo... |
24420083933 | from turtle import color
import dash
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
colors = {"background": "#111111", "text": "#7FDBFF"}
app.layout = html.Div(
id="parent_div",
children=[
html.H1(
"Sample Dashboard", style={"textAlign": "center", ... | sonercand/Data-Visualisation-Python | dash1/basicDashboard.py | basicDashboard.py | py | 1,031 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dash.Dash",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "dash_html_components.Div",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dash_html_components.H1",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dash_core_co... |
17142141061 | import matplotlib.pyplot as plt
import numpy as np
def load_data_from_txt(input_file):
layer_data_dict = {}
with open(input_file, 'r') as in_hdr:
line = in_hdr.readline()
key = ''
while line:
if line.startswith('###'):
key = line.strip('###').strip('\n').str... | kun0906/application_classification | paper_stat_Lu/visualize_each_layer_cnn.py | visualize_each_layer_cnn.py | py | 2,172 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matpl... |
74788185012 | from mythril.laser.ethereum.svm import LaserEVM
from mythril.laser.ethereum.state import Account
from mythril.disassembler.disassembly import Disassembly
from mythril.laser.ethereum.transaction.concolic import execute_message_call
from datetime import datetime
from mythril.laser.ethereum.util import get_concrete_int
im... | AwesomeHuang/Tako-Smart-Contract-Platform | mythril/tests/laser/evm_testsuite/evm_test.py | evm_test.py | py | 2,562 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "mythril.laser.ethereum.state.Account",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "mythril.d... |
1004750451 | #!/usr/bin/env python
from lxml import etree
from cairosvg.surface import PNGSurface
import argparse
import copy
G = '{http://www.w3.org/2000/svg}g'
class SVGSplitter(object):
def __init__(self, url, ppmm):
svg_file = open(url, 'rb')
self.tree = etree.fromstring(svg_file.read())
self.l... | festlv/svghost | splitter.py | splitter.py | py | 1,996 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "lxml.etree.fromstring",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lxml.etree.strip_eleme... |
5989866526 | """Utilities and tools for tracking runs with Weights & Biases."""
import logging
import os
from contextlib import contextmanager
from pathlib import Path
try:
import wandb
assert hasattr(wandb, '__version__') # verify package import not local dir
except (ImportError, AssertionError):
wandb = None
RAN... | mert-kurttutan/pytorch-template | src/utils/loggers/wandb.py | wandb.py | py | 3,916 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "wandb.init",
"line_number": 5... |
36232159071 | # app/__init__.py
from flask import Flask, request
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from prometheus_client import make_wsgi_app
from dotenv import load_dotenv
from .utils.monitoring import start_monitoring, configure_prometheus
from time import time
load_dotenv()
app = Flask(__name__)
... | GovA11y/frontend | app/__init__.py | __init__.py | py | 800 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.monitoring.start_monitoring",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flas... |
35489315657 | import scrapy
import json
import re
from scraper.scraper.items import Recipe, RecipeCategory, Ingredient
# from scrapy.spiders import CrawlSpider
class RecipeItem(scrapy.Item):
# define the fields for your item here like
title = scrapy.Field()
link = scrapy.Field()
rating = scrapy.Field()
ingredie... | Philippeomalley/finalproject | recipeapp/src/main/scraper/scraper/spiders/bbcgoodfood.py | bbcgoodfood.py | py | 3,435 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "scrapy.Item",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Field",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scrapy.Field",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scrapy.Field",
"line_nu... |
43806090965 | from PIL import Image
from torch.utils.data import Dataset
import torchvision
class DatasetSimulationImages(Dataset):
"""
Custom dataset for the tactile simulated images.
'''
Attributes
----------
image_path_lists : list
a list of image paths
transform : torchvision.transforms
... | hsp-iit/multi-tactile-6d-estimation | train/dataset.py | dataset.py | py | 1,617 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 71,
"usage_type": "name"
},
{
"api_name": "torchvision.transfor... |
17050202336 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
def get_dawn_columns():
url = "https://www.dawn.com/newspaper/column"
chrome_options = Options()
chrome_options.add_argument('--headless')
driver = webdriver.Chrome(options... | mirzahaider/good-serve | auto.py | auto.py | py | 711 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
... |
35156062231 | #!/bin/python
## pip install pyyaml
##
import csv
import os
import random
import yaml
## To read YAML file
# dir_path = os.path.dirname(os.path.realpath(__file__))
# with open("dev/test2.yml", "r") as f:
# data = yaml.safe_load(f)
# print(data)
# print(type(data))
# # contents[]
# # print(PWD)... | tcjoel/python | test_ReadWriteYAML.py | test_ReadWriteYAML.py | py | 1,581 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "yaml.dump",
"line_number": 68,
"usage_type": "call"
}
] |
39066977992 | # Databricks notebook source
import os
from pyspark.sql.types import *
from pyspark.sql.functions import current_timestamp, input_file_name, col, explode, lit, concat, date_format
from delta.tables import DeltaTable
from etldatabricks.utils.constants import WEATHER_AIR_QUALITY_CONTAINER_PATH, RAW_DATA_PATH, BRONZE_ST... | rafalnac/weather-air-quality-poland | etldatabricks/air_quality/gios_measure_points_data.py | gios_measure_points_data.py | py | 7,164 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "etldatabricks.utils.constants.RAW_DATA_PATH",
"line_number": 53,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_nam... |
28317356101 | import copy
import logging
from fedoidc import ClientMetadataStatement
from fedoidc import ProviderConfigurationResponse
from oic import oic, OIDCONF_PATTERN
from oic.exception import CommunicationError, ParameterError
from oic.exception import ParseError
from oic.exception import RegistrationError
from oic.oauth2 im... | jkakavas/fedoidc | src/fedoidc/client.py | client.py | py | 9,567 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "json.JSONDecodeError",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "oic.oic.Client",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "oic.oic",
... |
16671261860 | import json
import os
import boto3
def lambda_handler(event, context):
dynamodb_client = boto3.resource('dynamodb')
table = dynamodb_client.Table(os.environ["TableName"])
user = event['queryStringParameters']['user']
try:
response = table.get_item(Key={'id': user})
if 'Item' in res... | jovannajdovski/Cloud_photo_album | photo-album/sharing/get_shared_content/get_shared_content.py | get_shared_content.py | py | 1,033 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "boto3.resource",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
}
] |
29752428066 | #!/usr/bin/env python
# ============================================================================
# Project Name : iTrade
# Module Name : itrade_wxpanes.py
#
# Description: wxPython Panes for the Matrix
#
# The Original Code is iTrade code (http://itrade.sourceforge.net).
#
# The Initial Developer of the O... | eternallyBaffled/itrade | itrade_wxpanes.py | itrade_wxpanes.py | py | 58,200 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "itrade_config.nowxversion",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "wx.ListCtrl",
"line_number": 125,
"usage_type": "attribute"
},
{
"api_name": "wx.lib.mixins.listctrl.ListCtrlAutoWidthMixin",
"line_number": 125,
"usage_type": "attri... |
20594540779 | import torch.nn as nn
from models.nrha_body import NRHABody
class NRHABodyAdv(NRHABody):
def __init__(self, hparams):
super().__init__(hparams)
out_dim = hparams.head_num * hparams.head_dim
padding = (hparams.kernel_size - 1) // 2
assert 2 * padding == hparams.kernel_size - 1, "Ke... | Ruixinhua/NRHA | models/nrha_body_adv.py | nrha_body_adv.py | py | 753 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "models.nrha_body.NRHABody",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv1d... |
29803597246 | import datetime
import hashlib
import os
import urllib
import jinja2
import webapp2
import logging
import base64
from google.appengine.ext import ndb
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from gaesessions import get_current_session
#jinjaの定義
JINJA_ENV... | hrwatahiki/omoide-makimono | main.py | main.py | py | 10,279 | python | ja | code | 0 | github-code | 21 | [
{
"api_name": "jinja2.Environment",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
70045841974 | import json
from botocore.exceptions import ClientError
from flask import request, Response
from flask_restful import Resource
from flask_restful import reqparse
from ecommercy.utils.utils import serialize, deserialize
from ecommercy.db.db import db
class BatchGet(Resource):
''' BatchGet '''
TableName = "us... | cldcvr/dbdriver-python-sample-app | routes/batch.py | batch.py | py | 4,019 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask_restful.Resource",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.request.get_json",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "ecommercy... |
32820719983 | import math
from threading import Thread
from msgpack import loads
from socket import *
import nltk
import numpy as np
import os
import pygame
import random
import sys
from nltk import tokenize
from Display_output import Config
from Display_output import Util
class Runner:
def __init__(self, participant_name, ex... | BaiYunpeng1949/adaptive-text-display-prototype | Display_output/Ada_pygame_prototype.py | Ada_pygame_prototype.py | py | 58,468 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "nltk.download",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "pygame.d... |
17474092444 | from PyQt5 import QtCore, QtWidgets
class Ui_Calculator(object):
def setupUi(self, Calculator):
Calculator.setObjectName("Calculator")
Calculator.resize(495, 360)
self.centralwidget = QtWidgets.QWidget(Calculator)
self.centralwidget.setObjectName("centralwidget")
# Input f... | Maksydenko/software-creation-technologies | practice-02/main.py | main.py | py | 6,503 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QLineEdit",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5... |
71375054454 | # -*- coding: utf-8 -*-
"""
@author: Malek
"""
from sklearn.model_selection import RepeatedKFold
from sklearn.model_selection import GridSearchCV
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn.preprocessing
from sklearn import preprocessing
fro... | Malek-01/Transit-delay-prediction | Sydney case study/Main code ((including processing, prediction and merging)/SVM model selection (preprocessing).py | SVM model selection (preprocessing).py | py | 3,622 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.sum",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "nu... |
2473119231 | from django.shortcuts import render
from products.models import Product
from .models import Newsletter
from .forms import NewsletterForm
def newsletter(request):
form = NewsletterForm(request.POST or None)
product_list = Product.objects.get_products()[:3]
context = {
'title': None,
'form': for... | edarlynton/django-realestate-marketplace | src/newsletter/views.py | views.py | py | 800 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "forms.NewsletterForm",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "products.models.Product.objects.get_products",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "products.models.Product.objects",
"line_number": 11,
"usage_type": "att... |
13367344765 | import pickle
import pandas as pd
import numpy as np
with open('./kbo_player.pkl', 'rb') as f:
data = pickle.load(f)
pd.set_option('display.max_rows',None)
kbo = pd.DataFrame(data)
kbo.loc[kbo.연봉.apply(lambda x: len(x) == 0), '연봉'] = np.nan
# kbo.loc[kbo['연봉'].apply(lambda x: len(x) == 0), '연봉'] = np.nan
a = kbo['... | jinman-kim/playdata | kbo_연봉.py | kbo_연봉.py | py | 1,421 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "pickle.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_num... |
35068341507 | import functools
from logging import error
import os
import re
from flask import Flask, render_template, flash, request, redirect, url_for,session,g,make_response
from db import get_db, close_db
import utils
from re import X
from werkzeug.security import generate_password_hash, check_password_hash
from werkz... | GonzaloCossio/ProyectoCiclo3 | app.py | app.py | py | 15,407 | python | es | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.g.user",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number":... |
10112869874 | import torch
import torch.nn as nn
import torchvision.models as models
class baseline(nn.Module):
def __init__(self):
super(baseline, self).__init__()
# input channel 1, output channel 64
self.conv1 = nn.Sequential(
nn.Conv2d(3, 64, kernel_size=3),
nn.BatchNorm2d(64... | thyungkim/Exploring-Convolutional-Network-and-Transfer-Learning | model.py | model.py | py | 2,082 | python | en | code | 0 | github-code | 21 | [
{
"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.Sequential",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
6923248100 | import os
import sys
PROJECT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(PROJECT_PATH)
from measurement import Stopwatch
from toolbox import is_prime_naive
class Solution(Stopwatch):
def __init__(self):
super().__init__()
def execute(self):
... | ony3000/project-euler | problems_051to075/problem_058/solution.py | solution.py | py | 1,192 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
80740747 | from openpyxl import Workbook
from openpyxl.reader.excel import load_workbook
def sorVec(phrase):
alp = 'abcdefghijklmnopqrstuvwxyz'
table = {}
for i in range(26):
for j in range(26):
table[ alp[ i ] + alp[ j ] ] = 0
list = [ ]
for i in range(len(phrase) - 1):
list.app... | tudou0728/openFoodAnalyse | twoGrams.py | twoGrams.py | py | 1,578 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "openpyxl.Workbook",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "openpyxl.reader.excel.load_workbook",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "openpyxl.reader.excel.load_workbook",
"line_number": 58,
"usage_type": "call"
}
] |
22748001622 | import face_recognition
from datetime import datetime
import sqlite3
import numpy as np
import pickle
import cv2
import time
t1 = time.time()
conn = sqlite3.connect("db.sqlite3")
cursor = conn.cursor()
cursor.execute("SELECT * FROM FRS")
facecount = cursor.fetchall()
cursor.close()
conn.close()
known_face_encodings =... | slowpokalipsis/recognition_diploma | sqlite_recog.py | sqlite_recog.py | py | 4,533 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickle.loads",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": ... |
42841117851 | from django import forms
from django.forms import inlineformset_factory
from .models import Application, Attachment
from kms.contrib.children.models import Child
from kms.contrib.parents.models import Parent
AttachmentFormset = inlineformset_factory(Application,
Attachment,
... | gatsinski/kindergarten-management-system | kindergarten_management_system/kms/contrib/applications/forms.py | forms.py | py | 1,889 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "django.forms.inlineformset_factory",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Application",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "models.Attachment",
"line_number": 10,
"usage_type": "argument"
},
{
"api... |
41881882676 | from abc import ABC
import string
from typing import List, Optional
from lxml import etree
from .base import BaseExtractor
from .models import MultiWordExpression
class ContinuousExtractor(BaseExtractor, ABC):
def __init__(self,
language_from: str,
languages_to: Optional[List[s... | UUDigitalHumanitieslab/perfectextractor | perfectextractor/apps/extractor/continuousextractor.py | continuousextractor.py | py | 2,655 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "base.BaseExtractor",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_nu... |
23569105293 | import re
import docx
import customtkinter
from docx.shared import Pt as fontSize
from math import floor as roundDown
from tkinter.filedialog import askopenfilename, asksaveasfilename
customtkinter.set_appearance_mode("dark")
customtkinter.set_default_color_theme("dark-blue")
root = customtkinter.CTk()
root.geometry(... | JHAhmed/BionicText | main.py | main.py | py | 3,826 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "customtkinter.set_default_color_theme",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "customtkinter.CTk",
"line_number": 11,
"usage_type": "call"
},
... |
73644768692 | import click
import h5py
import numpy as np
def log_data_info(file_path, output_path, data):
length = len(file_path)
str = '='*length + '\n{}\n'.format(file_path) + '='*length + '\n'
str += 'Num:\t{}\n'.format(data.shape[0])
str += 'Shape:\t{}\n'.format(data.shape[1:])
with open(output_path, 'a')... | placaille/segmentation-transfer | src/data/explore.py | explore.py | py | 860 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "h5py.File",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "click.argument",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "click.Path",
"line_number"... |
32137793636 | from django.shortcuts import render,redirect
from django.contrib import messages
from django.contrib.auth.models import User,auth
from main.models import Person,Customer,Seller,mail_verification
import random
import smtplib, ssl
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from cr... | AntwanEmil/ta3refa | register/views.py | views.py | py | 17,212 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.auth.authenticate",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.auth",
"line_number": 21,
"usage_type": "... |
19082604933 | ### Facial KeyPoint Detection ###
### Import libraries ###
import numpy as np, matplotlib.pyplot as plt, pandas as pd
from time import sleep
import webbrowser, os
### Model libraries ###
from keras.layers import Conv2D,Dropout,Dense,Flatten
from keras.models import Sequential
from keras.layers.advanced_activations ... | markoo26/Kaggle_Kernels | FacialKeypointDetection.py | FacialKeypointDetection.py | py | 5,529 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "webbrowser.open_new_tab",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
13219693356 | # -*- coding: utf-8 -*- %reset -f
"""
@author: Hiromasa Kaneko
"""
# Demonstration of Double Cross-Validation (DCV) for PLS
import matplotlib.figure as figure
import matplotlib.pyplot as plt
import numpy as np
from dcekit.validation import double_cross_validation_group
from sklearn import datasets
import pandas as pd... | hkaneko1985/dcekit | demo_double_cross_validation_group_for_pls.py | demo_double_cross_validation_group_for_pls.py | py | 2,564 | python | en | code | 45 | github-code | 21 | [
{
"api_name": "sklearn.datasets.make_regression",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.c_",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy... |
26889955850 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import mean_squared_error
from math import sqrt
params = {
'image.origin': 'lower',
'image.interpolation': 'nearest',
'i... | mahmoud-al-najar/bathymetry_estimation | utils/visualization/visualize_subplots.py | visualize_subplots.py | py | 3,524 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "matplotlib.rcParams.update",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.pad",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.a... |
41263642754 | from flask import request, jsonify, json, Blueprint
import requests
import json
search = Blueprint("search", __name__)
@search.route("/search/deals/<string:searched>", methods=["GET"])
def get_deals(searched):
params = {
"spider_name": "amazon_spider",
"start_requests": True,
}
response =... | sushiPlague/tribble-amazon-sci-fi-book-crawler | blueprints/search.py | search.py | py | 523 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_numb... |
4154067861 | #!/usr/bin/env python
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import TruncatedSVD as SVD
from sklearn.decomposition import PCA, FastICA
from sklearn.random_projection import SparseRandomProjection as RP
from sklearn.neural_network import MLPClas... | neelaksh007/CS7641_Assignment3 | Step4.py | Step4.py | py | 9,682 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.random.seed",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sklearn.preproces... |
71007243254 | from datetime import timedelta
def convertSec(time_format):
return int(timedelta(
hours=int(time_format[0:2]),
minutes=int(time_format[3:5]),
seconds=int(time_format[6:])
).total_seconds())
# 부분 합: 핵심 부분
# 원래는 log_start[i] ~ log_end[i]-1까지 +1을 해주어 합을 구했다.
# 하지만 log_start[i]에 +1, lo... | c0natus/Practice | Algorithm-practice/Programmers/2021_kakao_blind_recruitment_광고삽입.py | 2021_kakao_blind_recruitment_광고삽입.py | py | 2,304 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.timedelta",
"line_number": 4,
"usage_type": "call"
}
] |
8621531010 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from lib.store_helper import StoreHelper
from lib.text_helper import TextHelper
from lib.csv_helper import CsvHelper
from lib.dict_helper import DictHelper
from lib.segment_helper import SegmentHelper
import pandas as pd
class Main(object):
@staticmethod
def generate_... | wuhaifengdhu/DataScientist | human.py | human.py | py | 7,811 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "lib.store_helper.StoreHelper.load_data",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lib.store_helper.StoreHelper",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "lib.store_helper.StoreHelper.load_data",
"line_number": 16,
"usage_ty... |
73877576694 | import sys
from collections import deque
n = int(sys.stdin.readline())
graph, directions = list(), [(0, -1), (-1, 0), (0, 1), (1, 0)]
maxHeight = 1
for _ in range(n):
temp = list(map(int, sys.stdin.readline().split()))
maxHeight = max(maxHeight, max(temp))
graph.append(temp)
result = [1]*(maxHeight+1)
... | gangslee/Coding-Test | 백준/210222/2468 안전영역.py | 2468 안전영역.py | py | 1,116 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.stdin.readline",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"l... |
25456949897 | from collections import deque
upDown = [-1, 1, 0, 0]
leftRight = [0, 0, -1, 1]
height, width, crashNum = map(int, input().split())
board = [[0 for i in range(width)] for i in range(height)]
visitList = [[[False for i in range(width)] for i in range(height)] for i in range(crashNum+1)]
visitList[0][0][0] = True
for i... | jy940408/algorithm_python | PYTHONBreadthFirstSearch/벽부수고이동하기3.py | 벽부수고이동하기3.py | py | 1,874 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 16,
"usage_type": "call"
}
] |
3707600491 | from typing import List
class Solution:
def maxProfit2(self, prices: List[int], fee: int) -> int:
store_a = dict()
store_b = dict()
def do_rec(is_a: bool, ind: int) -> int:
if ind == len(prices):
return 0
if is_a:
if ind in store_a:... | dmp2016/LeetCode | Best Time to Buy and Sell Stock with Transaction Fee.py | Best Time to Buy and Sell Stock with Transaction Fee.py | py | 1,589 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 37,
"usage_type": "name"
}
] |
24985414506 | from modules.visualizationTS import systemHandling
from modules.constantsAndVectors import slopeSimulation2, interceptSimulation2, slopeSimulation3, interceptSimulation3
import numpy as np
from pathlib import Path
import json
from typing import List
from scipy.stats import linregress
import pandas as pd
from functools ... | tommasoamico/masterThesis | code/pythonApp/runSystem.py | runSystem.py | py | 3,236 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 18,
... |
15895277647 | import sys
sys.path.append("../src")
import yfinance as yf
import numpy as np
from model import AutoEncoder
from noise import GaussianNoise
from loss import MaxSE
from tqdm import tqdm
from utils import rolling_window
stock_data = yf.download('CFR',
start='2012-01-01',
... | ramarlina/DenoisingAutoencoder_JAX | demo/timeseries_segmentation.py | timeseries_segmentation.py | py | 1,546 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "yfinance.download",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "model.AutoEncoder",
... |
1697562470 | from importlib import reload
import gradio as gr
import modules.ui
import modules # SBM Apparently, basedir only works when accessed directly.
from modules import paths, scripts, shared, extra_networks
import scripts.rp.attention
import scripts.rp.regions
reload(scripts.rp.regions) # update without restarting web-ui.b... | codewithevan/mecreater | scripts/rp/build.py | build.py | py | 5,166 | python | en | code | 29 | github-code | 21 | [
{
"api_name": "importlib.reload",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "modules.scripts.rp",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "modules.scripts",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "importlib.reloa... |
26004418607 | # PREDICTOR
import torch
import torch.nn.functional as F
import torch.nn as nn
from core.model import GMVAE
import os
import numpy as np
import json
class Generator():
def __init__(self, cfg, n_samples, logs_path, snapshot_path = None):
self.model = GMVAE(cfg)
self.n_samples = n_sample... | AlexCortiella/ORCCA | Image_clustering/CNNAE/core/generator.py | generator.py | py | 2,259 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "core.model.GMVAE",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
9501930433 | #!/usr/bin/env python
import sys
import os
import csv
import yaml
from datetime import datetime
from Pegasus.DAX3 import *
from optparse import OptionParser
# API Documentation: http://pegasus.isi.edu/documentation
# Load config
with open("config.yml", 'r') as f:
cfg = yaml.load(f)
# Create a abstract dag
ts = d... | papajim/mcvine-workflows | simapp/daxgen.py | daxgen.py | py | 1,433 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "yaml.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
}
] |
42220647914 | import time, logging
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.mail import mail_admins
from djwepay.utils import make_batch_key, make_callback_key
from wepay import calls, WePay as PythonWePay
from wepay.exceptions import WePayErr... | lehins/django-wepay | djwepay/backends/default.py | default.py | py | 12,897 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "django.conf.settings",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "django.conf.settings",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "django.conf.settings",
"line_number": 18,
"usage_type": "argument"
},
{
"api_na... |
1740895855 | import torch
import torch.autograd as autograd
import numpy as np
import matplotlib.pyplot as plt
def plot_loss(dat: list, outfile: str):
dat = np.array(dat)
fig, ax = plt.subplots(figsize=(10, 6))
ax.plot(dat)
plt.title("Loss over time")
ax.legend(["Generator", "Discriminator"])
p... | stevebottos/gans | util.py | util.py | py | 2,041 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
42081946046 | import sys
import inspect
import traceback
from datetime import datetime, timezone
# 'pylint: disable=too-few-public-methods
class Constant:
"""
This class for Constant.
"""
LOG_LEVEL = "INFO"
def set_logger_level(level):
"""
set logger level
:param level: level
:return: None
"""... | Ascend/tools | msaicerr/ms_interface/single_op_test_frame/common/logger.py | logger.py | py | 1,840 | python | en | code | 11 | github-code | 21 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "inspect.stack",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "inspect.stac... |
38793873052 | """Score functions."""
import logging
import torch
from torch import nn
logger = logging.getLogger(__name__)
class FusionScore(nn.Module):
"""Fusion score."""
def __init__(self, event_repr_size, directions=1):
super(FusionScore, self).__init__()
self.context_ffn = nn.Linear(event_repr_size... | waltbai/MCPredictor | mcpredictor/models/base/score.py | score.py | py | 6,185 | python | en | code | 14 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
... |
71833985334 | import numpy as np
from scripts.utils.utils import Utils as utils
from collections import OrderedDict
from scripts.utils.dict import DefaultOrderedDict
class ProblemModelling:
def __init__(self):
self.duration = -1
self.samples = -1
self.no_of_joints = -1
self.decimals_to_round = -... | k-maheshkumar/trajopt_python | scripts/sqp_solver/ProblemModelling.py | ProblemModelling.py | py | 10,691 | python | en | code | 25 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "numpy.indices",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "numpy.fill_diagonal",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line... |
73082646132 | import pandas as pd
import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
print(tf.__version__)
print(tf.keras.__version__)
import math
from sklearn.metrics import mean_squared_error #均方误差
from sklearn.metrics import r2_score#R square
from sklearn.metrics import mean_absolute_error... | limitlesszang/yield_prediction | lstm.py | lstm.py | py | 5,968 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.__version__",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 20,
"usage_type": "call"
},
{
"... |
71126193652 |
# Read parts of the QMCPACK XML input file
import xml.etree.ElementTree as ET
from collections import namedtuple, defaultdict
import math
import gaussian_orbitals
import slater_orbitals
import numpy as np
# Get the total number of basis functions after expanding the angular parts
def get_total_basis_functions(basis... | QMCPACK/qmcpack | src/QMCWaveFunctions/tests/read_qmcpack.py | read_qmcpack.py | py | 7,050 | python | en | code | 261 | github-code | 21 | [
{
"api_name": "gaussian_orbitals.get_ijk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gaussian_orbitals.CG_basis",
"line_number": 60,
"usage_type": "call"
},
{
"api_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.