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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
42243645300 | import os, fnmatch, sys
import dill as pickle
import scipy.interpolate as interp
import scipy.optimize as opti
import scipy.constants as constants
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import bead_util as bu
import configuration as config
import transfer_func_util as tf
... | charlesblakemore/opt_lev_analysis | scripts/weigh_beads/weigh_bead_efield.py | weigh_bead_efield.py | py | 5,194 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 18,
"usage_type": "name"
},
{
... |
23012310751 | import io
import os
import chess
import chess.pgn
import numpy as np
import tensorflow as tf
from absl.testing import absltest
from chess_ai import feature_converter
from chess_ai.datasets.chess_crawl import chess_crawl
_TEST_DATA_DIR = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../tests/testdata"... | waterhorse1/ChessGPT | chess_ai/feature_converter_test.py | feature_converter_test.py | py | 4,229 | python | en | code | 51 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
74321443942 | from datetime import date, datetime
from flask import abort
from apo import app, db
from apo.models import LostReports
# Constants
LOST_REPORTS_SELECT = db.select(LostReports)
def lost_report_locations_output(locations: str) -> list:
if locations is None:
abort(500)
return locations.split(",")
de... | alpha-phi-omega-ez/apoez.org-flask | apo/helpers/lostreports.py | lostreports.py | py | 6,701 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "apo.db.select",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "apo.models.LostReports",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "apo.db",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.abort",
"line_... |
21536350789 | import os, random, time, copy
from skimage import io, transform
import numpy as np
import os.path as path
import scipy.io as sio
import matplotlib.pyplot as plt
from PIL import Image
import sklearn.metrics
import torch
from torch.utils.data import Dataset, DataLoader
import torch.nn as nn
import torch.optim as optim
f... | ShadeAlsha/LTR-weight-balancing | utils/trainval.py | trainval.py | py | 7,324 | python | en | code | 100 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
35746929366 | # Python imports
import json
import logging
import sys
# Django imports
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
# Models imports
from api.models.dataset_model import Dataset
from api.models.storagehost_model import StorageHost
from api.models.computationhost_model imp... | yorgomoubayed/m2-thesis-project | dataproc/api/views/input_view.py | input_view.py | py | 10,222 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "django.http.Jso... |
31179207142 | from rest_framework.response import Response
from rest_framework import status
import random
import math
RESPONSE_FORBIDDEN = Response(
data={
'msg': 'Fobidden',
'status': 403
}, status=status.HTTP_403_FORBIDDEN
)
RESPONSE_NOT_FOUND = Response (
data={
'msg': 'Not Found',
'... | sudo-datluu/runfinity | backend/api/views/const.py | const.py | py | 1,180 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_403_FORBIDDEN",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.status",
"line_number": 10,
"usage_type": "n... |
23476844064 | import asyncio
from functools import partial
import flet as ft
from loguru import logger
from elite_dangerous_rich_presence.user_controls import (
EliteDangerousOptions,
GeneralOptions,
RichPresenceOptions,
)
from elite_dangerous_rich_presence.util import UiMessages, cancelable
async def close_button(ev... | Lasa2/Elite-Dangerous-Rich-Presence | elite_dangerous_rich_presence/settings_app.py | settings_app.py | py | 3,575 | python | en | code | 25 | github-code | 36 | [
{
"api_name": "flet.ControlEvent",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flet.ControlEvent",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "asyncio.Queue",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "flet... |
7659697862 | # It imports the OpenCV library.
import cv2
# It imports the numpy library, and it renames it to np.
import numpy as np
def stackImages(scale, imgArray):
# Getting the number of rows in the array.
rows = len(imgArray)
# Getting the number of columns in the array.
cols = len(imgArray[0])
# It c... | GurjotSinghAulakh/Python-openCV | 8. Contour - Shape Detection/chapter8.py | chapter8.py | py | 7,093 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.resize",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_GRAY2BGR",
"line_num... |
25532345794 | from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
import vk_api
from PIL import Image,ImageOps, ImageDraw,ImageFont
import requests
from io import BytesIO
import requests
token='27b7ab9bb881978742286fd17cd604145d22f365a8d2f8d8e6bcb149fe87cb86d4aac1e7671f1b43ad0a6'
vk = vk_api.VkApi(token=token)
ses_api= v... | kiritodyat/my-bot-for-vk | get.py | get.py | py | 3,032 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "vk_api.VkApi",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "vk_api.bot_longpoll.VkBotLongPoll",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "vk_api.VkUpload",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "reques... |
27477035562 | from django.shortcuts import render
from django.shortcuts import render, redirect
from . forms import CreateUserForm, LoginForm, UpdateUserForm, UpdateProfileForm
from . models import Profile
from django.contrib.auth.models import auth
from django.contrib.auth import authenticate, login
from django.contrib.auth.decora... | AdirNoyman/DjangOnAWS_bootcamp2 | appy/lynx/views.py | views.py | py | 3,824 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "forms.CreateUserForm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "forms.CreateUserForm",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mod... |
71551411944 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/9/9 下午11:19
# @Author : Bear Chao
# @Site : http://blog.nickzy.com
# @File : ultraflightMP.py
# @Software: PyCharm
import requests
url = 'http://139.199.212.48:8080/'
def check_ufmp_status():
r = requests.get(url)
if r.status_code == 200:
... | BearChao/cheduler | tasks/ufmp.py | ufmp.py | py | 375 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
}
] |
16738098260 | from datetime import datetime
registro = {}
print('='*30,'> Carteira de Trabalho <','='*30)
registro['nome'] = str(input('Digite seu nome:'))
nasc = int(input('Digite seu ano de nascimento: '))
registro['idade'] = datetime.now().year - nasc
registro['ctps'] = int(input('Digite o número da sua carteira de trabalho(0 pa... | TiagoFar/PythonExercises | ex092.py | ex092.py | py | 726 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.... |
347769393 | from PySimpleGUI import PySimpleGUI as sg
import pyautogui as ag
from time import sleep
def automatic(nf, frota, fornecedor, responsavel, saude, educacao, outros, viagemSim, qtd, data, preco, obs, km):
if (viagemSim == True):
precoViagem = sg.popup_get_text('Preço da viagem: ')
# saindo do automa... | GuiGolfeto/AppAlmoxarifado | screen/cadastro.py | cadastro.py | py | 6,592 | python | pt | code | 1 | github-code | 36 | [
{
"api_name": "PySimpleGUI.PySimpleGUI.popup_get_text",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.PySimpleGUI",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 11,
"usage_type": "call"
},
{
"api_name"... |
4714720771 | import copy
import pathlib
import operator
import textwrap
import itertools
import functools
from termcolor import colored
from clldutils.iso_639_3 import ISO, download_tables
def sprint(text, *args, **kw):
if not isinstance(text, str):
text = '{0}'.format(text)
if args:
text = text.format(*a... | glottolog/pyglottolog | src/pyglottolog/util.py | util.py | py | 3,364 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "termcolor.colored",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "textwrap.wrap",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
18076214456 | import re
import requests
import json
from requests.exceptions import RequestException
from bs4 import BeautifulSoup
import lxml
def get_page(url):
try:
headers = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36'}
... | sky19890315/PHP-MYSQL-JS | microsky/spider/sp3.py | sp3.py | py | 1,334 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.RequestException",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "r... |
71878929703 | import requests
from bs4 import BeautifulSoup
from encrypt import *
from typing import Dict
from urllib import parse
import logging
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36",
"Accept": "text/html,application/... | haowang-cqu/CourseMonitor | login.py | login.py | py | 4,442 | python | en | code | 13 | github-code | 36 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "requests.Session",
... |
71878708903 | #!/usr/bin/python
import sys
import logging
from random import randint
from dataclasses import dataclass, field
from typing import Optional, List
import datasets
import numpy as np
from datasets import load_dataset, load_metric
import transformers
from transformers import (
AutoConfig,
AutoModelForTokenClassif... | haowang-cqu/graduation-project | fine-tune/ner/run_ner.py | run_ner.py | py | 9,700 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dataclasses.field",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Opti... |
16768433234 |
import requests
def get_goods_id(session, goodsid):
"""查询商品"""
url = "http://49.235.92.12:7005/api/v2/goods/%s"%goodsid
r = session.get(url)
print("查询结果:%s" % r.text)
return r
def add_goods(session,
goodscode="sp_111",
goodsname="商品_test",
**kwargs):
... | aliyaliang/pytest_api | api/goods.py | goods.py | py | 1,527 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.session",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "api.login.login",
"line_number": 52,
"usage_type": "call"
}
] |
18521234605 | '''10_1 K-均值聚类支持函数
2019_11_25
'''
import numpy as np
import math
import random
import matplotlib.pyplot as plt
def loadDataSet(fileName):
dataMat = []
fr = open(fileName)
for line in fr.readlines():
curLine = line.strip().split('\t')
fltLine = list(map(float, curLine))
dataMat.appe... | DonghuiJin/Machine_Learning_In_Action | kMeans_10/kMeans.py | kMeans.py | py | 13,366 | python | zh | code | 1 | github-code | 36 | [
{
"api_name": "numpy.sqrt",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 48,... |
6324925248 | # -*- coding: utf-8 -*-
from sklearn.datasets.samples_generator import make_blobs
from sklearn.cluster import KMeans
if __name__ == '__main__':
x, y = make_blobs(n_samples=200, n_features=2, centers=4, cluster_std=1, center_box=(-10.0, 10.0), shuffle=True, random_state=1)
model = KMeans(n_jobs=-1)
for i i... | GoogleLLP/SGCC-BigData-Exercise | chapter11/exercise18.py | exercise18.py | py | 418 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "sklearn.datasets.samples_generator.make_blobs",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 8,
"usage_type": "call"
}
] |
15264960014 | from django.core.mail import EmailMessage
def send_mail():
'''Отправлячем уведомление на мою почту'''
email = EmailMessage(
subject = 'Новое сообщение',
body = F'Привет!У нас там новое сообщение',
from_email = 'info@citrom.ru',
to = ("untiwe@gmail.com",)
)
em... | untiwe/citrom_test | aboutus/package.py | package.py | py | 403 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "django.core.mail.EmailMessage",
"line_number": 8,
"usage_type": "call"
}
] |
36121320813 | from typing import Dict
from forte.utils import create_import_error_msg
from forte.common.configuration import Config
from forte.models.ner.conditional_random_field import ConditionalRandomField
try:
import torch
import torch.nn.functional as F
import torch.nn.utils.rnn as rnn_utils
from torch import n... | asyml/forte | forte/models/ner/model_factory.py | model_factory.py | py | 9,176 | python | en | code | 230 | github-code | 36 | [
{
"api_name": "forte.utils.create_import_error_msg",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typ... |
15472555384 | from iotutils_neopixel import Neopixel
from colorzero import Color, Hue
import time
ledCount = 10
ledPin = 18
degreeAdjustment = 360/ledCount
neop = Neopixel(ledCount, ledPin)
firstColor = Color("red")
for ledId in range(ledCount):
degree = ledId * degreeAdjustment
neop.setColor(ledId, firstColor + Hue(deg=... | HSSBoston/smart-earring | code/rainbow-dropping.py | rainbow-dropping.py | py | 504 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "iotutils_neopixel.Neopixel",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "colorzero.Color",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "colorzero.Hue",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
39277791022 | import os
import tempfile
from PIL import Image
class Generator(object):
def __init__(self, name, defaults):
self.defaults = {
"frame_duration": 50
}
self.defaults.update(defaults)
self.name = name
def generate(self, original_name, input_path, output_dir, options)... | grdaneault/emojigen | api/generators/generator.py | generator.py | py | 1,643 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PIL.Image.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number":... |
783702878 | import sqlalchemy
from sqlalchemy import MetaData, Table, String, Integer, Column, Text, DateTime, Boolean, BigInteger, ForeignKey, Date,\
SmallInteger
from datetime import datetime
from sqlalchemy import create_engine
# Подключение к серверу PostgreSQL на localhost с помощью psycopg2 DBAPI
engine = create_engine(... | PeyoteWilliams/OrganizerBot | db_create.py | db_create.py | py | 1,355 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalche... |
4428273426 | # -*- coding: utf-8 -*-
from django.shortcuts import render,redirect
### one-time flash messages
from django.contrib import messages
from django.db.models import Count
from .models import *
def index(request):
return render(request,'login_registration_app/index.html')
def createUser(request):
if request.method != '... | rhuidean/django_review | apps/login_registration_app/views.py | views.py | py | 1,934 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 18,
"usage_type": "call"
},
{
"api_na... |
25305984887 | __author__ = 'diegopinheiro'
from initialization_strategies.initialization_strategy import InitializationStrategy
from common.attribute import Attribute
from common.attribute_converter import AttributeConverter
from common.float_converter_2 import FloatConverter2
from genetic_algorithms.individual import Individual
im... | diegompin/genetic_algorithm | initialization_strategies/data_initialization.py | data_initialization.py | py | 2,950 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "initialization_strategies.initialization_strategy.InitializationStrategy",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "initialization_strategies.initialization_strategy.InitializationStrategy.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"ap... |
1693240144 | from tkinter import *
import pytesseract
import cv2
import pyscreenshot
pytesseract.pytesseract.tesseract_cmd = "D:/Program Files/Tesseract-OCR/tesseract.exe"
window = Tk()
def paint(event):
color = 'black'
x1, y1 = (event.x-1),(event.y-1)
x2, y2 = (event.x+1),(event.y+1)
Canvas1.create_oval(x1, y1, ... | Computer4062/Python-Projects | MathPad/MathPad.py | MathPad.py | py | 4,934 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyscreenshot.grab",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor... |
3045874520 | #Parse Code Coverage json file from SFDX Cli
import os
import os.path
from os import path
import sys
import json
import math
#take args from std in
filepath = sys.argv[1]
with open(filepath) as f:
tests = json.load(f)
#open file for writing
dirPath = input("Enter file output dir: ")
filePath = dirPath+'.txt'
... | bspeelm/SFDX_CC_Tool | SFDX_CC_Parser.py | SFDX_CC_Parser.py | py | 1,020 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
10408549623 | import numpy as np
import math
import scipy
from stl import mesh
from mpl_toolkits import mplot3d
from matplotlib import pyplot
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from scipy.interpolate import griddata
import matplotlib.pyplot as plt
from pyquaternion import Quaternion
equidistant_step_size = 3
p... | manuelEAProject/EAProject | stl_preprocessing_Wenzel.py | stl_preprocessing_Wenzel.py | py | 101,321 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.asarray",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "stl.mesh.Mesh.from_file",
... |
35563148498 |
from keras.preprocessing import image
from keras.preprocessing.image import load_img, img_to_array
from keras import models
import numpy as np
import matplotlib.pyplot as plt
import os
img_path = 'cats_and_dogs_small/test/cats/cat.1502.jpg'
model_path = '02_cats_and_dogs_small_2.h5'
now_path = os.ge... | yasaisen/try_keras | 02_lab/layer_output.py | layer_output.py | py | 1,981 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number":... |
74667028905 | # -*- coding: utf-8 -*-
# https://mathmod.deviantart.com/art/Pseudo-Hopf-Tori-565531249
import os
from math import pi, atan2, asin, sqrt, cos, sin
import numpy as np
import pyvista as pv
import quaternion
def quaternion2hab(q):
"Quaternion to heading, attitude, bank"
c = 180 / pi
t = q.x*q.y +... | stla/PyVistaMiscellanous | pseudoHopfTorus_anim.py | pseudoHopfTorus_anim.py | py | 3,991 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "math.pi",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "math.atan2",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.atan2",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.atan2",
"line_number": 23,
... |
6141168752 | from sklearn import datasets, model_selection, metrics
from sklearn.externals import joblib
from sklearn.linear_model import LogisticRegression
iris = datasets.load_iris()
X = iris.data
y = iris.target
X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.3, shuffle=True, random_state=... | 10kaoru12/4y-university-information-recommender-system | 3/samplecode_201904_v1/chapter07/train.py | train.py | py | 558 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 9,
"usage_type": "call"
},
{
... |
14292500742 | import numpy as np
import matplotlib.pyplot as plt
def plot_sun(sunposition, d):
'''
'''
fig = plt.figure(figsize=d['figsize'])
tks = [np.deg2rad(a) for a in np.linspace(0,360,8,endpoint=False)]
xlbls = np.array(['N','45','E','135','S','225','W','315'])
ax = fig.add_subplot(111, projection='... | cisaacstern/horpyzon | _plot.py | _plot.py | py | 897 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.deg2rad",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.linspace... |
22555828419 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
# odczyt danych
film_data = pd.read_csv('MoviesOnStreamingPlatforms_updated.csv')
# Czyszczenie wierszy z pustymi warościami.
film_data.dropna(inplace=True)
# Usunięcie zbędnych kolumn
film_data.drop(film_data.... | jarmosz/ium_CML | get_data.py | get_data.py | py | 1,385 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 22,
"usage_type": "name"
},
{
"api_name"... |
11532751793 | import os
import re
from typing import TypeVar, Optional
from argparse import ArgumentParser, Namespace
from urllib.request import urlopen
from pathlib import Path
from hashlib import sha256
ARTIFACTS = [
"opa_darwin_amd64",
"opa_darwin_arm64_static",
"opa_linux_amd64",
"opa_linux_amd64_static",
"o... | ticketmaster/rules_opa | tools/opa_upgrade.py | opa_upgrade.py | py | 3,005 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "typing.TypeVar",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "urllib.request.... |
34796837508 | # load packages
import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import MaxNLocator
from scipy.optimize import curve_fit
from tqdm import tqdm
from scipy.signal import find_peaks
plt.close('all')
#%% Define functions used in this code
... | meaton212/Raman_Code_Analysis | Python Code/RamanAnalysis_nanomaterials.py | RamanAnalysis_nanomaterials.py | py | 42,378 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "scipy.signal.find_peaks",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "num... |
8172670109 | from __future__ import absolute_import
from __future__ import division
import os
import sys
import argparse
__author__ = "Jonathan Madsen"
__copyright__ = "Copyright 2020, The Regents of the University of California"
__credits__ = ["Jonathan Madsen"]
__license__ = "MIT"
__version__ = "@PROJECT_VERSION@"
__maintainer_... | NERSC/timemory | timemory/analyze/__init__.py | __init__.py | py | 8,843 | python | en | code | 328 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI.COMM_WORLD.Get_rank",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "mpi4py.... |
20637675592 | #!/usr/bin/env python
# coding: utf-8
# In[2]:
import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel('Dataset.xlsx', index = None)
df.head()
G=nx.from_pandas_edgelist(df, 'Departure Station', 'Arrival Station','Time of Travel')
nx.draw(G, with_labels=False)
df['Route'] = df['D... | aseemkc/Travel-Planner1 | Travel Planner/Algorithm.py | Algorithm.py | py | 1,280 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_excel",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.from_pandas_edgelist",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "networkx.draw",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "network... |
16313772281 | import requests
_BASE_WORD_URL = 'http://www.dictionary.com/browse/'
_DEFAULT_HEADERS = {
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36',
'host': 'www.dictionary.com'
}
_DEFAULT_AUDIO_HEADERS = {
'user-agent': 'Mozilla/5.0 (Wind... | mradlinski/dictcom | dictcom/download.py | download.py | py | 807 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
}
] |
24807681148 | #!/usr/bin/env python
# coding: utf-8
# In[93]:
import numpy as np
import networkx as nx
import pandas as pd
import time
# # Load ca-GrQc
# In[94]:
def load_ca_grqc():
data = pd.read_csv('CA-GrQc.txt', sep="\t", skiprows=3)
records = data.to_records(index=False)
edges = list(records)
G = nx.DiGr... | wxEdward/cs599hw1 | script/problem3.py | problem3.py | py | 10,715 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "networkx.Graph",
... |
13217323943 |
# coding: utf-8
# In[ ]:
# In[29]:
#起始標準起手式~
import requests as rq
from bs4 import BeautifulSoup as bs
from collections import OrderedDict as od
import json
import csv
import traceback as tb
import re
# In[30]:
HOST = 'http://www.dodocook.com/recipe/'
# In[31]:
#def dodocook_crawler(開始文章ID,結束文章ID)
def ... | nick800608/TeamProject-FoodRecipe | dodocook_cralwer.py | dodocook_cralwer.py | py | 2,435 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
"line_number": 63,
"usage_type": "call"
}
] |
30389595402 | import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
import csv
FILE_PATH = "C:\\data\\fh_mal_train"
GRAPH_PATH = "C:\\code\\count_mal.pickle"
def get_size(start_path = '.'):
total_size = 0
total_count =0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filen... | siklee/mal_deep | check_file.py | check_file.py | py | 2,063 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.walk",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.getsize",
"line_number"... |
34036855952 | # Задание №1
from sys import argv
hours_worked_out, rate_for_the_time, prize = argv
hours_worked_out = int(hours_worked_out)
rate_for_the_time = int(rate_for_the_time)
prize = int(prize)
result = int(hours_worked_out * rate_for_the_time + prize)
print(f"Зраработная плата сотрудника составит - {result}")
# Задание №2
... | TBidnik/python | lesson_4_hw.py | lesson_4_hw.py | py | 2,236 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "functools.reduce",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "itertools.count",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "itertools.cycle",
"line_... |
24630926789 | from database.database import Databases
import uuid
import time
class scoreDB(Databases):
def __init__(self):
super().__init__()
self.avg_score_table = "avg_score"
self.realtime_score_table = "realtime_score"
self.subject_name_table = "subject"
self.user_subject_rel = "user_... | kojunseo/TTancent | web/database/score.py | score.py | py | 5,238 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "database.database.Databases",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "time.localtime",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
... |
29612486523 | from collections import deque
# recursive solution
""" runtime O(n), space O(n) """
def getHeight(root):
if not root:
return 0
return 1 + max(getHeight(root.left), getHeight(root.right))
# max height of the tree should be max height of stack
""" runtime O(n), space O(n) """
def getHeight_iter(root):
... | jungwook-lee/coding-practice | tree/getHeight.py | getHeight.py | py | 700 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 16,
"usage_type": "call"
}
] |
17701301018 | from cgi import print_environ
import torch
from collections import OrderedDict
from maml import MAML
def adaptation(model, optimizer, train_x,train_y, val_x,val_y, loss_fn, lr, train_step, train, device):
predictions = []
labels = []
epoch_loss = 0
# x_train, y_train = trainbatch #x_train テンソル化... | fukitani/MAML_AD | train.py | train.py | py | 3,833 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.OrderedDict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.autograd.grad",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.autograd",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "colle... |
39556047469 | # This is the model that agent acts on.
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import math
class DownsampleB(nn.Module):
def __init__(self, nIn, nOut, stride=2):
super(DownsampleB, self).__init__()
... | chrisVat/GumDrop | network.py | network.py | py | 5,534 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.AvgPool2d",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
3106439706 | import argparse
import json
import os
import re
import time
from simplex_sdk import SimplexClient
from car_rewrite_model.model import CarRewriteSynonymsReplace, CarRewriteBaseKeywordsNewProcess
# phrases_before_colon_file='/data/share/liuchang/car_rewirte_compare/remove_words'
# with open(phrases_before_colon_file,... | flyliu2017/car_rewrite_model | tests/local_predict.py | local_predict.py | py | 5,639 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.split",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "car_rewrite_model.model.CarRewriteSynonymsReplace",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 66,
"usage_type": "call"
},
{
"api_name"... |
36631030239 | import argparse
from pathlib import Path
import numpy as np
from localisation import run_convergence_localisation_on_file, run_localisation_on_file
import Models.models as models
import Utils.constants as const
from plotting import parameter_plot, comparison_plot, plot_evaluation_metric
def rmse(predictions: dict):
... | TechTurtle11/ble-geolocation | src/evaluate.py | evaluate.py | py | 10,742 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line... |
30072780652 | # -*- coding: utf-8 -*-
""" Download excel files and transform to correct format in csv files. """
""" Excel files are linked in href attribute of <a> elements in the given URL (Not nested URLs)"""
""" Each station, in stations array, is linked to a numerical code in this file"""
""" Longitude and latitude and locati... | CUTLER-H2020/DataCrawlers | Environmental/thess_env_cityofthess_dailyyearly.py | thess_env_cityofthess_dailyyearly.py | py | 12,139 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "urllib.reques... |
15860824543 | import logging
import scrapy
from crawler.items import MusicItem, ArtistItem
from crawler.spiders.base import BaseSpider
class ZkSpider(BaseSpider):
name = 'zk'
allowed_domains = ['zk.fm']
handle_httpstatus_list = [304, 404]
base_url = 'https://zk.fm'
count_page = 10 ** 6
def start_requests... | Arthur264/music_data | code/crawler/spiders/zk.py | zk.py | py | 2,581 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "crawler.spiders.base.BaseSpider",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scrapy.Request",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "logging.e... |
31313726066 | import json
import os
from dataclasses import dataclass
from typing import Any, List
import fire
import tinytuya
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SNAPSHOTFILE = '%s/setup/snapshot.json' % ROOT_DIR
rainbow = {
'red': [255, 0, 0],
'orange': [255, 127, 0],
'yellow': [25... | paraizofelipe/py_iot | py_iot/local.py | local.py | py | 2,821 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line_numb... |
70990945383 | import torch
import torch.nn.functional as F
from torch import nn
from torch import optim
from torch.distributions import Categorical
import numpy as np
import matplotlib.pyplot as plt
from statistics import stdev, mean
import multiprocessing
import gym
from model import Network
from utils import set_seed
def plo... | dylanamiller/actor_critic | actor_critic.py | actor_critic.py | py | 3,065 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matpl... |
13431297301 | import cv2
import boto3
import numpy as np
from botocore.exceptions import NoCredentialsError
# AWS S3 접근 정보 설정
ACCESS_KEY = '보호처리'
SECRET_KEY = '보호처리'
BUCKET_NAME = '보호처리'
OBJECT_NAME = '보호처리'
# S3 클라이언트 초기화
s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY)
try:
# S3 버킷에서 이... | kmyobin/capstone_demo_web | image_download.py | image_download.py | py | 913 | python | ko | code | 0 | github-code | 36 | [
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.frombuffer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cv2.imdecode",
"li... |
14379387806 | import json
from typing import List
from django.forms import model_to_dict
from wagtail.contrib.routable_page.models import RoutablePageMixin
from wagtail.core.models import Page
from main.models import Thematic
from main.models.country import Country
from main.models.country import WorldZone
from main.models.models ... | TelesCoop/geodev | main/models/resources_page.py | resources_page.py | py | 1,959 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "wagtail.contrib.routable_page.models.RoutablePageMixin",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "wagtail.core.models.Page",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
}... |
72774363945 | # This modules reads data from already collected data from APIF and transfer it to our DB hosted with
# MongoDB
import json
from DataBaseObjects.DataBaseObjects import FixtureResult
from pymongo import MongoClient
for season in range(2011, 2020):
# Load file (Static process for now)
file = open(f"C:\\Users\\rferre... | SigmaFireFox/SigmaFox | apps/eleven10ths/src/app/11sixteen-desktop-app/DatabaseBuilding/API-Football.com-FixtureResults-TxtToDB.py | API-Football.com-FixtureResults-TxtToDB.py | py | 1,380 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "DataBaseObjects.DataBaseObjects.FixtureResult",
"line_number": 21,
"usage_type": "call"
},
{
"api_... |
12366554892 | # -*- coding: utf-8 -*-
#
# AMPLE documentation build configuration file, created by
# sphinx-quickstart on Thu May 26 11:57:09 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | rigdenlab/ample | docs/conf.py | conf.py | py | 12,912 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"... |
74223738662 | from calendar import c
from pathlib import Path
import tempfile
import mlflow
import pandas as pd
from src.modelling.evaluating.eval import evaluate
from src.modelling.model.model import Model
from src.utils.config import Config
from src.utils.utils import create_artifact
class MlFlowModel(mlflow.pyfunc.PythonModel):... | DaveFantini/ML-template | src/utils/mlflow.py | mlflow.py | py | 4,018 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mlflow.pyfunc",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "src.modelling.model.model.Model",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name... |
4004022772 | from collections import namedtuple
from test.mock import MockArgs
import os
import proze
import unittest
# The output of all test projects are compiled to the same file.
OUTPUT_PATH = 'test/sample/tmp/output.txt'
Case = namedtuple('Case', ['root_path', 'expected_output'])
dark_and_stormy = Case(
'test/sample/dark... | RobotNerd/proze-python-converter | test/test_compile_text.py | test_compile_text.py | py | 3,295 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.namedtuple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "test.mock.Moc... |
8446011858 | import unittest
import numpy
from cupy import testing
@testing.parameterize(*testing.product({
'decimals': [-2, -1, 0, 1, 2],
}))
class TestRound(unittest.TestCase):
shape = (20,)
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(atol=1e-5)
def test_round(self, xp, dtype):
if dtyp... | cupy/cupy | tests/cupy_tests/core_tests/test_ndarray_math.py | test_ndarray_math.py | py | 3,529 | python | en | code | 7,341 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.bool_",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cupy.testing.shaped_random",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cu... |
8023958832 | import matplotlib.pyplot as plt
import compiled
def draw():
x_points = []
y_points = []
for x in range(-1000, 1000):
try:
y_points.append(compiled.compiled_func(x))
x_points.append(x)
except:
print("Error, posible discontinuidad en: ", x)
plt.scatte... | danieltes/tp_solver | draw.py | draw.py | py | 357 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "compiled.compiled_func",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "ma... |
23950768357 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup script
"""
from setuptools import setup
import os
def read(fname):
"""returns the text of a file"""
return open(os.path.join(os.path.dirname(__file__), fname), 'r').read()
def get_requirements(filename="requirements.txt"):
"""returns a list of al... | nightvisi0n/dockgraph | setup.py | setup.py | py | 1,496 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"lin... |
4391861651 | import torch, torchvision
from torch import nn
img_hidden_sz = 512
num_image_embeds = 5
#?? 8907
n_classes = 8790
img_embed_pool_type = 'avg'
class ImageEncoder18(nn.Module):
def __init__(self):
super(ImageEncoder18, self).__init__()
model = torchvision.models.resnet18(pretrained=True)
m... | harveyaot/AlphaTaiBai | azure-functions-python/imgclf/model.py | model.py | py | 1,576 | python | en | code | 24 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torchvision.models.resnet18",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision... |
36255605610 | from .models import Doc, FileCabinet, Block, Reg
# from users.serializers import NotifSerializer
from users.models import Notif
from rest_framework import serializers
import datetime
from django.utils import timezone
class FileCabinetSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = F... | Spanri/edsm-v1 | docs/serializers.py | serializers.py | py | 2,214 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.FileCabinet",
"line_number": 10,
"usage_type":... |
16020153398 | import unittest
import sqlite3
import json
import os
import matplotlib.pyplot as plt
import requests
import plotly.graph_objects as go
import plotly.express as px
import pandas as pd
import csv
# starter code
def setUpDatabase(db_name):
path = os.path.dirname(os.path.abspath(__file__))
conn = sql... | lbibbo6012/2022-finalproject | calculate.py | calculate.py | py | 5,532 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"l... |
8285806055 | import logging
import sqlite3
from sqlite3 import Error
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
class RecordsHandler:
def __init__(self, db_file):
self.sql_create_projects_table = """ CREATE TABLE IF NOT EXISTS Records (
id integ... | pauligb/TC4002.1_Analisis_Diseno | Lab3/src/records_handler.py | records_handler.py | py | 2,868 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
40885550378 | import os
import logging
import shutil
import tempfile
import json
from urllib.parse import urlparse
from pathlib import Path
from typing import Tuple, Union, IO
from hashlib import sha256
from nlp_architect import LIBRARY_OUT
from nlp_architect.utils.io import load_json_file
import requests
logger = logging.getLogg... | IntelLabs/nlp-architect | nlp_architect/utils/file_cache.py | file_cache.py | py | 5,769 | python | en | code | 2,921 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nlp_architect.LIBRARY_OUT",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pathlib.Path... |
13225956088 | import xml.sax
from itertools import accumulate
import logging
import os
from collections import OrderedDict
class XMLHandler(xml.sax.ContentHandler):
def __init__(self):
self.CurrentData = ""
self.date = ""
self.post_date = ""
self.debit_credit_flag = ""
self.response_... | cathrinejchristy/Automation | XmlCompare_test.py | XmlCompare_test.py | py | 13,268 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "xml.sax.sax",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "xml.sax",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number... |
678009931 | import os
import sys
sys.path.append('..')
sys.path.append('../..')
import argparse
import utils
from tsp_helper import *
from student_utils import *
OUTPUT_FILENAME = "naive_output.txt"
"""
======================================================================
Complete the following function.
=====================... | anniezhang21/carpool-problem | irrelevant/naive_solver.py | naive_solver.py | py | 6,380 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
205804702 | import torch
import torch.nn as nn
from transformers import BertModel
class SentimentClassifier(nn.Module):
def __init__(self, freeze_bert = True):
super(SentimentClassifier, self).__init__()
#Instantiating BERT model object
self.bert_layer = BertModel.from_pretrained('bert-base-uncased')... | kabirahuja2431/FineTuneBERT | src/model.py | model.py | py | 1,191 | python | en | code | 44 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "transformers.BertModel.from_pretrained",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tr... |
37937108471 | from dataclasses import dataclass
import os
import sys
import time
from datetime import datetime
import tempfile
import shutil
import json
from fastapi import APIRouter, HTTPException, UploadFile, Response
from app.controllers.processors import image as PI
from app.core import logger
from app.utils import utilities as... | KiranCHIHX/Handwritten | app/api/hw_classifier.py | hw_classifier.py | py | 3,047 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "fastapi.UploadFile",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "time.time",
... |
35112699995 | # implements Kafka topic consumer functionality
import os
import threading
from confluent_kafka import Consumer, OFFSET_BEGINNING
import json
from producer import proceed_to_deliver
import base64
import subprocess
UPDATE_CWD = "updater/"
STORAGE_PATH = "tmp/"
UPDATE_SCRIPT_NAME = "./update-and-restart-app.sh"
APP_PAT... | sergey-sobolev/secure-update | updater/consumer.py | consumer.py | py | 4,295 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "base64.b64decode",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"li... |
7231791491 | import json
from glob import glob
import yaml
def get_problems_by_name(response_file):
with open(response_file) as f:
response = json.load(f)
def get_name(place):
return place.get("permalink", place.get("id"))
name_to_problems = {
get_name(place): place["districtingP... | districtr/districtr-process | scripts/add_problems.py | add_problems.py | py | 974 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "yaml.safe_dump",
"line_number":... |
28866132568 | import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler, LabelEncoder, OneHotEncoder
from scipy import stats
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import make_pipeline
from sklearn.metrics ... | Pain122/MLAssignment1 | script.py | script.py | py | 6,330 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sklearn.preproc... |
40922739466 | from typing import List
import numpy as np
from advent2022 import utils
DAY = 9
def load_and_parse_data(day: int, test: bool = False) -> List[str]:
data = utils.get_input(day, test)
return [l.split(" ") for l in data]
def new_pos(h, t):
if abs(h[0] - t[0]) > 1 or abs(h[1] - t[1]) > 1:
for move_... | c-m-hunt/advent-of-code-2022 | advent2022/day9.py | day9.py | py | 1,434 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "advent2022.utils.get_input",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "advent2022.utils",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
... |
15024245302 | import os
from tqdm import tqdm
import datetime
import pandas as pd
import logging
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s',
level=logging.INFO,
# datefmt='%d-%b-%y %H:%M:%S'
)
def get_date_df(file_folder, days):
... | wenyuan-wu/corpus_preprocess_dong | sort_by_day.py | sort_by_day.py | py | 2,760 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tqdm.tqdm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_... |
30699830411 | from django.shortcuts import render, get_object_or_404
from zoo.models import Category, Product
from django.views.generic import ListView
from django.core.paginator import Paginator
from zoo.forms import ZooSearchForm
class CategoryListView(ListView):
model = Product
template_name = 'catalog.htm... | Yurevtsev13Pavel/zoolavka | zoo/views.py | views.py | py | 2,283 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "zoo.models.Product",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.core.paginator.Paginator",
"line_number": 21,
"usage_type": "call"
},
{
"a... |
18824343900 | import unittest
import importlib
import mock
import datetime
from oslo_utils import timeutils
evacuate_lbaas = importlib.import_module("neutron-evacuate-lbaasv2-agent")
class FakeSqlResult():
def fetchall(self):
return [
['1', 'healthy', timeutils.utcnow()],
['2', 'dead', timeuti... | skazi0/cookbook-openstack-network | files/default/test-neutron-evacuate-lbaasv2-agent.py | test-neutron-evacuate-lbaasv2-agent.py | py | 2,753 | python | en | code | null | github-code | 36 | [
{
"api_name": "importlib.import_module",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "oslo_utils.timeutils.utcnow",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "oslo_utils.timeutils",
"line_number": 14,
"usage_type": "name"
},
{
"api_name"... |
37823447895 | """Engi Init
Walks through the setup enabling a user to work with ENGI.
Usage:
engi init
engi (-h | --help)
engi --version
Options:
-h --help Show this screen
"""
from git import Repo
from gitsecrets import GitSecrets
import gnupg
import os
import re
import sys
from pathlib import Path
import ... | engi-network/cli | src/engi_cli/engi_init.py | engi_init.py | py | 3,737 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "gnupg.GPG",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "re.fullmatch",
"line_number":... |
41892613658 | from django.db.models.signals import pre_save
class Profile(models.Model):
to_receive_new_user = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
@receiver(pre_save, sender=User)
def update_profile(sender, instance, **kwargs):
instance.to_receive_new_user = ... | Horlawhumy-dev/earthly-django-signals-article | pre_save.py | pre_save.py | py | 367 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "django.db.models.signals.pre_save",
"line_number": 7,
"usage_type": "argument"
}
] |
31279498412 | from minio import Minio
import redis
import time
import json
APP = "wc"
minio_client = Minio("minio-service.yasb-mapreduce-db.svc.cluster.local:9000", access_key="admin123", secret_key="admin123", secure=False)
redis_client = redis.Redis(host="redis.yasb-mapreduce-db.svc.cluster.local", port=6379)
def handle(req):
... | tju-hwh/Yet-Another-Serverless-Benchmark | mapreduce/openfaas/wc/functions/wc-mapper/handler.py | handler.py | py | 2,118 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "minio.Minio",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 21,
... |
74112522982 | from rest_framework import routers
from .viewsets import CustomUserViewSet, AccountViewset
from django.urls import path
from . import views
urlpatterns = [
path( 'user/login', views.login ),
path( 'user/register', views.Register ),
path( 'account/getAccount', views.getAccountByEmail ),
path( 'account/... | cacero95/LocalTelBack | locatelBank/bank/urls.py | urls.py | py | 556 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
27549716670 | import re
import sys
import datetime
from itertools import zip_longest
from email.utils import getaddresses, parsedate_to_datetime
from email.header import decode_header, Header
from typing import AnyStr, Union, Optional, Tuple, Iterable, Any, List, Dict, Iterator
from .consts import SHORT_MONTH_NAMES, MailMessageFlag... | ikvk/imap_tools | imap_tools/utils.py | utils.py | py | 7,673 | python | en | code | 608 | github-code | 36 | [
{
"api_name": "typing.Union",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Iterable",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "re.search",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": ... |
6482852553 | #pip install opencv-python
import cv2
webcam = cv2.VideoCapture(0)
try:
if webcam.isOpened():
validacao, frame = webcam.read()
cv2.imwrite("testeWebcam.png", frame)
webcam.release()
cv2.destroyAllWindows()
except:
print("Não foi possível abrir a câmera.") | msullivancm/ProjetosComAte10LinhasDeCodigoPython | FotoSurpresa.py | FotoSurpresa.py | py | 293 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"line_number": 11,
"usage_type": "call"
}
] |
22439806116 | import os
import torch
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from .. import config as conf
processed_data_dir = conf.processed_data_dir
raw_data_dir = conf.raw_data_dir
# Create the directories if they don't exist
os.makedirs(raw_data_dir, exist_ok=True)
os.makedirs... | ayush0O7/Handwritten-Digit-Recognition | Handwritten_digit_recognition/src/data/download_mnist.py | download_mnist.py | py | 1,360 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.makedirs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.tr... |
27918407911 | # Python 3.5.1 tested
#
# If downloaded set is out of date, ie. does not contain most recent comic
# then the comics since most recently downloaded will be downloaded.
# If however the most recent comic is present, the script will scan all
# previous comics, ensuring ALL of them are present
#
# It is possible that scri... | MikeCroall/xkcd-crawler | xkcd_crawler.py | xkcd_crawler.py | py | 2,877 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
41332456125 | # coding=utf-8
import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt
import collections
import pprint as pp
from scipy.stats import gaussian_kde
from numpy import arange
def violin_plot(ax,data,pos, bp=False):
'''
create violin plots on an axis
'''
dist = max(pos)-min(pos)
w = min(0.15*max(dist,1.0),... | mimi33/DiplomskiProjekt | testing/5.velPop/boxplot.py | boxplot.py | py | 2,615 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scipy.stats.gaussian_kde",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "xml... |
4875660942 | import os
from django.conf import settings
from django.shortcuts import render, redirect
import face_recognition
import numpy as np
import cv2
from os.path import dirname, join
from django.apps import apps
from django.core.files.storage import FileSystemStorage
from django.contrib.auth.views import LoginView
from djang... | hashir-ashraf/Attendance-System | AttendanceSystem/Instructor/views.py | views.py | py | 6,146 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.views.LoginView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 24,
"usage_type": "call... |
837645453 | from http.server import HTTPServer, BaseHTTPRequestHandler
import sys, io, json, cgi
import MolDisplay, molsql, molecule
# Create DB
db = molsql.Database(reset=True)
db.create_tables()
# Set our default element values
db['Elements'] = (1, 'H', 'Hydrogen', 'FFFFFF', '050505', '020202', 25)
db['Elements'] = (6, 'C', '... | acandrewchow/Molecule-Viewer | server.py | server.py | py | 9,751 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "molsql.Database",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "json.dum... |
21216811074 | import io
import runoff_class as runoff
import unittest
from unittest import mock
class TestRunoff(unittest.TestCase):
def setUp(self) -> None:
self.candidates = ["Marta", "Joni", "Fran", "Linda"]
self.voter_number = 5
self.model = runoff.Runoff(self.candidates, self.voter_number)
... | SOUADSARAH/Harvard_CS50x_2022_Psets_and_Labs | 1.Psets/1.Python_solutions/8.Runoff/test_runoff.py | test_runoff.py | py | 8,139 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "runoff_class.Runoff",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "runoff_class.Runoff",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "runoff... |
476956710 | from __future__ import annotations
from typing import Any, Dict, List, Set, Union
from collections import OrderedDict
from .rows import Rows
from .option import Option
from .columns.column import Column
from .index import Index
from .constraint import Constraint
from ..operations.create_table import CreateTable
class T... | cmancone/mygrations | mygrations/core/definitions/table.py | table.py | py | 26,764 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "typing.Dict",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "columns.column.Column",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "constraint.Constraint",... |
71607807144 | # USAGE
# To read and write back out to video:
# python people_counter.py --prototxt mobilenet_ssd/MobileNetSSD_deploy.prototxt \
# --model mobilenet_ssd/MobileNetSSD_deploy.caffemodel --input videos/example_01.mp4 \
# --output output/output_01.avi
#
# To read from webcam and write back out to disk:
# python people_cou... | smriti283/Seating-preferences-of-Metrotech-visitors | Object Tracking Python Script/people_counter4.py | people_counter4.py | py | 16,223 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.dnn.readNetFromCaffe",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "imutils... |
2251689523 | import os
import imageio
import argparse
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from natsort import natsorted
from PIL import Image, ImageDraw, ImageFont
def plot_generated(generated_imgs, dim=(1, 10), figsize=(12, 2), save_name=None):
plt.figure(figsize=figsiz... | thbeucher/ML_pytorch | apop/GAN/plotter.py | plotter.py | py | 4,225 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "... |
22149140762 | """
Document Scanner
Algo : Take input from webcom
Preprocess Image and return as Threshold image
Find the biggest contour
Using corner points to get bird eye view
"""
import cv2
import numpy as np
window_width = 600
window_height = 350
webcam = cv2.VideoCapture(0) # Selecting webcam
webca... | codescoop/Computer-Vision | Document_Scanner/DocumentScanner.py | DocumentScanner.py | py | 4,538 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlu... |
16636486035 | from __future__ import absolute_import
import itertools
import math
import warnings
from typing import List, Iterable, Tuple, Optional
import cv2
import numpy as np
from .torch_utils import image_to_tensor
__all__ = [
"plot_confusion_matrix",
"render_figure_to_tensor",
"hstack_autopad",
"vstack_auto... | BloodAxe/pytorch-toolbelt | pytorch_toolbelt/utils/visualization.py | visualization.py | py | 7,811 | python | en | code | 1,447 | github-code | 36 | [
{
"api_name": "numpy.ndarray",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_n... |
74749464104 | # -*- coding: utf-8 -*-
from django.http import JsonResponse
from django.db.models import Count, F, Case, When, Value, IntegerField
from what.models import Composer, Instrument
from api.shared.tools import get_instrument_parent_category
from Octoopus.shared.tools import load_config
def search_composers(request):
... | MrFaBemol/octoopus-django | api/views.py | views.py | py | 5,689 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "what.models.Composer.objects.annotate",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "what.models.Composer.objects",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "what.models.Composer",
"line_number": 40,
"usage_type": "name"
... |
38308527532 | from pytablewriter import MarkdownTableWriter
import json
def main():
f = open("results/arxiv_papers_6_Aug_2021.json")
data = json.load(f)
value_matrix = []
for item in data:
temp = data[item]["summary"].find
value_matrix.append(
[item, data[item]["title"], data[item]["su... | FlokiBB/DeFiPapers | src/convert_json_to_md.py | convert_json_to_md.py | py | 718 | python | en | code | 57 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pytablewriter.MarkdownTableWriter",
"line_number": 16,
"usage_type": "call"
}
] |
9164147549 | from flask import Flask, request, jsonify
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
# rate_card_data = pd.read_csv('sample--rates.csv', dtype={
# 'member_csv': 'string',
# 'age_range': 'string',
# 'tier': 'string',
# '500000': 'int64',
# '700000': 'int64',
# '1000000': 'int64... | sheetalparsa/health-insurance-calculator | backend/app.py | app.py | py | 3,054 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 87,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
17978575525 | # 导入操作系统库
import os
# 更改工作目录
os.chdir(r"D:\softwares\applied statistics\pythoncodelearning\chap3\sourcecode")
# 导入绘图库
import matplotlib.pyplot as plt
# 导入支持向量机模型
from sklearn import svm
# 导入决策边界可视化工具
from sklearn.inspection import DecisionBoundaryDisplay
# 导入iris数据集
from sklearn.datasets import load_iris
# 导入绘图库中的字体管理包... | AndyLiu-art/MLPythonCode | chap3/sourcecode/Python3.py | Python3.py | py | 1,949 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager",
"line_number": 16,
"usage_type": "name"
},
{
"api_name":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.