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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14295656112 | import pinocchio as pin
import numpy as np
class NLinkCartpole(object):
def __init__(self, N, link_length, link_mass):
self.N = N
self.pin_model = pin.Model()
# Add the cart joint (prismatic joint along x axis)
jidx = 0
joint_model = pin.JointModelPrismaticUnaligned()
joint_model.axis[0] = 1
... | EpicDuckPotato/final_project_16715 | src/n_link_cartpole.py | n_link_cartpole.py | py | 2,776 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pinocchio.Model",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pinocchio.JointModelPrismaticUnaligned",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pinocchio.SE3.Identity",
"line_number": 14,
"usage_type": "call"
},
{
"api_... |
2119785373 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
@FILE : Month6_general_analysis.py
@TIME : 2023/07/20 22:34:20
@AUTHOR : wangyu / NMC
@VERSION : 1.0
@DESC : 本文件负责进行 2023年 6 月 华北地区高温事件的基础统计分析
华北地区 6 月份高温事件集中在 6月14-17日, 6月21-30日
'''
### to import parent dir files ###
# import os, sy... | wangy1986/HB-HeatWave-Analysis | heatwave_general_analysis.py | heatwave_general_analysis.py | py | 5,896 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.DataIO.readNC",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "utils.DataIO",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "numpy.max",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "utils.DataIO.writeNC",
... |
35920582247 | from flask import Flask
from pymongo import MongoClient
import json
client = MongoClient()
db = client.devdb
collection = db.jobs
# reads json file, returns data as python dict
def load_data():
with open("./app/data.json", "r") as file:
data = json.load(file) # gets python dict
return data
# insert ... | shailstorm/joblistings | app/__init__.py | __init__.py | py | 627 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 23,
"usage_type": "call"
}
] |
36809853370 | # -*- coding:utf-8 -*-
import multiprocessing
import os
_debug = os.environ.get('DJANGO_SETTINGS_MODULE', 'karelapan.settings').endswith('dev')
bind = "unix:/tmp/gunicorn.sock"
#bind = "127.0.0.1:8000"
workers = multiprocessing.cpu_count() * 2 + 1
preload_app = True
daemon = not _debug
pidfile = os.path.normpath(os.p... | oca159/karelapan | gconfig.py | gconfig.py | py | 557 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.normpat... |
72644993064 | import os
import unittest
from pathlib import Path
import numpy as np
from pkg_resources import resource_filename
from compliance_checker.acdd import ACDDBaseCheck
from compliance_checker.base import BaseCheck, GenericFile, Result
from compliance_checker.suite import CheckSuite
static_files = {
"2dim": resource_... | ioos/compliance-checker | compliance_checker/tests/test_suite.py | test_suite.py | py | 10,559 | python | en | code | 92 | github-code | 36 | [
{
"api_name": "pkg_resources.resource_filename",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pkg_resources.resource_filename",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pkg_resources.resource_filename",
"line_number": 15,
"usage_type": "call"... |
15969019025 | import torch.nn as nn
class MultiOutputCNN(nn.Module):
def __init__(self, ndigits, nvocab):
# inputsize 32*112
super(MultiOutputCNN, self).__init__()
feature_net = nn.Sequential()
def Conv_Relu(depth, ni, no, nk):
feature_net.add_module('layer_' + str(depth), nn.Conv2... | waitwaitforget/VerificationCodeRecognition | multiCNN.py | multiCNN.py | py | 1,279 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
3717849813 | from PySide2.QtWidgets import QWidget, QTableWidgetItem, QAbstractItemView, QHeaderView, QMessageBox
from Ventanas.agendar_vuelo import AgendarVuelo
from Database.aeropuerto import *
from Database.hangares_db import traer_todas_aerolineas
from PySide2.QtCore import Qt
import datetime
from datetime import datetime
from ... | SofhiAM/Aeropuerto_Campanero | Controles/agenda.py | agenda.py | py | 5,405 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Ventanas.agendar_vuelo.AgendarVuelo",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PySide2.QtCore.Qt.Window",
"line_number": 18,
"usage_type": "attribute"
}... |
26301777253 | from functools import reduce
from hashlib import md5
from jsonpath import jsonpath
from jsonpath_ng.parser import JsonPathParser
from tools.funclib import get_func_lib
import json
import re
import time
from tools.utils.utils import extract_by_jsonpath, quotation_marks
class Template:
def __init__(self, test, co... | Chras-fu/Liuma-engine | core/template.py | template.py | py | 12,092 | python | en | code | 116 | github-code | 36 | [
{
"api_name": "tools.funclib.get_func_lib",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "jsonpath_ng.parser.JsonPathParser",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
},
{
"api_name"... |
23467111744 | import os
import io
import lmdb
import six
import cv2
from PIL import Image
IMAGE_SAMPLE_HEIGHT = 64
def image_bin_to_pil(image_bin):
buf = six.BytesIO()
buf.write(image_bin)
buf.seek(0)
img = Image.open(buf)
return img
def is_valid_label(label, classes):
for ch in label:
if classes... | gucheol/CreateLMDB | lmdb_helper.py | lmdb_helper.py | py | 6,254 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "six.BytesIO",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_numbe... |
8356155101 |
import re
import cv2
import numpy as np
import matplotlib.pyplot as plt
flat_chess=cv2.imread('DATA/flat_chessboard.png')
flat_chess=cv2.cvtColor(flat_chess,cv2.COLOR_BGR2RGB)
plt.subplot(321)
plt.imshow(flat_chess)
gray_flat_chess=cv2.cvtColor(flat_chess,cv2.COLOR_BGR2GRAY)
plt.subplot(322)
plt.imshow(gray_flat_c... | janezv/computerVision | plt.subplot.py | plt.subplot.py | py | 1,350 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplot... |
29412108576 | import mediapipe as mp
import json
mp_pose = mp.solutions.pose
def calculate_pose(image, pose):
results = pose.process(image)
if (results.pose_landmarks == None):
return {
"error": "NO LANDMARKS"
}
landmarks = results.pose_landmarks.landmark
landmarks_list = []
f... | flexinai/flexin-ipod-ad | calculate_pose.py | calculate_pose.py | py | 1,240 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mediapipe.solutions",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 34,
"usage_type": "call"
}
] |
4298322287 |
# 发送纯文本
# SMTP: 邮件传输协议
# 发邮件
import smtplib
# 邮件标题
from email.header import Header
# 邮件正文
from email.mime.text import MIMEText
"""
user, pwd, sender, receiver, content, title
用户名,授权码,发送方邮箱,接收方邮箱,内容,标题
"""
def sendEmail(user, pwd, sender, receiver, content, title):
# 163的SMTP服务器
mail_host = "smtp.163.com"
... | H-Gang/exercise | learn.py | learn.py | py | 1,978 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "email.mime.text.MIMEText",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP_SSL",
"line_number": 43,
"usage_type": "call"
}
] |
23411420670 | from django.conf.urls import url
from .import views
# from views import ClienteAutocomplete
urlpatterns = [
# url(r'^cliente-autocomplete/$', ClienteAutocomplete.as_view(), name='cliente-autocomplete'),
url(regex=r'^$', view=views.index, name='index'),
url(r'^cliente/(?P<cliente_id>\d+)/edit/$', views.clie... | pmmrpy/SIGB | clientes/urls.py | urls.py | py | 625 | python | en | code | 0 | github-code | 36 | [
{
"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... |
13076610042 | import numpy as np
import pandas as pd
import matplotlib
from matplotlib import pyplot as plt
from matplotlib.ticker import AutoMinorLocator
# datafile from COMSOL
path_to_data = "E://COMSOL//laminar_mesh_refinement/"
# % Model: run40_lam_mesh_fluid_0.5_out.mph
# % Version: COMSO... | kromerh/phd_python | 03_COMSOL/02.rotatingTarget/old_py/COMSOL_new_target/mesh_refinement/mesh_refinement_fluid_T_along_z_at_beamspot.py | mesh_refinement_fluid_T_along_z_at_beamspot.py | py | 3,229 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotli... |
22509727291 | import re
import subprocess
import pygit2
from git_deps.utils import abort, standard_logger
from git_deps.gitutils import GitUtils
from git_deps.listener.base import DependencyListener
from git_deps.errors import InvalidCommitish
from git_deps.blame import blame_via_subprocess
class DependencyDetector(object):
... | aspiers/git-deps | git_deps/detector.py | detector.py | py | 15,150 | python | en | code | 291 | github-code | 36 | [
{
"api_name": "git_deps.utils.standard_logger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "git_deps.gitutils.GitUtils.get_repo",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "git_deps.gitutils.GitUtils",
"line_number": 32,
"usage_type": "name"
... |
6714176411 | """
Core config implementations.
"""
import importlib
import logging
import os
import sys
from collections import KeysView, ItemsView, ValuesView, Mapping
from .. import abc
from ..compat import text_type, string_types
from ..decoders import Decoder
from ..exceptions import ConfigError
from ..interpolation import Bas... | viniciuschiele/central | central/config/core.py | core.py | py | 30,318 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "interpolation.ConfigLookup",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "utils.EventHandler",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "compa... |
6379736623 | from functools import partial
import jax
import numpy as np
from tessellate_ipu import tile_map, tile_put_sharded
data = np.array([1, -2, 3], np.float32)
tiles = (0, 2, 5)
@partial(jax.jit, backend="ipu")
def compute_fn(input):
input = tile_put_sharded(input, tiles)
# input = tile_put_replicated(input, til... | graphcore-research/tessellate-ipu | examples/demo/demo1.py | demo1.py | py | 492 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tessellate_ipu.tile_put_sharded",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tessella... |
38269425685 | import random
import matplotlib.pyplot as plt
import math
import numpy as np
import time
plt.style.use('ggplot')
mutation = True
elitism = False
mutationPorcentage = .90
tournamentPercentage = 0.02
generations = 100
nPopulation = 400
fuzzyNetworks = 7
chromosomeSize = fuzzyNetworks*4
weight = 5
pMain = [8,25,4,... | monzter50/fuzzy_ga | copy.py | copy.py | py | 9,520 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name"... |
40794410326 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
from collections import deque
class Solution:
def zigzagLevelOrder(self, root: Optional[TreeNode]) -> List[List[int]]:
... | Devjyoti29/LeetHub | 0103-binary-tree-zigzag-level-order-traversal/0103-binary-tree-zigzag-level-order-traversal.py | 0103-binary-tree-zigzag-level-order-traversal.py | py | 1,286 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
}
] |
3637163420 | import cv2
from openvino.inference_engine.ie_api import IECore, IENetwork
import pprint
# default threshold
THRESHOLD = 0.5
class Face_Detection:
def __init__(self, model_name, device='CPU', extensions=None, perf_counts="False"):
self.model_weights = model_name + '.bin'
self.model_structure = mode... | alihussainia/Computer_Pointer_Controller | face_detection.py | face_detection.py | py | 2,813 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "openvino.inference_engine.ie_api.IENetwork",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pprint.PrettyPrinter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "openvino.inference_engine.ie_api.IECore",
"line_number": 28,
"usage_type"... |
21250532752 | # -*- coding:utf-8 -*-
# coding=utf-8
import os
from PIL import Image, ImageDraw, ImageFont
import matplotlib.pyplot as plt
# from skimage.transform import resize
import numpy as np
import cv2
# 膨胀算法 Kernel
_DILATE_KERNEL = np.array([[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
... | Tkwitty/watermark | Put_water_mark.py | Put_water_mark.py | py | 7,777 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.dilate",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number... |
6667722703 | """empty message
Revision ID: 764dadce9dd1
Revises:
Create Date: 2017-09-28 01:16:36.519727
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '764dadce9dd1'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | ThreeOhSeven/Backend | migrations/versions/764dadce9dd1_.py | 764dadce9dd1_.py | py | 1,289 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
41908721379 | from django.http import JsonResponse
from django.shortcuts import render
from .models import Userdata,Entry
from django.shortcuts import render,HttpResponse,HttpResponseRedirect
# Create your views here.
# def check(request):
# return render(request,'check.html')
# def save(request):
# if request.method == 'PO... | Farheen-14/Crud-Operations | ajaxproject/ajaxapp2/views.py | views.py | py | 2,874 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "models.Entry.objects.all",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "models.Entry.objects",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_na... |
34912332593 | import serial
import time
"Arduino Controller Object"
class Arduino_Controller(object):
def __init__(self, path):
self.path = path
self.arduino = serial.Serial(self.path, 9600, timeout = 5)
self.nums = "0123456789"
self.angle = 0
self.is_Button_Pressed = False
"Arduino ... | rviccina/Space-Defense | Arduino_Controller_Class.py | Arduino_Controller_Class.py | py | 1,135 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "serial.Serial",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 15,
"usage_type": "call"
}
] |
73137746664 | from django import forms
from .models import Submission, Dataset, Method
class SubmitForm(forms.Form):
def __init__(self,data=None,*args,**kwargs):
def conv(private):
if private:
return " (private Leaderboard)"
else:
return " (public Leaderboard)"
... | bcm-uga/ChallengeWebSite | challenge/forms.py | forms.py | py | 1,147 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.forms.Form",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.forms.ChoiceField",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.for... |
1165217345 | import requests
import bs4
print('Loading page...')
url=f'https://www.myjobmag.co.ke/search/jobs?q=&field=Engineering+%2F+Technical'
def getJobtitle(soup):
title=soup.select('section h1')
return str(title[0].getText())
def getDescription(soup):
Description=soup.select('.job-details p')
... | petreleven/Webscraping-101 | webscraping101/jobmagRefactored.py | jobmagRefactored.py | py | 1,791 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
1163783579 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import csv
x = []
y = []
with open('input.csv','r',encoding = 'utf8') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
for row in plots:
x.append(row[0])
y.append(float(row[1]))
plt.plot(x,y, label='banana')
plt.xlabel('date')
plt.yl... | sytsao/TQC-web-data-capture-and-analysis-Python3 | TQC-web-crawler-and-analysis-Python3/第4章/綜合範例/GE4-1PYA401.py | GE4-1PYA401.py | py | 408 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "csv.reader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.... |
44542833866 | # This package will contain the spiders of your Scrapy project
#
# Please refer to the documentation for information on how to create and manage
# your spiders.
import requests
import scrapy
api_endpoint = 'http://localhost:5000/api/domains'
class QuotesSpider(scrapy.Spider):
name = "quotes"
def start_requ... | imfht/sec-flask-cookiecutter | spider/spider/spiders/__init__.py | __init__.py | py | 790 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.Spider",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 22,
"usage_type": "call"
}
] |
22192896243 | from telegram import Bot
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
bot = Bot(token='5593423447:AAEe0rCZnZdYXNpxxyatR37l6afSppj-yZI')
updater = Updater(token='5593423447:AAEe0rCZnZdYXNpxxyatR37l6afSppj-yZI')
dispatcher = updater.dispatcher
def start(update, context):
context.bot.se... | Minions-Wave/GB-Minions-Wave | The Big Brain Solutions/Personal Zone/NighTramp Solutions/Blok 2/Python/HomeWork/Seminar009/main.py | main.py | py | 1,271 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "telegram.Bot",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "telegram.ext.Updater",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "telegram.ext.CommandHandler",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "telegram.... |
9624083818 | from boto3.session import Session
session = Session(aws_access_key_id='[your_key_id]', aws_secret_access_key='[your_secret_key]')
def shutdown_all(resource_name,region):
resource = session.resource(resource_name, region_name=region)
instances = resource.instances.filter(
Filters=[{'Values': ['running'... | tiago-clementino/desafioDevOps | ops/scripts/q1.py | q1.py | py | 411 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "boto3.session.Session",
"line_number": 3,
"usage_type": "call"
}
] |
73161250024 | from fastapi import APIRouter, Depends, HTTPException, status
from fastapi.exceptions import ResponseValidationError
from app.crud import users_dao
from app.schemas import UserBase
from sqlalchemy.orm import Session
from ..database import get_db
router = APIRouter()
@router.get("/{cbu}", response_model=UserBase)
de... | FelipeCupito/DB2-TP | backendBanks/app/routers/users.py | users.py | py | 1,315 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "database.get_... |
23408765544 | # -*- coding: utf-8 -*-
from sqlalchemy import Table, Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy_mate import EngineCreator, ExtendedBase
from sfm import rnd
import random
engine = EngineCreator(
host="rajje.db... | MacHu-GWU/Dev-Exp-Share | docs/source/01-AWS/01-All-AWS-Services-Root/31-Migration-and-Transfer/02-Database-Migration-Service-(DMS)-Root/Practice-Postgres-to-AWS-RDS/source_database.py | source_database.py | py | 1,468 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "sqlalchemy_mate.EngineCreator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlalchemy_mate.ExtendedBase",
"line_number": 20,
"usage_type":... |
13397438206 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 1 11:47:13 2022
@author: noise
neural network plot utilitiy functions
"""
import matplotlib.pyplot as plt
import numpy as np
import os
from mpl_toolkits.axes_grid1 import make_axes_locatable
def plotFullFields(Enn,Etest, epoch,i, dir):
i... | demroz/pinn-ms | optimizeNeuralNetwork/plotUtil.py | plotUtil.py | py | 1,787 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "os.path.isdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number":... |
19557411940 | import sys
from collections import deque
input = sys.stdin.readline
t = int(input())
for _ in range(t):
l = int(input())
n_x, n_y = map(int, input().split())
m_x, m_y = map(int, input().split())
visited = [[0] * l for _ in range(l)]
visited[n_x][n_y] = 1
dq = deque([(n_x, n_y)])
while dq:
... | hyotaime/PS.py | Silver/Silver1/7562.py | 7562.py | py | 722 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
23073952009 | from webapp import app
import os
from flask import render_template, url_for, flash, redirect, request, abort
from webapp.models import Video
from os import path
from sqlalchemy.sql import text
@app.route("/")
@app.route("/home")
def home():
page = request.args.get('page', 1, type=int)
videos = Video.query.orde... | sheikhhanif/cslesson | webapp/routes.py | routes.py | py | 2,179 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.request.args.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "webapp.m... |
11893023589 | # -*- coding: utf-8 -*-
import pymysql
# by huxiajie
class MySqlPipeline(object):
def __init__(self):
self.conn = pymysql.connect(
host="localhost",
db="jroom",
user="root",
passwd="123456",
charset='utf8'
)
self.cursor = self.co... | mohxjmo/jroomCrawl | JRoom/pipelines.py | pipelines.py | py | 3,424 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymysql.connect",
"line_number": 9,
"usage_type": "call"
}
] |
39510454656 | from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
def ngram_array(a_text, s_text, n):
'''
Calculate an ngram array for an answer and source text
Arguments:
a_text: answer text
s_text: source text
n : choice of n-gram (1 == unigram, 2 == bigram e... | tonyjward/plagiarism_detection | src/utils/create_features.py | create_features.py | py | 6,006 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.amin",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "... |
505960290 | """
Querying by location and extract data location
"""
def places_by_query(bfShp, epsgIn, keyword=None, epsgOut=4326,
_limit='100', onlySearchAreaContained=True):
"""
Get absolute location of facebook data using the Facebook API and
Pandas to validate data.
Works only for the ... | jasp382/glass | glass/acq/dsn/fb/places.py | places.py | py | 4,253 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "glass.prop.feat.bf.getBufferParam",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "glass.acq.dsn.fb.search.by_query",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 53,
"usage_type": "call"
},
{
"... |
15566377203 | # complete k-means++
from copy import deepcopy
import matplotlib.pyplot as plt
import numpy as np
#load data
data = np.loadtxt('Downloads/mnist_small.txt')
#normalize the data
data=np.divide(data,16)
#distance function
def dist(a, b, ax=1):
return np.linalg.norm(b - a, axis=ax)
#20 iterations
for k in range(20):
... | lizihao1999/k-means | k-means++.py | k-means++.py | py | 1,688 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.loadtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.divide",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_n... |
17581795142 | import urllib
from typing import Any, Optional
from functools import lru_cache
import requests
from starwhale.utils.retry import http_retry
from starwhale.base.uri.instance import Instance
from starwhale.base.uri.exceptions import UriTooShortException
class Project:
id: str
name: str
instance: Instance
... | star-whale/starwhale | client/starwhale/base/uri/project.py | project.py | py | 4,147 | python | en | code | 171 | github-code | 36 | [
{
"api_name": "starwhale.base.uri.instance.Instance",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "... |
570167896 | import logging
import math
from .geomsmesh import geompy
from .geomsmesh import smesh
from .putName import putName
def calculePointsAxiauxPipe_a(facesDefaut, centreFondFiss, wireFondFiss, \
lenSegPipe, \
nro_cas=None):
"""Maillage selon le rayon de courbu... | luzpaz/occ-smesh | src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py | calculePointsAxiauxPipe_a.py | py | 1,651 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "geomsmesh.geompy.MinDistance",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "geomsmesh.geompy",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "logging.in... |
36480992641 | from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QFileDialog, QGraphicsScene, QGraphicsView, QGraphicsPixmapItem, QDialog
from PyQt5.QtGui import QPixmap, QPainter, QColor, QImage
from gui import Ui_MainWindow
import sys
import math as m
import numpy as np
import matplo... | HamzaJamal782/MRI-Image-reconstruction- | test.secret.py | test.secret.py | py | 10,448 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "gui.Ui_MainWindow",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ma... |
35575503668 | """Miscellaneous functions used for plotting gradient data"""
import gzip
import math
import os.path as op
import pickle
import nibabel as nib
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
from neuromaps.datasets import fetch_fslr
from nilearn import image, masking, plotting
from nilear... | NBCLab/gradient-decoding | figures/utils.py | utils.py | py | 10,146 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "neuromaps.datasets.fetch_fslr",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.basename",... |
978437268 | import torch
from torch import nn
import numpy as np
import torch.nn.functional as F
def inverse_sigmoid(epoch, k=20):
return k / (k + np.exp(epoch/k))
class Encoder(nn.Module):
def __init__(self, input_size, hidden_size, latent_dim, num_layers=1, bidirectional=True):
super(Encoder,... | Jinhoss/MusicVAE | model.py | model.py | py | 6,869 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.exp",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.LSTM",
"line_number... |
5832039173 | import requests
from bs4 import BeautifulSoup
from datetime import datetime
from pymongo import MongoClient
client = MongoClient(port=27017)
db = client.historical_data4
def get_coins(url):
"""this function get all coins list"""
response = requests.get(url)
coin_list = [i['id'] for i in response.json()]
... | ShivaGuntuku/cryptos | coin_historical_data_with_mongodb.py | coin_historical_data_with_mongodb.py | py | 1,407 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
41979414512 | import questionary
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from BrokerManager import server as broker_manager
from BrokerManagerReadOnly import server as broker_manager_readonly
import sys
def create_app():
app = Flask(__name__)
answer = questionary.select(
"Which Server do you want to st... | DistributedSystemsGroup-IITKGP/Assignment-3 | main.py | main.py | py | 754 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "questionary.select",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "BrokerManager.server",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "BrokerManagerR... |
12894335645 | import pygame
import random
class boss(pygame.sprite.Sprite):
def __init__(self, game):
super().__init__()
self.game = game
self.health = 350
self.max_health = 350
self.attack = 6
self.image = pygame.image.load('assets/BOSS T.png')
self.image = pygame.transf... | MathieuTherias/Projet-Transverse | BOSS.py | BOSS.py | py | 1,440 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.sprite",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.transfor... |
39274786289 | import re
# from urllib.parse import urlparse
# from urllib.parse import urljoin
# from urllib.parse import urldefrag
import urllib
import time
from datetime import datetime
from urllib.robotparser import RobotFileParser
import queue
import random
import socket
import csv
import lxml.html
DEFAULT_AGENT = 'wswp'
DEFAU... | Code-In-Action/python-in-action | webscrap/c1.py | c1.py | py | 7,304 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.match",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlparse",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 80,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.no... |
36458063236 | import abc
import json
from typing import Any, Dict, List, NoReturn, Optional, Tuple, Union, final
from erniebot_agent.agents.base import BaseAgent
from erniebot_agent.agents.callback.callback_manager import CallbackManager
from erniebot_agent.agents.callback.default import get_default_callbacks
from erniebot_agent.ag... | Southpika/ERNIE-Bot-SDK | erniebot-agent/src/erniebot_agent/agents/agent.py | agent.py | py | 9,943 | python | en | code | null | github-code | 36 | [
{
"api_name": "typing.Tuple",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "erniebot_agent.agents.mixins.GradioMixin",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "erniebot_agent.agents.base.BaseAgent",
"line_number": 24,
"usage_type": "name"
},... |
8231955014 | """Client library for sending events to the data processing system.
This is for use with the event collector system. Events generally track
something that happens in production that we want to instrument for planning
and analytical purposes.
Events are serialized and put onto a message queue on the same server. These... | Omosofe/baseplate | baseplate/events/queue.py | queue.py | py | 4,735 | python | en | code | null | github-code | 36 | [
{
"api_name": "calendar.timegm",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": ... |
14783345102 |
# Built-In Python
import time
from pathlib import Path
import pickle
import random
import logging
# Third-Party
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from tqdm import tqdm
from fire import Fire
# Custom
from .population import Population
from .flips import Flips, Flip
class History... | ryanlague/thePerfectlyJustSociety | thePerfectlyJustSociety/coinFlip/coinFlip.py | coinFlip.py | py | 9,029 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "population.Population",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "population.getMoneyStamp",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "popul... |
35376021408 | import pandas as pd
import numpy as np
import streamlit as st
import plotly.express as px
from sklearn.datasets import fetch_california_housing
from sklearn.metrics import mean_squared_error
def main(verbosity=False):
cal_housing = fetch_california_housing()
df = pd.DataFrame(cal_housing.data, columns... | Wratch/TYBootcamp | youdo1.py | youdo1.py | py | 1,784 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.datasets.fetch_california_housing",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "streamlit.dataframe",
"line_number": 15,
"usage_type": "call"
},
{
"api... |
70847780583 | from setuptools import setup
import os
import sys
import codecs
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open
return codecs.open(os.path.join(here, *parts), 'r').read()
install_requires = [
"virtualenv==15.1.0",
"requests... | cloudify-cosmo/cloudify-agent-packager | setup.py | setup.py | py | 981 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_num... |
38118890596 | import matplotlib.pyplot as plt
from matplotlib import animation
import numpy as np
x = np.linspace(0,2,201)
y = np.linspace(0,1,101)
xy, yx = np.meshgrid(x,y)
ims = []
tmin, tmax = 0, 0.02
h = 1e-3
fig = plt.figure()
for i in range(int(np.ceil((tmax-tmin)/h))):
plt.pcolormesh(xy,yx,np.sin(xy+np.pi*i*h)+np.c... | arnemagnus/_oldversion_physicsproject | calculation_scripts/old_assorted_test_scripts/testmatplotliblive.py | testmatplotliblive.py | py | 420 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
... |
10849889917 | import os
import datetime
from jira import JIRA
class JiraIssueReporterHandler(object):
def __init__(self, jiraURL, username, api_token, projectKey):
self.options = {'server': jiraURL}
# self.server = jiraURL
self.auth = (username, api_token)
self.projectKey = projectKey
#... | gravity239/PySeleFramework | selenpy/common/jira_issue_reporter_handler.py | jira_issue_reporter_handler.py | py | 2,100 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "jira.JIRA",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "jira.create_issue",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "jira.issue",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "jira.add_comment",
"line_n... |
75088426664 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
# path('', views.TaskListView.as_view(), name='home'),
# path('add/', views.TaskCreateView.as_view(), name='add'),
path('detail/<int:pk>/', views.TaskDetailView.as_view(), name='detail'),
path('del... | alen0577/todo | todo_app/urls.py | urls.py | py | 461 | 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": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
74290457704 | import json
import yaml
def refs_to_dict(filename):
data = yaml.load(open(filename), Loader=yaml.CLoader)
return {elem['id']: elem['title'] for elem in data.get('references', [])}
refs = {elem['id']: elem['title'] for elem in json.load(open('wg21/data/csl.json'))}
refs.update(refs_to_dict('md/wg21_fmt.yaml'))... | brevzin/sd6 | reduce_refs.py | reduce_refs.py | py | 399 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "yaml.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "yaml.CLoader",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 12... |
29648505683 | #! /usr/bin/env python3
# pylint: disable=missing-module-docstring,missing-function-docstring
from . import std_headers
from .utils import Object
def customHeaderIdentificationHandler(header):
"""
A couple of headers don't fit into the target identification heuristics
we have implemented in CppSourceDeps... | mohitmv/depg | default_configs.py | default_configs.py | py | 2,600 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.Object",
"line_number": 17,
"usage_type": "call"
}
] |
36819201120 | # type: ignore
from functools import cached_property
from dataclasses import dataclass, field
from pathlib import Path
@dataclass
class File:
path: Path
size: int
@dataclass
class Dir:
path: Path
files: list[File] = field(repr=False, default_factory=list)
dirs: list["Dir"] = field(repr=False, de... | ocaballeror/adventofcode2022 | 07/day7.py | day7.py | py | 1,442 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
... |
17887416810 | from django.shortcuts import render, redirect
from .models import Reply
from review.models import Review
from .forms import ReplyForm
from django.contrib import messages
from django.core.exceptions import PermissionDenied
def Reply(request, pk):
""" Model for staff to reply to user reviews on menu """
review ... | Code-Institute-Submissions/yuyizhong-O.A.T-Vietnamese-Cuisine | reply/views.py | views.py | py | 1,090 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "review.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "review.models.Review.objects.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "review.models.Review.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"... |
11755542906 | from os import environ, listdir
from os.path import join, isfile, getmtime
from dataclasses import dataclass, field
import json
import time
import traceback
from datetime import datetime,timezone
savedGamePath = environ['USERPROFILE'] + "\Saved Games\Frontier Developments\Elite Dangerous"
@dataclass
class mission:
... | Matrixchung/EDAutopilot-v2 | utils/journal.py | journal.py | py | 10,593 | python | en | code | 42 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "dataclasses.fiel... |
29344342096 | import matplotlib
from matplotlib import pyplot as plt
import numpy as np
import cv2 as cv
import IO
import api
# >>> Przykładowe zadanie i proces wykonania na podstawie zestawu Artroom2 <<<
# Korzystając z metody StereoSGBM udostępnionej przez bibliotekę OpenCV wyznacz mapę rozbieżności oraz mapę głębi.
# Dobierz od... | SmartMaatt/How-to-Zaowr | Zad2.py | Zad2.py | py | 2,635 | python | pl | code | 6 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_num... |
74865037543 | #-*- coding:utf-8 -*-
import random
import pymongo
client = pymongo.MongoClient('112.74.106.159', 27017)
db = client.develop
#获取useragent池
get_info = db.userAgents.find()
USER_AGENTS = [i['userAgent'] for i in get_info]
class MyUserAgent(object):
def process_request(self, request, spider):
request.headers.setdefa... | dreamyteam/py_crawler | movie_spider/movie_spider/User_Agents.py | User_Agents.py | py | 378 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 14,
"usage_type": "call"
}
] |
18690414084 | import math
import numpy as np
import csv
from itertools import chain
import random
Feature_number=4
all_Feature=False
CUS_NUMBER=50
Training_number=50
count_setosa = 0
count_versicolor = 0
count_virginica = 0
k=0
l=40
fold = []
Output = []
variance = []
h =np.array([0.01,0.5,10])
confussion_matrix = [[0] * 3] * 3... | mmSohan/IrisDataSet_Classification_GaussianMultivariant-ParzenWindow_MachineLearning | parzen_window.py | parzen_window.py | py | 20,987 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.det",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_num... |
29852609530 | import collections
f = open("movie.txt","r")
print("Count number of movies in the file")
list_1 = []
for i in f:
list_1.append(i.split())
print(len(list_1))
f.close()
print("Add a new movie detail (War Amit 180 2019) at the end of file.")
f = open("movie.txt","a")
f.write("\nWar Amit 180 2019")
f.close()
print("... | Hardik121020/Pyhton-Code | File Handling/File3.py | File3.py | py | 882 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.Counter",
"line_number": 38,
"usage_type": "call"
}
] |
193648592 |
from asyncio.windows_events import NULL
import pygame
class Selector:
def __init__(self,w,h,x,y):
self.width = w
self.height = h
self.x = x
self.y = y
self.isSelected = False
self.selectedColor = -1
self.selectedTube = NULL
def draw(self,surface):
coord = [(self.x,self.y), (self.x+s... | Houdeifa/Lquid-tube | Selector.py | Selector.py | py | 946 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "asyncio.windows_events.NULL",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pygame.draw.polygon",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "asyn... |
3320859772 | import scrapy
import json
import csv
from ..items import FoodyItem
OUTPUT_DIRECTORY = "/Users/user/Desktop/Crawl/foody/OUTPUT/foody_output.json"
class CrawlfoodySpider(scrapy.Spider):
name = 'crawlFoody'
allowed_domains = ['www.foody.vn']
total_comment = 0
num_of_page = 1
url = 'https://www.food... | LENGHIA-CN8/FoodyCrawl | foody/spiders/crawlFoody.py | crawlFoody.py | py | 4,850 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scrapy.Spider",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
... |
74845408103 | import logging
from datetime import date
from flask.app import Flask
def get_logger(name=__name__, level=logging.INFO):
"""Returns a logger object"""
logger = logging.getLogger(name)
if not len(logger.handlers):
logger.setLevel(level)
console = logging.StreamHandler()
console.se... | carneirofc/utility-api | application/common/utils.py | utils.py | py | 1,104 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.DEBU... |
32476914350 | import sys
import csv
import sqlite3
# creates db if one does not exist
# conn = sqlite3.connect('some.db')
class CSVTool(object):
def __init__(self, path=None):
self.path = None
self.csv_name = None
self.db = None
def dump_to_db(self, csv_path):
# store connection... | cmhedrick/GalenDBTool | csvToDB.py | csvToDB.py | py | 1,047 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pdb.set_trace",
"line_number": 25,
"usage_type": "call"
}
] |
71846051304 | # -*- coding: utf-8 -*-
'''
这段代码将做出函数f(x)=e^2-2在[0,2]之间的图像,并描画出在该曲线下面的近似矩形
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import math
num = 4
x = np.linspace(0,2,1000)
y = np.power(np.e,x)-2
fig = plt.figure(figsize=(8,8))
x1 = np.linspace(0,2,num+1)
width=2.0/num
ax1 = fig... | coolban/somemath | plotf3.py | plotf3.py | py | 584 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.e",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
... |
13988017107 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from skfmm import travel_time, distance
from scipy.interpolate import interp1d
import os
from utils import plot_2d_image
from math import log10
plt.style.use('ggplot')
def transform_normal_scores(scores, nscore):
# for now, the values of our s... | wsavran/sokrg | generate_scale_truncated.py | generate_scale_truncated.py | py | 12,819 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_na... |
32057438346 | from aiogram.types import Message, ReplyKeyboardRemove
from aiogram.dispatcher.filters.builtin import Text
from aiogram.dispatcher import FSMContext
from states.StateStart import StateStart
from loader import dp
@dp.message_handler(Text(equals="Mukammal Telegram Bot"),state=StateStart.Kurs)
async def MTBKurs(msg: M... | ozodbekernazarov6642/mohirdev.uz_bot | handlers/users/KursBackendHendler.py | KursBackendHendler.py | py | 5,008 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aiogram.types.Message",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "aiogram.dispatcher.FSMContext",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "aiogram.types.ReplyKeyboardRemove",
"line_number": 19,
"usage_type": "call"
},
{
... |
20003378974 | import os
import re
import requests
import logging
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger(__name__)
# Declaramos a... | matiasnoriega/bot-telegram-analisis | bot.py | bot.py | py | 5,873 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ.get... |
11226132142 | from datetime import timedelta
from django.utils import timezone
from celery import shared_task
from django.contrib.auth.models import User
from .models import ReadingStatistics, ReadingSession
@shared_task
def update_reading_statistics():
# Завдання Celery для оновлення статистики читання користувачів
prin... | RomanovDanii1/Books | api/tasks.py | tasks.py | py | 2,075 | python | uk | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.auth.models.User.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.User",
"line_number": 16,... |
4759735391 | import streamlit as st
from PIL import Image
from detection import process
import numpy as np
from torchdetect import process
import os
st.set_page_config(
page_title="Image Detection",
layout="wide",
initial_sidebar_state="expanded"
)
st.title('Tuberculosis Detection from sputum sample')
st.markdown("## ... | irfanheru66/Tuberculosis-Detector | pages/page_2.py | page_2.py | py | 1,882 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit... |
5535184380 | import sys
import os
import json
import threading
BASE_DIR = os.getcwd()+"/.."
EOF = ""
def setPlatformCfg(env):
cfgPath = BASE_DIR+"/stays-platform/config.json"
cfg = ""
with open(cfgPath) as f:
cfg = json.load(f)
with open(cfgPath, "w") as f:
cfg['env'] = env
txt = json.dump... | nickrunner/stays | scripts/deploy.py | deploy.py | py | 1,806 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 25,
... |
41239382060 | # coding:utf-8
import sys
import os
import numpy as np
import cv2
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
sys.path.append('../synthesize_blur')
import viz_flow as viz
data_dir = "./"
old_path = data_dir + "1.jpeg"
new_path = data_dir + "2.jpeg"
gap = [0, 100]
feature_params = di... | MingmChen/burst-deghost-deblur | code/utils/cal_lk.py | cal_lk.py | py | 4,325 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITERIA_EPS",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITE... |
16961930308 | import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
# input parameter
den = 8880.0
cp = 386.0
cond = 398.0
temp_bc = 100.0
temp_init = 0.0
lx = 1.0
nx = 101
tend = 20000.0
dt = 0.1
tout = 100.0
alpha = cond / (den * cp)
dx = lx / (nx - 1)
nt = int(tend / dt)
nout = int(tout / d... | cattech-lab/lecture3_fdm_thermal | thermal_1d_ftcs.py | thermal_1d_ftcs.py | py | 1,474 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.full",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
72809322024 | from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.submodel_kind import SubmodelKind
from ..types import UNSET, Unset
if TYPE_CHECKING:
from ..models.administrative_information import AdministrativeInformation
from ..models.embedded_data_specification import Emb... | sdm4fzi/aas2openapi | ba-syx-submodel-repository-client/ba_syx_submodel_repository_client/models/submodel.py | submodel.py | py | 11,684 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.TypeVar",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"li... |
20645490044 | from my_socket import *
# from myMath import *
import inspect
import myMath
from myMath import *
from my_inspect import *
import logging
def send_functions():
global func_list
global server
func_info = []
n = 0
for f in func_list:
func_info.append(';'.join([f['name'], f['info'], str(n)]))
... | HarryFengYX/Py2GUI | free_op_interface.py | free_op_interface.py | py | 7,358 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.debug",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "inspect.getmembers",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "inspect.isclass",
"line_number": 121,
"usage_type": "call"
},
{
"api_name": "inspect.isfunction... |
31058313098 | from operator import itemgetter
import networkx as nx
import prefect
from sklearn.metrics import roc_auc_score
logger = prefect.context.get("logger")
def compute_centrality_metrics(G):
closeness_centrality = nx.centrality.closeness_centrality(G)
degree_centrality = nx.centrality.degree_centrality(G)
bet... | ryankarlos/networks_algos | networks/models/metrics.py | metrics.py | py | 1,184 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "prefect.context.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "prefect.context",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "networkx.centrality.closeness_centrality",
"line_number": 11,
"usage_type": "call"
},
{
"a... |
16523777795 | from django.core import urlresolvers
from django.core.mail import send_mail
from django.conf import settings
from django.contrib.comments.moderation import CommentModerator, moderator
from django.contrib.sites.models import Site
from akismet import Akismet
AKISMET_KEY = getattr(settings, "AKISMET_KEY", None)
class... | sunlightlabs/reportingsite | reporting/comments.py | comments.py | py | 1,809 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "django.contrib.comments.moderation.CommentModerator",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.contrib.sites.models.Site.objects.get_current",
"line_num... |
40095793121 | from django.urls import path
from . import views
urlpatterns = [
path('', views.TmListView.as_view(), name='home'),
path('table/', views.TableListView.as_view(), name='table'),
path('profile/', views.EmpCreateView.as_view(), name='profile'),
path('table/employe/<int:pk>/update', views.EmpUpdView.as_vi... | kostik2295/Django_Web-site | employees/urls.py | urls.py | py | 429 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
6209532245 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 31 12:39:09 2023
@author: Mouhamad Ali Elamine
"""
import argparse
import json
import re
parser = argparse.ArgumentParser(description='A1T1')
parser.add_argument('--input_file', type=str, default='./review.json', help='the input file ')
parser.add_argument(... | elami018/CSCI_5523 | HW1/task1.py | task1.py | py | 2,746 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkConf",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext.getOrCreate",
"line_number": 38,
"usage_type": "call"
},
{
"api_na... |
35899003132 | import discord
import asyncio
from dotenv import load_dotenv
from collections import Counter
from os import getenv
intents = discord.Intents.default()
intents.members = True
intents.presences = True
load_dotenv()
TOKEN = getenv('DISCORD_TOKEN')
class MyClient(discord.Client):
def __init__(self, *args, **kwargs... | mcl650s/DynamicChannelNameBot | DynamicNameBot.py | DynamicNameBot.py | py | 2,688 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "discord.Intents.default",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.gete... |
49873569 | # demonstration of the YCbCr encoder/decoder functionality
import numpy as np
import cv2
#import matplotlib.pyplot as plt
#import matplotlib.image as mpimg
K_VALS = [.299, .587, .114] # ITU-R BT.601
#K_VALS = [.2627, .678, .0593] # ITU-R BT.2020
R = 0
G = 1
B = 2
def color_matrix(values):
"""
Generates a color m... | octinhuh/hdvid21 | tests/ycbcr.py | ycbcr.py | py | 3,034 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.inv",
"line_numb... |
30112331556 | import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
# constants
TRAIN_DATA_FILE_PATH = "Lyrics-Genre-Train.csv"
TEST_DATA_FILE_PATH = "Lyrics-Genre-Test-GroundTruth.csv"
LYRICS_COLUMN = "Lyrics"
GENRE_COLUMN = "Genre"
# useful variables
output_mappings = {}
# Pentru ca... | daneel95/Master_Homework | FirstYear/Regasirea Informatiei/Homework2/main.py | main.py | py | 1,806 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 40,
"usage_type": "call"
},
{
"a... |
9052754713 | """Support for the Mastertherm Sensors."""
from decimal import Decimal
from datetime import date, datetime
import logging
from homeassistant.core import HomeAssistant
from homeassistant.components.sensor import SensorEntity, SensorDeviceClass
from homeassistant.config_entries import ConfigEntry
from homeassistant.cons... | sHedC/homeassistant-mastertherm | custom_components/mastertherm/sensor.py | sensor.py | py | 2,980 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "homeassistant.core.HomeAssistant",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "homeassistant.config_entries.ConfigEntry",
"line_number": 22,
"usage_type": "name"
}... |
35095640017 | from django.shortcuts import render
from .models import cities, city
from django.http import Http404
from datetime import datetime
import pytz
import folium
now = datetime.now(pytz.timezone('Europe/Warsaw')).strftime("%H")
def weather_view(request, *args, **kwargs):
cities_ = cities.objects.all()
city_ = city... | Kapiura/weather.is | src/cities/views.py | views.py | py | 2,002 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pytz.timezone",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.cities.obje... |
19169680561 | from setuptools import setup
with open('requirements.txt') as fp:
install_requires = fp.read()
setup(
name='mapped_config',
packages=['mapped_config'],
version='2.36',
description='Mapped config loader for python for secure, easy and modular configuration management',
author='Alvaro Garcia Gom... | maxpowel/mapped_config | setup.py | setup.py | py | 738 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
}
] |
71899575783 | import csv
import random
import numpy as np
from sklearn import preprocessing
import matplotlib.pyplot as plt
from keras.models import Sequential, Model
from keras.layers import Dense, LSTM, TimeDistributed, Conv2D, Flatten
from keras.optimizers import Adam
import utm
max_latitude = 330414.05273900216
max_longitude = ... | haoranpb/datamining | hw3/code/e.py | e.py | py | 12,319 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number"... |
26195476426 | from typing import List
from tensorflow import keras
from sklearn.model_selection import train_test_split
import librosa
import numpy as np
from tqdm.notebook import tqdm
import os
import data_augmentation
import random
RATE = 8000
def load_recordings(paths=["recordings"], label_type="number", sr=RATE):
"""
... | GianCarloMilanese/dsim_project | Audio/data_preparation.py | data_preparation.py | py | 18,819 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "tqdm.notebook.tqdm",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "librosa.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_nu... |
11936612348 | from typing import Optional, TYPE_CHECKING
from django.db import models
from django.contrib.auth.models import Group, User
from rest_framework import serializers
from rest_framework.exceptions import NotFound
from processes.exception import UnprocessableEntity
from .uuid_model import UuidModel
if TYPE_CHECKING:
... | CloudReactor/task_manager | server/processes/models/named_with_uuid_model.py | named_with_uuid_model.py | py | 2,749 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "uuid_model.UuidModel",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "... |
7775088104 | from django.shortcuts import render
from operator import attrgetter
# Para a paginação
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage, InvalidPage
# Importamos a função criada anteriormente
from post.views import get_post_queryset
POSTS_PER_PAGE = 2 # Pode ser qualquer valor acima de 0, co... | imklesley/SimpleBlog_Site_API | personal/views.py | views.py | py | 1,994 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "post.views.get_post_queryset",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "operator.attrgetter",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "django.core.paginator.Paginator",
"line_number": 37,
"usage_type": "call"
},
{
"... |
33943744293 | import asyncio
import atexit
import dataclasses
import multiprocessing
import time
from typing import Any, Dict
from aiogram import Bot, Dispatcher
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters import Text
from aiogram.dispatcher... | i026e/tg_filtering_bot | tg_filtering_bot/bot/filtering_bot.py | filtering_bot.py | py | 10,642 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aiogram.contrib.middlewares.i18n.I18nMiddleware",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tg_filtering_bot.config.settings.I18N_DOMAIN",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "tg_filtering_bot.config.settings",
"line_nu... |
33408291882 | from selenium import webdriver
import time
from selenium.webdriver.common.by import By
class clickSendkey():
def test(self):
driver = webdriver.Firefox(executable_path='/Users/Jatin Singh/Downloads/geckodriver')
driver.get('https://google.com/')
driver.maximize_window()
texttype =... | JatinSsingh/SeleniumPython | pythonProject/webelement.py | webelement.py | py | 648 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
22565700808 | from abc import ABC, abstractmethod
from dataclasses import dataclass
from functools import partial
from typing import Any, Dict, List, Optional, Tuple
import torch
from shap_e.models.nn.utils import sample_pmf
from shap_e.models.volume import Volume, VolumeRange
from shap_e.util.collections import AttrDict
from .mo... | openai/shap-e | shap_e/models/nerf/ray.py | ray.py | py | 19,663 | python | en | code | 10,619 | github-code | 36 | [
{
"api_name": "torch.Tensor",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "model.NeRFModel",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"... |
3163314445 | #!/usr/bin/python
import sys, glob
from sys import platform
if platform == "linux" or platform == "linux2":
sys.path.insert(0, glob.glob('/home/yaoliu/src_code/local/lib/lib/python2.7/site-packages/')[0])
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBin... | sonaliw-pointers/distributed-systems | DistributedStore/initReplica.py | initReplica.py | py | 10,236 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.platform",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sys.path.insert",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number"... |
14570130326 | from skimage.io import imread, imsave
from numpy import clip
img = imread('img.png')
pixels = []
for row in img:
for pixel in row:
pixels.append(pixel)
pixels.sort()
k = round(len(pixels) * 0.05)
mn, mx = pixels[k], pixels[-k]
img = img.astype('float')
img = (img - mn) / (mx - mn) * 255
img = clip(img, ... | vfolunin/stepic-image-processing-course | week2/3. Устойчивый автоконтраст черно-белого изображения.py | 3. Устойчивый автоконтраст черно-белого изображения.py | py | 382 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "skimage.io.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "skimage.io.imsave",
"line_number": 20,
"usage_type": "call"
}
] |
74160035623 | '''
Descripttion: 两个数组的交集 II
version: 1
Author: Jason
Date: 2020-11-22 16:58:35
LastEditors: Jason
LastEditTime: 2020-11-22 16:59:35
'''
import random
from typing import List
def GenerateRandomList(number, size):
temp = list()
random_legth = random.randint(0, size)
current_length = 0
... | CodingProgrammer/Algorithm | 双指针/350.py | 350.py | py | 1,700 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_num... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.