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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42838147863 | import heapq
import nltk
import numpy as np
def tfIdf(intents):
dataset = []
for intent in intents:
dataset.append(' '.join(intent["patterns"]))
word2count = {}
for data in dataset:
words = nltk.word_tokenize(data)
for word in words:
if word not in word2count.keys(... | arduini-eduarda/Pos-MachineLearning | Src/DataProcessing/TfIdf.py | TfIdf.py | py | 3,701 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.word_tokenize",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "heapq.nlargest",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.log",
... |
71178128035 | import numpy as np
from tensorflow.keras.layers import Input, Flatten, Dense, Reshape, Dropout, Concatenate, Lambda, ReLU, Activation
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.layers import LeakyReLU
from tensorflow.keras.models import Model
from tensorflow.keras import backend as K
... | alexmarshallbristol/Enhanced_Generative_Networks | VAE.py | VAE.py | py | 18,554 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.keras.backend.epsilon",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.backend",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.use",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
19067045748 | import time
import urllib.request
import json
import os
from enum import Enum
import numpy as np
import pandas as pd
import ast
GRASS_HOPPER_KEY = 'fc4feee8-6646-46a1-a480-ad2a14f094c2'
class SORT_BY(Enum):
haversine_distance = 1
Distance = 2
Time = 3
Risk = 4
POIScore = 5
class ROUTE_FROM(Enum... | techGIAN/Risk-Based-Trip-Recommender | utilityMethods.py | utilityMethods.py | py | 7,577 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "urllib.request.request.urlretrieve",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "urllib.reques... |
73207285794 | # Basic imports --------------------------------------------
from __future__ import annotations
import sys
# 파이썬 기본 재귀 limit이 1000이라고 함 --> 10^6으로 manual하게 설정
sys.setrecursionlimit(10**6)
from os.path import dirname, abspath, basename, normpath ... | etture/algorithms_practice | leetcode/google_prep/arrays_and_strings/3_rotate_image.py | 3_rotate_image.py | py | 1,934 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.normpath"... |
26375743384 | from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton
import sys
from random import choice
window_titles = [
'My App',
'My App',
'Still My App',
'Still My App',
'What on earth',
'What on earth',
'This is surprising',
'This is surprising',
'Something went wrong'
]
# ... | BigMoonTech/GuiTutorials | SlotsAndSignals/03_changing_ui.py | 03_changing_ui.py | py | 1,916 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PySide6.QtWidgets.QMainWindow",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PySide6.QtWidgets.QPushButton",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 45,
"usage_type": "call"
},
{
"api_nam... |
38639063239 | """
Find when the difference between ensembles of different precision is
significant.
"""
import matplotlib.pyplot as plt
import iris
import iris.quickplot as qplt
from iris.analysis import MEAN
from myscripts.statistics import rms_diff
from myscripts.models.speedy import datadir
def main():
# Parameters
path... | leosaffin/scripts | myscripts/projects/ithaca/precision_errors/ensembles.py | ensembles.py | py | 1,150 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "myscripts.models.speedy.datadir",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "iris.Constraint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "iris.load_cube",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "iris.a... |
9324696870 | from multiprocessing import Pool
import pandas as pd
from datetime import datetime
from functools import partial
from Task232 import get_count_vacancies, get_salary_level, DataSet, print_statistic
def get_statistic_by_year(file, vacancy, statistics):
df = pd.read_csv(file)
df['salary'] = df[['salary_from', '... | Elenaz441/Zasypkina | Task322.py | Task322.py | py | 2,229 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "functools.partia... |
32061157997 | """RecipeBase URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | djangoner/RecipeBase | RecipeBase/urls.py | urls.py | py | 2,437 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "recipes.urls.router",
"line_number": 33,
"usage_type": "name"
},
{
"a... |
4738835983 | # services/tienda/project/api/tienda.py
from flask import Blueprint, jsonify, request, render_template
from project.api.models import Tienda
from project import db
from sqlalchemy import exc
tienda_blueprint = Blueprint('tienda', __name__, template_folder='./templates')
@tienda_blueprint.route('/tienda/ping', me... | danilomorales/tienda-app | services/tienda/project/api/tienda.py | tienda.py | py | 3,483 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask.request",
... |
38288069447 | #!/usr/bin/env python3
# Convert hex to base64
import string
from base64 import b64encode
from utils import ans_check
# --------------------------------------------------------
# ---------------------- functions -----------------------
# --------------------------------------------------------
def hexToB64(data: str) ... | IOKernel/cryptopals | challenge01.py | challenge01.py | py | 1,189 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "string.hexdigits",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "base64.b64encode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "utils.ans_check",
"line_number": 30,
"usage_type": "call"
}
] |
38177507754 | import os
import csv
import time
import psutil
import traceback
import subprocess
import multiprocessing
from PySide6.QtCore import *
from param import *
from utils import *
from process import *
from gridbox import *
from backend import *
from prepare import *
__all__ = ['AutodockWorker', 'AutodockVinaWorker', 'Qui... | lmdu/dockey | src/worker.py | worker.py | py | 19,170 | python | en | code | 32 | github-code | 1 | [
{
"api_name": "multiprocessing.SimpleQueue",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "multiprocessing.SimpleQueue",
"line_number": 142,
"usage_type": "call"
},
{
"api_name": "multiprocessing.SimpleQueue",
"line_number": 433,
"usage_type": "call"
},
{
... |
1489810940 | # -*- coding: utf-8 -*-
import tensorflow as tf
from util.LayerUtil import LayerUtil
from tensorflow.examples.tutorials.mnist import input_data
import matplotlib.pyplot as plt
import numpy as np
#导入MNIST数据集
mnist = input_data.read_data_sets("D:\\tensorflow\\cha5\\mnist_data", one_hot=True)
#定义模型的超参数
learning_rate = ... | guozhenqiang/AILib | dl/classfication/MnistAutoEncoder.py | MnistAutoEncoder.py | py | 2,280 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tensorflow.placeholder",
"line_n... |
43279921183 | import ply.yacc as yacc
from mathpy.grammar.paranthesis.lexer import tokens
precedence = (
('nonassoc', 'NUMBER'),
('nonassoc', 'SINE', 'COSINE', 'SECANT', 'COSECANT', 'TANGENT', 'COTANGENT', 'LOG', 'EXP', 'ARCSINE', 'ARCCOSINE', 'ARCTANGENT', 'SINEH', 'COSINEH', 'TANGENTH', 'ARCSINEH', 'ARCCOSINEH', 'ARCTANGE... | pritansh/mathpy | mathpy/grammar/paranthesis/parser.py | parser.py | py | 2,810 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ply.yacc.yacc",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "ply.yacc",
"line_number": 112,
"usage_type": "name"
}
] |
13944459830 | from django.db import models
from django.contrib.auth.models import AbstractUser
from Image.models import File
# Create your models here.
class Gender(models.TextChoices):
MALE = 'M', 'Male'
FEMALE = 'F', 'Female'
OTHER = 'O', 'Other'
class User(AbstractUser):
age = models.DateField(auto_now=... | jafarjtown/educhat-like-facebook | user_profile/models.py | models.py | py | 1,346 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.TextChoices",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 10,
"usage_type": "name"
},
... |
7417459883 | from dataserver import FileServer
from model import Modelrunner, ModelDef
import argparse
import time
import numpy as np
from collections import defaultdict
from pathlib import Path, PurePath
import multiprocessing as mp
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator, FormatStrForm... | REPLICA-Collective-Rep/DATECentral | train.py | train.py | py | 4,740 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_na... |
69996666913 | # coding:utf-8
from py2neo import Graph, Node, Relationship, NodeMatcher
import csv
from tkinter import *
#调用node_set()函数和relationship_set()函数进行结点和关系的创建。
def node_set(dict1, node_list1, key1, label1):
temp1 = dict1[key1].replace(' ', '')
temp_list1 = temp1.split('/')
for j1 in temp_list1:
node_lis... | daixiangxiang/Crawler-knowledge-map-NLP | knowledge_map.py | knowledge_map.py | py | 3,792 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "py2neo.Node",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "py2neo.NodeMatcher",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "py2neo.Relationship",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "py2neo.Relationshi... |
12071969574 | # Databricks notebook source
# MAGIC %md
# MAGIC # CSR reports
# MAGIC
# MAGIC Any large scale organisation is now facing tremendous pressure from their shareholders to disclose more information about their environmental, social and governance strategies. Typically released on their websites on a yearly basis as a for... | claudiomirti/esg-scoring | 01_esg_report.py | 01_esg_report.py | py | 22,529 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "typing.Iterator",
"line_number": 87,
"usage_type": "name"
},
{
"api_name": "pandas.Series",
"line... |
43942664647 | import os
import sys
import time
import numpy as np
import theano
import theano.tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
import PIL.Image as Image
from collections import OrderedDict
def stochasticGradient(cost,params,lr = 0.01):
'''
Stochastic Gradient Descent
'''
... | hallvardnydal/autoencoder | dA.py | dA.py | py | 3,954 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "theano.tensor.grad",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "theano.tensor",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.... |
2056739113 | # from urllib import request
from flask import Flask, render_template,request,make_response
from sklearn.pipeline import Pipeline
import joblib
from sklearn import linear_model
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_... | Abii9443/Fake_news_identifier | app.py | app.py | py | 2,994 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
... |
41631110068 | import os
import subprocess
import sys
import logging
import shutil
from flask import Flask, jsonify, render_template, request
from werkzeug import secure_filename
app = Flask(__name__)
app.logger.addHandler(logging.StreamHandler(sys.stdout))
app.logger.setLevel(logging.ERROR)
app.config['PROPAGATE_EXCEPTIONS'] = True... | matteotiziano/secret-harbor | app.py | app.py | py | 2,568 | python | en | code | 25 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.ERROR",
... |
25755211571 | from accounts.forms.profile_form import ProfileForm
from accounts.models import Profile
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.http import Http404
from django.shortcuts import redirect, render
from django.urls import reverse, reverse_lazy
from django.utils.d... | walexhenrique/skype-clone | friendships/views.py | views.py | py | 5,892 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.View",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.Friend.objects.filter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Friend.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_nam... |
73241129635 | import gspread
from oauth2client.service_account import ServiceAccountCredentials
import os
import time
time_start=time.clock()
scope = [r'https://spreadsheets.google.com/feeds']
#os.chdir('discord_bots\\pss_bot')
credentials = ServiceAccountCredentials.from_json_keyfile_name('pss_bot.json', scope)
gc = gspread.au... | DT-1236/pss_bot_legacy | old versions/pss_bot v0.4.py | pss_bot v0.4.py | py | 3,363 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.clock",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
... |
7695458108 | # coding=utf-8
import os
import sys
import time
import tkinter
from tkinter import messagebox
import requests
from myConvert import ConvertPDF, ConvertPic
class tkPDF:
"""
创建PDF转换的Tk窗体\n
width: 窗体宽度\n
height: 窗体高度\n
"""
__Url: str
__APP_ID: str
__API_KEY: str
... | wwzhg77777/convertPDF | src/tkPDF.py | tkPDF.py | py | 8,532 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.Tk",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_n... |
12083402248 | # to capture images from webcam
import cv2
# to work on arrays
import numpy as np
# opens webcam and gives us the handle back
capture = cv2.VideoCapture(0)
# load face detection classifier
dataset = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
# an empty to store images later on
data = []
# an infini... | brainmentorspvtltd/MSIT_MachineLearning | faceStore.py | faceStore.py | py | 3,090 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY"... |
3569043832 | # -*- coding: utf-8 -*-
"""currency view."""
from flask import Blueprint, jsonify, request
from flask.views import MethodView
from flask_jwt_extended import verify_jwt_in_request
from marshmallow import ValidationError
from sqlalchemy import func
from evolux_solution.database import db
from evolux_solution.views impor... | Mateus-Brito/evolux-back-end-challenge | evolux_solution/currency/views.py | views.py | py | 3,168 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.views.MethodView",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "evolux_solution.views.ViewPaginator",
"line_number": 18,
"usage_type": "name"
},
{
"api_na... |
30168449782 | import pygame
from pygame.locals import *
import FrontEnd as f
import BackEnd as b
import Fight
WHITE = 250,250,250
#This is where the main loops are... main game control
# game class that is instantiated in the Launcher
class Game():
# Initialise what we need
def __init__(self, screenSize, name):
self.screen... | prithmanickam/2-Player-Platformer-Projectile-Shooter-Game | iteration 3/GameControl.py | GameControl.py | py | 3,099 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "FrontEnd.Screen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "FrontEnd.OptionCon... |
12597692501 | from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
# Create your views here.
import json
from .models import Idea
def index(request):
idea = Idea.objects.all()
response = json.dumps([{}])
return HttpResponse(response, content_ty... | adilmoumni/python_in_practice | apiapp/views.py | views.py | py | 1,356 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "models.Idea.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Idea.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.Idea",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "json.dum... |
72506235875 | #!/usr/bin/env python
# --------------------------------------------------------------------
# cli.py
#
# Author: Lain Musgrove (lain.musgrove@hearst.com)
# Date: Monday October 9, 2023
# --------------------------------------------------------------------
import asyncio
import getpass
import shlex
import signal
impor... | lainproliant/bivalve | bivalve/cli.py | cli.py | py | 6,202 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "bivalve.logging.LogManager",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "typing.Opt... |
7565321283 | import tempfile
import subprocess
import os
import yaml
import codecs
import logging
class FileService(object):
METAPATH_KEY = "_metapath"
def __init__(self, logger=None):
self.logger = logger or logging.getLogger(__name__)
def edit_temp_file(self, initial_text):
"""Edits a temp file in ... | withrocks/transcribe-cli | transcribe_cli/file_svc.py | file_svc.py | py | 2,483 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tempfile.NamedTemporaryFile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "codecs.... |
11710769912 | #author: Samet Kalkan
import numpy as np
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dropout, Dense
from keras.utils import np_utils
from keras.callbacks import ModelCheckpoint
from keras import regularizers
from keras import backend as K
np.random.seed(0)
... | baker12355/weather_prediction | CNN_train.py | CNN_train.py | py | 2,813 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line... |
933868552 | from collections import deque
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
graph = [[]*(n+1) for _ in range(n+1)]
visited = [False] * (n+1)
for _ in range(m):
a, b = map(int, input().split())
graph[a].append(b)
graph[b].append(a)
cnt = 0
def bfs(v):
queue = deque([v])
vis... | jjs0211/problem-solving-with-study | Baekjoon/Class03/11724_연결요소의개수.py | 11724_연결요소의개수.py | py | 1,228 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
}
] |
28785181845 | import torch
import tensorflow as tf
import math
import numpy as np
import cv2
from tensorflow import keras
def NME(y_true,y_pred):
w = 256
h = 256
d = (w**2+h**2)**(1/2)
nose_x = y_true[:,0]
nose_x_pred = y_pred[:,0]
nose_y = y_true[:,1]
nose_y_pred = y_pred[:,1]
distance_nose =... | JIYOON-INNOPOST/INNOFACE | crop.py | crop.py | py | 4,569 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.math.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow.math",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.math.sqrt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tensor... |
21414167412 | # -*- coding: utf-8 -*-
import tkinter as tk
from typing import List
from ParseError import ParseError
from geometry_syntax import GeometrySyntax
from oval_parameters import OvalParameters
from preview import Preview
class Application(tk.Frame):
_syntax_error_tag = "syntax_error"
def __init__(self, master,... | paper-lark/pythondev | 05_SshAndSmartWidgets/src/application.py | application.py | py | 3,767 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tkinter.Frame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tkinter.LabelFrame",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tkinter.LabelFrame",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "tkinter.Text... |
191299604 | from __future__ import absolute_import
from __future__ import print_function
import pyspark
import h5py
import json
from keras.optimizers import serialize as serialize_optimizer
from keras.models import load_model
from .utils import lp_to_simple_rdd
from .utils import model_to_dict
from .mllib import to_matrix, from_... | jem0101/BigSwag-SQA2022-AUBURN | TestOrchestrator4ML-main/resources/Data/supervised/GITLAB_REPOS/jamesluhz@elephas/elephas/spark_model.py | spark_model.py | py | 10,442 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "keras.optimizers.serialize",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "optimizers.SGD",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "utils.model_to_dict",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "paramet... |
31602843689 | from matplotlib import pyplot as plt
from PIL import Image
img = Image.open("original.jpg")
img2 = Image.open("broken1.png").convert(img.mode)
img2 = img2.resize(img.size)
img3 = Image.blend(img,img2,0.35)
plt.figure(num='BROKEN LENS Failure')
plt.subplot(121),plt.imshow(img),plt.title('Original')
plt.xticks([]),... | XYZ121212/issre2020 | superimposition.py | superimposition.py | py | 437 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 7... |
41437728573 | import logging
import os
import re
import pytest
import sqlalchemy
from datetime import datetime, timedelta, timezone
from sqlalchemy.dialects import oracle
from streamsets.testframework.markers import database, sdc_min_version
from stage.utils.common import cleanup
from stage.utils.utils_migration import LegacyHandl... | streamsets/datacollector-tests | stage/standard/test_oracle_cdc_client.py | test_oracle_cdc_client.py | py | 16,206 | python | en | code | 17 | github-code | 1 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "da... |
25577714533 | # Copyright (C) 2020 Claudio Marques - All Rights Reserved
from enum import Enum
class Lists(Enum):
VOWEL = 'aeiou'
CONSOANT = "bcdfghjklmnpqrstvwxyz"
NUMERIC = "0123456789"
SPECIALCHAR = "!\"#|\\$%&/()=?«»´`*+ºª^~;,-_@£€{[]}'"
class DatesEnum(Enum):
SemDados = 0
UmMes = 1
... | claudioti/dataset-creator | lib/enumerations.py | enumerations.py | py | 532 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 20,
"usage_type": "name"
}
] |
35990787928 | """
Get Options Action for App ID
"""
from urllib.parse import urlencode
from api.api_samples.python_client.ext import requests
from common.methods import set_progress
from itsm.servicenow.models import ServiceNowITSM
import json
def get_options_list(field, **kwargs):
options = [('', '--- Select an App ID ---')]... | mbomb67/cloudbolt_samples | params/create_tags.py | create_tags.py | py | 2,362 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "itsm.servicenow.models.ServiceNowITSM.objects.first",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "itsm.servicenow.models.ServiceNowITSM.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "itsm.servicenow.models.ServiceNowITSM",
... |
29165679484 | from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from wmh_server.models import LocationData as lc
from django.views.decorators.csrf import csrf_exempt
import json
import datetime as dt
from django.conf import settings
def index(request):
res = "Base Path:{}. This ... | PavloZub/WalkMeHome_SRV | wmh_server/views.py | views.py | py | 2,572 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.settings.BASE_DIR",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 13,
"usage_type": "call"
},
{
"... |
41919082633 | # Sytulacja rzutu dwoma kośćmi.
from die import Die
from plotly.graph_objs import Bar, Layout
from plotly import offline
die_1 = Die()
die_2 = Die(10)
results = [die_1.roll()+die_2.roll() for roll_num in range(50_000)]
max_result = die_1.num_sides + die_2.num_sides
frequencies = [results.count(value) for value in r... | Jvlia17/Data-Visualization | dice_visual.py | dice_visual.py | py | 830 | python | pl | code | 0 | github-code | 1 | [
{
"api_name": "die.Die",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "die.Die",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Bar",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Layout",
"l... |
3181829099 | #!/usr/bin/env python3
"""
cron: 0 40 22 * * *
new Env('明日天气');
"""
import sys
import requests
import json
import time
from bs4 import BeautifulSoup
import os, re
# 获取WxPusher appToken WxPusher_appToken
if "WxPusher_appToken" in os.environ:
if len(os.environ["WxPusher_appToken"]) > 1:
WxPusher_appToken = ... | BSSAMA/weather | tomorrow_weather.py | tomorrow_weather.py | py | 5,931 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_... |
11397164333 | from bs4 import BeautifulSoup
import requests
from rus import send_mail
from soc import messages_to_string
def parse_hearpwn_page(page):
page = requests.get(page)
soup = BeautifulSoup(page.text, 'html.parser')
messages = soup.find_all('div', itemprop='text')
return messages
def parse_sa... | komap2017/soc | hearthpwn.py | hearthpwn.py | py | 848 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "soc.messages_to_string",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rus.send_mail",
... |
35718199463 | # -*- coding: utf-8 -*-
"""
Course: CS 4365/5354 [Computer Vision]
Author: Jose Perez [ID: 80473954]
Assignment: Lab 1
Instructor: Olac Fuentes
Last Modification: September 2, 2016 by Jose Perez
"""
from timeit import default_timer as timer
from PIL import Image
from numpy import *
# Page 42-43, exercise 5
# Gradient ... | DeveloperJose/Python-CS4363-Computer-Vision | Lab1/problem1_exercise5.py | problem1_exercise5.py | py | 1,877 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number"... |
31136763706 | # -*- coding: utf-8 -*-
"""
This model takes the winemag data & filters on the north_america and europe continents.
After cleaning and prepping the date,
we run two bayesian hierarchical models (one for each continent) on the data using variational inference & pymc3
"""
import pandas as pd
import numpy as np
import py... | wkdaniel3/Bayesian-Analysis-for-Wine | points_regression_hierarchical.py | points_regression_hierarchical.py | py | 8,895 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "FE.FE",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number"... |
27827135577 | import pytest
from thefuck.types import Command
from thefuck_contrib_scoop.rules.scoop_unknown_command import get_new_command, match
from thefuck_contrib_scoop.scoop import get_aliases, get_commands
@pytest.mark.parametrize(
"script, output",
[
(
"scoop bucke add versions",
"s... | beerpiss/thefuck-contrib-scoop | tests/rules/test_scoop_unknown_command.py | test_scoop_unknown_command.py | py | 1,453 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "thefuck_contrib_scoop.rules.scoop_unknown_command.match",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "thefuck.types.Command",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 8,
"usage_type": "... |
34519629611 | #!/usr/bin/env python3
from Crypto.Util import number
from binascii import hexlify, unhexlify
from gmpy2 import next_prime, powmod, gcdext, gcd
from itertools import count
from random import randint
class MPRSA(object):
def __init__(self):
self.public_key = None
self.secret_key = None
def key... | p4-team/ctf | 2017-07-15-ctfzone/mprsa/mprsa.py | mprsa.py | py | 1,901 | python | en | code | 1,716 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gmpy2.next_prime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Crypto.Util.number.getPrime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Crypto.Ut... |
70039834274 | import pygame
world_size = (1600, 768 + 64)
import random
from data.src.utils.utils import wait
class ScreenShake:
def __init__(self, display):
self.display = display
self.timer = 0
self.screen_position = [0, 0]
self.shake = False
def update(self):
if self.shake:
... | eliczi/project_arena | data/src/display.py | display.py | py | 2,773 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "data.src.utils.utils.wait",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pyga... |
34468401334 | # Code source: Jaques Grobler
# License: BSD 3 clause
# Code from https://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
from joblib import dump, load... | Wallis16/Docker_Machine_Learning | App/Training/train.py | train.py | py | 1,870 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.datasets.load_diabetes",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.expand_dims",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "skl... |
8496698639 | import json
import os
import socket
import sys
import threading
import time
class Server:
__instance = None
@staticmethod
def getInstance(callback=None):
if Server.__instance == None:
Server(callback)
return Server.__instance
def __init__(self, callback):... | jaanonim/ISM | server/server.py | server.py | py | 6,736 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getenv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number":... |
5549227980 | #!/usr/bin/python3
# coding: utf-8
import os
import glob
import re
import sys
import shutil
import logging
import subprocess
def logging_init():
'''
紀錄檔格式初始化
格式:
[ 2015 Nov 19 21:13:06 ] ryHalign.py:090 [INFO] : Generate 4 scp files: genScpFiles() Success!
[ 2015 Nov 19 21:13:07 ] ryHalig... | don6105/PR2015 | TTS/ryHalign.py | ryHalign.py | py | 14,449 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.... |
6104384803 | # Import the dependencies.
import numpy as np
import pandas as pd
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
#################################################
# Da... | Wheezyotter/sqlalchemy-challenge | SurfsUp/app.py | app.py | py | 7,631 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.automap.automap_base",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 27,
"usage_type": "call"
},
{
... |
35282075051 | """
It is a file that crops the mp3 and srt file by the durations
which is getting from the srt file.
"""
import os
from ..helper.helper import run_bash, parse_time
class CropMp3Srt:
"""
Gets the mp3 and srt files to crop
"""
def __init__(self, filepath):
self._path = filepath
def crop(s... | IoT-Ignite/ArdicSrtCollector | ardicsrtcollector/crop_mp3_srt/crop_mp3_srt.py | crop_mp3_srt.py | py | 3,773 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "helper.helper.parse_time",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "helper.helper.parse_time",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "helper.h... |
29847344408 | from app import app
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import json
class IneffableStorage(object):
def __init__(self):
""" Initialize the class """
self.connection = None
self.bucket = None
def setup_connection(self):
""" Setup the connect... | taeram/ineffable | app/controllers/helpers/storage.py | storage.py | py | 1,142 | python | en | code | 8 | github-code | 1 | [
{
"api_name": "boto.s3.connection.S3Connection",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.app.config",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "app.app",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "app.app.c... |
17955145003 | from __future__ import unicode_literals
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from hazm import *
import fasttext
import string
import emoji
import hazm
import json
import os
import re
#
normalizer = Normalizer()
def remove_extra_chars(text):... | MinaHajirezaei/Text-classification-with-fasttext | fasttext_classification.py | fasttext_classification.py | py | 8,412 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "re.findall",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": ... |
72632121635 | # Capture multiple Faces from multiple users to be stored on a DataBase (dataset directory)
# ==> Faces will be stored on a directory: dataset/ (if does not exist, pls create one)
# ==> Each face will have a unique numeric integer ID as 1, 2, 3, etc
import cv2
from scripts.database_connection import Connection
... | FoOkySNick/faceRecognition | FaceRecognition/scripts/frontal_face_dataset_with_database.py | frontal_face_dataset_with_database.py | py | 3,813 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scripts.database_connection.Connection.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scripts.database_connection.Connection",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "cv2.destroyAllWindows",
"line_number": 32,
"usage_t... |
40363495908 | __author__ = 'M_Nour'
import numpy as np
from scipy import stats
from sklearn.semi_supervised import label_propagation
from sklearn.metrics import classification_report, confusion_matrix,accuracy_score, f1_score, recall_score
import dataset
from collections import Counter
import matplotlib.pyplot as plt
from ... | marjan-nourollahi/PALS | stream_PAL.py | stream_PAL.py | py | 11,813 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.semi_supervised.label_propagation.LabelSpreading",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.semi_supervised.label_propagation",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "dataset.load_data",
"line_number": 20,
... |
32600971056 | #!/usr/bin/python3
from typing import List
import json
from bplib.butil import TreeNode, arr2TreeNode, btreeconnect, aprint
class Solution:
def canAttendMeetings(self, intervals: List[List[int]]) -> bool:
intervals = sorted(intervals)
current_start = -1
current_end = -1
for [start... | negibokken/sandbox | leetcode/252_meeting_rooms/main.py | main.py | py | 536 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
}
] |
27203130897 | from ast import Interactive
from typing import Collection
import pygame
import logging
from settings import *
from player import Player
from overlay import Overlay
from sprites import GenericSprites, WaterSprites, TreeSprites, WildFlowerSprites, InteractionSprites, ParticleEffects
from pytmx.util_pygame import load_pyg... | lordhelmut/pygame-town | src/level.py | level.py | py | 10,702 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.info",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.display.get_surface",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pygame.sp... |
33274035782 | # -- coding: utf-8 --
import tensorflow as tf
import pandas as pd
import numpy as np
import pymysql
import sys
sys.path.append(sys.path.append('../')) # 导入上一级目录中的包
from settings import *
# 查询课程信息
# 课程信息查询,例:离散数学及其应用
# 课程编号,课程名称,公司企业名称,课程编码,课程类别,学分,是否考试,上传时间,标签
def courInfo(courseName):
db = pymysql.connect("10.1... | BoolWang/FuXueCase | fuxuecase/case4/case4.py | case4.py | py | 6,928 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pymysql.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"li... |
34576891554 | __author__ = "Michael Chambers"
__copyright__ = "Copyright 2019, Michael Chambers"
__email__ = "greenkidneybean@gmail.com"
__license__ = "MIT"
from snakemake.shell import shell
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
shell(
"samtools faidx {snakemake.params} {snakemake.input[0]} > {snakemake.ou... | leonqli/snakemake-wrappers | bio/samtools/faidx/wrapper.py | wrapper.py | py | 338 | python | en | code | null | github-code | 1 | [
{
"api_name": "snakemake.shell.log_fmt_shell",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "snakemake.shell",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "snakemake.shell.shell",
"line_number": 11,
"usage_type": "call"
}
] |
12747428660 | from keras.utils import to_categorical
import numpy as np
import pandas as pd
import time
TRAIN_SIZE = 30000
TEST_SIZE = 2
def label_generator(num_of_labels, size):
"""
Create a two coloum label set
:param size1:
:param size2:
:return:
"""
lab = np.zeros((size, num_of_labels), dtype=np.float)
length_per_label... | odedyec/biological_dnn | dataset_generator.py | dataset_generator.py | py | 7,460 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.c_",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.shuffle",
... |
43564951062 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def trim_fields(apps, schema_editor):
trim_extra_account(apps, schema_editor, "facebook")
trim_extra_account(apps, schema_editor, "github")
trim_extra_account(apps, schema_editor, "twitter")
def trim_... | colab/colab | colab/accounts/migrations/0004_auto_20150311_1818.py | 0004_auto_20150311_1818.py | py | 1,511 | python | en | code | 23 | github-code | 1 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.RunPython",
"line_number": 30,
"usage_type": "call"
},
... |
4340565342 | import logging
import re
from datetime import datetime, timezone
from zipfile import ZipFile
import pandas
from jal.widgets.helpers import g_tr
from jal.db.update import JalDB
from jal.constants import Setup, DividendSubtype, PredefinedCategory, PredefinedAsset
# -----------------------------------------------------... | iliakan/jal | jal/data_import/statement_uralsib.py | statement_uralsib.py | py | 13,042 | python | en | code | null | github-code | 1 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "jal.widgets.helpers.g_tr",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.read_ex... |
25316109249 | from config import data_db_schema,data_ocr
from repositories import DataRepo
from utilities import LANG_CODES
import logging
from logging.config import dictConfig
log = logging.getLogger('file')
repo = DataRepo()
class OcrModel:
def __init__(self):
self.db = data_db_schema
self.col = da... | ishudahiya2001/ULCA-IN-ulca-Public | backend/metric/ulca-utility-service/src/models/ocr.py | ocr.py | py | 3,702 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "repositories.DataRepo",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "config.data_db_schema",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "config.da... |
32990811232 | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from cssspy.utils import domains_from_urls, absolute_urls
from cssspy.cssscrapy.items import CssFilesItem
from scrapy.contrib.linkextractors.htmlparser import HtmlParserLinkExtractor
... | Scorpil/cssspy | cssspy/cssscrapy/spiders/cssspider.py | cssspider.py | py | 1,492 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cssspy.utils.domains_from_urls",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scrapy.selector.HtmlXPathSelector",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cssspy.cssscrapy.items.CssFilesItem",
"line_number": 21,
"usage_type": "... |
1707012386 | from typing import Dict, List
import asana
from giges.models.team import Team
from giges.slack import SlackClient
from giges.tasks.app import app
from giges.util import validate_uuid
def _add_ds_class_item(custom_field: Dict[str, str]) -> str:
"""
Returns the slack representation for a Data Science item.
... | tesselo/giges | giges/tasks/asana.py | asana.py | py | 4,761 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": ... |
21065266517 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import flags
import tensorflow as tf
import dataloader
import retinanet_model
from tensorflow.contrib.tpu.python.tpu import tpu_config
from tensorflow.contrib.tpu.python.tpu import tpu_est... | ProjectSidewalk/sidewalk-cv-assets19 | old/tf_resnet_tutorial/tpu/models/official/retinanet/retinanet_main.py | retinanet_main.py | py | 8,690 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "absl.flags",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "absl.fla... |
2427076789 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
class TrainTestSplitter:
def __init__(self, subjects, labels):
"""
Initializes the TrainTestSplitter class.
Parameters:
- subjects (list): List of subjects.
- labels (list): List of... | dheerajpr97/Explainable-AI-Non-EEG | src/utils/cross_val.py | cross_val.py | py | 5,499 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.delete",
"lin... |
40738971562 | import h2o
import numpy as np
# Start H2O on your local machine
h2o.init ( ip='localhost', port=54321, nthreads=-1, max_mem_size='25g' )
# Import the train_numeric
train_numeric = h2o.import_file ( path="/Users/avinashbarnwal/Desktop/Kaggle/Bosch/train_numeric.csv" )
# train_categorical = h2o.import_file(path = "/User... | avinashbarnwal/Bosch-Kaggle | .idea/Code.py | Code.py | py | 2,944 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "h2o.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "h2o.import_file",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "h2o.estimators.gbm.H2OGradientBoostingEstimator",
"line_number": 47,
"usage_type": "call"
},
{
"api_name":... |
20491564834 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pywt
from sklearn.cluster import KMeans
from sklearn.cluster import AgglomerativeClustering
import random
from scipy.spatial import distance
import math
from typing import Union
DataSources = Union[str,pd.Series,np.ndarray]
class TemplateEr... | ZoyaV/ikmeans | ikmeans/dwt_templates.py | dwt_templates.py | py | 5,004 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "typing.Union",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pandas.Series",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
... |
20261507881 | from django.db.models import Manager
from .exceptions import TenantError
from .utils import state
FIELD_NAME = "shop"
class TenantManager(Manager):
def __init__(self):
self.state = state
super().__init__()
def get_queryset(self):
current_state = self.state.get_state()
queryse... | ragsub/smplshop2 | smplshop/users/tenant/managers.py | managers.py | py | 743 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.db.models.Manager",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utils.state",
"line_number": 10,
"usage_type": "name"
}
] |
12533465974 | #!/usr/bin/env python3
"""
Sales As Code: randomly selects a sales-y buzzword from a google sheet.
"""
import argparse
import logging
import os
import random
import sys
import gspread
from cachetools import TTLCache
from dotenv import load_dotenv
from oauth2client.service_account import ServiceAccountCredentials
lo... | bblinder/home-brews | SalesAsCode.py | SalesAsCode.py | py | 3,610 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cachetools.TTLCache",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dotenv.load... |
17816136485 | from getmac import get_mac_address as gma
import sys
import os
import getopt
#varibles
mac = None
mac_vendor = ""
#argv
argv = sys.argv[1:]
opts, args = getopt.getopt(argv, "i:m:h", ["ip=", "mac=", "help"])
archivo = open("archivo.txt", "r")
def getmac(ipadress):
mac = gma(ip=ipadress)
... | robot-beep/tarea1-OUILookup | OUILookup.py | OUILookup.py | py | 730 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "getopt.getopt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "getmac.get_mac_address",
"line_number": 16,
"usage_type": "call"
}
] |
24869313700 | from functools import wraps
import numpy as np
def handle_0D_1D_input(
patched_kwargs: [], patched_argpos: [], return_scalar=False
):
"""
A decorator that handles 0D, 1D inputs and transforms them to 2D.
Parameters
----------
kwarg : list of str
The names of the keyword arguments tha... | acerbilab/pyvbmc | pyvbmc/decorators/handle_0D_1D_input.py | handle_0D_1D_input.py | py | 2,169 | python | en | code | 99 | github-code | 1 | [
{
"api_name": "numpy.ndim",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.atleast_2d",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.ndim",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.atleast_2d",
"line_n... |
23584376110 | # vim: set expandtab:
import typing
import subprocess
import os
import pwd
import sys
import docker
import re
import socket
import psutil
import io
import pickle
import math
import threading
import time
import shutil
import uuid
from .imageTransient import TransientImageSlurmBackend, list_instances, get_gce_client
fr... | getzlab/canine | canine/backends/dockerTransient.py | dockerTransient.py | py | 24,264 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "threading.Lock",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "imageTransient.TransientImageSlurmBackend",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name... |
15143070119 | #!/usr/bin/env python
# coding: utf-8
# # COURSE: Master statistics and machine learning: Intuition, Math, code
# ##### COURSE URL: udemy.com/course/statsml_x/?couponCode=202006
# ## SECTION: The t-test family
# ### VIDEO: Permutation testing
# #### TEACHER: Mike X Cohen, sincxpress.com
# In[ ]:
# import libraries... | mikexcohen/Statistics_course | Python/ttest/stats_ttest_permutation.py | stats_ttest_permutation.py | py | 2,373 | python | en | code | 18 | 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.log",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.histogram",
... |
8169473685 | import math
from torch import nn
import torch.nn.init as init
from .common import AdaptiveFM
from .dgr import DGR
import torch
import torch.nn.functional as F
def make_model(args, parent=False):
return ESPCN(args)
def get_valid_padding(kernel_size, dilation):
kernel_size = kernel_size + (kernel_size - 1) * (... | anonymousECCV2022/paper2031_ECCV2022_code | src/model/espcnori.py | espcnori.py | py | 3,794 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.nn.functional.conv2d",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "t... |
14777550147 | import functools
import turtle
import hangman
import words
def write_word(word):
writer = turtle.Turtle()
writer.penup()
writer.goto(100, 200)
writer.write(word, font=('Arial', 16, 'bold'))
writer.hideturtle()
# Иницилизация
original_word = words.get_random_word()
word = '_' * len(original_word... | simo1209/tues_homework | 24/game.py | game.py | py | 954 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "turtle.Turtle",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "words.get_random_word",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "hangman.MAX_ERRORS",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "words.fill... |
22525543773 | import json
import os
import numpy as np
import sys
import copy
import random
import jsonlines
import time
import scipy.stats
task = sys.argv[1]
model = sys.argv[2]
model = f"en_dense_lm_{model}"
# !!! replace by your $base_dir/ana_rlt here
base_dir = "$base_dir/ana_rlt"
ana_rlt_dir = f"{base_dir}/{model}"
debug_sca... | microsoft/LMOps | understand_icl/icl_ft/compute_training_example_attn.py | compute_training_example_attn.py | py | 8,440 | python | en | code | 2,623 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "jsonlines.Reader",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_nu... |
17218746745 | import os
import click
import requests
from .utils import prepare_path, save_list_and_cache, write_to, get_result
from .help import BRANDING
prepare_path()
# @click.group()
@click.command()
@click.argument('ignore', required=False)
@click.version_option(message=BRANDING)
@click.option('-a', '--listall', help='Get al... | AzatAI/addignore | addignore/cli.py | cli.py | py | 1,397 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils.prepare_path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.prepare_path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"li... |
15972604163 | #load matplotlib.pyplot as plt
import matplotlib.pyplot as plt
#load numpy as np
import numpy as np
#x range: [-pi, pi]
x = np.linspace(-np.pi, np.pi, 256, endpoint = True)
#y = sin(x)
y_sin = np.sin(x)
#y = cos(x)
y_cos = np.cos(x)
#Figure & subplot
fig = plt.figure(figsize = (12,8))
ax = fig.add_subplot(1,1,1)
#... | SONG-WONHO/start_Matplotlib | 07_review.py | 07_review.py | py | 976 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 1... |
19822983990 | from fastapi import FastAPI
from models import User, UserBet, VerifyRequest
app = FastAPI()
@app.post("/server_seed")
def get_hashed_server_seed(request: User):
resp = request.get_server_seed()
return resp
@app.post("/bet")
def bet(request: UserBet):
resp = request.process()
return resp
@app.pos... | PerryGraham/provably-fair-python | main.py | main.py | py | 414 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "models.User",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.UserBet",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "models.VerifyRequest",
"... |
34427844204 | import pandas as pd
import numpy as np
import datetime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import colors
import seaborn as sns
from sklearn.preprocessing import LabelEncoder, OneHotEncoder, OrdinalEncoder
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition ... | charanharsha-git/VehicleInsuranceProject | fraud_detection.py | fraud_detection.py | py | 5,440 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
... |
8999801447 | from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
from data_processing.transformers.CommonSimilarity import CommonSimilarity
from data_processing.transformers.ToPandas import ToPandas
from recommend.transformers.CosSimilarity import CosSimilarity
from recommend.transformers.FetchSimil... | arctic-source/game_recommendation | recommend/pipeline.py | pipeline.py | py | 3,726 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.pipeline.Pipeline",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sklearn.compose.ColumnTransformer",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "recommend.transformers.CosSimilarity.CosSimilarity",
"line_number": 52,
"usag... |
17330037248 | import torch
import numpy as np
from scipy import interpolate
def load_pretrained(checkpoint_path, model, simmim):
if not simmim:
load_pretrained_swin(checkpoint_path, model)
else:
load_pretrained_simmim(checkpoint_path, model)
def load_pretrained_swin(checkpoint_path, model):
checkpoint ... | isadrtdinov/ens-for-transfer | models/swin/utils.py | utils.py | py | 6,790 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.interpolate",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Lin... |
27438503281 | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import re
from builtins import str as text
import wx
# -----------------------------------------------------------------------------
# Global variables
# ----------------
#
__author__ = "Pierre Rouleau"
__version__ = "$... | thiagoralves/OpenPLC_Editor | editor/i18n/mki18n.py | mki18n.py | py | 17,501 | python | en | code | 307 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "wx.VERSION",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "wx.App",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "wx.PySimpleApp",
"line_number":... |
22718690979 | import cPickle as pickle
import scipy.io
import numpy as np
import theano.tensor as T
import theano
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from utils import *
#this scrip is designed to produce prediction results from the pickled
#models generated by the utils and cnnlearning scripts... | corentintallec/mlproject2 | code/python/generate_results.py | generate_results.py | py | 2,841 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.concatenate",
... |
17567214725 | import torch
import torch.nn as nn
import numpy as np
import pickle
from utils.utils import NeighborSampler
class MTL(nn.Module):
def __init__(self, base_encoder_k, encoder, view_learner, edge_rnn, sample_time_encoder, len_full_edge,
train_e_idx_l, train_node_set, train_ts_l, e_feat, device, dim... | ViktorAxelsen/TGSL | GraphMixer+TGSL/MTL.py | MTL.py | py | 13,488 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.randn",
"line_numbe... |
32844015163 | from sklearn import preprocessing
import pickle
import joblib
import nltk
import pandas as pd
from flask import Flask,request
"""
string = "infection including flu pneumonia immunization diphtheria tetanus child teething \
infant inflammatory disease including rheumatoid arthritis ra crohn disease blood \
... | azharudh33n/MedConnect | ml/app_api.py | app_api.py | py | 1,991 | python | en | code | null | github-code | 1 | [
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 16,
"usage_type": "call"
},
{
... |
70673992353 | #!/usr/bin/env python
import os
import shutil
import argparse
import subprocess
import random
import pandas as pd
import numpy as np
import pickle as pkl
import scipy as sp
import networkx as nx
import scipy.stats as stats
import scipy.sparse as sparse
from torch import nn
from torch import optim
from torch.nn import ... | KennthShang/PhaBOX | PhaMer_single.py | PhaMer_single.py | py | 7,806 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
28052011409 | from comparison_sol import str_path
#from Global_alignment_MM_functions import seq_to_alignement
from matplotlib import colors
import argparse
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import os
# This is a script to visualize SCRaMbLEd chromosomes using an arrow plot.
# Created by ... | Mmark94/SCRaMbLE-SIM | arrowplot.py | arrowplot.py | py | 7,885 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "comparison_sol.str_path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
2061777653 | from django.conf.urls import url
from . import views
app_name = 'food'
urlpatterns = [
url(r'^order/$', views.order, name="order"),
url(r'^$', views.homepage, name="home"),
url(r'^prepare/$', views.prepare, name="prepare"),
url(r'^success/$', views.success, name="success"),
url(r'^business/$', vie... | rifatblack/Coffee-Shop-System | food/urls.py | urls.py | py | 581 | python | en | code | 6 | github-code | 1 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.co... |
34774711459 | import boto3
import sys
import json
from pygments import highlight, lexers, formatters
from src.s3_event_config import S3EventConfig, TopicConfig, QueueConfig, LambdaConfig
class S3Events:
def __init__(self, client):
self.Config = {}
self.Client = client
def __str__(self, pretty=True):
... | hsk86/s3_event_deploy | src/s3_event.py | s3_event.py | py | 2,330 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.dumps",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygments.highlight",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygments.lexers.JsonLexer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygments.lexe... |
31241017265 | from PyQt5.QtWidgets import QWidget, QLabel, QPushButton
from PyQt5.QtWidgets import QVBoxLayout, QHBoxLayout, QGridLayout
from PyQt5.QtGui import QPixmap, QImage
import numpy as np
class Panel(QWidget):
def __PrivateMethod(self):
print("private method, value of")
return
def __init__(self)... | shane97luo/python_play | face_rec/ui/Panel.py | Panel.py | py | 2,168 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 16,
"usage_type": "name"
},
{
"a... |
37046986835 | from datetime import datetime
from channels.generic.websocket import AsyncJsonWebsocketConsumer
from asgiref.sync import sync_to_async
from .models import Room,Message
class ChatConsumer(AsyncJsonWebsocketConsumer):
async def connect(self):
self.room_name = self.scope['url_route']['kwargs']['room_name']
... | WellingtonNico/django_channels_chat | room/consumers.py | consumers.py | py | 1,307 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "channels.generic.websocket.AsyncJsonWebsocketConsumer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.isoformat",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "na... |
40690193714 | from flask_restplus import Api
from flask import Blueprint
from .offices import offices
from .meetings import meetings
blueprint = Blueprint('api', __name__, url_prefix='/api')
api = Api(
blueprint,
title='Office Data Manager',
description='Manages and provides data about each office, meeting, and sugge... | Larry-Gan/PCS-Node | Back End/office-data-manager/officedatamanager/main/routes/__init__.py | __init__.py | py | 469 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_restplus.Api",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "offices.offices",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "meetings.meetin... |
72116408675 | import torch
import numpy as np
from torch.utils.data import DataLoader
import pandas as pd
from sklearn.model_selection import train_test_split
from keras.datasets import mnist
from torch.autograd import Variable
import matplotlib.pyplot as plt
import torch.nn as nn
import warnings
warnings.filterwarnings("i... | Berkan352/Machine-Learning | CNN.py | CNN.py | py | 3,659 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 14,
"usage_type": "name"
},
{
"api_n... |
30992765140 | from .colors import Color
from fastapi import APIRouter, Response
from jinja2 import Template
from os import path
class SvgResponse(Response):
media_type = "image/svg+xml"
def __init__(self, *args, **kwargs) -> None:
super().__init__(media_type="image/svg+xml", *args, **kwargs)
class Markers:
de... | HakierGrzonzo/PBL-polsl-2022 | backend/backend/markers.py | markers.py | py | 1,298 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "fastapi.Response",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_numb... |
6411650046 | import torch
import torchvision
from torch import nn
from torch.utils.tensorboard import SummaryWriter
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.optim import Adam, SGD
from torch.optim.lr_scheduler import ChainedScheduler, LinearLR, MultiStepLR
import argparse
import os
impor... | rishabbala/Layerwise_model_training | extra_files/contrastive_training.py | contrastive_training.py | py | 13,603 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 53,
"usage_type": "call"
},
{
... |
10541655560 | from collections import deque
N, K = map(int, input().split(' '))
que = deque(list(range(1, N+1))) # 큐로 문제 풀이
tmp_list = []
while que :
que.rotate(-K + 1)
tmp_list.append(str(que.popleft()))
print("<",', '.join(tmp_list),">", sep = '') | Lee-han-seok/Solving_Algorithm_SQL | 백준/Silver/11866. 요세푸스 문제 0/요세푸스 문제 0.py | 요세푸스 문제 0.py | py | 271 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.