# Path: lepo/apidef/parameter/base.py
# NO_VALUE = object()
# 
# Path: lepo/excs.py
# class ErroneousParameters(Exception):
#     def __init__(self, error_map, parameters):
#         self.errors = error_map
#         self.parameters = parameters
# 
# class MissingParameter(ValueError):
#     pass


import base64
import iso8601
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import force_bytes, force_str
from lepo.apidef.parameter.base import NO_VALUE
from lepo.excs import ErroneousParameters, MissingParameter
    if type == 'number' or format in ('float', 'double'):
        return float(value)
    if format == 'byte':  # base64 encoded characters
        return base64.b64decode(value)
    if format == 'binary':  # any sequence of octets
        return force_bytes(value)
    if format == 'date':  # ISO8601 date
        return iso8601.parse_date(value).date()
    if format == 'dateTime':  # ISO8601 datetime
        return iso8601.parse_date(value)
    if type == 'string':
        return force_str(value)
    return value


def read_parameters(request, view_kwargs=None, capture_errors=False):  # noqa: C901
    """
    :param request: HttpRequest with attached api_info
    :type request: HttpRequest
    :type view_kwargs: dict[str, object]
    :type capture_errors: bool
    :rtype: dict[str, object]
    """
    if view_kwargs is None:
        view_kwargs = {}
    params = {}
    errors = {}
    for param in request.api_info.operation.parameters:
        try:
            value = param.get_value(request, view_kwargs)

# Path: lepo/apidef/parameter/base.py
# NO_VALUE = object()
# 
# Path: lepo/excs.py
# class ErroneousParameters(Exception):
#     def __init__(self, error_map, parameters):
#         self.errors = error_map
#         self.parameters = parameters
# 
# class MissingParameter(ValueError):
#     pass


# Path: lepo/parameter_utils.py
import base64
import iso8601
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import force_bytes, force_str
from lepo.apidef.parameter.base import NO_VALUE
from lepo.excs import ErroneousParameters, MissingParameter

    if type == 'number' or format in ('float', 'double'):
        return float(value)
    if format == 'byte':  # base64 encoded characters
        return base64.b64decode(value)
    if format == 'binary':  # any sequence of octets
        return force_bytes(value)
    if format == 'date':  # ISO8601 date
        return iso8601.parse_date(value).date()
    if format == 'dateTime':  # ISO8601 datetime
        return iso8601.parse_date(value)
    if type == 'string':
        return force_str(value)
    return value


def read_parameters(request, view_kwargs=None, capture_errors=False):  # noqa: C901
    """
    :param request: HttpRequest with attached api_info
    :type request: HttpRequest
    :type view_kwargs: dict[str, object]
    :type capture_errors: bool
    :rtype: dict[str, object]
    """
    if view_kwargs is None:
        view_kwargs = {}
    params = {}
    errors = {}
    for param in request.api_info.operation.parameters:
        try:
            value = param.get_value(request, view_kwargs)

            if value is NO_VALUE: