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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7280135650 | import os
import asyncio
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_scoped_session
from sqlalchemy.orm import sessionmaker, scoped_session
import models, schemas, async_crud
#os.environ.get("DB_URL")
async_engine = create_async_engine(os.environ.get("DB_URL"))
async def setup... | Elite35P-Server/EliteBot | python_app/test/db.py | db.py | py | 823 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sqlalchemy.ext.asyncio.create_async_engine",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name":... |
39889222180 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 9 13:34:03 2022
@author: Bestvision
"""
import numpy as np
import cv2
from CNN import CNN_layer
import joblib
from SharedImageUseOpenCV import SharedMemory_Image
import argparse
import sys
import os
import glob
global cnn_model,feature_extractor,RF_model
def Test(... | lsc25846/C-_Python_Connect | SimplePythonTest4/bin/Debug/Python/TestByShareMemory.py | TestByShareMemory.py | py | 3,536 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "CNN.CNN_layer.build_CNN",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "CNN.CNN_layer",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "joblib.... |
38815000267 | from flask import current_app
import json
import re
import os
class Utilities:
@staticmethod
def allowed_file(filename):
"""
Function to check if the uploaded file is allowed
"""
if '.' in filename and filename.rsplit('.',1)[1].lower() in current_app.config['ALLOWED_EXTENS... | kaumil/resume_parser | app/resume_parser/utilities.py | utilities.py | py | 1,676 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.current_app.config",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.compile... |
17283960601 | from sqlalchemy import text
from domain.models.order_line import OrderLine
def test_orderline_mapper_can_load_lines(session): # (1)
session.query(OrderLine).delete()
session.execute(
text('INSERT INTO order_lines (order_id, sku, quantity) '
'VALUES '
'("order1", "RED-CHAIR",... | saurabhsm07/retail-app | tests/integration/test_orm.py | test_orm.py | py | 992 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "domain.models.order_line.OrderLine",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.text",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "domain.models.order_line.OrderLine",
"line_number": 15,
"usage_type": "call"
},
... |
31525885838 | from pathlib import Path
import os, shutil
import pandas as pd
from math import log2
import numpy as np
import os
from math import sqrt
import blosum as bl
from timer import Timer
from fastaReader import readFastaMul
import seaborn as sb
import matplotlib.pyplot as plt
def countCouple_countAA(num_accession, name... | PaulineTurk/Stage_MNHN | utils_dev/mainBlosum.py | mainBlosum.py | py | 9,767 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "timer.Timer",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 55,... |
39005616354 | import os
# set env variables to limit numpy thread usage to 1 in order
# to avoid oversubscription.
# Current Machine uses OpenBLAS but all threading env. variables
# were assigned to 1 as a precaution.
# Vars need to be defined before importing numpy
os.environ["OMP_NUM_THREADS"] = "1"
os.environ["OPENBLAS_NUM_THREAD... | TassaraR/MPI-Power-Method | power_method.py | power_method.py | py | 5,780 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_n... |
10492353422 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Alexis Zhang
import argparse
import shutil
import time
import os
from sys import platform
from models import *
from utils.datasets import *
from utils.utils import *
import cv2
def detect(
cfg,
weights,
img_path,
output='output',... | Alexis97/Multi-target-Recognition-and-Grabbing-System-of-Collaborative-Robot | Server/single_detect.py | single_detect.py | py | 4,514 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_numbe... |
70230940842 | # -*- coding:utf-8 -*-
import json
import datetime
import weakref
import cmq_curve
import numpy as np
class CurveShiftType:
Abs, Rel = range(2)
inst_type_map = {
"ComCalSwapFut": "cmq_calendarswap.CMQCalSwapFuture",
"ComCalSwap": "cmq_calendarswap.CMQCalendarSwap",
"ComFut": "cmq_cmfwd.CMQCommodFuture... | harvey1673/pyktrader2 | cmq_inst.py | cmq_inst.py | py | 4,035 | python | en | code | 36 | github-code | 18 | [
{
"api_name": "cmq_curve.ForwardCurve",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "cmq_curve.ForwardCurve.from_array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cmq_curve.ForwardCurve",
"line_number": 28,
"usage_type": "attribute"
},
... |
34405654410 | import cv2
import mediapipe as mp
import numpy as np
cap = cv2.VideoCapture(0)
mpDraw = mp.solutions.drawing_utils
mpFaceMesh = mp.solutions.face_mesh
faceMesh = mpFaceMesh.FaceMesh()
faceimg = cv2.imread('face_mk.png', cv2.IMREAD_UNCHANGED)
def change_mask(background_img, img_to_overlay, x, y, overlay_size=None):
... | dlsco123/DeepLearning-2nd- | mediapipe/face_snow.py | face_snow.py | py | 1,924 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mediapipe.solutions",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.i... |
15807206998 | # Source code title: No Sleep Bug
# Source code desc: Simple desktop application to avoid sleep
# Source code author: Jovial
# Source code version: v0.1
# Importing required modules
import os
import json
import sys
import tkinter as tk
from tkinter import *
import traceback
# Global variable declaration
METADATA_FIL... | jovialgeorge/no-sleep-bug | main.py | main.py | py | 1,826 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 3... |
32417020802 | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 21 16:16:38 2017
@author: mikha
"""
import json
import urllib
#helper function to turn input string into floats
def parseInputString(inputString):
parsed = inputString.split()
return parsed;
#parseFuelStation returns a list of dictionaries with the following ke... | yeungco2/Utek2017 | parseJSON.py | parseJSON.py | py | 1,869 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "urllib.request.... |
17091168129 | from matplotlib.widgets import MultiCursor
from pylab import figure, show, np
t = np.arange(0.0, 2.0, 0.01)
s1 = np.sin(2*np.pi*t)
s2 = np.sin(4*np.pi*t)
fig = figure()
ax1 = fig.add_subplot(211)
ax1.plot(t, s1)
ax2 = fig.add_subplot(212, sharex=ax1)
ax2.plot(t, s2)
multi = MultiCursor(fig.canvas, (ax1, ax2), color=... | JeanBilheux/python_101 | matplotlib/multicursor_1.py | multicursor_1.py | py | 386 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pylab.np.arange",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pylab.np",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pylab.np.sin",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pylab.np",
"line_number": 5,
... |
74817358439 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import cv2
import utilities.charcut as cc
import sys
# reload(sys)
# sys.setdefaultencoding("utf-8")
GRAYSCALE_AVG = 127.5
print_separater = "#################################################################"
from P... | falconjhc/W-Net | utilities/infer_implementations.py | infer_implementations.py | py | 34,750 | python | en | code | 27 | github-code | 18 | [
{
"api_name": "os.listdir",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 100,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_numb... |
5950210329 | from rest_framework.viewsets import ViewSet
from rest_framework.response import Response
from rest_framework import status
from courtzapi.models import Filing
from courtzapi.models.case_status import CaseStatus
from courtzapi.models.dockets import Docket
from courtzapi.models.filers import Filer
from courtzapi.models.... | david-clark-1043/glowing-pancakes | courtzapi/views/filing_view.py | filing_view.py | py | 2,938 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.viewsets.ViewSet",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "courtzapi.models.Filing.objects.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "courtzapi.models.Filing.objects",
"line_number": 19,
"usage_type": "a... |
21835031555 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0023_change'),
]
operations = [
migrations.AddField(
model_name='user',
name='permissions',
... | MatthewJohn/Tuckshop | tuckshop/app/migrations/0024_user_permissions.py | 0024_user_permissions.py | py | 386 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
4006362604 | import os
import sys
from google.protobuf import text_format
from tensorflow.core.framework import graph_pb2
from tensorflow.python.platform import gfile
from tensorflow.python.platform import test
from tensorflow.python.tools import selective_registration_header_lib
# Note that this graph def is not valid to be loa... | tensorflow/tensorflow | tensorflow/python/tools/print_selective_registration_header_test.py | print_selective_registration_header_test.py | py | 9,543 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "tensorflow.python.platform.test.TestCase",
"line_number": 79,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.platform.test",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "os.path.split",
"line_number": 82,
"usage_type": "call"
}... |
28412493123 | """import statement"""
import os
import time
from argparse import Namespace
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import yaml
"""
This is a general utilities file for the active learning pipeline
To-Do:
"""
def get_config(args, override_args, args2config):
"""
Combines... | alexhernandezgarcia/gflownet | gflownet/utils/legacy.py | legacy.py | py | 31,412 | python | en | code | 62 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
26447580100 | import argparse
# On some system, import scanpy will report "ImportError: dlopen: cannot load any more object with static TLS" when scanpy import sklearn
# as described in
# https://github.com/singleron-RD/CeleScope/issues/127
# https://github.com/scikit-learn/scikit-learn/issues/14485
# https://github.com/scverse/sc... | singleron-RD/CeleScope | celescope/celescope.py | celescope.py | py | 2,054 | python | en | code | 71 | github-code | 18 | [
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "argparse.RawTextHelpFormatter",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type":... |
10573919689 | import torch
import pickle
import matplotlib.pyplot as plt
from NN_Models.Adapter import Adapter
import logging
from datetime import datetime
dateTime = datetime.now().strftime("%d-%m-%YT%H:%M:%S")
logging.basicConfig(filename='logs/log_fase_3_' + dateTime + '.log', level=logging.DEBUG)
with open('adapter.dataset', ... | guillemlla/TFM_Simulator | fase_3_train_adapter.py | fase_3_train_adapter.py | py | 1,871 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBU... |
16549908020 |
from singleton_decorator import singleton
import re
from .Cardinal import Cardinal
from .Digit import Digit
@singleton
class Address:
def __init__(self):
super().__init__()
self.filter_regex = re.compile(r"[. -]")
self.address_regex = re.compile(r"((?P<upper_prefix>[A-Z\.]*)|(?P<lower_pr... | bikky9/Machine-Learning | TextNormalization/Code/converters/Address.py | Address.py | py | 1,889 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Cardinal.Cardinal",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "Digit.Digit",
"line_numbe... |
33240265709 | from dataclasses import dataclass, field
import heapq
from random import randint, uniform
from typing import Optional, List, Tuple, Dict
from model.Board import Board
from model.Token import Token
@dataclass(order=True)
class PrioritizedItem:
score: int
token: Token = field(compare=False)
player: Board =... | zemiret/AGHtochess | mechanics/model/Battle.py | Battle.py | py | 4,931 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "model.Token.Token",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "model.Board.Board",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "dataclasses.fie... |
32801384308 | from bs4 import BeautifulSoup
from lxml import html
import requests
import pandas as pd
import re
from collections import OrderedDict
def select_regions(regions:list, html_tree, column:int):
"""Find a list of councils per specified region"""
base_url = 'https://www.cvk.gov.ua/pls/vm2020/'
return [
... | dmtrkl/chesno | chesno.py | chesno.py | py | 7,406 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.OrderedDict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "bs4.Beau... |
3809739845 | import numpy as np
from scipy.linalg import circulant, eig
def eps_kernel_sym(nb_steps : int,
gamma : float,
eps : float,
):
n : int = nb_steps//2 + 1 # nb_actions per player
kernel = gamma * np.eye(2 * n, dtype = float)
nbr_pl1 =... | MarcoSaponara/CentipedeGameEDAI23 | mysrc/utils/kernel.py | kernel.py | py | 2,599 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.eye",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.linalg.circulant",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line... |
72978144039 |
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import time
import copy
import os
# GPU Setting
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
k = 4
n = 7
seed = 0
import pickle
with open('UAP','rb') as load_data:
UAP = pickle.load(loa... | YudiDong/GAN-based-E2E-communications-system-for-defense-against-adversarial-attack | regular_training_blackbox.py | regular_training_blackbox.py | py | 2,420 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_n... |
26376792579 | import matplotlib.pyplot as plt
import pandas as pd
import pickle
file_name = "situation-158213001.pkl"
current_time = 0
time_in_sec = 660
plt.rcParams["font.family"] = "Arial"
plt.rcParams["font.size"] = "32"
fig, ax = plt.subplots()
with open(file_name, 'rb') as handle:
results = pickle.load(handle)
# energy_c... | onurklngc/drone-network-onos-and-mininet | 2019-2020/results/draw_energy_consumption_statistics_without_fly.py | draw_energy_consumption_statistics_without_fly.py | py | 2,224 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"a... |
330859590 | from io import StringIO
from flask import Flask, request
from modules.database import mydb, cursor
from datetime import datetime
from flask_cors import CORS
import modules.queries as q
from modules.helpers import rowInRows, rowInRowsFor2Columns, rowInRowsFor3Columns
from modules.blob import blob_service_client, ... | mriduliyer/PhonePe-Project-3 | App/Backend/backend.py | backend.py | py | 5,013 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.form... |
23378862902 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.pyplot import MultipleLocator
from torch.utils.data import DataLoader, Dataset
import copy
from parse import parse_arg
import numpy as np
import pandas as pd
import torch
import pickle
from model.Update import LocalUpdate,DatasetSpl... | Pa-wan/FedDef_IDS | main_fed.py | main_fed.py | py | 17,333 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.se... |
33756234612 | import unittest
import unittest.mock
import os
import PyKCS11
import cryptography.hazmat.primitives.asymmetric.rsa as rsa
import cryptography.hazmat.primitives.asymmetric.padding as padding
import cryptography.hazmat.primitives.hashes as hashes
#from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey
... | rgammans/TokenCrypt | tests/test_pkcss11.py | test_pkcss11.py | py | 12,949 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "unittest.mock.patch",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "unittest.mock",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "TokenCr... |
19239493670 | """ Confluence Publisher
Encapsulate the logic of processing a markdown directory tree.
"""
import os
import mistune
from .MetadataPlugin import MetadataPlugin
from .ConfluenceRenderer import ConfluenceRenderer
from .KeyValue import KeyValue
from atlassian import Confluence
from atlassian.confluence import ApiError
f... | olafrv/mdtocf | mdtocf/classes/ConfluencePublisher.py | ConfluencePublisher.py | py | 7,421 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "atlassian.Confluence",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "KeyValue.KeyValue",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "ConfluenceRenderer.ConfluenceRenderer",
"line_number": 32,
"usage_type": "call"
},
{
"api_... |
27894789243 | # -- coding: utf-8 --
# @File : test_wechat.py
import time
from appium import webdriver
class TestWeChart:
def setup(self):
condition = {
"platformName": "android",
"deviceName": "111", #一定不能少这个参数
"udid": "127.0.0.1:7555", #如果只有一个设备可以不写,多个设备就要写进行指定
"appPack... | Guoxiang1992/Personal | test_wechat.py | test_wechat.py | py | 2,073 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "appium.webdriver.Remote",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "appium.webdriver",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 33,
"usage_type": "call"
}
] |
20302974330 | from django.conf import settings
from django.contrib import messages
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.db.models.query import QuerySet
from django.http import FileResponse, HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.... | e-valuation/EvaP | evap/grades/views.py | views.py | py | 7,470 | python | en | code | 93 | github-code | 18 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "evap.evaluation.models.Semester.objects.filter",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "evap.evaluation.models.Semester.objects",
"line_number": 28,... |
72605208679 | # M4 - Autonomous fruit searching
# basic python packages
import sys, os
import cv2
import numpy as np
import json
import ast
import argparse
import time
from Astar import AStarPlanner
sys.path.insert(0,"{}/network/".format(os.getcwd()))
sys.path.insert(0,"{}/network/scripts".format(os.getcwd()))
from network.scripts.... | ShiHau/Autonomous-navigating-mobile-robot-mapping-planning-driving | milestone4/auto_fruit_search_L3.py | auto_fruit_search_L3.py | py | 15,287 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.insert",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path.insert",
"line_n... |
6592934725 | import re
import datetime
import snscrape.modules.twitter as sntwitter
from .scraper import Scraper, Content
class TwitterScraper(Scraper):
def __init__(self) -> None:
pass
def _query_constructor(
self,
ticker: str,
min_date: datetime.datetime,
max_date: datetime.datetime,
min_faves: int = 300) -> str... | akuchibotla/stock_sentiment | backend/data/scrapers/twitter_scraper.py | twitter_scraper.py | py | 1,322 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "scraper.Scraper",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "datetime... |
14397859503 |
from data import load_original_gmd_dataset_pickle
# Load 2bar gmd dataset as a dictionary
gmd_dict = load_original_gmd_dataset_pickle(
gmd_pickle_path="data/gmd/resources/storedDicts/groove_2bar-midionly.bz2pickle")
gmd_dict.keys() # dict_keys(['train', 'test', 'validation'])
gmd_dict['train'].keys() ... | behzadhaki/GrooveTransformer | demos/data/demo.py | demo.py | py | 2,786 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "data.load_original_gmd_dataset_pickle",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "data.extract_hvo_sequences_dict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "data.get_drum_mapping_using_label",
"line_number": 20,
"usage_type":... |
34071386938 | import torch.nn as nn
import torch
import numpy as np
import torch.nn.functional as F
from einops import rearrange, repeat
class ScaledDotProductAttention(nn.Module):
"""Scaled dot-product attention mechanism."""
def __init__(self, attention_dropout=0.0):
super(ScaledDotProductAttention, self).__init_... | Janspiry/A-Demo-for-Image-Inpainting-by-React | inpaint/model/transformer/transformer.py | transformer.py | py | 17,091 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Dropout",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_num... |
21100607924 | import argparse
import os
import pty
import shlex
import sys
from typing import List, Optional
TRT_DOCKER_FILES = {
"8.4": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_6_tensorrt8_4",
"8.5": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_5",
"8.6": "tools/ci_build/... | microsoft/onnxruntime | onnxruntime/python/tools/tensorrt/perf/build/build_image.py | build_image.py | py | 7,299 | python | en | code | 9,700 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "shlex.quote",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pty.spawn",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_nu... |
15612297596 | from django.shortcuts import render, HttpResponse
from .models import PokemonSpawn, NestMigrations
from .config_parser import get_gmaps_api_key
from .tasks import update_migration_date
from .utils.google_storage import download_xml
def show_map(request):
nxt = NestMigrations.objects.get_last_datetime()
if no... | ppQueens/Pokemon_spawn_map | spawns_map/views.py | views.py | py | 928 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "models.NestMigrations.objects.get_last_datetime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.NestMigrations.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.NestMigrations",
"line_number": 10,
"usage_type... |
72332640679 | """
Szyfrowanie tekstu korzystające z ECC.
Autor: Maciej Milewski
Źródło algorytmu szyfrującego: https://pypi.org/project/pycrypto/
"""
from tinyec import registry
from Crypto.Cipher import AES
import hashlib, secrets, binascii
import timeit
import os
def encrypt_AES_GCM(msg, secretKey):
""" encrypt AES in GCM... | MaciejMilewski/BSI_Szyfrowanie_algorytmy | src/ecc.py | ecc.py | py | 2,896 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.AES.MODE_GCM",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name"... |
71829986601 | #!/usr/bin/python
import json
import psycopg2
import db_connection
import programminglanguage
def db_connect():
conn_string = db_connection.get_connection_string()
# get a connection, if a connect cannot be made an exception will be raised here
conn = psycopg2.connect(conn_string)
# conn.cursor will... | hanstoomassaarest/idu0080 | database.py | database.py | py | 3,102 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "db_connection.get_connection_string",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "programminglanguage.ProgrammingLanguage",
"line_number": 51,
"usage_type": "call"
... |
4829386942 | import json
import requests
import time
print("In order for this script to work, the channel ids, auth token, and username are required in the info.json file")
with open('info.json', 'r') as f:
info = json.load(f)
username = info['username']
auth_token = info['auth_token']
channels = info['channels']
def get_a... | mouhtasi/discorddelete | main.py | main.py | py | 2,579 | python | en | code | null | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 38,
... |
42588828089 | import time
import os
import sys
import traceback
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.common.exceptions import TimeoutException as SeleniumTimeoutException
from selenium import webdriver
from common import COLORS... | r0d1on/chalkboard | docker/selenium/play.py | play.py | py | 4,797 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 28,
"usage_type": "call"
... |
29901827840 | import pygame
import time
import math
from utils import scale_image, blit_rotate_center
GRASS = scale_image(pygame.image.load("imgs/grass.jpg"), 2.5)
TRACK = scale_image(pygame.image.load("imgs/track.png"), 0.9)
TRACK_BORDER = scale_image(pygame.image.load("imgs/track-border.png"), 0.9)
TRACK_BORDER_MASK = p... | techwithtim/Pygame-Car-Racer | tutorial2-code/main.py | main.py | py | 3,807 | python | en | code | 80 | github-code | 18 | [
{
"api_name": "utils.scale_image",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "utils.scale_image"... |
29489956484 | #!/usr/bin/env python3
# coding: utf-8
"""Loop detector
Detect loops in Hi-C contact maps with pattern matching.
"""
from setuptools import setup, find_packages
CLASSIFIERS = [
"Development Status :: 1 - Planning",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Artistic License",
... | axelcournac/Loops_Detector | setup.py | setup.py | py | 1,361 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 49,
"usage_type": "call"
}
] |
71427456360 | import numpy as np
import pandas as pd
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
import warnings
warnings.filterwarnings('ignore')
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
from sklearn.preprocessing import Imputer
import seaborn as sns
from sklearn.m... | aorursy/new-nb-3 | jacksmengel_home-away-submit-csv.py | jacksmengel_home-away-submit-csv.py | py | 17,009 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.set_option",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
14760261608 | #!/usr/bin/env python
# Author: Tom Parker <palfrey@tevp.net>
# Description: Docs rebuild script
# Requires: Docutils (http://docutils.sourceforge.net/)
# Hacked together from rst2html.py by David Goodger <goodger@users.sourceforge.net>
import locale
try:
locale.setlocale(locale.LC_ALL, '')
except:
pass
try:... | palfrey/comicsgrab | docs.py | docs.py | py | 1,061 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "locale.setlocale",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "locale.LC_ALL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "html.Writer",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "docutils.core.publish... |
72522477160 | import pickle
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import RandomizedSearchCV
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import classification_report, confusion_matrix, accuracy_score
from sklearn.model_selection import ShuffleSplit
from feature... | gauravsingh1960/Sentiment-analysis | modelling.py | modelling.py | py | 8,257 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pickle.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": ... |
8826788735 | # -*- coding: utf-8 -*-
"""JJCM Practica 3 LC.ipynb
1) Implementar, usando NLTK y Python, el algoritmo de Lesk simplificado para
desambiguar el sentido de las palabras (WSD). La función recibirá una palabra y
una frase que la contenga y decidirá el mejor sentido para esa palabra. Las frases
será... | JoseJavierCalvoMoratilla/MUIARFID | LC/lab3/jjcm_practica_3_lc.py | jjcm_practica_3_lc.py | py | 3,790 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.download",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_n... |
35274597118 | import os
import datetime
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras.layers import (
Concatenate,
Dense,
Embedding,
Flatten,
Input,
Multiply,
)
from tensorflow.keras import Model
from tensorflow.keras.regularizers import l2
from tensorflow.k... | linhthi/ts | models/NeuMF/NeuMF.py | NeuMF.py | py | 5,892 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.Model",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras"... |
30717583783 | import sqlite3
from app.core.pathutils import get_database_root
from app.database.tables import users_table, shopping_list_table
class DatabaseCreator:
def __init__(self) -> None:
self._database_path = get_database_root()
self._connector = sqlite3.connect(self._database_path)
def create_tabl... | SecondAttempt-GH/checklist | server/app/database/databasecreator.py | databasecreator.py | py | 560 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "app.core.pathutils.get_database_root",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.database.tables.shopping_list_table",
"line_number": 14,
"usage_type": "argument"... |
13563703953 | from django.contrib import admin
from django import forms
from .models import *
# Register your models here.
# class PersonForm(forms.ModelForm):
# some_field = forms.ModelMultipleChoiceField(Person.objects.all(), widget=FilteredSelectMultiple("Person", False, attrs={'rows':'2'}))
# class Meta:
# mod... | silaves/OdinApi_v03 | apps/periodico/admin.py | admin.py | py | 2,307 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelForm.__init__",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
37511313215 | #!/usr/bin/env python
# encoding: utf-8
r"""
Routines for reading and writing a NetCDF output file
Routines for reading and writing a NetCDF output file via either
- netcdf4-python - http://code.google.com/p/netcdf4-python/
- pupynere - http://pypi.python.org/pypi/pupynere/
These interfaces are very simil... | clawpack/pyclaw | src/pyclaw/fileio/netcdf.py | netcdf.py | py | 15,678 | python | en | code | 148 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 174,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 174,
"usage_type": "attribute"
},
{
"api_name": "netCDF4.Dataset",
"... |
34867043291 | from django.urls import path
from core import views as v
urlpatterns = [
path('', v.home, name='core_home'),
path('pessoas/', v.lista_pessoas, name='core_lista_pessoas'),
path('pessoas/criar', v.criar_pessoas, name='core_criar_pessoas'),
path('pessoas/update/<int:id>', v.update_pessoa, name='core_updat... | jadilson12/sistema_estacionamento | core/urls.py | urls.py | py | 1,762 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "core.views.home",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "core.views",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
... |
16730466205 | import json
import requests
from collections import Counter
def numberOfDates(data):
counter = 0
for key in data:
counter += 1
return counter
def findTop5Highest(data):
num = numberOfDates(data)
k = Counter(data)
printCounter = num
if num < 5:
high = k.most_common(num)
else:
high = k.most_common(5)
... | super-nexus/DragonHack2020 | bin/atributes_script.py | atributes_script.py | py | 3,308 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "requests.post",
"l... |
23173145230 | """Adds edges between family members at the same address."""
import six
from . import entity_tools
from . import graph_tools
from . import utils
# Edges between neighbours are added only if the number of entities
# at a particular address is at most `MAX_NEIGHBOUR_GROUP_SIZE`:
MAX_NEIGHBOUR_GROUP_SIZE = 2
# String ... | verejnedigital/verejne.digital | data/prod_generation/post_process_neighbours.py | post_process_neighbours.py | py | 4,812 | python | en | code | 26 | github-code | 18 | [
{
"api_name": "six.moves.range",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "six.moves",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "six.moves.range",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "six.moves",
"line_... |
30647415064 | import folium
def map_creation(df_static,geo_json_data):
#json file with the coordinates of each commune in France imported as dataframe
#capitalized everything because it is case sensitive
geo_json_data['libgeo'] = geo_json_data['libgeo'].str.upper()
commune_avg = df_static.groupby('Nom de la co... | rimhajal/mapstatic | mapstatic/visualization/vis/map_creation.py | map_creation.py | py | 2,553 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "folium.Map",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "folium.features.GeoJson",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "folium.features",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "folium.featur... |
6261873805 | import argparse
import os
import sys
from . import client, message_variables
DEFAULT_RUN_MESSAGE = "Run triggered by `tfc` command line tool"
class MessageVariableMapping:
"""
Wrapper for the tfc.message_variables module
Wraps the tfc.message_variables module in a mapping (dictionary like) interface. T... | octoenergy/terraform-cloud-client | src/tfc/cli.py | cli.py | py | 2,934 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sy... |
25646325771 | from functools import reduce
from typing import Any, List, Mapping, Optional, Set
import dpath.util
import pendulum
class CatalogField:
"""Field class to represent cursor/pk fields"""
def __init__(self, schema: Mapping[str, Any], path: List[str]):
self.schema = schema
self.path = path
... | datasphere-oss/datasphere-databyte | airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/utils/json_schema_helper.py | json_schema_helper.py | py | 5,404 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.Mapping",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number"... |
33973839550 | import os
import glob
import torch.utils.data
import numpy as np
class RGBImageSet(torch.utils.data.Dataset):
def __init__(self, path, centered=False):
super().__init__()
self.centered = centered
self.add_string = lambda a, b: a + b
assert os.path.exists(path)
self.base_pat... | neohanju/AutoencodingTheWorld | Datasets/RGBImageSet.py | RGBImageSet.py | py | 1,448 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "torch.utils.data.utils",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
5866656243 | import autokeras as ak
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler, RobustScaler
##
# Load and preprocess the data
train_csv = pd.read_csv('d:/study/_data/dacon_diabetes/train.csv', index_col=0)
train_csv = train_csv.dropna()... | mkim9002/AIA | keras2/keras63_autokeras03_dacon_diabetes.py | keras63_autokeras03_dacon_diabetes.py | py | 1,044 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},... |
7620969412 | import math, random, sys, pygame, os, time, argparse
from pygame.locals import *
from agent import Agent
from part import Part
from objects import Object
from network_collection import NetworkCollection
from tab import Tab
from options import Options
from log import Log
from random import *
# Main Class. This runs the... | solanylander/Tower | main.py | main.py | py | 16,821 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "network_collection.NetworkCollection",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 72,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "pyga... |
72185090601 | import PIL.Image
import argparse, os
ascii_chars = "`^\",:;Il!i~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$"
def dir_path(string):
if os.path.isdir(string):
return string
else:
raise NotADirectoryError(string)
parser = argparse.ArgumentParser(
prog='Pic2ASCII'... | DanielCufino/Text2ASCII | pic2ascii.py | pic2ascii.py | py | 2,317 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.isdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentPar... |
25811620892 | from django.urls import path, include
from watchlist_app.api import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('streams', views.streamPlatformVS, basename='streamplatform')
urlpatterns = [
path('list/', views.WatchListAV.as_view(), name='movie-list'),
path(... | yashpatel-py/restAPI-imdb-clone-django | watchlist_app/api/urls.py | urls.py | py | 1,163 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "watchlist_app.api.views.streamPlatformVS",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "watchlist_app.api.views",
"line_number": 6,
"usage_type"... |
71642424039 | import cv2
import numpy as np
import os
# Create the directory structure
paths=["data","data/train","data/test","data/train/okay","data/train/peace","data/train/Clenched_fist","data/train/ILY","data/train/Thumb_up","data/test/okay","data/test/peace","data/test/Clenched_fist","data/test/ILY","data/test/Thumb_up"]
for ... | arungarg14/hand_gesture_recognition | collect_data_realtime.py | collect_data_realtime.py | py | 3,285 | python | en | code | 6 | github-code | 18 | [
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_nu... |
15509068916 | from flask import Flask, request, render_template, jsonify, redirect, url_for
from values import customers, services, drinks, snacks, other
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def boilerplate():
return render_template('passenger.html')
@app.route('/crew')
def crew_view():
return render_... | benjmo/PythonOnAPlane | app.py | app.py | py | 5,958 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_te... |
27114129725 | import datetime
from contextlib import contextmanager
from logging import getLogger
LOG = getLogger(__name__)
class RecordDetail(object):
def __init__(self, name):
self.name = name
self.status = None
self.start_time = datetime.datetime.now()
self.stop_time = None
self.num... | atleypnorth/bp2dvcm | recorddetail3.py | recorddetail3.py | py | 1,227 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "datetim... |
38977616076 | from django.urls import path
from Paytm import PaymentViews, views
urlpatterns = [
# Payments urls
# Creating Order
path('create-order/',views.CreateOrder,name='create-order'),
# First Step
path('ReactNativeCustomPayment/',views.ReactNativeCustomPayment,name='ReactNativeCustomPayment'),
# S... | sumit-singh1196/Food-Delivery-App | swiggy-x-backend/Paytm/urls.py | urls.py | py | 628 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Paytm.views.CreateOrder",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "Paytm.views",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.urls.pa... |
32041225190 | import tensorflow as tf
import json
import keras
from keras.models import Model
from keras.applications import ResNet50
from keras.layers import Input, Dense, Lambda, LeakyReLU, Reshape
#from pix3d_dataset import Pix3DDataset, Pix3DSequence
from loss import batch_cd_loss
from shapenet_dataset import ShapenetDataset
imp... | britanyasmith/3D-Image-Reconstruction-with-Point-Cloud | model.py | model.py | py | 2,594 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.Session",
"line_number": 15,
"usage_type": "call"
},
{
... |
23906805164 | """Main file"""
import importlib
import click
import pyspark.pandas as ps
from hamilton import driver
from hamilton.experimental import h_spark
from utils.constants import (CLINICAL_TRIALS_MAPPING, DRUG_TITLE_COL,
DRUGS_MAPPING, OUTPUT_DF_COLS, P_DATE_COL,
PUB... | AnwarBrini/MedTest | main.py | main.py | py | 2,276 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "utils.spark.SparkProvider",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "utils.constants.SPARK_CONF",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pyspark.pandas.set_option",
"line_number": 25,
"usage_type": "call"
},
{
"ap... |
72557768039 | from django.shortcuts import render
from django.http import JsonResponse, HttpResponseNotFound
from django.contrib.auth.models import User, Group
from topicyeucau.models import Topic, MyTopic, Rating
from django.db.models import Count, Q
import datetime, numpy as np
# Create your views here.
def index(request):
... | Phuc-code-2001/HaTienProject | quanlytruonghop/quanly/reporting/views.py | views.py | py | 6,384 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "topicyeucau.models.Topic.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
... |
3273404951 | import jax.numpy as jnp
from jax import device_put
from bench.core.executer import Executer
def yolo_encode(bboxes, gt_bboxes, stride, eps=1e-6):
x_center_gt = (gt_bboxes[..., 0] + gt_bboxes[..., 2]) * 0.5
y_center_gt = (gt_bboxes[..., 1] + gt_bboxes[..., 3]) * 0.5
w_gt = gt_bboxes[..., 2] - gt_bboxes[...,... | DeepLink-org/DLOP-Bench | bench/samples/long_tail/yolo_encode/jax_impl.py | jax_impl.py | py | 1,363 | python | en | code | 38 | github-code | 18 | [
{
"api_name": "jax.numpy.log",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "jax.numpy.clip",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number":... |
6389282896 | from pathlib import Path
import pytest
from src.utils import LineReader
def test_LineReader_lines_ok():
"""
Tests if correct lines are returned, empty lines are skipped and StopIteration is reached
:return: None
"""
line_reader = LineReader(Path("tests/test_fiels_text.txt"))
line_generator ... | kamildemocko/Highlight-Reader | tests/test_files.py | test_files.py | py | 630 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "src.utils.LineReader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 22,
"usage_type": "call"
}
] |
38983423778 | import os
import configparser
from irods.meta import iRODSMeta, AVUOperation
from git import Repo
def configReader():
"""
ConfigParser function
Reads configuration variables inside a file and returns a reader object.
Returns
-------
config : object
"""
config_file = os.path.expandvars... | hpcleuven/vsc-gitirods | gitirods/util.py | util.py | py | 4,215 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.expandvars",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getcwd",... |
27833777282 | import torch as th
import coremltools as ct
from tensorflow.python.keras.layers.recurrent import PeepholeLSTMCell
from keras.layers import RNN, Dense
from keras.models import Sequential
from torch.utils import mobile_optimizer
# =====================#
# TORCHSCRIPT #
# =====================#
class LSTMStep(... | MWM-io/PeepholeLSTM-Apple-Issue | convert_models.py | convert_models.py | py | 6,099 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.empty",
"lin... |
41847937535 | import os
from datetime import datetime, timedelta
import requests
from src.applications.boe_app import BOEApplication, PermissionsEnum, query_table_dao, GenderEnum, TransactionMethodEnum
INFRASTRUCTURE_FACTORY = "eventsourcing.sqlite:Factory";
SQLITE_DBNAME = "_db/prod_db"
os.environ['INFRASTRUCTURE_FACTORY'] = INF... | byt3-m3/boe | src/dev.py | dev.py | py | 5,082 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "src.applications.boe_app.BOEApplication",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
72141775720 |
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from Application.Simulation import Simulation
import os
import numpy as np
from dash.dependencies import Input, Output, State
from Application.DistributionFactory import *
i... | Askill/DSPS | purePy - Simulation/dashboard.py | dashboard.py | py | 19,046 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.options",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "dash.Dash",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.themes",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "s... |
37417986430 | '''
Anthony Thomas-Bell
V1.0 July 23rd 2019
Updated: December 7th 2
Class that is going to run the scikit learn models for the cannabis classification problem.
'''
class MlModel:
# TODO Insert INIT function that sets the X_Train, X_Test, y_train, y_test datasets
# def __init__(self, x_train, x_test, y_trai... | TTB53/ml-data-exploration | ml_models.py | ml_models.py | py | 8,287 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "imblearn.over_sampling.SMOTE",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "imblearn.over_sampling.ADASYN",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 52,
"usage_type": "call"
},
... |
23242775798 | from transformers import AutoTokenizer
from llm_serving.model.wrapper import get_model
from coordinator.coordinator_client import LocalCoordinatorClient
import traceback
from loguru import logger
from time import sleep
import argparse
import time
import math
import torch
import random
import numpy as np
from alpa.devic... | FMInference/DejaVu | Decentralized_FM_alpha/dist_latency_alpa_inference_w_httpclient.py | dist_latency_alpa_inference_w_httpclient.py | py | 9,779 | python | en | code | 86 | github-code | 18 | [
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "transformers.AutoTokenizer",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "llm_serving.model.wrapper.get_model",
"line_number": 21,
"usage_typ... |
30245262755 | """
This code is supported by the website: https://www.guanjihuan.com
The newest version of this code is on the web page: https://www.guanjihuan.com/archives/3895
"""
import numpy as np
import matplotlib.pyplot as plt
from math import *
import cmath
import functools
def hamiltonian(k, N, t): # 准一维方格子哈密顿量
# 初始化为... | guanjihuan/guanjihuan.com | academic_codes/models_and_bands/2020.01.03_bands_of_qusi_1D_square_lattice/bands_of_qusi_1D_square_lattice.py | bands_of_qusi_1D_square_lattice.py | py | 1,324 | python | en | code | 24 | github-code | 18 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cmath.exp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_numbe... |
23253974443 | from PyQt5.QtWidgets import QTreeWidget, QTreeWidgetItem
from PyQt5.QtCore import QSize, pyqtSignal
from PyQt5.QtGui import QIcon, QBrush, QColor, QFont
from domestic.core import ReaderDb, Settings
from domestic.widgets.treeitem import FolderItem, FeedItem
class TreeWidget(QTreeWidget):
def __init__(self, parent=... | mthnzbk/domestic | domestic/widgets/treewidget.py | treewidget.py | py | 6,718 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QTreeWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QTreeWidget",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "PyQt5.QtCore.QSize",
"line_number": 13,
"usage_type": "call"
},
{
"api... |
26965332380 | # pyright: strict
from __future__ import annotations
import itertools as it
import collections as co
import dataclasses as dc
import re
import typing as t
T = t.TypeVar("T")
# useful kstricks utility for simulating multi-worlds: dictionary mapping state to counts, evolve accordingly
def deterministic_dice() -> t.It... | kwshi/aoc-2021 | 21/21.py | 21.py | py | 2,246 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.TypeVar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "typing.Iterable",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "typing.Iterable",
... |
43654261844 | from Auxilary import CalculateAB, setQ, LqrFhD, getError, LqrFhD2,scanUopt
import numpy as np
import keras
import time
from DataBase import DataBase
from SYS import SYS
size=100
data=DataBase(size)
R = np.identity(2)*0.01
Q = np.identity(6)
Q = setQ(Q)
filepath = '/home/london/PycharmProjects/Reacher/net/6xy21.3-9_... | MoragTK/Reacher | main.py | main.py | py | 1,469 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "DataBase.DataBase",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.identity",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.identity",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Auxilary.setQ",
"... |
10415769114 | from rest_framework.test import APITestCase
from django.urls import reverse
from rest_framework import status
from django.contrib.auth import get_user_model
from core.models import Category, Product
from decimal import Decimal
class PublicUserTests(APITestCase):
def test_get_categories(self):
response = ... | dangawr/shop-drf-api | app/shop/tests/test_category.py | test_category.py | py | 2,520 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_200_OK",
"line_number": 13,
"usage_type": "attribute"
},
... |
75325610600 | import pandas as pd
import numpy as np
import os
from config import appliances, houses_refit, houses_ukdale, arguments
# For REFIT dataset
def load_raw_refit_data(appliance, house_no, appliance_col) -> pd.DataFrame:
# Loading the house we need
raw_house = pd.read_csv(f'./data/RAW_House{house_no... | vkanatas/thesis | load_data.py | load_data.py | py | 5,093 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_t... |
39719437374 | """classic Acrobot task"""
import numpy as np
from numpy import sin, cos, pi
from gym import core, spaces
from gym.utils import seeding
__copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy"
__credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dann",
"William Dabney", "Jonathan P. ... | AI4Finance-Foundation/FinRL-Tutorials | DQN-DDPG_Stock_Trading/gym/envs/classic_control/acrobot.py | acrobot.py | py | 10,801 | python | en | code | 599 | github-code | 18 | [
{
"api_name": "gym.core.Env",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "gym.core",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.pi",
"line_number": 73,
"usage_type": "name"
},
{
"api_name": "numpy.pi",
"line_number": 74,... |
23278786829 | # -*- coding: utf-8 -*-
from django import forms
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from common.shortcuts import reorder_form_fields
from profiles.models import Membership
from .models import Meeting
from committees.models import Com... | dwebdevcore/BoardDirector_dashboard | apps/meetings/forms.py | forms.py | py | 10,739 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "django.forms.Form",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.forms.ChoiceField",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.f... |
73969349801 | import asyncio
import logging
import os
import json
import gzip
import uuid
from dotenv import load_dotenv
from quart import Quart, jsonify, request, Response, make_response, session
from quart.helpers import stream_with_context
from log import init_logging
load_dotenv()
init_logging()
logger = logging.getLogger(__n... | TopDevSteven/ai_tutor_backend | src/app.py | app.py | py | 2,223 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "log.init_logging",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "quart.Quart",
... |
35053998283 | from functools import partial
from random import randint
from sympy import randprime, sqrt_mod_iter, isprime
from gost2001.ecc import mul, add
from utils.utils import positive_mod
MIN_RANDOM = 0x1000 # границы n
MAX_RANDOM = 0xffff
COEFFICIENT_RANGE = 0xff # граница для a, b
get_random_prime = partial(randprime,... | McFeod/lab_three_sec | gost2001/keygen.py | keygen.py | py | 2,996 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "functools.partial",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sympy.randprime",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "functools.partial",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.randin... |
13563601733 | from django.urls import path
from . import views
urlpatterns = [
# CATEGORIA
path('ecommerce/categoria/<str:estado>/', views.get_categorias_productos, name='Lista de Categorias Productos Lista'),
path('ecommerce/categoria/<str:estado>/nivel/', views.get_categorias_productos_niveles, name='Lista de Categori... | silaves/OdinApi_v03 | apps/ecommerce/urls.py | urls.py | py | 2,962 | python | es | code | 0 | github-code | 18 | [
{
"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",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
2222168996 | # -*- coding: utf-8 -*-
import asyncio
import requests
import time
import urllib3
import m3u8
from functools import partial
URL = "https://www.soundvideostar.com/live/_definst_/rti3/chunklist_w1129242241.m3u8"
BASE = "https://www.soundvideostar.com/live/_definst_/rti3/"
audio_files = []
urllib3.disable_warnings()
... | yunusabd/radio-transcription | _download.py | _download.py | py | 1,177 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",... |
6798442657 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import numpy as np
import tensorflow as tf
from data.dataset_factory import get_dataset
from model.config import cfg
from model.bilinear_cnn import bilinear_cnn
def _preprocess_for_training(input_i... | RRanddom/tf-bilinear-cnn | train.py | train.py | py | 6,522 | python | en | code | 16 | github-code | 18 | [
{
"api_name": "tensorflow.expand_dims",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.cast",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "model.... |
36485207500 | from model import TokenClassificationSoftmaxModel
from model import TokenClassificationCrfModel
from model import BertSoftmaxModel
from model import BertCrfModel
from model import LstmSoftmaxModel
from model import LstmCrfModel
import tensorflow as tf
from hnlp import Corpus, Tokenizer, DataManager, Trainer, Node
from... | hscspring/hnlp | examples/token_classification/train.py | train.py | py | 2,874 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pnlp.read_json",
"line_num... |
38481937920 | import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
def hard_sigmoid(x):
'''
- hard sigmoid function by zcr.
- Computes element-wise hard sigmoid of x.
- what is hard sigmoid?
Segment-wise linear approximation of sigmoid. Faster than sigm... | Li-jingfeng/Predictive-Coding-SVIO | d1_conv_LSTM_utils.py | d1_conv_LSTM_utils.py | py | 1,383 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.functional.threshold",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.threshold",
"line_number": 19,
"usage_type": "call"
},
{
"a... |
26673394750 | import requests
import pendulum
import hashlib
from Utils.DataTools import DataSaver
from .Model.User import User, ConfidentialUser
from .Model.Post import Post
from .Model.FriendRequest import FriendSuggestion, FriendRequest
from .Model.Memory import Memory
class BeRealConnectionHandler:
def __init__(self):
... | torresflo/PyReal | API/BeRealAPI.py | BeRealAPI.py | py | 7,520 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "requests.post",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "pendulum.now",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "Utils.DataTools.DataSaver.sa... |
14113096111 | #참고 : https://heytech.tistory.com/368
import sys
import copy
from itertools import combinations
ans = 0
h, w = map(int,sys.stdin.readline().split())
graph = [list(map(int,sys.stdin.readline().split())) for _ in range(h)]
empty = [(x,y) for x in range(w) for y in range(h) if graph[y][x] == 0]
move = ((1,0),(-1,0),(0,1)... | YouHojoon/baekjoon_coding_test | bfs/14502.py | 14502.py | py | 971 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.stdin.readline",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
24123659512 |
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LinearRegression
from load_data import cp_data
import scipy as sc
from scipy.interpolate import UnivariateSpline
#fit linear regression pressure plateau
x0= cp_data[14:18, 0].reshape(-1,1)
y0=cp_data[14:18, 1]
model0= LinearRegressio... | diogoscf/ae-2224-b08 | cp_graphs.py | cp_graphs.py | py | 8,258 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "load_data.cp_data",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "load_data.cp_data",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 13,
"usage_type": "call"
},
{
"api_nam... |
18779845295 | # -*- coding: utf-8 -*-
# @Time : 14-07-2022, 18:06 HKT
# @Author : marc0cheung
# @Site : https://marc0cheung.github.io/projects
# @File : rsa.py
# @Software: SendMessageSafe
import binascii
import os
import sys
import base64
import pyperclip
import Crypto.PublicKey.RSA
import Crypto.Cipher.PKCS1_v1_5
import... | marc0cheung/SendMessageSafe | RSA/rsa.py | rsa.py | py | 9,288 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "os.environ",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets.QFileDialog.getExistingDirectory",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets.QFileDialog",
"line_number": 32,
"usage_type": "name... |
31937721982 | # This Python file uses the following encoding: utf-8
import json
from pathlib import Path
from matplotlib import pyplot as plt
from wordcloud import WordCloud
CN_punctuations = ",。()、﹑!:﹕‘’ “” ;﹗??﹖"
def process_CN1():
cn1_path = Path("texts/CN1.txt")
assert cn1_path.is_file()
with cn1_path.open() as... | MarkHershey/Laozi | main.py | main.py | py | 2,026 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "wordcloud.WordCloud",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "matplotlib.... |
766456761 | from metaflow import FlowSpec, step, IncludeFile, batch, S3, Parameter, current
import time
import numpy as np
from io import StringIO
from random import choice
from sklearn import linear_model
from sklearn.metrics import r2_score
class RegressionModel(FlowSpec):
# Include a local file.
DATA_FILE = IncludeFil... | jordantoaster/metaflow-exemplar | src/flows/training.py | training.py | py | 3,192 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "metaflow.FlowSpec",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "metaflow.IncludeFile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "metaflow.Parameter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "metaflow.cur... |
7594599435 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from core.models import ShoppingCart, ShoppingCartItem, Book
from .serializers import ShoppingCartSeriali... | Yagua/BookStore_API | cart/views.py | views.py | py | 3,589 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "core.models.ShoppingCart.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "core.models.ShoppingCart.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "core.models.ShoppingCart",
"line_number": 17,
"usage_type": "n... |
35579817970 | import re
from lxml import etree
import requests
from .fake_useragent import useragent_random
from .spider_data.database import Database
def spider_video_data(headers, bv: str) -> dict:
video_data = {}
url = f"https://www.bilibili.com/video/{bv}"
with requests.get(url, headers=headers, timeout=10) as re... | CS-Zucker/flask_bilibili_spider | demo_flask/App/spider/spider_1_video.py | spider_1_video.py | py | 2,219 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.