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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5519443045 | import torch
import torch.nn as nn
from tqdm import tqdm
from torch.optim import Adam
from torchvision.datasets import MNIST
from torchvision.transforms import Compose, ToTensor, Normalize, Lambda
from torch.utils.data import DataLoader
from omegaconf import DictConfig, OmegaConf
import hydra
from high_order_layers_tor... | jloveric/forward-forward | examples/mnist.py | mnist.py | py | 5,769 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "torch.Tensor",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.max",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number":... |
1071554997 | from typing import Optional
import numpy as np
from omni.isaac.core.robots.robot import Robot
from omni.isaac.core.prims.rigid_prim import RigidPrim
from omni.isaac.manipulators.grippers.surface_gripper import SurfaceGripper
from omni.isaac.core.utils.prims import get_prim_at_path
from omni.isaac.core.utils.stage impor... | benchun123/Digital-Twin-Implementation | scripts/uarm/uarm_model.py | uarm_model.py | py | 7,681 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "omni.isaac.core.robots.robot.Robot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "nu... |
870205755 | # -*- coding: utf-8 -*-
from PySide2 import QtCore, QtGui, QtWidgets
import json
import core_functions as cf
import numpy as np
class Ui_Statistics(object):
def setupUi(self, Statistics):
# Note: this is not how it should be done but currently I don't know
# how to do it differently. This is only... | GatherLab/OLED-evaluation | src/UI_statistics_window.py | UI_statistics_window.py | py | 6,187 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "PySide2.QtWidgets.QVBoxLayout",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "PySide2.QtWidgets.QLabel",
"line_number": 67,
"usage_type": "call"
},
{
"api_name... |
39644078266 | import models
import yfinance as yf
from fastapi import FastAPI, Request, Depends, BackgroundTasks
from fastapi.templating import Jinja2Templates
from database import SessionLocal, engine
from sqlalchemy.orm import Session
from pydantic import BaseModel
from models import Stock
app = FastAPI()
models.Base.metadata.c... | vanshxjain/StockDatabase | main.py | main.py | py | 1,981 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Base.metadata.create_all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Base",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "data... |
39868276361 | from django import forms
from main.model.rubric import SuperRubric, SubRubric
class SubRubricForm(forms.ModelForm):
super_rubric = forms.ModelChoiceField(
queryset=SuperRubric.objects.all(),
empty_label=None,
required=True,
label="Надрубрика",
)
# Убираем у раскр... | artemgv/spacemusic | app/main/forms/subrubric.py | subrubric.py | py | 784 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelChoiceField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "d... |
18466961806 | import datetime
from copy import deepcopy
import numpy as np
from scipy.special import gammaln
from shapely.geometry import Point
from openquake.hmtk.seismicity.utils import haversine
from pyetas.utils import get_region
'''
This file performs the change point calculations as described in the
in-review paper - Gupta ... | SalvIac/pyetas | pyetas/bayesian_change_point.py | bayesian_change_point.py | py | 16,957 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.datetime64",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "numpy.datetime64",
"line... |
10419431423 | from __future__ import annotations
import dataclasses
import functools
from typing import TYPE_CHECKING
from PySide6.QtGui import QColor
from randovania.games.am2r.layout.am2r_cosmetic_patches import AM2RCosmeticPatches, AM2RRoomGuiType, MusicMode
from randovania.gui.dialog.base_cosmetic_patches_dialog import BaseCo... | randovania/randovania | randovania/games/am2r/gui/dialog/cosmetic_patches_dialog.py | cosmetic_patches_dialog.py | py | 5,516 | python | en | code | 165 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PySide6.QtGui.QColor.fromRgb",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "PySide6.QtGui.QColor",
"line_number": 29,
"usage_type": "name"
},
{
"api_name":... |
16539531125 | #!/usr/bin/env python3
from cryptography.fernet import Fernet
import os
#finding files
files = []
for file in os.listdir():
#ignore the .py file and the key file before using .append
if file == "voldemort.py" or file == "thekey.key" or file == "decrypt.py":
continue
# using .isfile to add... | igorkcarneiro/python-codes | ransom/decrypt.py | decrypt.py | py | 1,365 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cryptography.fernet.Fernet",
... |
31215062731 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('siteScrape', '0005_auto_20150912_0911'),
]
operations = [
migrations.AlterModelOptions(
name='teacher',
... | anikan/Classify | migrations/0006_auto_20150912_1707.py | 0006_auto_20150912_1707.py | py | 912 | python | en | code | 0 | github-code | 6 | [
{
"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.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
9209848596 | """ A module intended to decode and parse savedState files for the Terminal application
for each user on disk.
"""
# KEEP THIS - IMPORT FUNCTIONS FROM COMMON.FUNCTIONS
from .common import ccl_bplist as bplist
from .common.dep import six
from .common.functions import multiglob, read_bplist, read_stream_bplist
# MODULE... | CrowdStrike/automactc | modules/mod_terminalstate.py | mod_terminalstate.py | py | 8,934 | python | en | code | 491 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "__main__.data_writer",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "common.functions.multiglob",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "__m... |
32568603590 | from django.conf import settings
from django.views.generic import TemplateView
from nimr_web.models import Publication, News, SliderPhoto, HeadDepartment, StaffProfile
from nimr_web.models.centre_manager import CentreManagerPhoto
class ViewMixin(TemplateView):
ordering = "-report_datetime"
model = CentreMana... | frdrckaman/nimr-muhimbili | nimr_web/views/view_mixin.py | view_mixin.py | py | 2,659 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "nimr_web.models.centre_manager.CentreManagerPhoto",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "nimr_web.models.Publication.objects.all",
"line_number": 1... |
27901870544 | from flask import Flask, render_template, url_for, request
import requests
app = Flask(__name__)
API_URL = "https://api-inference.huggingface.co/models/siripranitha/iter1"
ACCESS_TOKEN = "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"
def query(payload):
HEADERS = {"Authorization": "Bearer "+ACCESS_TOKEN}
response... | siripranitha/Intimacy-score-detection | app.py | app.py | py | 1,037 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request.method",... |
35875218840 | import os
import sys
from utils import CustomException
import utils
from logger import logging
import pandas as pd
import datetime
import boto3
import json
from dataclasses import dataclass
# Organise the classes by the highest probability
def create_order(prob, classes, k = 5):
list_probs = list(zip(prob, clas... | jooaobrum/marketing_campaign_CRM_case | src/propensity_ml/inference_pipeline/model_inference.py | model_inference.py | py | 5,532 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_numb... |
35032054483 | """Module Docstring"""
import subprocess
import isort # noqa: F401
from bottle import Bottle, request, template
from loguru import logger
fmt = "{time} - {name} - {level} - {message}"
logger.add("../logs/info.log", level="INFO", format=fmt, backtrace=True, diagnose=True) # noqa: E501
logger.add("../logs/error.log",... | miccaldas/bottle | bottle/handler.py | handler.py | py | 801 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "loguru.logger.add",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "loguru.logger.add",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"... |
2132326791 | import os
from .base_settings import *
import dj_database_url
DEBUG = False
ALLOWED_HOSTS = ['*']
# secret key settings
SECRET_KEY = os.environ['SECRET_KEY']
GITHUB_SECRET_KEY = os.environ['GITHUB_SECRET_KEY']
# e-mail settings
#EMAIL_HOST = 'smtp.gmail.com'
#EMAIL_HOST_USER = os.environ['EMAIL_ADDRESS']
#EMAIL_HOS... | hayatek/star-chart | config/settings/settings_p.py | settings_p.py | py | 2,124 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
30950770227 | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import ode
def f(t,y,Pi,usepotential):
cutoff = 2**(1/6)
if t < cutoff and usepotential:
v0 = 4*(1/t**12-1/t**6)+1
else:
v0 = 0
return [y[1],-3*y[1]/t+Pi*y[0]+v0/t]
def jac(t,y,Pi):
return [[0,1... | samueljmcameron/ABPs_coarse_graining | experiments/2020_01_21/hard_sphere_w/numerical_solve_homogeneous_ODE.py | numerical_solve_homogeneous_ODE.py | py | 1,323 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.integrate.ode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot... |
20393698560 | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 16 16:54:42 2017
@author: eun
"""
from collections import deque
import os
#import sys
import numpy as np
import tensorflow as tf
import random
class DQNAgent :
def __init__ ( self , path_name , rows , cols ) :
#tensorflow 그래프 초기... | inkp80/6jo | Python AIs/Othello Python/dqn_agent2.py | dqn_agent2.py | py | 6,253 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "tensorflow.reset_default_graph",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.... |
35051648444 | import pandas as pd
from pandas.core.generic import NDFrame
import logging
import numpy as np
from toolkit.Judy import My_Math as Math
path = "../data/"
logging.basicConfig(level=logging.INFO,filename='mylog.log',filemode='w')
df = pd.read_csv(path+"A121151.csv")
keys = df.keys()
# datas = [[0 for i in range(3)] for... | JackyCafe/basicProject | csv_lib/readercsv4.py | readercsv4.py | py | 682 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
23061761610 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import urllib.request
import re
import json
import os
def wikiSupple(minStr):
skillsPathDict=readNameDict("(var skillsPath)")
jo=json.loads(minStr)
newJo={}
for x in jo:
svt={}
if ("friendship" in x):
fsDict={}
fsDict["id"]=x["friendship"]["... | pplost/for-test | tools/wiki_ supple.py | wiki_ supple.py | py | 1,648 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "re.S",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number": 58,
... |
37090910543 | from unittest import TestCase
from fastapi.testclient import TestClient
from trader_api.main import app
client = TestClient(app)
class TestInternal(TestCase):
def test_ping(self):
"""Tests /_internal/ping endpoint."""
response = client.get('/_internal/ping')
self.assertEqual(
... | slownet/trader-api | tests/test_internal.py | test_internal.py | py | 540 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.testclient.TestClient",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "trader_api.main.app",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "name"
}
] |
57072600 | import torch, os, time, numpy as np
import torch.nn as nn
import torch.optim as optim
from initValues import config
from helper import GanHelper
from tensorboard import summary
import datetime
from torch.autograd import Variable
class Trainer(object):
def __init__(self, outDir):
self.currentTime = str(date... | Mgosi/StackGAN-Text-to-Photo-Realistic-Image-Synthesis | training.py | training.py | py | 6,170 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
40004123935 | #!/usr/bin/env python3
"""Python Energy Logger"""
import numpy as np
from os import nice
from time import sleep
from math import sqrt, cos
from signal import signal, SIGINT
from scipy.optimize import leastsq
from multiprocessing import Process, Pipe
def signal_handler(signal, frame):
"""Allows graceful exit"""
... | mdarty/PyEnergy | pyenergy.py | pyenergy.py | py | 3,965 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "signal.signal",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "numpy.sqrt",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_num... |
30217435994 | #Distplot (Verteilungsfunktionen plotten), joinrplot, pairplot, kdeplot, Boxplot, Violinplot, Swarmplot, countplot, barplot
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
#%matplotlib inline
tips = sns.load_dataset('tips')
#Verteilungsfunktion
sns.distplot(tips['total_bill'],kde=False #Anze... | ThePeziBear/MyPythonLibrary | Visualizing_Python/Seaborn/1_general_functions_seaborn.py | 1_general_functions_seaborn.py | py | 4,251 | python | de | code | 0 | github-code | 6 | [
{
"api_name": "seaborn.load_dataset",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "seaborn.distplot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "seaborn.jointplot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "seaborn.jointp... |
21310741084 | import time
import numpy as np
import cv2
import matplotlib.pyplot as plt
import json
import os
import matplotlib.image as mpimg
def grad(input_array):
length = len(input_array)
out_grad = [0]*length
for idx in range(1,length):
out_grad[idx] = int(input_array[idx]) - int(input_array[idx-1])
out... | StartingPointM/Defect-Dtection | auto.py | auto.py | py | 2,484 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 28... |
23360486001 | # -*- coding: utf-8 -*-
import os
import webapp2
import jinja2
from google.appengine.api import users
from artist_service import artist_info
jinja_env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
def get_auth():
... | rtoal/musick | main.py | main.py | py | 1,703 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "jinja2.Environment",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
4348795444 | import sys
from PyQt5 import uic
from PyQt5.QtWidgets import QApplication, QMainWindow
from steganography_in_text import Crypter, Decrypter
import pyperclip
crypt = Crypter()
decrypt = Decrypter()
class MyWidget(QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi('app.ui', self) # З... | red-lexinus/steganography_progect | desktop_app/main.py | main.py | py | 1,962 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "steganography_in_text.Crypter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "steganography_in_text.Decrypter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 12,
"usage_type": "name"
},
... |
33652181324 | from fastapi import FastAPI, Body
app = FastAPI()
BOOKS = [
{'title': "Title One", 'author': 'Ivan', 'category': 'science'},
{'title': "Title Two", 'author': 'Author Two', 'category': 'Category Two'},
{'title': "Title Three", 'author': 'Author Three', 'category': 'Category Three'},
{'title': "Title Fo... | Taner940706/basic-fastapi-exercise | fastApiBooks/books.py | books.py | py | 1,678 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "fastapi.Body",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "fastapi.Body",
"line_number": 42,
"usage_type": "call"
}
] |
42641168665 | #!/usr/bin/python3
import sys
import argparse
class Options(object):
__arg_list = []
def argv(self):
return self.__mode, self.__arg_list
def __init__(self, argv):
parser = argparse.ArgumentParser(prog="detector",
usage="usage: detector cmd [option... | osssanitizer/maloss | main/options.py | options.py | py | 4,537 | python | en | code | 98 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 85,
"usage_type": "attribute"
}
] |
43136507891 | import toml
import enum
from UsageFactory import UsageFactory
# use toml for readabiliity
class CMD(enum.Enum):
Quit = 1
Wait = 2
HELP = 3
Link = 4
Search = 5
ListAlone = 6
Edit = 7
if __name__ == '__main__':
arg = input("choose Usage: (Voc)abulary linking, (Mean)ing Linking: ")
if a... | yenchihliao/ankiSupport | Linkionary.py | Linkionary.py | py | 2,884 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "UsageFactory.UsageFactory",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "UsageFactory.UsageFactory",
"line_number": 18,
"usage_type": "call"
}
] |
19272874983 | from devpi_common.metadata import parse_version
from devpi_server import __version__ as _devpi_server_version
import pytest
devpi_server_version = parse_version(_devpi_server_version)
if devpi_server_version < parse_version("6.9.3dev"):
from test_devpi_server.conftest import gentmp, httpget, makemapp # noqa
... | devpi/devpi-passwd-reset | tests/conftest.py | conftest.py | py | 1,644 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "devpi_common.metadata.parse_version",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "devpi_server.__version__",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "devpi_common.metadata.parse_version",
"line_number": 9,
"usage_type": "cal... |
4756047948 | from pathlib import Path
import shutil
from .errors import NotAFileError
def _copy(self, target):
try:
assert self.is_file()
except AssertionError:
raise NotAFileError(self)
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copy(str(self), str(target))
Path.copy = _copy
| Living-with-machines/wrangle-ukds-trade-directories | wrangle_ukds_trade_directories/pathlib.py | pathlib.py | py | 317 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "errors.NotAFileError",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "shutil.copy",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.copy",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path"... |
13479233793 | '''
Author: xinao_seven_
Date: 2021-10-05 22:27:04
LastEditTime: 2022-10-25 23:08:10
LastEditors: xinao_seven_
Description:
Encoding: utf8
FilePath: \\1xingao\\python\\main\\med_find.py
'''
# -*- coding: utf-8 -*-
import requests
first_url = "http://scxk.nmpa.gov.cn:81/xk/itownet/portalAction.do?method=getXkzsList... | 1xingao/1xingao | python/main/med_find.py | med_find.py | py | 1,475 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 51,
"usage_type": "call"
}
] |
30367887581 | """Tutorial 1. Creating a plot and saving it as an image to disk."""
import os
import sys
from scipy import arange, pi, sin
from chaco import api as chaco
# First, we create two arrays of data, x and y. 'x' will be a sequence of
# 100 points spanning the range -2pi to 2pi, and 'y' will be sin(x).
numpoints = 100
st... | enthought/chaco | examples/tutorials/tutorial1.py | tutorial1.py | py | 2,271 | python | en | code | 286 | github-code | 6 | [
{
"api_name": "scipy.pi",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "scipy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.pi",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "scipy.sin",
"line_number": 14,
... |
41436277363 | import os
import torch
import xml.etree.ElementTree as ET
from torch.utils.data import Dataset
import numpy as np
import cv2
import sys
from ctpn_utils import cal_rpn
from config import IMAGE_MEAN
class ICDARDataset(Dataset):
def __init__(self, datadir, labelsdir):
datadir = os.path.abspath(datadir)
... | risingstar213/OCR | ctpn/data/dataset.py | dataset.py | py | 4,236 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath... |
10698973488 | from aiohttp import web
import aiohttp_jinja2
from livecode.utils import sha1_encrypt, create_live_code
import time
class Index(web.View):
"""用户操作页面
"""
@aiohttp_jinja2.template('index.html')
async def get(self):
# 获取我的活码
phone = self.request['user']
cursor = self.request.app['d... | mikuh/livecode | livecode/views/index.py | index.py | py | 1,595 | python | en | code | 29 | github-code | 6 | [
{
"api_name": "aiohttp.web.View",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.web",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "aiohttp_jinja2.template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aiohttp.web.Vi... |
37940662604 | import sys,threading,warnings,serial,time,logging,queue,yaml,serial
#sys.path.append('/home/pi/Desktop/ADRNX/Utils')
#sys.path.append('/home/pi/Desktop/ADRNX')
import SIM_MOD,SIM_MOD_STREAMER,SIM921, SIM922, SIM960, SIM970
from timeit import default_timer as timer
class SIM900:
debug = True
input_thread_on = ... | nikitakuklev/ADRNX | SRS/SIM900.py | SIM900.py | py | 15,888 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "queue.Queue",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": ... |
7985279968 | import csv
import cv2
import matplotlib
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import collections
from PIL import Image
import matplotlib.pyplot as plt
import torch
from torc... | gibum1228/ComputerVision | alphabet_classification/read_data.py | read_data.py | py | 10,952 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array_split",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_numb... |
22419607453 | from flask import Flask, blueprints
from flask import render_template, blueprints,url_for,redirect
from flask.globals import request
from authlib.integrations.flask_client import OAuth
from auth import login, signup
from data_firebase import create_database,manda_gravar
#from config import oauth
app = Flask(__name__... | Ericles-Miller/Process-seletivo-hucf | app.py | app.py | py | 7,792 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "authlib.integrations.flask_client.OAuth",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 77,
"usage_type": "call"
},
{
"api_nam... |
8363259866 | #Used to organize motors into the database
#There are three sources of motor parameters: DriveCalc, MotoCalc, csv from Josh
import sqlite3 as sql
import numpy as np
import os
from os import path
import csv
def isNum(x):
try:
float(x)
return True
except ValueError:
return Fa... | corygoates/PropulsionOptimization | Database/createMotorDatabase.py | createMotorDatabase.py | py | 4,285 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_numbe... |
30827786115 | import os
import logging
import novelwriter
from math import ceil
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import qApp
from PyQt5.QtGui import (
QPalette, QColor, QIcon, QFont, QFontMetrics, QFontDatabase, QPixmap
)
from novelwriter.enum import nwItemLayout, nwItemType
from novelwriter.error import logEx... | vaelue/novelWriter | novelwriter/gui/theme.py | theme.py | py | 26,913 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "novelwriter.CONFIG",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtGui.QFontDatabase",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "P... |
34589710837 | import pygame as pg
import numpy as np
import visualizer as vis
from svg.path import parse_path
WINDOW = (800, 800)
TITLE = "svg-mirrors"
FRAMERATE = 60
def main():
pg.init()
screen = pg.display.set_mode(WINDOW)
pg.display.set_caption(TITLE)
loop(screen)
def loop(screen):
clock ... | LinusCebulla1208/svg-mirrors | main.py | main.py | py | 1,180 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
20070430457 | import datetime
import command
import config
timer_usage = 'usage: `!timer list`, `!timer add thing in 1d2h3m`, `!timer del thing`'
@command.command('per-channel reminders', {
'type': command.OPTION_TYPE.SUB_COMMAND,
'name': 'list',
'description': 'list timers for this channel',
}, {
'type': command.OPTION_TYPE.... | raylu/sbot | timer.py | timer.py | py | 4,812 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "command.command",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "command.OPTION_TYPE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "command.OPTION_TYPE",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "comma... |
27228412791 | #!venv/Scripts/python3.exe
import os
import sys
from pathlib import Path
from cairosvg import svg2png
import tkinter as tk
from tkinter import filedialog, messagebox
def svg_string2png(svg_path):
with open(svg_path) as fp:
svg_code = fp.read()
png_path = f'{Path(svg_path).stem}.png'
svg2pn... | rightson/svg2png | svg2png.py | svg2png.py | py | 1,274 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cairosvg.svg2png",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys._MEIPASS",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
21335903294 | """
Titouan Brierre
"""
import json
from math import sin, cos, acos, pi
import numpy as np
import time as t
with open('donneesbus.json') as donneesbus:
databus = json.load(donneesbus)
noms_arrets = list(databus.keys()) #liste les arrets du dictionnaire
n=len(noms_arrets) #taille de la liste
#liste les ... | LaradiMoussa/BUT | SEMESTRE-2/SAE/S2.2/algorithmes.py | algorithmes.py | py | 7,507 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "math.pi",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "math.pi",
"line_number": 63,
"usage... |
6435433708 | # from server import app
from flask import Flask, render_template, request, redirect, url_for, jsonify
import json
# from driver import *
from Car_Rental_project.models.car import *
from Car_Rental_project.models.customer import *
from Car_Rental_project.models.employee import *
app= Flask(__name__)
@app.route('/')
... | Malinolsen/assignment4-info212 | my_services.py | my_services.py | py | 6,519 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "flask.req... |
12136380371 | import discord.ext
from discord.ext import commands
from discord.utils import get
from discord.ext import commands
from discord import Member
from discord.ext.commands import has_permissions, MissingPermissions
import asyncio
import time
prefixes = list(["<@716530326662545450> ", ">"])
bot = commands.Bot(command_prefi... | dante-nl/utilly-bot | bot.py | bot.py | py | 14,829 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "discord.ext.Embed",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "disco... |
42345376269 | from itertools import combinations
from functools import wraps
def cache(f):
cache_dict = {}
@wraps(f)
def inner(*args):
val = cache_dict.get(tuple(args))
if val:
return val
val = f(*args)
cache_dict[tuple(args)] = val
return val
return inner
@ca... | yodigi7/kattis | alchemy101.py | alchemy101.py | py | 1,121 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "functools.wraps",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 41,
"usage_type": "call"
}
] |
37598067006 | # Create a mesh, compute the normals inplace, set the active
# vectors to the normals, and show that the active vectors are
# the ``'Normals'`` array associated with points.
#
import pyvista
mesh = pyvista.Sphere()
_ = mesh.compute_normals(inplace=True)
mesh.active_vectors_name = 'Normals'
mesh.active_vectors_info
# Ex... | pyvista/pyvista-docs | version/stable/api/core/_autosummary/pyvista-DataSet-active_vectors_info-1.py | pyvista-DataSet-active_vectors_info-1.py | py | 409 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pyvista.Sphere",
"line_number": 6,
"usage_type": "call"
}
] |
8833372409 | from api.validators import validate_year
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.validators import UnicodeUsernameValidator
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
class User(AbstractUser):
USER = 'user'
MODERAT... | thalq/yamdb_final | api_yamdb/reviews/models.py | models.py | py | 4,412 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.validators.UnicodeUsernameValidator",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.db.models.EmailField",
"line_number": 2... |
71844663869 | # -*- coding: utf-8 -*-
from django.urls import reverse_lazy
from django.http import JsonResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import ListView, CreateView, UpdateView, DetailView, DeleteView
from django.forms import modelformset_factory, formset_factory
fr... | dbsiavichay/invenco | maintenance/views.py | views.py | py | 4,051 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pure_pagination.mixins.PaginationMixin",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.views.generic.ListView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.views.generic.CreateView",
"line_number": 32,
"usage_type": "... |
39722733870 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import cauchy
fig, ax = plt.subplots(1,1)
mean,var,skew,kurt = cauchy.stats(moments='mvsk')
x = np.linspace(cauchy.ppf(0.01),cauchy.ppf(0.99),100000)
y = np.linspace(0,140,100)
y2 = np.linspace(0,80,100)
ons = np.ones(100)
plt.rc(... | mhoffies/UQ-mesa | manycauchy.py | manycauchy.py | py | 1,478 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "scipy.stats.cauchy.stats",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sc... |
37972466539 | # /usr/bin/env python
import pygal
import requests
import json
#Use a view in CouchDB to get the data
#use the first key for attribute type
#order descending so when limit the results will get the latest at the top
r = requests.get('http://127.0.0.1:5984/mvp_sensor_data/_design/doc/_view/attribute_value?startkey=["te... | webbhm/OpenAg_MVP_UI | MVP_UI/python/temp_chart.py | temp_chart.py | py | 966 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygal.Line",
"line_number": 17,
"usage_type": "call"
}
] |
39269955755 | import logging
import os
import os.path
import shlex
import sys
import re
from io import StringIO
from dimcli import CLI, logger
cli = CLI()
# taken from unittest/python 2.7
def assertDictSubset(actual, expected, msg=None):
"""Checks whether actual is a superset of expected."""
missing = []
mismatched = ... | 1and1/dim | ndcli/tests/__init__.py | __init__.py | py | 3,356 | python | en | code | 39 | github-code | 6 | [
{
"api_name": "dimcli.CLI",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
... |
71171020027 | import sqlite3
from sqlite3 import Error
#from . import *
from common.database import PostsTableFunctions
from common.database import FriendsTableFunctions
from common.database import LikesTableFunctions
from common.database import UsersTableFunctions
from common.database import CommentsTableFunctions
def create_conn... | maxdecken/AluStego | main/common/database/TableCreationFunctions.py | TableCreationFunctions.py | py | 4,516 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlite3.Error",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sqlite3.Error",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "sqlite3.Error",
"line... |
10383046483 | from typing import Dict
import executorch.backends.qualcomm.python.PyQnnWrapperAdaptor as PyQnnWrapper
import numpy as np
import torch
from .node_visitor import NodeVisitor, register_node_visitor
from .qnn_constants import OpDepthToSpace, QNN_OP_PACKAGE_NAME_QTI_AISW
@register_node_visitor
class DepthToSpaceVisito... | pytorch/executorch | backends/qualcomm/builders/op_depth_to_space.py | op_depth_to_space.py | py | 2,234 | python | en | code | 479 | github-code | 6 | [
{
"api_name": "node_visitor.NodeVisitor",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.fx",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "torch.fx",
"li... |
36981559310 | import spacy
from spacy.matcher import Matcher
from models.paciente import Paciente
from flask import jsonify
from models.ruler import patrones_ruler
nlp = spacy.load("es_core_news_md")
matcher = Matcher(nlp.vocab)
ruler = nlp.add_pipe("entity_ruler", before="ner")
patterns = patrones_ruler()
ruler.add_patterns(patter... | PRY20220112/nlp_proyect | servicioNlp.py | servicioNlp.py | py | 7,061 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "spacy.matcher.Matcher",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.ruler.patrones_ruler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.pac... |
29122482140 | import json
from tests.fixture import couponTestDatas, initDb
from couponsApi.getId.lambda_handler import lambda_handler
def test_lambda_handler_get(initDb):
"""getIdのlambda_handlerのテスト関数
HTTPメソッド分岐処理を中心にテスト
"""
tests = [
{
"name": "クーポンID(0001245)の問合せ",
"case": "norm... | shuntaka9576/ServerlessApiSample | lambdaFunctions/tests/couponsApi/getId/test_lambda_handler.py | test_lambda_handler.py | py | 1,600 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tests.fixture",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "tests.fixture.couponTestDatas",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "tests.fixture",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "couponsApi.... |
41303891590 | #!/usr/bin/env python3
import argparse
import subprocess
import Metadatos
import Encabezados
import sublist3r
import VIRUS_01
import file_powershell
import CifradoMensajes
description = """
Suite de Seguridad:
[1] Metadatos
[2] Analizar encabezados
[3] Subdominios
[4] API
[5]... | Melissa-Mendieta/PIA-PC | main.py | main.py | py | 3,095 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "Metadatos.scrapingImages",
"line_number": 55,
"usage_type": "call"
},... |
30366572171 | #!/usr/bin/env python
"""
Draws a contour polygon plot with a contour line plot on top
- Left-drag pans the plot.
- Mousewheel up and down zooms the plot in and out.
- Pressing "z" brings up the Zoom Box, and you can click-drag a rectangular
region to zoom. If you use a sequence of zoom boxes, pressing alt-left-... | enthought/chaco | chaco/examples/demo/basic/contour_plot.py | contour_plot.py | py | 3,038 | python | en | code | 286 | github-code | 6 | [
{
"api_name": "numpy.random.uniform",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "numpy.random.uniform",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"li... |
28102445015 | import numpy as np
from numpy.linalg import multi_dot
from scipy.linalg import block_diag
def TAMatrix(sin,cos):
phases = (2*np.pi)*np.random.random_sample(3)
matrix_one = np.array([[1,0],[0,np.exp(-1j*phases[0])]])
matrix_two = np.array([[1,-sin],[-sin,1]])
matrix_three = np.array([[np.exp(1j*p... | orionlee3/Reed_Thesis | matrix_constructions.py | matrix_constructions.py | py | 2,243 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.pi",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random_sample",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",... |
70322593788 | """added_product_rating_unique_constraint
Revision ID: acf2fa2bcf67
Revises: 338bae562a5b
Create Date: 2023-05-26 10:48:50.456396
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "acf2fa2bcf67"
down_revision = "338bae562a5b"
branch_labels = None
depends_on = Non... | ttq186/DressUp | alembic/versions/2023-05-26_added_product_rating_unique_constraint.py | 2023-05-26_added_product_rating_unique_constraint.py | py | 833 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.create_unique_constraint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "alembic.op.f",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "alembic.o... |
33246784827 | import boto3
def start_model(project_arn, model_arn, version_name, min_inference_units):
client=boto3.client('rekognition')
try:
# Start the model
print('Starting model: ' + model_arn)
response=client.start_project_version(ProjectVersionArn=model_arn,
MinInferenceUnits=min... | HusainArtist/CustomLabels | Untitled5.py | Untitled5.py | py | 2,262 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "boto3.client",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 30,
"usage_type": "call"
}
] |
24160169202 | from django.test import TestCase
from products.models import Product
from django.contrib.auth.models import User
from django.urls import reverse
class TestBagViews(TestCase):
def setUp(self):
"""
Set up requirements for view testing
"""
self.product = Product.objects.create(
... | shanedunne/press_records | bag/tests.py | tests.py | py | 2,373 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "products.models.Product.objects.create",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "products.models.Product.objects",
"line_number": 14,
"usage_type": "attribute"... |
73887835068 | from pydantic import BaseModel
class Search(BaseModel):
class Config:
_model_id = "japanese_faq"
_text = 'Can I unregister as I am not in charge of class anymore ?'
_variations = ["en", "ja"]
schema_extra = {
"example": {
"text": _text,
"... | Crowlingo/PyCrowlingo | PyCrowlingo/ApiModels/Faq/Examples/Requests.py | Requests.py | py | 5,634 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "pydantic.Base... |
73416849789 | import sys
import sqlite3
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QFrame, QFileDialog
from PyQt5.QtGui import QIcon, QPixmap, QPalette, QColor, QPainter
from PyQt5.QtWidgets import (QRadioButton, QWidget, QStylePainter, QSizePolicy,
QStyle... | DenisAvocado/Trolleybus-Route | Trolleybus_Route.py | Trolleybus_Route.py | py | 56,577 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QFrame",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QFrame.__init__",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QFrame",
"line_number": 19,
"usage_type": "name"
},
{
"api... |
27687388659 | import time
import pyglet
from .button import Button
from .image_assets import IMAGE_ASSETS
class Ptimer(object):
def __init__(self, times=[25, 5, 20]):
self.sequence = [
'round', 'break',
'round', 'break',
'round', 'break',
'round', 'long break'
]
... | AddisonSchiller/pomodoro_timer | ptimer/gui/gui_version.py | gui_version.py | py | 3,552 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "button.Button",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "image_assets.IMAGE_ASSETS",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "button.Button",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "image_assets.IM... |
26041727356 | from __future__ import annotations
import logging
import textwrap
from dataclasses import dataclass
from pathlib import Path
from typing import Callable
from pants.backend.scala.bsp.spec import (
ScalaBuildTarget,
ScalacOptionsItem,
ScalacOptionsParams,
ScalacOptionsResult,
ScalaMainClassesParams,... | pantsbuild/pants | src/python/pants/backend/scala/bsp/rules.py | rules.py | py | 18,458 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "pants.bsp.util_rules.lifecycle.BSPLanguageSupport",
"line_number": 70,
"usage_type": "name"
},
{
"api_name": "pants.engine.target.FieldSet",
"line_number": 77,
"usage_type": "name... |
23624146347 | from dataclasses import replace
from datetime import date
from django.core.cache import cache
from pytest import raises
from unittest.mock import call
from .cache import get_daily, get_total
def test_get_daily(response_external, daily_data, mocker):
cache.clear()
cache.set(str(date(2017, 6, 14)), daily_data[2... | sergey-misuk-work/cache | cache/test_cache.py | test_cache.py | py | 1,414 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.core.cache.cache.clear",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.core.cache.cache",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.core.cache.cache.set",
"line_number": 11,
"usage_type": "call"
},
{
... |
44380458156 | from django.shortcuts import render, redirect
from django.contrib import messages, auth
from django.core.validators import validate_email
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from .models import FormContato
def login(request):
if request.method != '... | danilosheen/cursopython3 | projeto_agenda/contas/views.py | views.py | py | 3,380 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth",
"line_number": 16,
"usage_type": "name"
},
{
"api_... |
14141726880 | '''*******************************************************************
* Module: regd.serv
*
* Created: Jul 5, 2015
*
* Abstract: Server.
*
* Author: Albert Berger [ alberger@gmail.com ].
*
********************************************************************'''
__lastedited__ = "2018-11-08 04:09:44"
import sys, ... | al-berger/regd | regd/serv.py | serv.py | py | 11,785 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "regd.cmds.CmdProcessor",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "regd.defs.STOP_SERVER",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "regd.defs",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "regd.defs... |
22447766377 | import dash_core_components as dcc
import dash_html_components as html
import numpy as np
import plotly.graph_objects as go
class DataPlotter:
def __init__(self, data, heading, titles, matrix):
self.data = data
self.heading = heading
self.titles = titles
self.matrix = matrix
d... | fj0lverkr/covid_19_belgium | Utils/DataPlotter.py | DataPlotter.py | py | 3,813 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "dash_html_components.H1",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects.Figure",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objects",
"line_number": 24,
"usage_type": "name"
},
{
"api_name... |
26598538531 | # transform from recipe to asian
from parse import wrapper, remove_punc_lower, food, direction, make_recipe_obj
import string
from collections import deque
from get_key_ingredient import get_key, get_key_food
def lookup(ing, lst):
name_lst = ing.name.lower().translate(str.maketrans('', '', string.punctuation)).split... | emilyjenkins08/Recipes | transform_asian.py | transform_asian.py | py | 18,571 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "string.punctuation",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "parse.food",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "parse.food",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "parse.food",
"line_n... |
14431781509 |
import os
import numpy as np
from skorch.callbacks import Callback
from sklearn.metrics import f1_score
class ModelStorer(Callback):
def __init__(self, path):
super().__init__()
self.path = path
def on_epoch_end(self, net, **kwargs):
epoch = net.history[-1]['epoch']
net.save_... | StefanJMU/CapsuleNetwork | mnist_example/callbacks.py | callbacks.py | py | 1,220 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "skorch.callbacks.Callback",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "skorch.callbacks.C... |
72330721787 | import datetime
import json
from urllib.parse import urljoin, urlparse
import pyproj
from django.conf import settings
from map.map_template import map_template, single_feature_template
import arcgis
from arcgis.gis import GIS
def get_submissions_df():
gis = GIS(username=settings.ESRI_USERNAME, password=settings... | jeverling/geochimp | geochimp/utils/arcgis.py | arcgis.py | py | 5,025 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "arcgis.gis.GIS",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.ESRI_USERNAME",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 14,
"usage_type": "name"
},
{
"api_n... |
27694350452 | from selenium import webdriver
from selenium.webdriver.common.by import By
from datetime import date, datetime, timedelta
import openpyxl as opxl
from selenium.webdriver.common.keys import Keys
from openpyxl.styles import Font, PatternFill, Alignment, Border, Side
import time
def str_to_int_or_float(value):
... | soffet713/20210312_Selenium_Python_Testing | main.py | main.py | py | 7,192 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "selenium.web... |
37149716634 | '''
Written by Chiann-Ling Cindy Yeh, updated 12/1/2021
Disclaimer: I have not actually tested this script since my construct is a little more unique and requires a different set up.
This script translates variant sequences to the amino acid sequence and outputs two barcode maps: barcode-translated variant map and bar... | cindyyeh/barseq | misc_scripts/get_mutations.py | get_mutations.py | py | 2,113 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
73675808826 | import os, sys
proj_path = "/home/webuser/webapps/tigaserver/"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tigaserver_project.settings")
sys.path.append(proj_path)
os.chdir(proj_path)
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
from tigaserver_app.models import Report... | Mosquito-Alert/mosquito_alert | util_scripts/picture_classification.py | picture_classification.py | py | 2,035 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "os.environ.setdefault",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"li... |
20919803266 | import argparse
import datetime
from tqdm import tqdm
import pandas as pd
from selenium import webdriver
from time import sleep
import gspread
from df2gspread import df2gspread as d2g
from df2gspread import gspread2df as g2d
from oauth2client.service_account import ServiceAccountCredentials
parser = argparse.Argumen... | seunghyukcho/soomgo-crawler | main.py | main.py | py | 4,419 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccount... |
40726690331 | from collections import deque
n = input()
lst = []
for i in n:
lst.append(i)
lst2 = list(map(int, lst))
q = deque(lst2)
res = q.popleft()
while q:
temp = q.popleft()
if res == 0:
res += temp
elif temp == 0 or temp == 1:
res += temp
else:
res *= temp
print(res)
| John3210of/AnyPrac | 2cote/greedy_mulsum.py | greedy_mulsum.py | py | 307 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 8,
"usage_type": "call"
}
] |
35866723710 | import os
import random
import h5py
import numpy as np
import scipy.io
import torch
import torchvision.transforms as transforms
from PIL import Image
from torch.utils.data import Dataset
from torchvision.transforms import functional as F
import numbers
from util.utils import color_label_np
import PIL.Imag... | ZhaoyangLi-nju/Segmentation-dataloader | cityscapes.py | cityscapes.py | py | 7,949 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFile",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "torch.utils",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name"... |
70090995387 | import numpy as np
import scipy.optimize as optimization
from resources.MathHandler import MathHandler
from resources.DataPlotter import DataPlotter
class SharpeRatioOptimizer:
def __init__(self, log_daily_returns, stocks, num_of_generated_portfolios=10000):
self._log_daily_returns = log_daily_returns
... | ICavlek/QDev | resources/SharpeRatioOptimizer.py | SharpeRatioOptimizer.py | py | 3,442 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "resources.DataPlotter.DataPlotter.show_portfolios_scatter_with_sharpe_ratio",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "resources.DataPlotter.DataPlotter",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "resources.MathHandler.MathHandler.g... |
12016898568 | from typing import Optional, Tuple, List, Callable, Union
import os
import json
import codecs
import collections
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils.rnn import PackedSequence
from torch.nn.utils.rnn import pad_packed_sequence
from t... | jinmang2/Sequential-Is-All-You-Needs | seq2seq/encoder_base.py | encoder_base.py | py | 8,594 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_... |
36096947471 | import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
from sklearn.metrics import accuracy_score, classification_report
from sklearn.model_selection import train_test_split
class KMeans:
def __init__(self, K=5, max_iters=100, plot_steps=False):
self.K = K
self.max_iters =... | janaSunrise/ML-algorithms-from-scratch | algorithms/kmeans.py | kmeans.py | py | 3,196 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "numpy.random.choice",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.empty",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.argmin",
... |
25508838470 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('grid', '0002_auto_20151105_1800'),
]
operations = [
migrations.CreateModel(
name='Layout',
fields=[
... | sheppard/bg | db/grid/migrations/0003_auto_20151109_1721.py | 0003_auto_20151109_1721.py | py | 1,371 | python | en | code | 0 | github-code | 6 | [
{
"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.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
3010135729 | from celery import shared_task
from celery.utils.log import get_task_logger
from django.conf import settings
from kombu import Connection, Exchange, Queue, Consumer
import socket
from api.address.services import get_longitude_latitude
from api.address.constants import (
ADDRESS_EXCHANGE,
ADDRESS_CUSTOMER_CONS... | drsantos20/address-service | api/address/consumer.py | consumer.py | py | 1,923 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "celery.utils.log.get_task_logger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "kombu.Connection",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.BROKER_URL",
"line_number": 20,
"usage_type": "attribute"
},
{... |
41318283085 | import time
import pymongo
from pymongo import TEXT, GEOSPHERE
def cal_time(file):
def decorator(func):
def wrapper(*args, **kw):
start = time.time()
res = func(*args, **kw)
end = time.time()
with open(file, "a+", encoding="utf-8") as f:
f.w... | beishangongzi/db_write | compare_mongo/main.py | main.py | py | 1,855 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pymongo.TEXT",
"line_numb... |
11766238986 | from PIL import Image, ImageFilter, ImageFont, ImageDraw
import random
im = Image.open('Asset/WechatIMG78.jpeg')
w, h = im.size
print('original image size: %sx%s' % (w, h))
# 缩略图
im.thumbnail((w // 2, h // 2))
im.save('Asset/thumbnail.jpeg', 'jpeg')
print('thumbnail image size: %sx%s' % im.size)
# 模糊
im2 = im.filter... | thongk/LearnPython | Image.py | Image.py | py | 1,011 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PIL.ImageFilter.BLUR",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFilter",
... |
35323265815 | """
overall flow:
initialize the bandit parameters (arm means, q start values)
init storage dict for every strategy
play loop:
for strategy in [eVALUE_greedy, eVALUE2_greedy, eVALUE3_greedy, UCB, UCB_c, UCB_c2]:
for pull in T:
choose arm based on (highest q(a) / uncertainty with highe... | inayrus/k_bandits | game.py | game.py | py | 8,249 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.argmax",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number... |
31064802092 | import sys
from pathlib import Path
import shutil
import subprocess
import NCFileUtilities as ncfu
from NCFileUtilities import extractBooleanDataFromDigitalArray
from PostProcessingUtilities import loadChannelConfiguration
FFMPEG_EXE = shutil.which('ffmpeg')
# A script to split mutli-channel audio files into separate... | GoldbergLab/PyVAQ | postDigitalChannelSplitter.py | postDigitalChannelSplitter.py | py | 6,591 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "shutil.which",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "NCFileUtilities.readNCFile",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "NCFileUtilities.extractBooleanDataFromDigitalArray",
"line_number": 90,
"usage_type": "call"
},
... |
13043319244 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ministerio', '0001_initial'),
('inventario', '0001_initial'),
]
operations = [
migrations.CreateModel(
n... | mfsalas/TesisIglesia | apps/salida/migrations/0001_initial.py | 0001_initial.py | py | 926 | python | en | code | 0 | github-code | 6 | [
{
"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.CreateModel",
"line_number": 15,
"usage_type": "call"
},
... |
1609258977 | """Data coordinator for the hochwasserportal integration."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import DEFAULT_SCAN_INTERVAL, DOMAIN, LOGGER
from .lhp_api import HochwasserPortalAPI, LH... | stephan192/hochwasserportal | custom_components/hochwasserportal/coordinator.py | coordinator.py | py | 1,155 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "homeassistant.helpers.update_coordinator.DataUpdateCoordinator",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "homeassistant.core.HomeAssistant",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "lhp_api.HochwasserPortalAPI",
"line_number": ... |
12496689771 | from collections import deque
N, M = list(map(int, input().split()))
board = []
blue_red = [[[], [], 0]] # BFS 돌면서 time도 지속적으로 기억해야함!
for n in range(N):
board.append([s for s in input()])
# print(board)
for n in range(N):
for m in range(M):
if board[n][m] == "B":
blue_red[0][0] = [n, m]
... | devappendCBangJ/Algorithm_Python | 2_CodingTest/5_DFSBFS/Baekjoon_13460_구슬 탈출2_실패.py | Baekjoon_13460_구슬 탈출2_실패.py | py | 4,667 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 54,
"usage_type": "call"
}
] |
72568503867 | import json
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from main.forms import ProductForm
from main.models import Item
from django.utils import timezone
from django.urls import reverse
from django.http import HttpResponse
from django.core import serializers
from ... | firedfrogg/stardew_tracker | main/views.py | views.py | py | 7,726 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "main.models.Item.objects.filter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "main.models.Item.objects",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "main.models.Item",
"line_number": 25,
"usage_type": "name"
},
{
"ap... |
21365579425 | import os
from os.path import join, exists, basename
import sys
import argparse
import time
import numpy as np
from glob import glob
import logging
import paddle
import paddle.distributed as dist
from datasets.inmemory_dataset import InMemoryDataset
from utils import load_json_config
from featurizers.gem_featurizer i... | liyishuilys/SMPT | pretrain.py | pretrain.py | py | 22,653 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "paddle.to_tensor",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "paddle.distributed.get_rank",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "paddle.distributed",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "paddl... |
21247189717 | """
replacement_datamodule.py
This module defines the data module and dataset class.
.. _Google Python Style Guide:
http://google.github.io/styleguide/pyguide.html
"""
__author__ = "Luis Felipe Villa Arenas"
__copyright__ = "Deutsche Telekom"
from omegaconf import OmegaConf
import torch
from torch.utils.data im... | blaze56768/Anomaly-Detection | src/datamodules/datasets/replacement_dataset.py | replacement_dataset.py | py | 4,102 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.SparkSession.builder.master",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 60,
"usage_type": "att... |
71791604028 | from functools import partial
from pprint import pprint
import click
import fasttext
import numpy as np
import pandas as pd
import sklearn
from scipy import stats
@click.command()
@click.option('--train', prompt='train CSV file path', help='train CSV file path.')
@click.option('--test', prompt='test CSV file path', ... | MalihehIzadi/SoftwareTagRecommender | machine_learning/fasttext_classifier.py | fasttext_classifier.py | py | 7,254 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "fasttext.train_supervised",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.array... |
42923252876 | """Command-line interface."""
import click
from ecs_tasks_ops import ecs_data
from ecs_tasks_ops import ecs_facade
from ecs_tasks_ops import pretty_json
from ecs_tasks_ops import pretty_table
@click.group()
@click.option("-x", "--debug/--no-debug", default=False)
@click.option("-j", "--output-json", "output_json", i... | ppalazon/ecs-tasks-ops | src/ecs_tasks_ops/__main__.py | __main__.py | py | 6,130 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "click.group",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "click.version_option",
"lin... |
27564609055 | # -*- coding: UTF-8 -*-
import os
import random
import itertools
import time
import numpy as np
from tqdm import tqdm
from eprogress import LineProgress
import matplotlib.pyplot as plt
from genetic import Genetic
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
DATA_NAME = 'att48.txt'
TOTAL_EPOCHS = 1500
TOTAL_... | spankeran/GeneticAlgorithm-TSP | tsp.py | tsp.py | py | 2,431 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_... |
73816590586 | import asyncio
import discord
from discord import Color, Embed, Message, RawReactionActionEvent, errors
from discord.ext.commands import Cog, Context, command
from bot import constants
from bot.bot import Bot
from bot.converters import MemberOrUser
from bot.log import get_logger
from bot.utils.checks import has_any_r... | python-discord/bot | bot/exts/fun/duck_pond.py | duck_pond.py | py | 8,455 | python | en | code | 1,206 | github-code | 6 | [
{
"api_name": "bot.log.get_logger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "bot.bot.Bot",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "bot.constants... |
27265325081 | import torch
from torch.nn import MSELoss
from torch.optim import SGD
from benchmarks.pytorch.matrix_factorisation.model import MatrixFactorisationModel
from benchmarks.pytorch.pytorch_execution import PytorchExecution
class MatrixFactorisation(PytorchExecution):
def __init__(self, n_users, n_items, n_features, ... | pablogs98/MLLess | benchmarks/pytorch/matrix_factorisation/matrix_factorisation.py | matrix_factorisation.py | py | 1,335 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "benchmarks.pytorch.pytorch_execution.PytorchExecution",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.manual_seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "benchmarks.pytorch.matrix_factorisation.model.MatrixFactorisationModel",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.