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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73789734435 |
import torch,torchvision
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as transforms
from torchvision import models
from torch import optim
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from PIL import Image
import cv2
import os
devi... | Nithya-Satheesh/Drowsiness-And-Distraction-Detection-System | res_training.py | res_training.py | py | 2,606 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch... |
32931276072 | from django.shortcuts import render
from .models import Articles
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.template.context_processors import csrf
def articles(request):
articles_list = Articles.objects.all().order_by("-date")
paginator = Paginator(articles_list,5)
... | sytyy00/News-blog | main/views.py | views.py | py | 813 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Articles.objects.all",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Articles.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.Articles",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": ... |
31778161847 | import json, threading
import re, requests
from lxml import etree
from queue import Queue
class DouBan(threading.Thread):
def __init__(self, q=None):
super().__init__()
self.base_url = 'https://movie.douban.com/chart'
self.headers = {
'User-Agent':
'Mozilla/5.0 (Win... | ruirui-wang-study/pythonlearning | doubanthread.py | doubanthread.py | py | 3,310 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "threading.Thread",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"l... |
27917745436 | #
# 使用python asyncio编写tcp服务端,要求: 监听7000端口, 设置端口可重用, 新建连接的时候打印新连接信息,断开连接的时候也打印断开时的信息,连接设置tcp nodelay选项, 使用包头为: 4字节做包体长度, 4字节做pack_id, 8字节做user_id。
import asyncio
import struct
import datetime
import yaml
import logging
async def handle_client(reader, writer):
peername = writer.get_extra_info('peername')
prin... | hhhflow2020/AS | server.py | server.py | py | 1,727 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "struct.unpack",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "asyncio.exceptions",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.n... |
29110569541 | #-*- encoding: UTF-8 -*-
from django import forms
from AlyMoly.mantenedor.models import Bodega
from AlyMoly.movimiento.models import ProductoBodega, Ingreso, Producto, Egreso, Traspaso
from AlyMoly.utils import widgets
class IngresoMercaderiaForm(forms.ModelForm):
def __init__(self,*args,**kwargs):
super(... | CreceLibre/alymoly | AlyMoly/movimiento/forms.py | forms.py | py | 6,606 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.ModelChoiceField",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
74541188832 | import json
from functools import partial
from pytest import fixture, mark
from traitlets.config import Config
from ..generic import GenericOAuthenticator
from .mocks import setup_oauth_mock
def user_model(username, **kwargs):
"""Return a user model"""
return {
"username": username,
"scope":... | jupyterhub/oauthenticator | oauthenticator/tests/test_generic.py | test_generic.py | py | 7,623 | python | en | code | 384 | github-code | 1 | [
{
"api_name": "mocks.setup_oauth_mock",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "generic.GenericOAuthenticator",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "f... |
15428156236 | """Signup processing (Waiting list and payments).
So far only dummy functionality, i.e. if a payment is posted, all courses
are set to accepted.
As soon as we have payment service provider, the definite functionality needs
to be implemented.
TODO: Send notification mails
"""
import json
from functools import wraps
... | amiv-eth/pvk-tool | Backend/backend/signups.py | signups.py | py | 5,368 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "itertools.chain.from_iterable",... |
4247808845 | from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.models import Param
from common.operators.gce import (
StartGCEOperator,
StopGCEOperator,
CloneRepositoryGCEOperator,
SSHGCEOperator,
)
from airflow.providers.google.cloud.operators.bigquery import (
BigQ... | pass-culture/data-gcp | orchestration/dags/jobs/export/export_posthog.py | export_posthog.py | py | 5,583 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "common.config.ENV_SHORT_NAME",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "common.config.GCP_PROJECT_ID",
"line_number": 34,
"usage_type": "name"
},
{
"api_name":... |
32039040636 | from collections import defaultdict
FILE_NAME = "input16.in"
fields = defaultdict(list)
your_ticket = []
other_tickets = defaultdict(list)
with open(FILE_NAME, 'r') as file:
fieldos = True
your = False
other = False
other_index = 0
for line in file:
if line == "\n":
... | Jozkings/advent-of-code-2020 | 16.py | 16.py | py | 3,214 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 40,
"usage_type": "call"
}
] |
32204994985 | # save model not replace
import face_recognition
import cv2
import os
import pickle
print(cv2.__version__)
j=0
Encodings=[]
Names=[]
with open('train.pkl','rb') as f:
Names=pickle.load(f)
Encodings=pickle.load(f)
for root,dirs, files in os.walk(image_dir):
for file in files:
print(root)
... | suriya43426/SuperAI_-_Edge_Computing | 41_readRecognize.py | 41_readRecognize.py | py | 1,426 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.__version__",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_numbe... |
14844168075 | import keras
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Input, Dense, Activation
from keras.layers import Reshape, Lambda
from keras.models import Model, load_model
from keras.layers import Bidirectional
from keras.layers import LSTM
from keras.optimizers import Adam
from generate_data impor... | b8Nw8/number_plate_detection | train_model.py | train_model.py | py | 4,458 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "keras.backend.ctc_batch_cost",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "keras.backend.image_data_format",
"line_number": 29,
"usage_type": "call"
},
{
"a... |
34084522015 | import matplotlib
import matplotlib.pyplot as plt
import dataset
import numpy as np
import tensorflow as tf
import os
import time
tf.compat.v1.reset_default_graph()
np.random.seed(42)
tf.compat.v1.set_random_seed(42)
###################################################################################
##################... | Laalasa137/Classification-of-Artwork | capsuleNet.py | capsuleNet.py | py | 18,067 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "tensorflow.compat.v1.reset_default_graph",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"ap... |
4454139738 | from django.conf import settings
from django.test import SimpleTestCase, override_settings
import responses
from ...records.api import get_records_client
from ...records.models import Record
from ..exceptions import ClientAPIError, DoesNotExist, MultipleObjectsReturned
from .factories import create_record, create_sea... | nationalarchives/ds-wagtail | etna/ciim/tests/test_models.py | test_models.py | py | 3,087 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "django.test.SimpleTestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "records.api.get_records_client",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "responses.add",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
35979062217 | import datetime
from flask import Flask, Response, send_from_directory
import httpx
from os.path import exists
app = Flask(__name__)
now = datetime.datetime.now().strftime("%Y%m%d")
@app.route("/health")
def health():
return "Ready"
@app.route("/")
def root():
if not exists(f"/data/{now}.jpg"):
print("Daily... | jammer/k8s-python | project/project.py | project.py | py | 1,252 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists"... |
29704572650 | import numpy as np
from lightfm.datasets import fetch_movielens
from lightfm import LightFM
data = fetch_movielens(min_rating = 4.0)
print(repr(data['train']))
print(repr(data['test']))
#model with loss func.
model = LightFM(loss = 'warp')
model.fit(data['train'],epochs = 30,num_threads = 2)
def samp... | varunp04/Basic-ML-projects | PythonClassifierApplication1/recom.py | recom.py | py | 918 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "lightfm.datasets.fetch_movielens",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "lightfm.LightFM",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.ar... |
3757066687 | import bs4
import urllib.request
import smtplib
import time
prices_list=[]
def check_price():
url = 'https://www.amazon.in/dp/B082MDMW3X/ref=s9_acsd_al_bw_c2_x_0_i?pf_rd_m=A1K21FY43GMZF8&pf_rd_s=merchandised-search-5&pf_rd_r=CF9JY0WX1GAAPBD3S9KW&pf_rd_t=101&pf_rd_p=8398f427-fbf5-4310-a31e-29a4be7a59bc&pf_rd_i... | anshpratap013/monitorPrice | price.py | price.py | py | 1,394 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_nam... |
8011180631 | import cv2
import numpy as np
import torch
class BaseTransform(object):
def __init__(self, resize, rgb_means, swap=(2, 0, 1)):
self.means = rgb_means
self.resize = resize
self.swap = swap
def __call__(self, img):
interp_methods = [cv2.INTER_LINEAR, cv2.INTER_CUBIC, cv2.INTER_A... | TR19006/robot_controller | utils/data_augment.py | data_augment.py | py | 666 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.INTER_LINEAR",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.INTER_CUBIC",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.INTER_AREA",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.IN... |
71019847074 | #IMPORTING LIBRARIES
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# READING DATA FROM TRAIN DATASET
data_1 = pd.read_csv('iosdml1_train.csv')
x_train = data_1.iloc[:, :2].values
y_train = data_1.iloc[:, -1].values
# READING DATA FROM TEST DATASET
data_2 = pd.read_csv('iosdml1_test.csv')
x_tes... | chanakyakapoor/IOSD_ML | IOSD__ML/IOSD_ML_1.py | IOSD_ML_1.py | py | 939 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "s... |
79605347 | import concurrent
from concurrent import futures
import grpc
import json
import booking_pb2
import booking_pb2_grpc
class BookingServicer(booking_pb2_grpc.BookingServicer):
def __init__(self):
with open('{}/databases/bookings.json'.format("."), "r") as jsf:
self.db = json.load(jsf)["bookings"]... | InSomniaMoon/imt-api-grpc | servers/booking.py | booking.py | py | 1,470 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "booking_pb2_grpc.BookingServicer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "booking_pb2.BookingMessage",
"line_number": 15,
"usage_type": "call"
},
{
"api_nam... |
15638250697 | # -*- coding: utf-8 -*-
"""
Author: [Yunting Chiu](https://www.linkedin.com/in/yuntingchiu/)
"""
import cv2
import matplotlib.pyplot as plt
import numpy as np
import time
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing impor... | twyunting/Deepfake_Video_Classifier | code/10.final_rf_model.py | 10.final_rf_model.py | py | 4,082 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplo... |
17709340792 | import requests
import json
import os
def buscar_pokemon(nombre):
url = f"https://pokeapi.co/api/v2/pokemon/{nombre.lower()}"
response = requests.get(url)
if response.status_code == 404:
print("El Pokémon no fue encontrado.")
return None
data = response.json()
imagen ... | Shynomni/practicaspython | LUISARTURO_GUTIERREZ_proyectoM4..3.py | LUISARTURO_GUTIERREZ_proyectoM4..3.py | py | 2,129 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_numbe... |
24153835574 | import datetime
import textwrap
from pathlib import Path
from slap import __version__
from slap.application import Application, Command, argument, option
from slap.plugins import ApplicationPlugin
from slap.util.external.licenses import get_spdx_license_details, wrap_license_text
from slap.util.vcs import get_git_auth... | pombredanne/slap.cli | src/slap/ext/application/init.py | init.py | py | 8,116 | python | en | code | null | github-code | 1 | [
{
"api_name": "slap.plugins.ApplicationPlugin",
"line_number": 142,
"usage_type": "name"
},
{
"api_name": "slap.application.Command",
"line_number": 142,
"usage_type": "name"
},
{
"api_name": "slap.application.Application",
"line_number": 150,
"usage_type": "name"
},
... |
8144343701 | import requests
import os
import sys
from physics import calculate
LINE_URL = 'https://api.line.me/v2/bot/message/reply'
token = os.environ.get('LINE_TOKEN')
VALID_VARIABLES = ['v', 'u', 'a', 't', 's']
class User:
def __init__(self, userId):
self.userId = userId
self.reset()
def reset(... | ruboon-dej/graph-project | user.py | user.py | py | 3,398 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.environ.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "physics.calculate",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "requests.post",
"l... |
18055497974 | import ply.lex as lex
# List of token names. This is always required
reserved = {
'if': 'IF',
'then': 'THEN',
'else': 'ELSE',
'while': 'WHILE',
"switch": "SWITCH",
'bool': "BOOL",
'char': "CHAR",
'byte': "BYTE",
'short': "SHORT",
'int': "INT",
'long': "LONG",
'double':... | DanielFraser/SimplyJava | flex.py | flex.py | py | 1,723 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ply.lex.lex",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_number": 84,
"usage_type": "name"
}
] |
21256651942 | #1 wala issue
import json
import pprint
import collections
import operator
import pandas as pd
import csv
import math
from collections import defaultdict
import networkx as nx
csv_file = open('article-ids.csv')
csv_reader = csv.reader(csv_file,delimiter = ',')
aid = {}
for row in csv_reader:
if row[0] == "Articl... | abhishekb785/CS685 | 170022_assign2/question9.py | question9.py | py | 3,480 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number"... |
7548656650 | from PyQt5.QtCore import QSize, Qt
from PyQt5.QtWidgets import QLabel, QPushButton, QFrame, QWidget, QVBoxLayout, QHBoxLayout
from PyQt5.QtGui import *
from modules.codeeditor import CodeEditor
def add(self):
# Creacion del tab
tab = QFrame(self.ui.pages)
tab.setObjectName(u"file_"+str(self.tab_number))
tab.setMi... | self-david/notpad-modern | modules/tabs.py | tabs.py | py | 2,703 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QFrame",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QFrame.StyledPanel",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets.QFrame",
"line_number": 13,
"usage_type": "name"
},
{
... |
42039508376 | from django.shortcuts import render, get_object_or_404, redirect
from recipes.models import Recipe
from recipes.forms import RecipeForm
# SHOW_RECIPE
def show_recipe(request, id):
recipe = get_object_or_404(Recipe, id=id)
context = {
"recipe_object": recipe,
}
return render(request, "recipes/de... | DennieCodes/delicious | recipes/views.py | views.py | py | 1,358 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "recipes.models.Recipe",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
},
{
... |
24217427343 | from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.keras.layers import Lambda, Dense, TimeDistributed, Input
from tensorflow.keras.models import Model
from tensorflow.keras.preprocessing import image
import tensorflow.keras.backend as K
from vgg16 import VGG1... | emilymuller1991/thesis | chapter4clustering/clustering/1.rmac/rmac.py | rmac.py | py | 5,915 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.compat",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.float",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.backe... |
1442466849 | # -*- coding: utf-8 -*-
import os
HERE = os.path.dirname(os.path.abspath(__file__))
# We setup the cache for Chameleon templates
template_cache = os.path.join(HERE, 'cache')
if not os.path.exists(template_cache):
os.makedirs(template_cache)
os.environ["CHAMELEON_CACHE"] = template_cache
# Bootstrapping the Cr... | morganjk/ZodbDemo | server.py | server.py | py | 3,402 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
2416421872 | import pathlib
import os
from setuptools import setup, find_packages
UPSTREAM_URLLIB3_FLAG = "--with-upstream-urllib3"
def get_requirements(raw=False):
"""Build the requirements list for this project"""
requirements_list = []
with open("requirements.txt") as reqs:
for install in reqs:
... | Vito39/testing_repo_2 | setup.py | setup.py | py | 2,241 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "setuptools.find_packages",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"... |
25377643097 | from unittest.mock import Mock, patch
import botocore.session
from botocore.exceptions import ParamValidationError
from moto import ( # pylint: disable=import-error
mock_ec2,
mock_kinesis,
mock_kms,
mock_lambda,
mock_s3,
mock_sqs,
)
from opentelemetry.instrumentation.botocore import BotocoreI... | NathanielRN/clone-opentelemetry-python | instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_instrumentation.py | test_botocore_instrumentation.py | py | 8,794 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "opentelemetry.test.test_base.TestBase",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "opentelemetry.instrumentation.botocore.BotocoreInstrumentor",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "botocore.session.session.get_session",
"lin... |
34872495828 | import torch
import torchreid
import tensorrt as trt
# Load pre-trained OSNet model with x0.25 width multiplier
model_name = 'osnet_x0_25'
model = torchreid.models.build_model(
name=model_name,
num_classes=1000,
pretrained=True
)
# Create example input tensor
data_shape = (3, 256, 128)
input_tensor = torc... | strikerPro818/strikerBot | Xavier_NX/mobileSelectTrack/trtConversion.py | trtConversion.py | py | 1,594 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torchreid.models.build_model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torchreid.models",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.randn",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorrt... |
24262589675 | import pandas as pd
import astropy as ap
from astropy.table import Table
from astropy.coordinates import SkyCoord
import healpy as hp
import matplotlib as mpl
mpl.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from matplotlib.patches import Patch
from matplotlib.lines import Line2D
... | apizzuto/Novae | scripts/create_master_nova_dataframe.py | create_master_nova_dataframe.py | py | 18,679 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.style.use",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "astropy.tabl... |
11351792106 | import sys
sys.path.append("../common/tests")
from test_utils import *
import test_common
sys.path.insert(0, '../../../../build/debug/config/schema-transformer/')
from vnc_api.vnc_api import *
import uuid
class STTestCase(test_common.TestCase):
def setUp(self):
super(STTestCase, self).setUp()
self... | Juniper/contrail-dev-controller | src/config/schema-transformer/test/test_case.py | test_case.py | py | 4,591 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
42689807900 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import queue as q
import os
from os.path import isfile, join
import seaborn as sns
import matplotlib.pylab as pylab
import sys
sys.path.append('/Users/aabir/anaconda/envs/pca/simulations')
sns.set_style('whitegrid')
params = {'legend.fontsiz... | bakerwho/invmgmt | __init__.py | __init__.py | py | 1,444 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "seaborn.set_style",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab.rcPa... |
24997941524 | import numpy as np
from scipy.stats import norm
from stock import Stock
# source: https://github.com/jeromeku/Python-Financial-Tools/blob/master/capm.py
class CAPM(object):
def __init__(self, risk_free, market, alpha=.05):
self.risk_free = Stock(risk_free["ticker"], risk_free["date_range"]) if type(risk_... | LongntLe/Tradingsystem | src/statistics/CAPM.py | CAPM.py | py | 576 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "stock.Stock",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "stock.Stock",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm.ppf",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm",
"... |
28345998993 | from typing import List
import gymnasium as gym
import numpy as np
from urdfenvs.robots.generic_urdf import GenericUrdfReacher
from urdfenvs.scene_examples.goal import dynamicGoal
from urdfenvs.scene_examples.obstacles import dynamicSphereObst2
from urdfenvs.urdf_common.urdf_env import UrdfEnv
def run_panda_capsules(n... | maxspahn/gym_envs_urdf | examples/panda_capsules.py | panda_capsules.py | py | 2,589 | python | en | code | 33 | github-code | 1 | [
{
"api_name": "urdfenvs.robots.generic_urdf.GenericUrdfReacher",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "urdfenvs.urdf_common.urdf_env.UrdfEnv",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "gymnasium.make",
"line_number": 13,
"usage_type": "... |
70737271074 | ## 10816. 숫자 카드 2 (01.04)
from collections import Counter
n = int(input())
card = list(map(int, input().split()))
card_count = Counter(card).most_common()
card_count.sort()
m = int(input())
find = list(map(int, input().split()))
answer = []
for f in find:
flag = 0
for c in card_count:
if f == c[0]:
... | ChanWhanPark/Algorithm | BaekJoon/Searching/10816_number_card_2.py | 10816_number_card_2.py | py | 463 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.Counter",
"line_number": 5,
"usage_type": "call"
}
] |
1993760833 | """Test for TaskContextConnection"""
from unittest.mock import Mock
import pytest
from pynocular.aiopg_transaction import LockedConnection, TaskContextConnection
@pytest.fixture()
def locked_connection():
"""Return a locked connection"""
return LockedConnection(Mock())
@pytest.mark.asyncio()
async def tes... | NarrativeScience-old/pynocular | tests/unit/test_task_context_connection.py | test_task_context_connection.py | py | 1,463 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "pynocular.aiopg_transaction.LockedConnection",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "call"
},
{
"api... |
10633828499 | import re
from pyparsing import (
Char,
Combine,
LineEnd,
LineStart,
Literal,
MatchFirst,
OneOrMore,
Optional,
ParserElement,
ParseResults,
Regex,
SkipTo,
StringEnd,
Token,
)
from jira2markdown.markup.advanced import Panel
from jira2markdown.markup.base import A... | catcombo/jira2markdown | jira2markdown/markup/lists.py | lists.py | py | 4,074 | python | en | code | 14 | github-code | 1 | [
{
"api_name": "pyparsing.Token",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "pyparsing.Literal",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pyparsing.MatchFirst",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "jira2markdown.... |
72143589475 | from copy import deepcopy
import logging
from typing import Any, Dict, List, Optional, Type
from braces.views import (
FormInvalidMessageMixin,
FormValidMessageMixin,
LoginRequiredMixin,
MessageMixin
)
from django.forms import BaseModelForm, Form
from django.http.response import HttpResponse
from djang... | caltechads/django-wildewidgets | wildewidgets/views/generic.py | generic.py | py | 22,102 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "widgets.Block",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 90,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
10389756553 | import time
from random import randint
import matplotlib.pyplot as plt
import algorythms
import threading
threading.stack_size(2 ** 27)
q = 1
n = 10000
r = 1000000
T_fb = []
M_fb = []
T_d = []
M_d = []
def task(m_min, m_step, m_max):
# creating data
for m in range(m_min, m_max, m_step):
arr_edges ... | Mihinator3000/Group-Projects | Ilia/main.py | main.py | py | 1,459 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "threading.stack_size",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "algorythms.Edge",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.time",
"l... |
43788847753 | from django.urls import path, include
from rest_framework_simplejwt.views import (
TokenObtainPairView
)
from .views import SignUpUser
urlpatterns = [
path('signup/', SignUpUser.as_view(), name='signup_user'),
path('jwt/', include([
path('', TokenObtainPairView.as_view(), name='token_obtain_pair')... | Farnaz-1999/CloudProject | identity_service/users/urls.py | urls.py | py | 333 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.SignUpUser.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "views.SignUpUser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.urls.p... |
34195148442 | import tweepy
import feedparser
import re
import requests
import os
import datetime
# pip3 install tweepy feedparser
feed_url = "https://lambdan.se/blog/rss.xml"
database_file = "./tweeted_by_twitter_bot.txt" # txt with urls that have been tweeted (one url per line)
twitter_consumer_api_key = ""
twitter_api_secret_ke... | lambdan/lambblog | twitter_bot/twitter_bot.py | twitter_bot.py | py | 2,532 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
9748710718 | #!/usr/bin/python3
import urllib.request, json, mysql.connector
import os
from datetime import datetime,date
import collections
class DatetimeEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return obj.strftime('%Y-%m-%d %H:%M:%S')
elif isinstance(obj, da... | Gain-Profit/Tools | python/PostingProduct.py | PostingProduct.py | py | 1,710 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.JSONEncoder",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "datetime.date",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "json.JSON... |
30579043142 | from datetime import datetime, timedelta
from requests.exceptions import HTTPError
from utils.signing import sign
from blockchain.models import Policy
from utils import headers
from utils.urls import BANK_URL, BC_URL, SELLER_URL
from utils.ids import BANK_ID, SELLER_ID
import utils.auth
from utils.auth import create_a... | momvart/dns_project | client/__main__.py | __main__.py | py | 3,494 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "client.cer... |
37614396512 | import math
import numpy as np
import matplotlib
import torch
from matplotlib import pyplot as plt
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
from matplotlib.patches import Arc
# https://stackoverflow.com/questions/34017866/arrow-on-a-line-plot-with-matplotlib
def add_arrow(line, position=No... | dvgodoy/PyTorchStepByStep | plots/chapter9.py | chapter9.py | py | 20,754 | python | en | code | 622 | github-code | 1 | [
{
"api_name": "numpy.argmin",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.absolute",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
41663441089 | from PyQt5.QtCore import Qt, QRect
from PyQt5.QtGui import QPixmap, QPainter, QFont, QColor
from Picture import Picture
class MiddlePicture(Picture):
# A middle picture is consisted of a background picture
# a caption and a subtitle
def __init__(self, size : int):
super().__init__()
self.c... | paul-zz/WechatLongPic | MiddlePicture.py | MiddlePicture.py | py | 6,342 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "Picture.Picture",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QColor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui.QFont",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui.QFont... |
25538779474 |
from flask import session, flash, redirect, current_app
from flask import Blueprint, session, redirect, url_for, render_template #request, , , jsonify
auth_routes = Blueprint("auth_routes", __name__)
@auth_routes.route("/login")
def login():
print("LOGIN...")
return render_template("login.html")
@auth_route... | ryanrs93/uncommon_grounds_sheet_2023 | web_app/routes/auth_routes.py | auth_routes.py | py | 2,293 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.current_app.config",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "fl... |
4508130902 | # 5 kyu Simple fraction to mixed number converter
# https://www.codewars.com/kata/556b85b433fb5e899200003f/train/python
from gmpy2 import bit_scan1 as ctz
def mixed_fraction(s):
# special cases
if s.endswith('/0'):
raise ZeroDivisionError
if s.startswith('0'):
return '0'
sign = '-'*(s... | mateuszmacheta/codewars-python | simple-fraction-mixed-number-converter.py | simple-fraction-mixed-number-converter.py | py | 1,334 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "gmpy2.bit_scan1",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "gmpy2.bit_scan1",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "gmpy2.bit_scan1",
"line_number": 45,
"usage_type": "call"
}
] |
28377662905 | import numpy as np
from matplotlib.axes import Axes
from matplotlib.collections import PathCollection
from matplotlib.lines import Line2D
from matplotlib.projections import register_projection
class PickableAxes(Axes):
"""
A subclass of matplotlib.axes._axes.Axes which support selection and action on data se... | clark3493/pygui | pygui/widget/plot/_pickable_plot.py | _pickable_plot.py | py | 21,770 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.axes.Axes",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.lines.Line2D",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "matplotlib.collections.PathCollection",
"line_number": 49,
"usage_type": "name"
},
{
... |
74923992992 | import discord
import emailer as emailer
from discord.ext import commands
client = commands.Bot(command_prefix = ",")
@client.event
async def on_ready():
print("le bot est pret")
@client.command()
async def email(ctx,*,name):
data = name.split(sep = " ")
print(data)
num = emailer.getcommandline()
... | adamsirri1231/emailer | bot.py | bot.py | py | 745 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "emailer.getcommandline",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "em... |
73034204833 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
from... | shineforever/ops | salt/tests/unit/states/ntp_test.py | ntp_test.py | py | 1,869 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "salttesting.helpers.ensure_in_syspath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "salt.states.ntp.__salt__",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "salt.states.ntp",
"line_number": 23,
"usage_type": "name"
},
{
... |
30050528076 | # S6.1: Design the View Data page of the multipage app.
# Import necessary modules
import streamlit as st
import pandas as pd
import numpy as np
# Define a function 'app()' which accepts 'car_df' as an input.
def app(car_df):
st.markdown("<body><h1 style='color:black;font-size:40px'> <center> <b> VIEW DATA</b>... | SomyaJhamb/web_app | data.py | data.py | py | 1,418 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "streamlit.markdown",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.beta_expander",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.table",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.m... |
20192676246 | import os
from tkinter.tix import INTEGER
from conf import SAMPLE_INPUTS, SAMPLE_OUTPUTS
from moviepy.editor import *
from PIL import Image
source_path = os.path.join(SAMPLE_INPUTS, 'sample.mp4')
thumbnail_dir = os.path.join(SAMPLE_OUTPUTS, 'thumbnails')
thumbnail_per_frame_dir = os.path.join(SAMPLE_OUTPUTS, 'thumbn... | eavf/30-days | Day15/1_thumbs.py | 1_thumbs.py | py | 2,246 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "conf.SAMPLE_INPUTS",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"lin... |
20113329318 | import asyncio
import json
from typing import Any, AsyncGenerator, Coroutine, Generator, Optional
import requests
from fastapi import HTTPException
from pydantic import BaseModel, Field
from llmstudio.engine.providers.provider import ChatRequest, Provider, provider
class OllamaParameters(BaseModel):
temperature... | TensorOpsAI/LLMstudio | llmstudio/engine/providers/ollama.py | ollama.py | py | 1,970 | python | en | code | 60 | github-code | 1 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
... |
11822031002 | import pandas as pd
import numpy as np
import re
from joblib import dump
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.model_selection import GridSe... | willzh0/titanic | train.py | train.py | py | 8,975 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.svm.SVC",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 20,
"usage_type": "call"
... |
20501404858 | from dataclasses import dataclass
from networkx import DiGraph, contracted_edge, weakly_connected_components, subgraph, draw_networkx, nx_agraph, relabel_nodes, tree
import matplotlib.pyplot as plt
from random import randint
from networkx.drawing.nx_pydot import graphviz_layout
from matplotlib.backend_bases import Mous... | webmiche/edge-choice | main.py | main.py | py | 4,579 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "networkx.DiGraph",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "networkx.DiGraph",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "dataclasses.datacl... |
25759539784 | import pathlib
# import classification
import os
# PACKAGE_ROOT = pathlib.Path(classification.__file__).resolve().parent
PACKAGE_ROOT = pathlib.Path(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
DATASET_DIR = PACKAGE_ROOT / 'dataset'
TRAINED_MODEL_DIR = PACKAGE_ROOT/'trained_model'
TESTING_DATA_... | mikosa01/smoking-status | package/classification/classification/config/config.py | config.py | py | 1,795 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_numbe... |
72307937635 | import requests # Get URL data
from bs4 import BeautifulSoup # Manipulate URL data
from pymongo import MongoClient
from datetime import timedelta, date
import os
# ad_decline takes a row of data from the JSE Market Activity list and converts it
# into a list of dictionaries formatted like:
# {ticker symbol, stock nam... | Foliolensja/scrape_data_scripts | scrape_market_activities.py | scrape_market_activities.py | py | 4,680 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"lin... |
73511514913 | import json
import math
import tvregdiff as tvrd
import dataFuncs
import numpy as np
class Point:
def __init__(self, x, y, label = ''):
if(isinstance(x, int) or isinstance(x, float)):
self.x = x
else:
self.x = float(x)
if(isinstance(y,int) or isinstance(y, float)):
... | danmartelly/sketch | studentInterface/graphUtil.py | graphUtil.py | py | 8,105 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 128,
"usage_type": "attribute"
},
{
"api_name": "math.exp",
"line_number": 128... |
32163240806 | import pandas as pd
from utils import *
import regex
import traceback
from sentence_transformers import SentenceTransformer, util
import argparse
import os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
def topic_pairs(topic_sent, all_pairs, threshold=0.5, num_pair=2):
"""
Return the most similar topic pairs... | chtmp223/topicGPT | script/refinement.py | refinement.py | py | 12,346 | python | en | code | 104 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sentence_transformers.SentenceTransformer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sentence_transformers.util.cos_sim",
"line_number": 23,
"usage_type": "call"
}... |
35329696123 | import cv2
import time
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from skimage.morphology import medial_axis, skeletonize
cv2.destroyAllWindows()
def plot_color_image(image,title,colorscheme,file_ext,colorbar,path):
# sizes=np.shape(image)
my_dpi=96
pix=700
... | mjm7919/ground-truth-velocity | ground_truth3.py | ground_truth3.py | py | 5,186 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.destroyAllWindows",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matpl... |
5118365393 | from django.urls import re_path as url
from . import views
from django.conf import settings
from django.conf.urls.static import static
app_name = 'pictures'
urlpatterns = [
url(r'^login/', views.loginPage, name='login'),
url(r'^logout/', views.logoutPage, name='logout'),
url(r'^$', views.index, name='ind... | HusainSuksar/photo_library | pictures/urls.py | urls.py | py | 616 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.re_path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.re_path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.url... |
10053022525 | import requests
import json
import time
import re
URL = 'https://5ka.ru/api/v2/special_offers/'
headers = {'User-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'}
CAT_URL = 'https://5ka.ru/api/v2/categories/'
def x5ka(url, params):
resul... | alexzhdankin34/Geekbrains_Data_Mining | Lesson1/Task_1.py | Task_1.py | py | 1,159 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 28,
... |
72642332195 |
#
# @Function:This script is designed to trnasform sentences to a
# 100 dimensional vector
#
# @Input: Input a filename which indicates the place for your
# text files that you would like to deploy transformation
#
# @Output: The text will be transformed and stored in to some
# certain pl... | XiaohanLiang/data_classification | sentence_to_vec_new.py | sentence_to_vec_new.py | py | 1,855 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.dont_write_bytecode",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "gensim.models.Word2Vec.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "gensim.models.Word2Vec",
"line_number": 21,
"usage_type": "name"
},
{
"a... |
1167739842 | from django.shortcuts import render, get_object_or_404, redirect
from .models import Project
from django.contrib.auth.decorators import login_required
def home(request):
projects = Project.objects
return render(request, 'projects/home.html', {'projects':projects})
def detail(request, project_id):
project ... | m2442/projecthunt-project | projects/views.py | views.py | py | 1,279 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Project.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "models.Project",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "djang... |
40156597239 | import matplotlib.pyplot as plt
from calculator import HUCalculator
mu = lambda x: 1
beta = lambda x: 50 * pow(x, 2)
sigma = lambda x: 40 * pow(x, 2)
f = lambda x: 40 * pow(x - 0.3, 5)
N = 5
a = -1
b = 1
calc = HUCalculator(N, a, b, mu, beta, sigma, f)
calc = calc.calc_until(5, 50)
print("N\t| Норма оцінювача\t\t|... | helgi98/num_mod | main.py | main.py | py | 589 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "calculator.HUCalculator",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "... |
40930652896 | # -*- coding: utf-8 -*-
from django.contrib import messages
from uuid import uuid4
from Contract.models import Stage, Attache
from Contract.forms import FormStage
######################################################################################################################
def change_stage(request, contract... | joinc/SupportCenter | Contract/tools.py | tools.py | py | 1,013 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Contract.models.Stage",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Contract.forms.FormStage",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Contract.models.Attache",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
30322430680 | import numpy as np
import os
from PIL import Image
# root_dir="C:/Users/sh/Desktop/data"
root_dir = "C:/Users/huili/Desktop/fruitdatas"
image_folders = os.listdir(root_dir)
floders_num = 0
for i in image_folders:
image_list = os.listdir(root_dir + '/' + i)
for j in image_list:
# if os.path.splitext(j)[... | huilizhou/Deeplearning_Python_DEMO | read_image.py | read_image.py | py | 864 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13... |
14545580592 | from re import I
from uuid import uuid4
def renderPlaceholder(placeholder: str, value: str,filename: str):
with open(filename, 'r') as f:
content = f.read()
return content.replace(placeholder, value)
xsrf_token = str(uuid4())
addedTokenPage = renderPlaceholder("{{token}}", xsrf_tok... | a2677331/CSE312-Web-Applications | HW2/Obejct_3-5/text.py | text.py | py | 394 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "uuid.uuid4",
"line_number": 13,
"usage_type": "call"
}
] |
36629170558 | """Доработаем задачи 3 и 4. Создайте класс Project, содержащий атрибуты – список пользователей проекта и админ проекта.
Класс имеет следующие методы:
Классовый метод загрузки данных из JSON файла (из второй задачи 8 семинара)
Метод входа в систему – требует указать имя и id пользователя.
Далее метод создает пользовател... | Pisarev82/Immersion_in_Python | sem_13/task_13_5.py | task_13_5.py | py | 4,043 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sem_13.task_13_4.User",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sem_13.task_13_4.User",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "sem_13.task_13_... |
19029218792 | import numpy as np
import nolds
def mle(x: np.ndarray) -> float:
""" Maximum Lyapunov Exponent
:param x: 1-d numeric vector
:return: numeric scalar
"""
k = int(np.sqrt(len(x)))
try:
out = nolds.lyap_r(data=x,
emb_dim=k,
trajectory_... | vcerqueira/vest-python | vest/aggregations/lyapunov.py | lyapunov.py | py | 477 | python | en | code | 19 | github-code | 1 | [
{
"api_name": "numpy.ndarray",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nolds.lyap_r",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_nu... |
74748567073 | import argparse
import glob
from multiprocessing.pool import ThreadPool
import numpy as np
import os
import random
import shutil
import subprocess
import tarfile
import threading
import sys
sys.path.append('./')
from network import network
def parse_args():
argv = sys.argv[1:]
if '--' in argv:
remaining_args =... | aravic/6.829-pset-3 | scripts/leaderboard.py | leaderboard.py | py | 4,608 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",... |
11776543102 | #from tgpirobot.tgpirobot import TgPiRobot, print_help
from tgpirobot import TgPiRobot, print_help, instally
import sys
import os
from rich.console import Console
from rich.progress import track, Progress
import subprocess
from pyrogram.errors.exceptions.unauthorized_401 import AuthKeyUnregistered
try:
def update()... | hk4crprasad/tgpirobot | tgpirobot/main.py | main.py | py | 4,220 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rich.progress.Progress",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "rich.con... |
27401833030 | import pytest
from cognite.client import data_modeling as dm
from cognite.pygen._core.generators import SDKGenerator
from cognite.pygen._generator import CodeFormatter
from tests.constants import APM_SDK, EXAMPLES_DIR
@pytest.fixture
def sdk_generator(apm_data_model: dm.DataModel[dm.View]) -> SDKGenerator:
retur... | cognitedata/pygen | tests/test_unit/test_generator/test_sdk_generator_apm_sdk.py | test_sdk_generator_apm_sdk.py | py | 859 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "cognite.client.data_modeling.DataModel",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cognite.client.data_modeling",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cognite.client.data_modeling.View",
"line_number": 10,
"usage_ty... |
8702569815 | import streamlit as st
from snowflake.snowpark import Session
def icon(emoji: str):
"""Shows an emoji as a Notion-style page icon."""
st.write(
f'<span style="font-size: 78px; line-height: 1">{emoji}</span>',
unsafe_allow_html=True,
)
st.set_page_config("Snowpark & PySpark support", "🏂"... | streamlit/release-demos | 1.16.0/snowpark-support/streamlit_app.py | streamlit_app.py | py | 2,133 | python | en | code | 78 | github-code | 1 | [
{
"api_name": "streamlit.write",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.set_page_config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.echo",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "snowflake.sno... |
6310460415 | import tool.excel
import db
import pymysql
from tool.update import category as book_cate
data = tool.excel.import_data()
def deal():
conn = db.database_conn()
cursor = conn.cursor(cursor=pymysql.cursors.DictCursor)
# book列表
books = book_cate()
books_name = []
for u in books:
... | wantaname/flask_huayiyiyu | huayiyiyu/tool/analysis.py | analysis.py | py | 1,551 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tool.excel.excel.import_data",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tool.excel.excel",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "tool.excel",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "db.databas... |
9439503388 | from django.test import TestCase, Client
from .models import Museum
from .forms import CreateGroupForm
import secrets
from django.contrib.auth.models import User
from user.models import UserProfile
class CreateDeleteGroupTestCase(TestCase):
def setUp(self):
_basic_setup(self)
def test_create_one_user... | nicholastaylor0000/CPS410-F20-Team04 | museum/tests.py | tests.py | py | 2,529 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "forms.CreateGroupForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "user.models.UserProfile.objects.all",
"line_number": 20,
"usage_type": "call"
},
{
"api... |
30171104636 | from functools import partial, wraps
from databases import Database
def init_db(func=None, *, db: Database = None):
if func is None:
if db is None:
raise ValueError('init db must not be None')
return partial(init_db, db=db)
@wraps(func)
async def wrapper(*args, **kwargs):
... | ruicore/python | 02-usecase/decorator/database.py | database.py | py | 628 | python | en | code | 10 | github-code | 1 | [
{
"api_name": "databases.Database",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "functools.partial",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 12,
"usage_type": "call"
}
] |
41884370702 | import logging
from pymongo.errors import DuplicateKeyError
from api.caching.caching_shared import getDatabase
logger = logging.getLogger(__name__)
def getInstanceLifetimeCollection():
return getDatabase().instance_lifetime
def addInstance(instanceKey, oauthToken, oauthSecret, instanceGeographicalSetupString, ke... | michael-pryor/GeoTweetSearch | api/caching/instance_lifetime.py | instance_lifetime.py | py | 2,291 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "api.caching.caching_shared.getDatabase",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pymongo.errors.DuplicateKeyError",
"line_number": 20,
"usage_type": "name"
}
] |
45015791803 | from qwak_proto import wire_dependencies
from qwak.alerting.alerting_registry_client import AlertingRegistryClient
from qwak.alerting.channel import SlackChannel, Channel
wire_dependencies()
def set_session(env_name: str):
"""
Sets the working environment for this session
"""
from qwak_proto.di_confi... | qwak-ai/sdk-examples | model-monitoring/add_alert_channels.py | add_alert_channels.py | py | 1,233 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "qwak_proto.wire_dependencies",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "qwak_proto.di_configuration.session.Session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "qwak.alerting.alerting_registry_client.AlertingRegistryClient",
"line... |
16568162004 | import openpyxl
# 打开excel文件,获取工作簿对象
wb = openpyxl.load_workbook('example.xlsx')
ws = wb.active # 当前活跃的表单
col_range = ws['B:C']
row_range = ws[2:6]
# for col in col_range: # 打印BC两列单元格中的值内容
# for cell in col:
# print(cell.value)
# for row in row_range: # 打印 2-5行中所有单元格中的值
# for cell in... | 1071183139/biji | 3_简历/3_python操作excel/1_获取excel/5_遍历行和列中单元格的值 .py | 5_遍历行和列中单元格的值 .py | py | 586 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 4,
"usage_type": "call"
}
] |
26382411896 | #!/usr/bin/env python
# coding=utf-8
from wtforms import form, validators, StringField, TextField, BooleanField,\
IntegerField
from tornado.web import HTTPError
class BaseForm(form.Form):
@classmethod
def from_json_with_validate(cls, json):
form = cls.from_json(json)
if not form.validat... | ghostry/tvee | tvee/forms/__init__.py | __init__.py | py | 1,259 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "wtforms.form.Form",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wtforms.form",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "wtforms.form",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "wtforms.form.validat... |
14151866900 | import re, math
from typing import NamedTuple, List, Tuple
from collections import defaultdict
class Reaction(NamedTuple):
left: List[Tuple[int, str]]
right: Tuple[int, str]
def create_reaction(unparsed_reaction: List[str]) -> Reaction:
parse_element = lambda x: (int(x.split(' ')[0]), x.split(' ')[1])
... | cernat-catalin/advent_of_code_2019 | day14/main.py | main.py | py | 2,245 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.NamedTuple",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_numb... |
43067855203 | import numpy as np
import matplotlib.pylab as plt
from pathlib import Path
import csv
from functions import sigmoid, softmax, sigmoid_derivative
"""
Multilayered neural network class.
Note: only the sigmoid and softmax activation functions have been implemented.
"""
class MLN:
def __init__(self, layers_s... | ArchambaultP/COMP473-Project | MultiLayerNetwork.py | MultiLayerNetwork.py | py | 4,380 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.randn",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"li... |
29585182461 | import sys
import argparse
from monogusa.cli import run
from monogusa.cli import runtime
from monogusa.langhelpers import import_module
def main() -> None:
from handofcats.customize import logging_setup
parser = argparse.ArgumentParser(
prog="monogusa.cli", add_help=False, formatter_class=runtime._He... | podhmo/monogusa | monogusa/cli/__main__.py | __main__.py | py | 1,024 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "monogusa.cli.runtime._HelpFormatter",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "monogusa.cli.runtime",
"line_number": 12,
"usage_type": "name"
},
{
... |
26514065783 | from multiprocessing import Process, Pipe
import os
import time
import random
def send_data(conn):
print('发送数据的子进程%d启动' % os.getpid())
print('发送数据:None')
conn.send(None)
# 发送的数据的进程仍然继续,但是接受数据的进程终止
for obj in list(range(1, 10)):
print('发送数据:%s' % obj)
conn.send(obj)
time.slee... | hemuke/python | 17_process_thread/42_multiprocess_pipe.py | 42_multiprocess_pipe.py | py | 1,448 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "os.getpid",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 23,
... |
40378285601 | from dataclasses import dataclass
from uuid import UUID
from praetorian_api_client.resources.base import BaseResource
class UserResource(BaseResource):
@dataclass
class User(object):
id: UUID
username: str
name: str
surname: str
email: str
phone: str
ro... | Praetorian-Defence/praetorian-api-client | praetorian_api_client/resources/user.py | user.py | py | 1,661 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "praetorian_api_client.resources.base.BaseResource",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "uuid.UUID",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 8,
"usage_type": "name"
},
{
"a... |
33980572448 | from os import name
from fastapi import FastAPI
from sqlalchemy.sql.functions import user
from db import models
from db.database import engine
from routers import user, post, review
from fastapi.staticfiles import StaticFiles
from auth import authentication
from fastapi.middleware.cors import CORSMiddleware
from fastap... | kayesokua/fastapi-artshoppe | backend/main.py | main.py | py | 1,078 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "routers.user.router",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "routers.user",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "routers.post.ro... |
2359439432 | """subscribe commands."""
# flake8: noqa: DAR101
from backoff import expo, on_exception
import click
from logzero import logger
from blackcap.configs import config_registry
from blackcap.messenger import messenger_registry
from blackcap.cluster import cluster_registry
config = config_registry.get_config()
messenger... | EBI-Metagenomics/orchestra | blackcap/src/blackcap/cli/subscribe.py | subscribe.py | py | 1,395 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "blackcap.configs.config_registry.get_config",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "blackcap.configs.config_registry",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "blackcap.messenger.messenger_registry.get_messenger",
"line_numb... |
3243198675 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# !@Time : 2021/4/30 下午4:49
# !@Author : miracleyin @email: miracleyin@live.com
# !@File : main.py
import spacy
import urllib
import urllib.request
import zipfile
import os
from lxml import etree # 读取XML文件
from utils import *
debug_mode = True
def model_build(mo... | MIracleyin/spacy_ud | main.py | main.py | py | 9,794 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "spacy.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "spacy.cli.download",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlretrieve",... |
22941304622 | import logging
import time
from monai.transforms import Compose
from monailabel.interfaces.exception import MONAILabelError, MONAILabelException
logger = logging.getLogger(__name__)
def dump_data(data, level=logging.DEBUG):
if data and logging.getLogger().level == level:
logger.log(level, "************... | Project-MONAI/MONAILabel | monailabel/interfaces/utils/transform.py | transform.py | py | 3,680 | python | en | code | 472 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "monai.transform... |
622159516 | """https://zhuanlan.zhihu.com/p/29515986"""
from skimage import transform as trans
import numpy as np
import cv2
src = np.array([
[30.2946, 51.6963],
[65.5318, 51.5014],
[48.0252, 71.7366],
[33.5493, 92.3655],
[62.7299, 92.2041] ], dtype=np.float32 )
tform = trans.SimilarityTransform()
def affine_transform(img,... | blacknwhite5/privacy-preserving-v2 | data/affine.py | affine.py | py | 534 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "skimage.transform.SimilarityTransform",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "s... |
30996098053 | import pygame
import sys
import os
import subprocess
import pyperclip
import json
from general_function import load_images, select_font, resource_path
YELLOW = (255, 228, 181)
RED = (139, 0, 0)
class Button:
def __init__(self, x, y, width, height, image_path, text, callback=None):
self.rect = pygame.Rect... | DSofiya/TextQuest | adventure_menu.py | adventure_menu.py | py | 8,915 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.Rect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.scal... |
37022989422 | """
A non-blending lightGBM model that incorporates portions and ideas from various public kernels
This kernel gives LB: 0.977 when the parameter 'debug' below is set to 0 but this implementation requires a machine with ~32 GB of memory
"""
import pandas as pd
import time
import numpy as np
from sklearn.cross_validati... | vuhoangminh/Kaggle-TalkingData-AdTracking-Fraud-Detection-Challenge | need to clean/codes_v5/test.py | test.py | py | 1,488 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "psutil.Process",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_numb... |
7564702413 | from .. import __version__ as version
from typing import Union, List, Dict, Any, Callable, Type
from cascade import data as cdd
from cascade import models as cdm
class Dataset(cdd.Dataset):
"""
Dataset is a wrapper around any collection of items to put in the ML model
for inference
"""
def __init... | Oxid15/xai-benchmark | xaib/base/base.py | base.py | py | 5,224 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "cascade.data.Dataset",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cascade.data",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"lin... |
20358272470 | import torch
import pickle
import random
import os
import numpy as np
import matplotlib.pyplot as plt
from torchvision import transforms
from captum.attr import Saliency
from PIL import Image
from convnet import *
from ResNets import *
from utils.dynamiccentrecrop import DynamicCenterCrop
# Load model to test
model = ... | ripervail/weapon-detection-CNN | saliency_plot.py | saliency_plot.py | py | 2,142 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "util... |
23708441683 | import numpy as np
import cv2
import time
import argparse
import glob
from sys import getsizeof
###################################################################################################
#Parsing Arguments
parser = argparse.ArgumentParser(description='Background extraction from microscope images')
parser.ad... | NielsPichon/hBN-Hunter | Individual Functions/FullPicMaker.py | FullPicMaker.py | py | 2,514 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_nu... |
21857947473 | import os
import json
import config
if __name__ == "__main__":
motions = os.listdir(config.processed_dir)
for m in motions:
dir = os.path.join(config.processed_dir, m)
f = open(dir)
records = json.load(f)
f.close()
for i in range(len(records)):
for j in ran... | Naplesoul/iGuard | similarity/reducefeature.py | reducefeature.py | py | 943 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.processed_dir",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.