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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74539110134 | #!/usr/bin/env python
# encoding: utf-8
#!/bin/env python
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.gen
import tornado.httpclient
import tornado.concurrent
import tornado.ioloop
import time
from pymongo import Connection
from tornado.options import defi... | zhkzyth/BT-Share | web/test/request-async.py | request-async.py | py | 1,806 | python | en | code | 47 | github-code | 21 | [
{
"api_name": "tornado.options.define",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pymongo.Connection",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tornado.httpserver.web",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": ... |
28410680183 | from root_api import gw_api
import json
def get_timestamp():
data = r'{}'
d = gw_api(api="mtop.common.gettimestamp", version="*", data=data,
host="guide-acs.m.taobao.com")
return json.loads(d)['data']['t']
if __name__ == '__main__':
print(get_timestamp())
| chendayin/taobao_spider | get_taobao_timestamp.py | get_taobao_timestamp.py | py | 291 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "root_api.gw_api",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
}
] |
17343858789 | from buildingid.code import decode, encode
from openlocationcode.openlocationcode import MAX_DIGIT_COUNT_
from shapely.geometry import Point, Polygon
def encode_ubid(geometry: Polygon) -> str:
min_longitude, min_latitude, max_longitude, max_latitude = geometry.bounds
centroid = geometry.centroid
ubid = en... | SEED-platform/cbl-workflow | utils/ubid.py | ubid.py | py | 1,049 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "shapely.geometry.Polygon",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "buildingid.code.encode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "openlocationcode.openlocationcode.MAX_DIGIT_COUNT_",
"line_number": 9,
"usage_type": "name"... |
71246469173 | from django.urls import path, include
from rest_framework import routers
from purchases.views import (
PurchaseAPIView,
PurchasesListAPIView,
MonthlyCostsView
)
router = routers.SimpleRouter()
router.register("purchases", PurchaseAPIView, basename="purchases")
urlpatterns = [
path("", include(rout... | Maksim-Burtsev/tgbot_api | purchases/urls.py | urls.py | py | 453 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.routers.SimpleRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "purchases.views.PurchaseAPIView",
"line_number": 13,
"usage_type": "argument"
... |
43481865173 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 14 11:08:42 2020
@author: Miguel
"""
import numpy as np
# =============================================================================
# ODE SOLVERS
# =============================================================================
def euler(x_i, f_i, h):
... | migueldelafuente1/diseaseSIRModel | disease.py | disease.py | py | 11,187 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.log",
"line_number": 254,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 265,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 265,
"usage_type": "name"
},
{
"api_name": "matplotlib.... |
12143131143 | import datetime
import requests
import uuid
import json
from flask.views import MethodView
from flask import request, g
from api.globals import db, endpoints, exceptions
from common.config import constants
from common.databases.tosurnament.token import Token
from api import logger
def get_user_id(access_token):
... | SpartanPlume/Tosurnament | backend/api/v1/tosurnament/token/__init__.py | __init__.py | py | 2,551 | python | en | code | 10 | github-code | 21 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "api.globals.endpoints.DISCORD_ME",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "api.globals.endpoints",
"line_number": 18,
"usage_type": "name"
},
{
"api_name... |
41453718151 | from flask import Flask, render_template, jsonify, make_response, request
import requests
import json
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
API_KEY = "AIzaSyBwQIJgd3BTxyNA8ccg6vcplWGA5kWNbNE"
def getTimeDuration(currentLoc, destLoc, mode = "walking"):
url = "https://maps.googleapis.com/maps/... | CS196Illinois/Group1-SP22 | Project/qpang2/flask/app.py | app.py | py | 7,918 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number"... |
18209611072 | from enum import Enum
class Color(Enum):
kWhite = 0
kRed = 1
kGreen = 2
class Solution:
def possibleBipartition(self, n: int, dislikes: List[List[int]]) -> bool:
graph = [[] for _ in range(n + 1)]
colors = [Color.kWhite] * (n + 1)
for u, v in dislikes:
graph[u].append(v)
graph[v].ap... | walkccc/LeetCode | solutions/0886. Possible Bipartition/0886.py | 0886.py | py | 908 | python | en | code | 756 | github-code | 21 | [
{
"api_name": "enum.Enum",
"line_number": 4,
"usage_type": "name"
}
] |
31896632358 | from datetime import timedelta
from dateutil.relativedelta import relativedelta, MO, TU, WE, TH, FR, SA, SU
from z3c.form.interfaces import ITextWidget
from zope.interface import Interface, Attribute
from uu.task import _
TASK_STATE_KEY = "uu.task.state"
TASK_NOTIFICATIONS_KEY = "uu.task.notifications"
TASK_STATE_I... | upiq/uu.task | uu/task/interfaces.py | interfaces.py | py | 2,303 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "uu.task._",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "uu.task._",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "uu.task._",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "uu.task._",
"line_number": 18,
... |
71313730292 | from sb3_contrib import MaskablePPO
from sb3_contrib.common.maskable.utils import get_action_masks
from stable_baselines3.common.monitor import Monitor
import gym
from online_policy_adaptation_using_rollout.ppo_base_policy.scenario_1_env.routing_env import RoutingEnv
from online_policy_adaptation_using_rollout.ppo_base... | foroughsh/online_policy_adaptation_using_rollout | src/online_policy_adaptation_using_rollout/evaluation/evaluation.py | evaluation.py | py | 5,310 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "gym.make",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "stable_baselines3.common.monitor.Monitor",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sb3_contrib.MaskablePPO.load",
"line_number": 27,
"usage_type": "call"
},
{
"ap... |
21163346744 | #!/usr/bin/with-contenv python3
# -*- coding: utf-8 -*-
import os
import sys
import time
import socket_request
from shutil import copy2
from config.configure import Configure as CFG
from common.icon2 import get_preps, get_inspect, get_validator_status, get_validator_info, get_validator_info_by_node_key
from common.out... | havah-project/havah-chain-node-docker | ctx/manager/chain_init.py | chain_init.py | py | 9,280 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "config.configure.Configure",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "socket_request.ControlChain",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "time.... |
9397593320 | from PIL import Image,ImageDraw,ImageFont,ImageFilter
import random
import os
from io import BytesIO
def random_str():
all_str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz1234567890'
i = 0
login_code = ''
while i < 4:
login_code = login_code + random.choice(all_str)
i = i + 1
... | nishikinoyan/login_code | login_code_create.py | login_code_create.py | py | 1,539 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "random.choice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image.new",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_numb... |
921139873 | """This defines a class for handling Lua scripts for LabJack T7 DAQ modules"""
import inspect
import time
from pathlib import Path
from time import sleep
import re
import dsautils.dsa_syslog as dsl
from labjack import ljm
from hwmc.common import Config as CONF
from hwmc.utilities import vprint as vprint
# Set up mo... | dsa110/dsa110-hwmc | hwmc/lua_script_utilities.py | lua_script_utilities.py | py | 6,974 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dsautils.dsa_syslog.DsaSyslogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dsautils.dsa_syslog",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "hwmc.common.Config.SUBSYSTEM",
"line_number": 17,
"usage_type": "attribute"
},
{... |
2778124709 | """Add type to actions
Revision ID: 256ba522e545
Revises: d5f29bd1a40b
Create Date: 2022-05-20 08:57:32.214004
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '256ba522e545'
down_revision = 'd5f29bd1a40b'
branch_labels = None
depends_on = None
def upgrade():
... | Charl1996/churchlife | alembic/versions/256ba522e545_add_type_to_actions.py | 256ba522e545_add_type_to_actions.py | py | 655 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
28973051501 | import tensorflow as tf
import tensorflow_datasets as tfds
def get_data(batch_size=32, shuffle_buffer=1024):
AUTO = tf.data.experimental.AUTOTUNE
train, valid = tfds.load('mnist', split=['train', 'test'], shuffle_files=True)
train = train.shuffle(shuffle_buffer).batch(batch_size).prefetch(AUTO)
valid... | b1ck0/transfer-training-samples | tf-mnist-efficientnetb0-single-node/main.py | main.py | py | 1,757 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.data",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "tensorflow_datasets.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.layers.Input",
"line_number": 22,
"usage_type": "call"
},
{
"api_nam... |
10374397053 | from django.db import models
# Create your models here.
class Room(models.Model):
code = models.CharField(max_length=4)
num = models.IntegerField()
start = models.DateTimeField(blank=True,null=True)
class Guess(models.Model):
room_id = models.ForeignKey(Room,on_delete=models.CASCADE)
info = models.CharFiel... | Yuki326/numeronBackend | myapp/models.py | models.py | py | 436 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
72936285173 | """
This command is used to load all of the default data into the database, or to update the data if new files are
obtained, e.g. a new file from Human Phenotype Ontology (HPO).
To run this file use 'python manage.py load' in your virtual environment in the root directory for the project.
"""
import os
im... | JacobSpectorMD/ClinTAD | home/management/commands/load.py | load.py | py | 27,786 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "os.... |
2210736463 | import matplotlib.pyplot as plt
import numpy
file = open("fael.txt").read().split("LINE")
f1 = [float(i.split(" ")[1]) for i in file[0].split("\n")[:-1]]
f2 = [float(i.split(" ")[1]) for i in file[1].split("\n")[1:-1]]
fd1 = numpy.array(f1)
fdd1 = numpy.arange(0, len(f1), 1)
print(len(f1), len(f2))
fd2 = numpy.arr... | tomsoier1/num1 | plot.py | plot.py | py | 444 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number":... |
29468127252 | import base64
from Crypto.Util.number import long_to_bytes
from dataclasses import dataclass
from typing import Any, Callable, Type
from . import sony, nec
@dataclass
class ProtocolDefinition:
name: str
type: Type
encoder: Callable[[Any], str]
PROTOCOLS = [
ProtocolDefinition("NEC", nec.Command, ne... | rgsilva/homeassistant-positivo | tuya_remote/protocols.py | protocols.py | py | 1,207 | python | en | code | 28 | github-code | 21 | [
{
"api_name": "typing.Type",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"l... |
10684002431 | """
A collection of general helper functions.
"""
import argparse
import os
import random
from PIL import Image
import image_slicer
import tensorflow as tf
def scale(image):
""" Normalizes each pixel value to be in the [0,1] range.
Args:
image: the original image.
Returns:
the original i... | TheWeiHu/image_denoising | utils.py | utils.py | py | 7,419 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "tensorflow.cast",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.cast",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.ma... |
3325413361 | from datetime import datetime
from django.db.models import Count, Avg
from django.utils import timezone
from rest_framework import serializers
from product.models import Event as EventModel
from product.models import Product as ProductModel
from product.models import ProductReview as ProductReviewModel
... | GoHeeSeok00/drf_sparta | product/serializers.py | serializers.py | py | 3,786 | python | ko | code | 2 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "product.models.Event",
"line_number": 17,
"usage_type": "name"... |
4100082256 | from django.urls import path
from inventory.views import RetailerProductList, RetailerProductDetail
app_name = "retailer_inventory"
urlpatterns = [
path("list", RetailerProductList.as_view(), name="product_list_view"),
path(
"detail/<int:pk>", RetailerProductDetail.as_view(), name="product_detail_vie... | tanjibpa/mednet | src/inventory/urls/retailer.py | retailer.py | py | 332 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "inventory.views.RetailerProductList.as_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "inventory.views.RetailerProductList",
"line_number": 8,
"usage_type": "name"
... |
29718423601 | from dataclasses import dataclass
# Defaults taken from syntaxdot
# https://github.com/tensordot/syntaxdot/blob/22bd3d43ed2d7fcbef8a6217b01684194fae713f/syntaxdot-transformers/src/models/bert/config.rs#L25
@dataclass
class BERTEmbeddingConfig:
"""
BERT (`Devlin et al., 2018`_) embedding configuration.
.... | popin0/curated-transformers | curated_transformers/models/bert/config.py | config.py | py | 6,951 | python | en | code | null | github-code | 21 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 86,
"usage_type": "name"
},
{
"api_name": "data... |
22816435052 | import argparse
import os
import pandas as pd
import pickle
import numpy as np
from pathlib import Path
import time
import csv
import re
from scipy import stats
from analyze import assign_node_type, calc_tt
__author__ = 'Nolan Newman'
__contact__ = 'nolankn@uio.no'
if __name__ == '__main__':
"""
Descripti... | newmanno/sisana | network_analysis/compare_degrees.py | compare_degrees.py | py | 2,468 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "time.time",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "analyze.assign_node... |
22327551936 | from __future__ import absolute_import
from keras import backend as K
import numpy as np
import six
from keras.utils.generic_utils import serialize_keras_object
from keras.utils.generic_utils import deserialize_keras_object
from keras.constraints import *
# if K.backend() == 'theano':
# from theano import tensor as... | the-moliver/kfs | kfs/constraints.py | constraints.py | py | 3,739 | python | en | code | 69 | github-code | 21 | [
{
"api_name": "keras.backend.ndim",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "keras.backend.permute_dimensions",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "ker... |
43577327891 | from django.shortcuts import render, redirect
from django.http import HttpResponse , HttpResponseRedirect
from .models import *
from .forms import *
from django.contrib.auth import logout, authenticate
# Create your views here.
def home(request):
if request.POST:
try:
if request.POST... | mousavi-lg/Simply-site | base/views.py | views.py | py | 1,164 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "django.contrib.auth.logout",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 25,
"usage_type": "call"
},
{
"api_... |
15297664468 | import streamlit as st
import pandas as pd
import modules.data as data
from modules.database import GuppyPostGres
if "flatData" not in st.session_state or "typeData" not in st.session_state:
guppyDb = GuppyPostGres(**st.secrets.pg_credentials)
flatData, typeData = data.GetBenchmarkData(db=guppyDb)
st.session_... | rink72/guppy_parameter_optimiser_streamlit | src/app.py | app.py | py | 1,557 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "streamlit.session_state",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "modules.database.GuppyPostGres",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.secrets",
"line_number": 9,
"usage_type": "attribute"
},
{
"a... |
34877270717 | import re,requests,urllib3,subprocess,traceback,copy
from datetime import datetime
from ..slack import slack_sender
from ..utils import utils
from .. import constants
from ..mongo import mongo
from ..redmine import redmine
from ...objects.vulnerability import Vulnerability
regions = ['us-east-2', 'us-east-1', 'us-wes... | badBounty/Orchestrator | Orchestrator/OrchestratorApp/src/security/bucket_finder.py | bucket_finder.py | py | 8,480 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "slack.slack_sender.send_simple_message",
"line_number": 21,
"usage_type": "call"
},
... |
20414961760 | #!/usr/bin/env python
from __future__ import print_function,division
__author__ = "Yu Feng and Martin White"
__version__ = "1.0"
__email__ = "yfeng1@berkeley.edu or mjwhite@lbl.gov"
import h5py
from imaginglss import DECALS
from imaginglss.cli import CLI
cli = CLI("""
Query Depth from DECALS data f... | desihub/imaginglss | scripts/imglss-mpi-query-depth.py | imglss-mpi-query-depth.py | py | 2,695 | python | en | code | 6 | github-code | 21 | [
{
"api_name": "imaginglss.cli.CLI",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "imaginglss.DECALS",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.seterr",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "mpi4py.MPI.COMM_WOR... |
14116566253 | import numpy as np # linear algebra
import pandas
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import cv2
from keras.models import Sequential, Model,load_model
import os
import matplotlib.pyplot as plt
import random
os.environ['KMP_DUPLICATE_LIB_OK']='True'
img_size=224
model=load_model('... | MohamedAbdelAleem-cs/NN_Sports_classification | Project/test.py | test.py | py | 1,235 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "keras.models.load_model",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.walk",
... |
12127467188 | from flask_restplus import Api
from flask import Blueprint
from app.main.controller.football_controller import api as football_ns
blueprint = Blueprint('api', __name__)
api = Api(blueprint,
title='POSEIDON PREDICTOR SERVER',
version='1.0',
description='a boilerplate for flask restplus we... | HeewonChae/PoseProject | MachineLearning/Poseidon_Predictor_Server/app/__init__.py | __init__.py | py | 393 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "flask.Blueprint",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_restplus.Api",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.main.controller.football_controller.api",
"line_number": 13,
"usage_type": "argument"
}
] |
75026496052 | import cv2
import matplotlib.pyplot as plt
import numpy as np
import requests
from PIL import Image
from keras.datasets import mnist
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import Flatten
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPo... | gahgsp/convolutional-neural-network-mnist | main.py | main.py | py | 5,323 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.models.Sequential",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "keras.layers.convolutional.Conv2D",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.layers.convolutional.MaxPooling2D",
"line_number": 24,
"usage_type": "cal... |
4988234262 | from models.sun_model import CNNModel
from PIL import Image
import os
import torch
from torch.autograd import Variable
from torchvision import transforms
from dataset.sun_data_loader import GetLoader
import numpy as np
batch_size = 128
image_size = 256
data_transforms = {
'train': transforms.Compose([
tra... | liuxindazz/JANN | getfea.py | getfea.py | py | 3,254 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.RandomResizedCrop",
"line_number": 15,
"usage_type": "call"
... |
38787018846 | import json
import sys
from chatclient.сhatclient.Log.Log_decorators import log
from chatserver.сhatserver.Mainlib.variables import ENCODING
sys.path.append('../')
class JIM(object):
pass
@log
def get_message(client):
"""
The utility for receiving and decoding a message accepts bytes and gives out a diction... | nikolaeff80/GB_Learn_Chat | сhatclient/Mainlib/JIM.py | JIM.py | py | 1,560 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "chatserver.сhatserver.Mainlib.variables.ENCODING",
"line_number": 24,
"usage_type": "argument"
},
{
"... |
29562462950 | import torch
import torch.nn as nn
from .smplx_local import SMPLX
from ...core import config
from ...core.constants import NUM_JOINTS_SMPLX
from ...utils.geometry import perspective_projection, convert_weak_perspective_to_perspective
class SMPLXHead(nn.Module):
def __init__(self, focal_length=5000., img_res=224)... | pixelite1201/BEDLAM | train/models/head/smplx_head.py | smplx_head.py | py | 1,842 | python | en | code | 164 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "smplx_local.SMPLX",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "core.config.SMPLX_MOD... |
73032885493 | import os
import re
import pickle
import logging
from collections import defaultdict, namedtuple
from urllib.parse import urljoin, urlparse
import nltk
import numpy as np
import scipy.sparse as sp
from webgraph import WebPageGraph, Link
from pagerank import pagerank
from htmltools import iter_html_files, ParseHTML
... | LiuFang816/SALSTM_py_data | python/itdxer_neupy/neupy-master/site/search-index/build.py | build.py | py | 5,205 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "logging.basicConfig",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
18384243101 | import numpy as np
import pytest
from scipy.special import assoc_laguerre
from mrmustard import settings
from mrmustard.lab import (
Coherent,
Fock,
SqueezedVacuum,
State,
)
from mrmustard.physics.wigner import wigner_discretized
# original settings
autocutoff_max0 = settings.AUTOCUTOFF_MAX_CUTOFF
aut... | XanaduAI/MrMustard | tests/test_physics/test_wigner.py | test_wigner.py | py | 7,164 | python | en | code | 69 | github-code | 21 | [
{
"api_name": "mrmustard.settings.AUTOCUTOFF_MAX_CUTOFF",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "mrmustard.settings",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "mrmustard.settings.AUTOCUTOFF_MIN_CUTOFF",
"line_number": 16,
"usage_typ... |
1079118019 | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
""" Test Configuration REST API """
import os
import http.client
import json
from urllib.parse import quote
import time
from collections import Counter
import pytest
from foglamp.common.common import _FOGLAMP_ROOT, _FOGLAMP_D... | foglamp/FogLAMP | tests/system/python/api/test_configuration.py | test_configuration.py | py | 15,970 | python | en | code | 70 | github-code | 21 | [
{
"api_name": "foglamp.common.common._FOGLAMP_DATA",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "foglamp.common.common._FOGLAMP_ROOT",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 31,
"usage_type": "call"
},
{... |
32340595330 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask.ext.script import Manager, Server, Shell, prompt_bool
from core import app
from core.models import db
from core.routes import site
from crawler.runner import run_spiders
# 注册路由
app.register_blueprint(site)
# 创建 Manager 实例
manager = Manager(app)
# 启动服务器
man... | ryerh/py-crawler | manage.py | manage.py | py | 974 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "core.app.register_blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "core.routes.site",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "core.app",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.ext.s... |
74678177653 | #Importing libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
url = "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data"
#----------------------------------------------------------------------------------------------------------
# Loading dataset into Pandas DataFr... | imullick/pca | code.py | code.py | py | 4,766 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_numbe... |
6626914837 | """미로에서 1은 이동할 수 있는 칸을 나타내고, 0은 이동할 수 없는 칸을 나타낸다. 이러한 미로가 주어졌을 때, (1, 1)에서 출발하여 (N, M)의 위치로 이동할 때 지나야 하는 최소의 칸 수를 구하는 프로그램을 작성하시오. 한 칸에서 다른 칸으로 이동할 때, 서로 인접한 칸으로만 이동할 수 있다.
위의 예에서는 15칸을 지나야 (N, M)의 위치로 이동할 수 있다. 칸을 셀 때에는 시작 위치와 도착 위치도 포함한다."""
from collections import deque
dx, dy = [1, 0, -1, 0], [0, 1,0, -1]
n, m =... | kkkmj/algorithm_study | BFS&DFS/2178.py | 2178.py | py | 1,590 | python | ko | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 35,
"usage_type": "call"
}
] |
70440723573 | import os
import time
import boto3
from shopify.base import ShopifyConnection
import pyactiveresource.connection
from functools import wraps
def resp(body_data):
return {
'statusCode': 200,
'headers': {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'... | koinherman/serverless-ex | src/utils.py | utils.py | py | 1,790 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "functools.wraps",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "shopify.base.ShopifyConnection._open",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "shopify.base.ShopifyConnection",
"line_number": 32,
"usage_type": "name"
},
... |
17617485586 | '''
Description: 界面
Author: Senkita
Date: 2021-12-22 12:17:30
LastEditors: Senkita
LastEditTime: 2022-03-17 20:28:01
'''
from types import FunctionType
from typing import Tuple, Union
import PySimpleGUI as sg
from src.Tools.Tools import verification
class Interface:
def __init__(self) -> None:
... | Senkita/Science_Reading_Book_Downloader | src/UI/Interface.py | Interface.py | py | 3,298 | python | zh | code | 22 | github-code | 21 | [
{
"api_name": "PySimpleGUI.T",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.T",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.T",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.T",
"line_n... |
29976518341 | from typing import Any, Dict, Optional, Union
from aiogram.filters import Filter
from aiogram.types import Message, User
class HelloFilter(Filter):
def __init__(self, name: Optional[str] = None) -> None:
self.name = name
async def __call__(
self,
message: Message,
event_from_... | Bloodies/Personal-BOT | bot/filters/filters.py | filters.py | py | 511 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "aiogram.filters.Filter",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "aiogram.types.Message",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "aiogram.ty... |
70445050934 | import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
from sklearn.datasets import make_blobs
X, y_true = make_blobs(n_samples=300, centers=4, cluster_std=0.60, random_state=0) #4 개의 클러스터 생성
plt.scatter(X[:, 0], X[:, 1], s=50);
plt.show()
plt.cla()
n_cluster = range(1,10)
kmeans_test =... | LEESAE-BOM/AIClass | 2019116247_kmeans.py | 2019116247_kmeans.py | py | 942 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.datasets.make_blobs",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "... |
17070578998 | import os
import jwt
from pydantic import BaseModel, Field
class BearerSchema(BaseModel):
"""
declare a data model for the Bearer details
"""
bearer_name: str = Field(...)
bearer_secret: str = Field(...)
class Config:
"""
an example usage of the model
"""
json... | RENCI/APSViz-Settings | src/common/security.py | security.py | py | 1,926 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pydantic.Field",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
... |
72114868532 | #!/usr/bin/python
# -*- coding:utf-8 -*-
from django.conf.urls import re_path
from django.urls import path
from firstapp import views
urlpatterns = [
path('checkUsername/',views.checkUsername,name='checkUsername'),
path('checkEmail/',views.checkEmail,name='checkEmail'),
path('captcha/',views.captcha,name='... | firefly668/ShortTerm_back-end | firstapp/urls.py | urls.py | py | 3,933 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "firstapp.views.checkUsername",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "firstapp.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django... |
74932994292 | # -*- coding: UTF-8 -*-
import emoji
import operator
from emoji import UNICODE_EMOJI
#Funções
def extract_emojis(str):
s = ''.join(c for c in str if c in emoji.UNICODE_EMOJI)
return (count_emoji(s))
#return ''.join(c for c in str if c in emoji.UNICODE_EMOJI)
def has_emoji(s):
count = 0
for emoji in UNICODE_EMO... | deboramour4/emoji-finder | emoji.py | emoji.py | py | 3,623 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "emoji.UNICODE_EMOJI",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "emoji.UNICODE_EMOJI",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "operator.itemgetter",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "emoj... |
32001125408 | import pygame as pg
import random
import sys
class Screen:#背景を生成
def __init__(self, title, whtpl, bgfile):
self.title = title
self.whtpl = whtpl
pg.display.set_caption(self.title)
self.sfc = pg.display.set_mode(self.whtpl)
self.rct = self.sfc.get_rect()
self.bgi_sfc... | kotaokuda/ProjExD | ex06/jump_kokaton.py | jump_kokaton.py | py | 5,922 | python | ja | code | 0 | github-code | 21 | [
{
"api_name": "pygame.display.set_caption",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name":... |
73070597813 | import config
from user_data_worker import UserDataWorker
from utils import *
from toxicity_detector import NNClassifier
import telebot
from telebot.types import Message, User
import threading
import sentry_sdk
sentry_sdk.init(config.sentryToken, traces_sample_rate=0.35)
# init telegram bot
bot = telebot.TeleBo... | DenisIndenbom/AntiToxicBot | main.py | main.py | py | 11,221 | python | en | code | 15 | github-code | 21 | [
{
"api_name": "sentry_sdk.init",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "config.sentryToken",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "telebot.TeleBot",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "config.telegr... |
1303407614 | import datetime
import numpy as np
exec_part = 2 # which part to execute
exec_test_case = 0 # -1 = all test inputs, n = n_th test input; 0 = real puzzle input
# Puzzle input
with open('input/input_test17.txt') as f:
INPUT_TEST = f.read()
with open('input/input17.txt') as f:
INPUT = f.read()
def parse_inp... | vunguyenq/adventofcode | 2021/17.TrickShot.py | 17.TrickShot.py | py | 3,692 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
3175133821 | import os
from email import parser
import csv
from datetime import datetime
import numpy as np
# Location of the employee directories
rootDic = os.path.join(os.getcwd(),'enron_mail_20150507','maildir')
# Parses the emails contained in subdirectories of empl that contain
# the string 'sent' in their na... | MKaivola/Enron_Aktia | main.py | main.py | py | 5,080 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 17,
... |
8597248377 | import csv
import logging
from io import StringIO
from flask import g, jsonify, make_response, request, send_file, url_for
from xivo import tenant_helpers
from xivo.auth_verifier import required_acl
from xivo.tenant_flask_helpers import Tenant, auth_client, token
from wazo_call_logd.auth import (
extract_token_id... | wazo-platform/wazo-call-logd | wazo_call_logd/plugins/cdr/http.py | http.py | py | 12,298 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "logging.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"li... |
28230041396 | '''
Given a knight in a chessboard (a binary matrix with 0 as empty and 1 as barrier) with a source position, find the shortest path to a destination position, return the length of the route.
Return -1 if knight can not reached.
source and destination must be empty.
Knight can not enter the barrier.
Clarification
If ... | zsmountain/lintcode | python/bfs/611_knight_shortest_path.py | 611_knight_shortest_path.py | py | 2,615 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "collections.deque",
"line_number": 64,
"usage_type": "call"
}
] |
71837219894 | from flask import Flask
from flask import url_for, render_template, request, redirect
from database_utils import *
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = "tables"
def check_empty(arg_list):
if arg_list == [""]:
return list()
else:
return arg_list
@app.route('/')
def index():
... | EkaterinaVoloshina/LexTypDB | app.py | app.py | py | 4,695 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.request.... |
24899719085 |
from aiogram import types, Bot, Dispatcher
import pytesseract
from PIL import Image
API_TOKEN = "6214205049:AAG2hKi_LViqSZuxbB37VMoyySSK3w7i2Fg"
bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)
@dp.message_handler(commands=['start'])
async def start_command(message: types.Message):
await message.reply('Привет! ... | DmitriiKolesnikov/NonDum_Bot | Nondum_clients.py | Nondum_clients.py | py | 1,118 | python | ru | code | 0 | github-code | 21 | [
{
"api_name": "aiogram.Bot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "aiogram.Dispatcher",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aiogram.types.Message",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types... |
15224493957 | import re
import requests
from json import loads, dumps
from .NotifyBase import NotifyBase
from ..common import NotifyType
from ..utils import is_phone_no
from ..utils import parse_phone_no
from ..utils import validate_regex
from ..AppriseLocale import gettext_lazy as _
class NotifyWhatsApp(NotifyBase):
"""
A... | caronc/apprise | apprise/plugins/NotifyWhatsApp.py | NotifyWhatsApp.py | py | 17,770 | python | en | code | 8,936 | github-code | 21 | [
{
"api_name": "NotifyBase.NotifyBase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "NotifyBase.NotifyBase.template_tokens",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "NotifyBase.NotifyBase",
"line_number": 54,
"usage_type": "name"
},
{... |
22993488159 | from django.dispatch import receiver
from django.db.models.signals import pre_save, post_save, pre_delete
from transactions.models import Transaction, WalletTransacton
from django.utils.timezone import now
from django.core.exceptions import ValidationError
def wallet_controller(instance):
if instance.is_return and ... | maharshivpatel/bookclub | transactions/signals.py | signals.py | py | 5,377 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 50,
... |
24020032509 | import setuptools
from pathlib import Path
long_desc = Path('README.md').read_text('utf-8')
setuptools.setup(
name='helloworldplayerlili',
version='0.0.3',
long_description=long_desc,
long_description_content_type='text/markdown',
packages=setuptools.find_packages(
exclude=['mocks', 'tests... | ljloaizap/ultimate_python | helloworldplayerlili/setup.py | setup.py | py | 331 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 11,
"usage_type": "call"
}
] |
15327356770 | import cv2
from Survellance_Engines.Vision_engine import Vision_Engine
import playsound
class ML_Engine():
def __init__(self):
self.VI=Vision_Engine()
self.IG=0
self.impurity=1
self.MOTION=False
self.contours_present=False
self.Face=False
self.TAMPER=False... | SwetaSubhraDatta/Rakshak--Smart-security-webcam | Survellance_Engines/ML_Engine.py | ML_Engine.py | py | 4,608 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "Survellance_Engines.Vision_engine.Vision_Engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.contourArea",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.putText",
"line_number": 109,
"usage_type": "call"
},
{
"api_... |
6520794423 | from tkinter import * # Importing the GUI library
from sympy import * # Importing the graphing library
from sympy.solvers import solve
from sympy import Symbol
canvas = Tk() # Creates a background window
canvas.geometry("1424x840+0+0")
canvas.title("Solve any polynomial equati... | blongen1/my-python-graph | mpg.py | mpg.py | py | 3,182 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sympy.Symbol",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "sympy.solvers.solve",
"line_number": 95,
"usage_type": "call"
}
] |
13823617181 | """edgebox_web URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | zhouzhousc/EB | edgebox_web/urls.py | urls.py | py | 2,085 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.urls.include",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.contrib.... |
39073918198 |
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
image = cv.imread("images/xray1.jpg", 0)
img_hist= cv.calcHist([image], [0],None,[256], [0,256])
equalized_histogram = cv.equalizeHist(image)
img_equal_hist= cv.calcHist([equalized_histogram], [0],None,[256], [0,256])
clahe = cv.createCLAHE(cli... | mrymsadeghi/Learn_Python_codes | Image_processing/10_HistogramEqu.py | 10_HistogramEqu.py | py | 714 | python | en | code | 40 | github-code | 21 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.calcHist",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.equalizeHist",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.calcHist",
"line_number... |
70430646134 | from typing import Any
import pytorch_lightning as pl
import torch
import torch.nn as nn
from torchvision.utils import make_grid
import matplotlib.pyplot as plt
import cv2
import numpy as np
# import trimesh
# import vedo
# from vedo import Points, show, trimesh2vedo
from scipy.spatial.transform import Rotation as R
... | carolinahiguera/NCF-Policy | NCF_policies/algo2/ncf/contact_regressor/pipeline.py | pipeline.py | py | 8,418 | python | en | code | 9 | github-code | 21 | [
{
"api_name": "numpy.eye",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.transform.Rotation.from_euler",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "scipy.spatial.transform.Rotation",
"line_number": 38,
"usage_type": "name"
},
{... |
12058081505 | # The page from which all other classes will be inherited
# In it we describe auxiliary methods for working with the driver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException, WebDriverException
from selenium.webdriver.support import expected_conditions
from seleni... | Natasha2202/UI_tests_calculator | pages/base_page.py | base_page.py | py | 2,126 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "selenium.common.exceptions.NoSuchElementException",
"line_n... |
31343425699 | import pandas as pd
from pymongo import MongoClient
import os
import dotenv
from sqlalchemy import create_engine, text
dotenv.load_dotenv()
answers = pd.read_csv('./data/answers.csv')
photos = pd.read_csv('./data/answers_photos.csv')
questions = pd.read_csv('./data/questions.csv')
# merge rows with the same answer_id
... | SDC-2023/question-api | db/db_mongo_postgres.py | db_mongo_postgres.py | py | 2,420 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
12861011358 | from flask_restful import Resource, reqparse
from flask_jwt import jwt_required
from datetime import datetime
from os import path, makedirs, remove
from shutil import rmtree
from traceback import print_exc
import subprocess
from models.blueprint import BlueprintModel
from models.service import ServiceModel
from models... | obitech/andes | andes/system/api/code/resources/stack.py | stack.py | py | 20,997 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "flask_restful.Resource",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "util.response.response",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.stack.StackModel.query.all",
"line_number": 24,
"usage_type": "call"
},
{
"a... |
14200034269 | # Required Packages
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import datasets, linear_model
# 函数来获取数据,解析csv文件
def get_data(file_name):
data = pd.read_csv(file_name)
X_parameter = []
Y_parameter = []
for single_square_feet ,single_price_value in zip(data['square... | 935048000/MyMachineLearning | linear_regression/example02.py | example02.py | py | 1,782 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model",
"line_number": 22,
"usage_type": "name"
},
{
"api_nam... |
42403468381 | from z3 import *
from gurobipy import *
from support_functions import distance,json_parser
import networkx as nx
from itertools import permutations,combinations
def routing(edges, jobs, tasks, Autonomy, start_list, ATRs, current_path, previous_routes = []):
m = Model('router')
m.setParam('OutputFla... | sabinoroselli/VRP | routing_3index_Gurobi_2.py | routing_3index_Gurobi_2.py | py | 19,704 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "support_functions.distance",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 167,
"usage_type": "call"
},
{
"api_name": "support_functions.distance",
"line_number": 388,
"usage_type": "call"
},
{
"ap... |
10521795600 | """add_assets
Revision ID: 2ab5564cfe99
Revises: eb9f8639d610
Create Date: 2020-01-09 14:37:08.316607
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "2ab5564cfe99"
down_revision = "eb9f8639d610"
branch_labels = None
depends_on = None
def upgrade():
op.cr... | canonical/assets.ubuntu.com | webapp/alembic/versions/2ab5564cfe99_add_assets.py | 2ab5564cfe99_add_assets.py | py | 671 | python | en | code | 4 | github-code | 21 | [
{
"api_name": "alembic.op.create_table",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
31994720431 | import pandas as pd
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import sklearn.metrics
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.feature_selection import SelectFromM... | ping543f/cmcase-conf | cmcase_prediction.py | cmcase_prediction.py | py | 4,389 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "google.colab.drive.mount",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "google.colab.drive",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.m... |
22998461968 | import os
import numpy as np
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.optimizers import RMSprop
# parameters
num_classes = 10
batch_size_1 = 128
epochs_1 = 20
batch_size_2 = 64
epochs_2 = 10
# the data, split between train a... | yoon-tae-ho/MLCS-Lab-intership-training-program | neural_networks/001_MLP/train.py | train.py | py | 2,262 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "keras.datasets.mnist.load_data",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.datasets.mnist",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.concatenate",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": ... |
26028289842 | #!/usr/bin/python3
# -*-coding:utf-8 -*-
# @Time : 2019/12/5 16:28
# @Author : Peter Zheng
# @File : dnn_model.py
# @Software: PyCharm
from .based_model import BasedModel
import torch
from torch import nn
import torch.utils.data as Data
import os
import torch.nn.functional as F
from matplotlib import pyplot as ... | Peter-zds/StrokePrediction | core/models/dnn_model.py | dnn_model.py | py | 3,723 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "based_model.BasedModel",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",... |
3594195562 | """
validate_img_labels.py
Author: Maggie Jacoby
Date: 2021-03-01
"""
import os
import sys
import csv
import yaml
import pickle
import logging
import argparse
import numpy as np
import pandas as pd
from glob import glob
from datetime import datetime, date
def get_difference(title, val):
predicted = pd.read... | mhsjacoby/HPD-DataStorage | ImageValidation/validate_img_labels.py | validate_img_labels.py | py | 2,546 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pandas.to_datetime",
"l... |
74164160374 | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import sys
import configparser
import datetime
sys.path.insert(0, os.path.abspath('../../'))
sys.path.inser... | JelleKUL/geomapi-server | docs/source/conf.py | conf.py | py | 2,063 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
10865227729 | #Boa:Frame:Frame1
# -*- coding: utf-8 -*-
import wx
def create(parent):
return Frame1(parent)
[wxID_FRAME1, wxID_FRAME1BTNMUESTRADIALOGO, wxID_FRAME1PANEL1,
] = [wx.NewId() for _init_ctrls in range(3)]
class Frame1(wx.Frame):
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Fr... | lopecillo/python | WxWindows/GuiTest1/Frame1.py | Frame1.py | py | 1,570 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "wx.NewId",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "wx.Frame.__init__",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number"... |
35260178854 | from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework_simplejwt.tokens import RefreshToken
from rest_framework.decorators import api_view
from django.contrib.auth import authenticate
from rest_framework.decorators import api_view, permission_classes
from django.co... | JuniorPortella/Encasa_AD_backend | core/views.py | views.py | py | 3,555 | python | pt | code | 0 | github-code | 21 | [
{
"api_name": "django.contrib.auth.models.User",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api... |
39715765646 | from typing import List
import math
class Solution:
def smallestDivisor(self, nums: List[int], threshold: int) -> int:
left = 1
right = max(nums)
while left < right:
mid = (left + right) // 2
curr_sum = 0
for num in nums:
curr_sum += m... | dyaroshevych/leetcode | python/1283. Find the Smallest Divisor Given a Threshold.py | 1283. Find the Smallest Divisor Given a Threshold.py | py | 477 | python | en | code | 2 | github-code | 21 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "math.ceil",
"line_number": 16,
"usage_type": "call"
}
] |
12083397093 | import os
import requests
def get_movie_info(movieTitle):
url = 'http://www.omdbapi.com/?i=tt3896198&apikey=ac4b246d'
api_key = os.getenv('ac4b246d')
data = {'apikey': api_key, 't': movieTitle}
response = requests.get(url, data)
if response.status_code != 200:
return None
data = respo... | Shyamdevkrishnanj/amfoss-tasks | task-04/apiomdb.py | apiomdb.py | py | 591 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "os.getenv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
}
] |
75049991731 | from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_digits
from sklearn.model_selection import KFold, StratifiedKFold, cross_val_score
# define get scor... | Enrico112/K_Fold_Cross_Validation | main.py | main.py | py | 1,790 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "sklearn.datasets.load_digits",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 21,
"usage_type": "c... |
10656287533 | from flask import render_template, request, redirect, make_response
from functools import wraps
from managestore import app, db
# from managestore.decorators import token_required
from managestore.models import StoreDB, UserDB, EmployeeDB, ProductDB
email = ''
def get_logged_in_user(new_request):
token = new_req... | HyeonjuPark/FlaskStoreTutorial | managestore/routes.py | routes.py | py | 5,909 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "managestore.models.UserDB.decode_auth_token",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "managestore.models.UserDB",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "managestore.models.UserDB.query.filter_by",
"line_number": 15,
"usa... |
13515025762 | import os.path
from robot.errors import DataError
from robot.running import ArgInfo, TypeInfo
from robot.utils import ET, ETSource
from .datatypes import EnumMember, TypedDictItem, TypeDoc
from .model import LibraryDoc, KeywordDoc
class XmlDocBuilder:
def build(self, path):
spec = self._parse_spec(path... | robotframework/robotframework | src/robot/libdocpkg/xmlbuilder.py | xmlbuilder.py | py | 6,488 | python | en | code | 8,521 | github-code | 21 | [
{
"api_name": "model.LibraryDoc",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.path.isfile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.path",
... |
29155672912 | import random as rand # For randomization
import uuid # For generating unique trait IDs
class Agent:
# Create a new agent.
def __init__(self, params, group):
self.group = group
self.trait_types = []
self.trait_levels = []
self.current = None
# Innovation
def il(self, params):
if rand.random... | MarcelMontrey/IngroupDiversity | agent.py | agent.py | py | 1,892 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "random.random",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_num... |
36347382617 | import traceback
from collections import namedtuple
from adsk.fusion import BRepEdge
from adsk.fusion import SketchLine
Point = namedtuple('Point', ['point', 'vertex', 'geometry'])
def x_direction(start, end):
return 1 if not x_reversed(start, end) else -1
def y_reversed(start, end):
return not (start.y ... | snelweg/TabGen | core/fusion/line.py | line.py | py | 3,915 | python | en | code | null | github-code | 21 | [
{
"api_name": "collections.namedtuple",
"line_number": 9,
"usage_type": "call"
}
] |
7096414163 | from dataclasses import dataclass
@dataclass
class ToyData:
id: int
name: str
description: str
price: float
quantity: int
def to_dict(self):
return {
'id': self.id,
'name': self.name,
'description': self.description,
'price': self.price,... | sursamra/SoftToyOnlineAPI | mem_repo.py | mem_repo.py | py | 1,671 | python | en | code | 1 | github-code | 21 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 4,
"usage_type": "name"
}
] |
6585916725 | import yaml
from selenium.webdriver.common.by import By
def get_yaml(yaml_path):
with open(yaml_path, 'rb') as file:
return yaml.load(file.read())
def set_yaml(yaml_path, data):
with open(yaml_path, 'wb') as file:
yaml.dump(data, file)
def get_tuple(yaml_path):
data = get_yaml(yaml_pat... | Fantexu/pom_test_v2.0 | base/baseYaml.py | baseYaml.py | py | 1,000 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "yaml.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "yaml.dump",
"line_number": 12,
"usage_type": "call"
}
] |
43987151999 | #!/usr/bin/python
from pydub import AudioSegment
from pydub.silence import detect_nonsilent
#from pydub.playback import play
import soundfile as sf
import argparse
import sys
import os
import glob
import re
def get_basename_without_extension(file_path):
"""
Get file's basename without its extension.
"""
retur... | ArnixChen/splitAudioBySilence.py | splitAudioBySilence.py | splitAudioBySilence.py | py | 9,808 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.path.splitext",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
... |
29897905950 | import cv2
import numpy as np
import time
# cap = cv2.VideoCapture(0)
video_captor = cv2.VideoCapture(0)
video_captor.set(cv2.CAP_PROP_FRAME_WIDTH,1280)
video_captor.set(cv2.CAP_PROP_FRAME_HEIGHT,720)
wisize = (500, 300)
while True:
ret,img = video_captor.read()
blur = cv2.GaussianBlur(img,(5,5),0)
# cv2.i... | CZFuChason/SomeDemos4AI | 1脸部识别/skindetect.py | skindetect.py | py | 3,596 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_na... |
15937752661 |
import gast
from tensorflow.python.autograph.core import converter
from tensorflow.python.autograph.pyct import anno
from tensorflow.python.autograph.pyct import parser
from tensorflow.python.autograph.pyct import qual_names
from tensorflow.python.autograph.pyct import templates
from tensorflow.python.autograph.utils ... | Mockingbird01001/NLG-code-generator-LSTM | work/data/data_model/batch_3/call_trees.py.transformed.py | call_trees.py.transformed.py | py | 4,937 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gast.Tuple",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "gast.Load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "gast.Call",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "gast.Name",
"line_number": 34,
... |
8227311590 | import torch.nn as nn
import torch.nn.functional as F
from utils import *
class Flatten(nn.Module):
def forward(self, x): return x.view(x.size(0), -1)
class AdaptiveConcatPool2d(nn.Module):
"Layer that concats `AdaptiveAvgPool2d` and `AdaptiveMaxPool2d`,"
"a module from fastai v1."
def __init__(self... | yurayli/histopathologic-cancer-detection | model.py | model.py | py | 5,279 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
23456886479 | from django.urls import path
from . import views
#Django にどのアプリのものが判断可能にさせるために名前空間を明らかにする。
app_name = 'buchi_wk'
#path(
# route 必須) ・URL パターンを含む文字列です。パターンはGETやPOSTのパラメーター、そしてドメイン名を検索しません。
# view 必須) ・Django がマッチする正規表現を見つけると、Django は指定されたビュー関数を呼び出します。
# 第一引数にHttpRequest オブジェクトを、
# ... | YnYnHnFn/buchiDjango3 | buchiDjango3/buchi_wk/urls.py | urls.py | py | 1,388 | python | ja | code | 0 | github-code | 21 | [
{
"api_name": "django.urls.path",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
29736825890 | # Import modules
from flask import request
from chatbot import *
# Variables
bot_token = "token"
bot_email = "yourbot@webex.bot"
# Main handler function
def handler(request):
webhook_event = request.get_json()
print(webhook_event)
headers = {
'authorization': f'Bearer {bot_token}'
}
payl... | benbenbenbenbenbenbenbenbenben/webex-teams-bot-guide | example/main.py | main.py | py | 894 | python | en | code | 3 | github-code | 21 | [
{
"api_name": "flask.request.get_json",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
}
] |
15605626429 | # from yahoo_finance import Share
# yahoo = Share('YHOO')
# print(yahoo.get_open())
# print(yahoo.get_historical('2014-04-25', '2014-04-29'))
import pandas as pd
import datetime as dt
data_df = pd.read_csv('C:/Users/Ishan/Desktop/Trade/table.csv')
# print(data_df)
class DataMining:
def __init__(sel... | ishchat/Stridsman | Data_mining.py | Data_mining.py | py | 2,923 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pand... |
14538140452 | import datetime as dt
from django.contrib.auth.tokens import default_token_generator
from rest_framework import serializers
from reviews.models import (Category, Comment, Genre, Review,
Title, User)
class UserSerializer(serializers.ModelSerializer):
role = serializers.Strin... | Ilya-c4talyst/api_yamdb | api_yamdb/api/v1/serializers.py | serializers.py | py | 4,090 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.StringRelatedField",
"line_number": 11,... |
15254433655 | import os
from PIL import Image
path_dir = 'C:/Users/Mee/Desktop/spilt_screenshot'
file_list = os.listdir(path_dir)
def crop_saver(dir, name):
img = Image.open(f'{dir}/{name}')
(w, h) = img.size #(3000, 1920)
w = w-h
#(x, y, x+자를 넓이, y+자를 높이)
a1 = (0, 480, h, w+480)
a2 = (h, 0, h+w, h)
cro... | hwahyeon/Screenshot_Spliter | main.py | main.py | py | 551 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "os.listdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
}
] |
72340999413 | from datetime import datetime, timedelta
import csv
import urllib.request
from io import StringIO
import json
import boto3
import os
def handler(event,context):
# Obtain of dates
dateToday = datetime.now().replace(hour = 0, minute = 0, second = 0, microsecond = 0)
dateYesterday = dateToday - timedelta... | freevejarano/Apps_AWS_Lambda | First/Upload/app.py | app.py | py | 1,277 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.t... |
22214924236 | from tvm.driver import tvmc
import numpy as np
import io
import os
from PIL import Image
MOUNT_DIR = '/sample/data/'
records_filename = MOUNT_DIR + 'tune_resnet50_1_3_224_224.json'
model_filename = MOUNT_DIR + 'resnet50-v1-7.onnx'
labels_filename = MOUNT_DIR + 'synset.txt'
test_filename = MOUNT_DIR + 'kitten.jpg'
d... | aws-samples/aws-graviton-ml-inference-apache-tvm-example | src/app.py | app.py | py | 2,113 | python | en | code | 5 | github-code | 21 | [
{
"api_name": "PIL.Image.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "io.BytesIO",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 23... |
821946037 | from gauss2D import gauss2D
from scipy.signal import convolve2d
import numpy as np
from math import pi, exp
from scipy.ndimage import laplace
def compute_LoG(image, LOG_type):
sigma = 0.5
kernel_size = 5
if LOG_type == 1:
gauss_kernel = gauss2D(sigma, sigma, kernel_size)
smoothed_image = c... | ligia26/cv_lab2 | code/Image_enhancement/compute_LoG.py | compute_LoG.py | py | 1,107 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "gauss2D.gauss2D",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scipy.signal.convolve2d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.laplace",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.z... |
37782876902 | import numpy as np
import matplotlib.pyplot as plt
import math
import os
from xlwt import Workbook
from scipy.optimize import curve_fit
CfcalKoef = 0.913 # linear koeficient of proton drop point calibration curve
def read(loadName):
highChannel, lowChannel, highy, lowy, highGain, lowGain, le, gain = [],... | ODZ-UJF-AV-CR/HAWK_TEPC | CalibrationBy252Cf.py | CalibrationBy252Cf.py | py | 10,107 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "xlwt.Workbook",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.logspace",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.log10",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number"... |
26580326265 | ##CODE TO NUMERICALLY INTEGRATE THE N-BODY PROBLEM
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
#Number of bodies
n = 3
#UI Stuff
coord = ["x", "y", "z"]
# masses
m = np.zeros(n)
for i in range(n):
m[i] = float(input("Enter mass of " + str(i) + "-th b... | Poincare057/N-Body-Problem | nbody.py | nbody.py | py | 3,061 | python | en | code | 0 | github-code | 21 | [
{
"api_name": "numpy.zeros",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.