o
    [d                     @   sj  d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	m
Z
mZ d dlmZ d dlmZ d dlmZ d dlmZmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ zd dlmZ W n eyw   dZY nw ddlmZm Z  ddl!m"Z" ddl!m#Z# ddl!m$Z$ dd Z%dd Z&	dWddZ'			dXddZ(dd Z)			dYddZ*dZd d!Z+d"d# Z,d$d% Z-d&d' Z.d[d)d*Z/d[d+d,Z0d-d. Z1d/d0 Z2d\d2d3Z3d]d5d6Z4dZd7d8Z5d9d: Z6d;d< Z7dWd=d>Z8		d^d?d@Z9dAdB Z:dCdD Z;dEdF Z<G dGdH dHe=Z>G dIdJ dJe>Z?G dKdL dLe?Z@dMdN ZAdOdP ZBdQdR ZCdSeDdTefdUdVZEdS )_    N)string_types	text_type)deepcopywrapsimport_module)OrderedDictdefaultdict)Response)abort)current_app)request)
MethodView)methods   )OPTIONAL_FIELDSDEFAULT_FIELDS)SwaggerView)convert_schemas)Schemac                 C   sb   |  D ]*\}}t|tr| |i }t|| qt|tr*| |g }|| q|| |< qdS )zk
    Update target dictionary with values from the source, recursively.
    List items will be merged.
    N)items
isinstancedict
setdefaultmerge_specslistextend)targetsourcekeyvaluenode r#   S/var/www/html/crm_dreinet/venv_linux/lib/python3.10/site-packages/flasgger/utils.pyr   "   s   


r   c           
      C   s   t |jdd}|jdpt}|jd}|j  ttj	 |||j
|}dd |D }W d    n1 s:w   Y  |D ]&}|dg D ]}|di d	}	|	d urf|	 |  krf|    S qIqAd S )
Nignore_verbs)HEADOPTIONSoptional_fieldsopenapic                 s   s.    | ]\}}|D ]\}}|d ur|V  qqd S Nr#   ).0_verbsswagr#   r#   r$   	<genexpr>B   s    z#get_schema_specs.<locals>.<genexpr>
parametersschemaid)setconfiggetr   appapp_context	get_specsr   url_map
iter_rules	sanitizerlower)
	schema_idswaggerr%   r(   openapi_versionspecsswagsr.   dd_schema_idr#   r#   r$   get_schema_specs3   s,   
rD   c                  C   sX  g }| D ]}t j|j }t }	t|}
|j|D ]i}|
s5t|r5|jp'dg|_||jv r4||	| < qt	|dd d ur}t
|jtrU||jv rT| }t	|j||	|< qtd ur{tdd |jD }||v rz|j|jd}|rzt	t||	| < qt||	| < qg }|	 D ]\}}|jdd }|
s|rt|drt	|dd }n|rt|drt	|dd }|d u rt	||d }|d u r|
rqtd	|i }i }d
}t	|dd ri }t|tt|j| |}d}t	|dd }|r#t|tr#i }|g d }|D ]}t	||}|r|||< q|di }|t|| |}d}|r^|r6tj ||j|jd }n
tj ||jd }tj!|r^t|drP|j"n|}t#|dd t#|d| t$|||j|d\}}}t%|rx||&di d< n||d< |rt|| d}|r|r||d< |r||d< |'||f q|r|'||f q|S )NGETr   c                 s   s    | ]}|j V  qd S r*   )method)r+   mr#   r#   r$   r/   a   s    zget_specs.<locals>.<genexpr> 
view_classverbdispatch_requestz$Cannot detect view_func for rule {0}F
specs_dictT)r0   definitions	responsessummarydescriptionrM   z.yml__func__	swag_typeyml	swag_path)endpointrJ   
componentsschemasrO   rP   )(r   view_functionsrU   r   is_valid_method_viewr   
differencehas_valid_dispatch_view_docsr<   getattrr   r3   rI   fmr_methodsreplace__name__	TypeErrorr   __dict__r5   hasattrRuntimeErrorformatr   r   r   rL   
issubclassr   updateospathjoinisfilerQ   setattrparse_docstringis_openapi3r   append) rulesr%   r(   r;   r?   doc_dirr@   rulerU   r   is_mvrJ   endpoint_methods
proxy_verbr-   rF   klassr.   swag_defswagged
definitionrI   apispec_swagapispec_attrsattrr!   apispec_definitions	file_pathfuncdoc_summarydoc_descriptiondoc_swagr#   r#   r$   r8   M   s   








r8   Fc
              
      sR   dd 
fdd
fdd	dd  	
f
d	d
}
|
S )a  
    Takes a filename.yml, a dictionary or object and loads swagger specs.

    :param specs: a filepath, a dictionary or an object
    :param filetype: yml or yaml (json and py to be implemented)
    :param endpoint: endpoint to build definition name
    :param methods: method to build method based specs
    :param validation: perform validation?
    :param schema_id: Definition id ot name to use for validation
    :param data: data to validate (default is request.json)
    :param definition: alias to schema_id
    :param validation_function:
        custom validation function which takes the positional
        arguments: data to be validated at first and schema to validate
        against at second
    :param validation_error_handler: custom function to handle
        exceptions thrown when validating which takes the exception
        thrown as the first, the data being validated as the second and
        the schema being used to validate as the third argument
    c                 S   sl   zddl m} t||rt|}W n	 ty   Y nw |ds4t| ds*t| | _t	j
| j|}|S |S )Nr   Path/	root_path)pathlibr   r   strImportError
startswithrb   get_root_pathr   rg   rh   ri   )functionfilepathr   resr#   r#   r$   resolve_path   s   



zswag_from.<locals>.resolve_pathc                    s   | }p| dd | _ srt| dsi | _ s$s$|| _d S  r<r<D ]}d | }|| j|< q*d S  rGsG|| j < d S rW sYD ]}|| j| < qMd S d S d S )N.
swag_paths{}_{})splitrR   rb   r   rT   rd   r<   )r   final_filepathrJ   r    )rU   filetyper   r   r@   r#   r$   set_from_filepath   s&   


z$swag_from.<locals>.set_from_filepathc                    s
    | _ d S r*   )rL   )r   )r@   r#   r$   set_from_specs_dict
  s   
z&swag_from.<locals>.set_from_specs_dictc                 S   sB   t | t}zddlm} t | |}|p|W S  ty    | Y S w )z; Returns True if specs is a string or pathlib.Path
        r   r   )r   r   r   r   r   )r@   is_str_pathr   is_py3_pathr#   r#   r$   is_path  s   


zswag_from.<locals>.is_pathc              	      s~   r  t  dd }t  dd }|p|t  dd dttr,  dit  	
fdd}|S )NrT   r   r   )r   rootr@   c                     s2   du rt  p	fd | i |S )NT)validation_functionvalidation_error_handler)validate)argskwargs)datarx   r   r=   validate_args
validationr   r   r#   r$   wrapper'  s   z-swag_from.<locals>.decorator.<locals>.wrapper)r\   r   r   r   )r   rT   r   r   )
r   rx   r   r=   r   r   r@   r   r   r   )r   r   r$   	decorator  s   


zswag_from.<locals>.decoratorr#   )r@   r   rU   r   r   r=   r   rx   r   r   r   r#   )r   rx   rU   r   r   r   r   r=   r   r   r@   r   r   r   r$   	swag_from   s   r   c              	   C   sl  t jtjd }i }|  D ]\}}t|tr!t|||||< q|dkrt	|dkrS|
drS|}|ddd D ]}|| }q;t|trOt|||  S |  S t	|dkrd|d dkrd|| }	n|d | }	t j|	}t|	2}
|
 }|d}|dkr|d	 }nd}t||d }|}t|trt|||}W d   n1 sw   Y  q|||< q|S )
zd TODO: add dev docs

    :param schema:
    :param relative_path:
    :param swag:
    :return:
    r   $ref   z#/r   r   N---   )rg   rh   dirnamesysargvr   r   r   __replace_reflenr   r   openreadrfindyaml	safe_load)r1   relative_pathr.   absolute_path	new_valuer    r!   contentr2   file_ref_pathfilefile_contentcomment_indexr#   r#   r$   r   7  sB   







r   Tc
              
   C   s  |p|}|du r|du rt tddd | du rtj} nt| r#|  } | s/|r/t tddd tj dd}
tj }|dur|sczt	
 d	 }tjtj|d	 }W n tyb   d}Y nw tj|}|d
svtj||}n|}t|}|d}t||dkr|ndd }nt|}dd |dg D }i }i }t||
||	d}|du r|D ]}|ddkr|di d}|r|d
d } nq|du r|r|d d}|D ]}|d  | kr| }q|||d < q|t|v rt||}||d< | D ]\}}d|v r|d= q|du r$tj}tjtj d }|du r5|}ntj|}t!|||}z|| | W dS  tyz } z$|dur^||| | nt tt"|dd W Y d}~dS W Y d}~dS d}~ww )a  
    This method is available to use YAML swagger definitions file
    or specs (dict or object) to validate data against its jsonschema.

    example:
        validate({"item": 1}, 'item_schema', 'defs.yml', root=__file__)
        validate(request.json, 'User', specs={'definitions': {'User': ...}})

    :param data: data to validate, by default is request.json
    :param schema_id: The definition id to use to validate (from specs)
    :param filepath: definition filepath to load specs
    :param root: root folder (inferred if not provided), unused if path
        starts with `/`
    :param definition: Alias to schema_id (kept for backwards
        compatibility)
    :param specs: load definitions from dict or object passed here
        instead of a file.
    :param validation_function: custom validation function which takes
        the positional arguments: data to be validated at first and
        schema to validate against at second
    :param validation_error_handler: custom function to handle
        exceptions thrown when validating which takes the exception
        thrown as the first, the data being validated as the second and
        the schema being used to validate as the third argument
    :param require_data: is the data param required?
    Nz'Filepath or specs is needed to validatei  )statuszNo data to validatei  r   r,   r   r   r   r   c                 S   s   g | ]	}| d r|qS r1   )r5   )r+   itemr#   r#   r$   
<listcomp>  s    zvalidate.<locals>.<listcomp>r0   )rU   rJ   r?   inbodyr1   r   r   r2   rM   )#r   r   r   jsoncallablerU   r<   r^   rF   inspectstackrg   rh   r   abspath	Exceptionr   ri   load_from_filefindr   r   copyr   r5   extract_definitionsr   extract_schemar   
jsonschemar   r   r   r   r   )r   r=   r   r   rx   r@   r   r   require_datar?   rU   rJ   
frame_infor   full_doc
yaml_startr.   paramsrM   main_defraw_definitionsparamdefir    r!   r   r   errr#   r#   r$   r   c  s   


 






"r   c           
      C   s   |pg }|pg }|   5 |D ]}t|ttfr|\}}n	|}|jdd}|jj||d q|D ]}|j|d q1W d   n1 sDw   Y  |	 }t
|}	|	S )z
    Converts apispec object in to flasgger definitions template
    :param app: Current app
    :param spec: apispec.APISpec
    :param definitions: a list of [Schema, ..] or [('Name', Schema), ..]
    :param paths: A list of flask views
    r   rH   r   )viewN)r7   r   tupler   r_   r^   rV   r1   rh   to_dictordered_dict_to_dict)
r6   specrM   pathsrx   namer1   rh   	spec_dictretr#   r#   r$   apispec_to_template  s    

r   c                 C   sN   i }t | }| D ]\}}t|trt|}t|tr t|}|||< q
|S )z1
    Converts inner OrderedDict to bare dict
    )r   r   r   r	   r   r   )rB   r   new_dkvr#   r#   r$   r     s   


r   c                 C   s   t j| d S )zRemove all file ending suffixesr   )rg   rh   splitextfpathr#   r#   r$   remove_suffix  s   r   c                 C   s   |  dod| vS )zNaive Python module filtererz.py__)endswithr   r#   r#   r$   is_python_file  s   r   	examples/c                    s   | dd  fdd| D S )z*nix to python module pathr   r   c                    s   g | ]} | qS r#   r#   )r+   basenameexampler#   r$   r         zpathify.<locals>.<listcomp>)r^   )	basenamesexamples_dirr#   r   r$   pathify  s   r   c                 C   sF   t | }dd |D }dd |D }dd t|D }dd |D S )zAll example modulesc                 S   s   g | ]}t |r|qS r#   )r   r+   fr#   r#   r$   r   #  s    z get_examples.<locals>.<listcomp>c                 S      g | ]}t |qS r#   )r   r   r#   r#   r$   r   $  r   c                 S   r   r#   r   r+   moduler#   r#   r$   r   %  r   c                 S   s    g | ]}t |d ddur|qS )r6   N)r\   r   r#   r#   r$   r   &  s
    )rg   listdirr   )r   	all_filespython_filesr   modulesr#   r#   r$   get_examples   s   
r   c                 C   s&   |  dd }|dd }||fS )z1
    If `file:` is provided import the file.
    file:rH   r   r   )r^   stripr   )r   rT   rR   r#   r#   r$   get_path_from_doc,  s   r  c                 C   s   | S )z$
    TODO: convert json to yaml
    r#   )r   r#   r#   r$   json_to_yaml5  s   r  rS   c                 C   s  |dvrt dz#t| }tj| |d}| W  d   W S 1 s$w   Y  W dS  ty   tj|p<tj	t
| } z&t| }tj| |d}| W  d   W  Y S 1 s]w   Y  W Y dS  ty   | dtjdtj} | |ptj	t
dtjdd }tj|d	 }|jr|jd
d}ntdtj|tj|dd } t| }| W  d    Y  Y S 1 sw   Y  Y Y dS w w )z#
    Load specs from YAML file
    )r   rS   z$Currently only yaml or yml supported)encodingNr   \rH   r   r   z/__init__.pyzPackage does not have origin)AttributeErrordetect_by_bomcodecsr   r   IOErrorrg   rh   ri   r   __file__r^   sepr   	importlibutil	find_spechas_locationoriginrc   )rT   rR   r   enc	yaml_filerh   package_specsite_packager#   r#   r$   r   <  sB   (.
0r   utf-8c                    s   t | d}|d W d    n1 sw   Y  dtjffdtjtjffdtjtjfffD ]\}}t fdd|D rB|  S q/|S )Nrb   z	utf-8-sigzutf-16zutf-32c                 3   s    | ]}  |V  qd S r*   r   )r+   bomrawr#   r$   r/   n  s    z detect_by_bom.<locals>.<genexpr>)	r   r   r  BOM_UTF8BOM_UTF16_LEBOM_UTF16_BEBOM_UTF32_LEBOM_UTF32_BEany)rh   defaultr   r  bomsr#   r  r$   r  g  s   

r  c                 C   st  d\}}}d}t | dd}t | dd}	t | dd}
t| }d}|dur+t||	}d}n'|
durMd	|||| fD ]}||
v rIt|
| |	} nq:d}nt| }|r|d
rvt| dsa|| _	t
|\}}	tj| j	|}t||	}d}t||}|d}|dkr|d}|dkr||d| }|||d | }t||d d }n
|rt|}n|}|||fS )z2
    Gets swag data for method/view docstring
    )NNNNrT   rR   rS   r   FTr   r   r   r   r   
r   r  )r\   r   r   rd   r<   r   getdocr   rb   r   r  rg   rh   ri   parse_importsr   r   r   )objprocess_docrU   rJ   
first_lineother_linesr.   r   rT   rR   r   r   	from_filer    doc_filepathyaml_sep	line_feedr#   r#   r$   rl   s  sR   









rl   c              	   C   s^   zt j| jd }W n ttfy(   t| ddr!t| j Y S t	
| }Y nw t j|S )z:
    Get file path for object and returns its dirname
    r	  __wrapped__N)rg   rh   r   __globals__KeyErrorr  r\   r   r.  r   getfiler   )r&  filenamer#   r#   r$   r     s   r   c           	      C   s   d\}}d}t | dd}t | dd}|durt||}nt| }|rm|drEt| ds2t| | _t|\}}t	j
| j|}t||}|d}|d	kri|rZ||d|d
  nd}t||d }||fS ||}||fS )zC
    Gets swag data from docstring for class based definitions
    NNNrT   rR   rS   r   r   r   r   r   )r\   r   r   r$  r   rb   r   r   r  rg   rh   ri   r   r   r   )	r&  r'  	doc_linesr.   r   rT   rR   r+  r,  r#   r#   r$   parse_definition_docstring  s4   





r5  c           	      C   s   t d}|| }|rF| }|| dd| d }|d}|dr*t|}nt||d}|ddd|  }|j	|| dd} t
| S | S )	z=
    Supports `import: otherfile.yml` in docstring specs
    zimport: "(.*)"r#  r   r   r   )r    )count)recompilesearchstartr   groupr   r   r^   subr%  )	r   r   regeximport_propr;  
spaces_numr   imported_docindented_imported_docr#   r#   r$   r%    s   




r%  c              	      sF   pt j  pt j  dd  fdd}du r$dt }| D ]w}t|ds4td|d	}	|	dur|	d
}
|
dur|rSd	 |
 |	d
< }
|
|	 d}trad}nd}dd	||
i}dkrt||d	< n|| |d	= |	d}|dur|t| d  7 }|||	7 }|||7 }q)|S )z
    Since we couldn't be bothered to register models elsewhere
    our definitions need to be extracted from the parameters.
    We require an 'id' field for the schema to be correctly
    added to the definitions list.
    r   r,   c                    s>   g }|  d}|durd|v r|t|gd  7 }|S )z9
        Extracts definitions identified by `id`
        r   Nr1   r   )r5   r   )r   r   r   rU   levelr?   
prefix_idsrJ   r#   r$   _extract_array_defs  s   
z0extract_definitions.<locals>._extract_array_defsNr   r5   z#definitions must be a list of dictsr1   r2   z{}_{}_{}z#/components/schemas/z#/definitions/r   z{}{}
propertiesr   )r   rU   r<   rF   r^   r   r\   rc   r5   rd   rn   rm   rf   r   values)alistrD  rU   rJ   rE  r?   rF  defsr   r1   r=   ref_pathrefrG  r#   rC  r$   r     sJ   






r   c                 C   s2   | j dd}|ot|dot| dot|djS )z6
    Return True if dispatch_request is swaggable
    rI   NrK   r   )ra   r5   rb   r\   __doc__rU   ru   r#   r#   r$   r[   E  s   
r[   c                 C   s0   | j dd}zt|tW S  ty   Y dS w )z*
    Return True if obj is MethodView
    rI   NF)ra   r5   re   r   r`   rN  r#   r#   r$   rY   O  s   rY   c                 C   s   dd |   D S )z
    Identify vendor extension fields and extract them into a new dictionary.
    Examples:
        >>> get_vendor_extension_fields({'test': 1})
        {}
        >>> get_vendor_extension_fields({'test': 1, 'x-test': 2})
        {'x-test': 2}
    c                 S   s    i | ]\}}| d r||qS )zx-r  )r+   r   r   r#   r#   r$   
<dictcomp>c  s     z/get_vendor_extension_fields.<locals>.<dictcomp>)r   )mappingr#   r#   r$   get_vendor_extension_fieldsZ  s   	rQ  c                   @   s   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zed d! Zd"S )#
StringLikez
    Class to mimic the behavior of a regular string. Classes that inherit (or
    mixin) this class must implement the `__str__` magic method. Whatever that
    method returns is used by the various string-like methods.
    c                 C   s&   |  | }t||rt||S t|)z
        Forwards any non-magic methods to the resulting string's class. This
        allows support for string methods like `upper()`, `lower()`, etc.
        )r   rb   r\   r  )selfr{   stringr#   r#   r$   __getattr__m  s   


zStringLike.__getattr__c                 C      t | | S r*   )r   r   rS  r#   r#   r$   __len__w     zStringLike.__len__c                 C   s   |  | | S r*   r   )rS  r    r#   r#   r$   __getitem__z  rY  zStringLike.__getitem__c                 C   rV  r*   )iterr   rW  r#   r#   r$   __iter__}  rY  zStringLike.__iter__c                 C   s   ||  | v S r*   rZ  )rS  r   r#   r#   r$   __contains__  rY  zStringLike.__contains__c                 C   s   |  | | S r*   rZ  rS  otherr#   r#   r$   __add__  rY  zStringLike.__add__c                 C   s   ||  |  S r*   rZ  r_  r#   r#   r$   __radd__  rY  zStringLike.__radd__c                 C   s   |  | | S r*   rZ  r_  r#   r#   r$   __mul__  rY  zStringLike.__mul__c                 C   s   ||  |  S r*   rZ  r_  r#   r#   r$   __rmul__  rY  zStringLike.__rmul__c                 C   s   |  | |k S r*   rZ  r_  r#   r#   r$   __lt__  rY  zStringLike.__lt__c                 C   s   |  | |kS r*   rZ  r_  r#   r#   r$   __le__  rY  zStringLike.__le__c                 C   s   |  | |kS r*   rZ  r_  r#   r#   r$   __eq__  rY  zStringLike.__eq__c                 C   s   |  | |kS r*   rZ  r_  r#   r#   r$   __ne__  rY  zStringLike.__ne__c                 C   s   |  | |kS r*   rZ  r_  r#   r#   r$   __gt__  rY  zStringLike.__gt__c                 C   s   |  | |kS r*   rZ  r_  r#   r#   r$   __ge__  rY  zStringLike.__ge__c                 C   s   t S r*   rZ  rW  r#   r#   r$   r     s   zStringLike.text_typeN)r_   
__module____qualname__rM  rU  rX  r[  r]  r^  ra  rb  rc  rd  re  rf  rg  rh  ri  rj  propertyr   r#   r#   r#   r$   rR  f  s&    
rR  c                   @   s    e Zd ZdZdd Zdd ZdS )
LazyStringze
    A lazy string *without* caching. The resulting string is regenerated for
    every request.
    c                 C   s
   || _ dS )zy
        Creates a `LazyString` object using `func` as the delayed closure.
        `func` must return a string.
        N)_funcrS  r~   r#   r#   r$   __init__  s   
zLazyString.__init__c                 C   s   |  |  S )z,
        Returns the actual string.
        )r   ro  rW  r#   r#   r$   __str__  s   zLazyString.__str__N)r_   rk  rl  rM  rq  rr  r#   r#   r#   r$   rn    s    rn  c                       s(   e Zd ZdZ fddZdd Z  ZS )CachedLazyStringz%
    A lazy string with caching.
    c                    s   t t| | d| _dS )zL
        Uses `__init__()` from the parent and initializes a cache.
        N)superrs  rq  _cacherp  	__class__r#   r$   rq    s   
zCachedLazyString.__init__c                 C   s   | j s| |  | _ | j S )zB
        Returns the actual string and caches the result.
        )ru  r   ro  rW  r#   r#   r$   rr    s   zCachedLazyString.__str__)r_   rk  rl  rM  rq  rr  __classcell__r#   r#   rv  r$   rs    s    rs  c                    s   t   fdd}|S )Nc                     s@  | dds | i |S | d }i }t D ]\}}| ||||< q|j D ]`\}}t|trX| }| }|d D ]	}	|d |	 q=|d |d  t	|||}q)t|t
rx|dddd	}
d
| | d v rpd|
d< |d |
 q)t|tr|d |dddd	 q)||_t| } || d< t| }  | i |S )Nr.   Fr   r0   rM   rh   integerT)r   r   typerequiredzint(signed=True):r   minimumrT  )popr   r   __annotations__re   r   to_specs_dictrn   rf   validate_annotationintr   rL   r   r   )r   r   r   r@   r    r!   variable
annotationr   rowrG   r   r#   r$   r     sF   



z swag_annotation.<locals>.wrapperr   r   r   r#   r  r$   swag_annotation  s   ,r  c                    s    fdd}|S )Nc                    s   t   fdd}|S )Nc                     sh    j r)d } jdkrttj}n jdkrtjrtj}t|   j	 j
 jd | i ||iS )Nqueryr   )r@   r   r   r   )swag_validateswag_inr   r   r   is_jsonr   r   r  swag_validation_functionswag_validation_error_handlerswag_require_data)r   r   payload)anr   varr#   r$   r     s   
	z7validate_annotation.<locals>.decorator.<locals>.wrapperr   r  r  r  r  r$   r     s   z&validate_annotation.<locals>.decoratorr#   )r  r  r   r#   r  r$   r     s   r  c                 C   s   | ot | dd dkS )z.
    Returns True if openapi_version is 3
    r   r   3)r   r   )r?   r#   r#   r$   rm     s   rm   r   returnc                 C   s<   |  dd}t|r|  di  dttS |  dttS )z?
    Returns schema resources according to openapi version
    r)   NrV   rW   rM   )r5   rm   r
   r   )r   r?   r#   r#   r$   r   $  s   
r   r*   )
NNNNFNNNNN)
NNNNNNNNTNr3  )r   )rS   N)r  )NNNFN)Fr  r   r  r   rg   r8  r   r   r   sixr   r   r   	functoolsr   r   collectionsr	   r
   flaskr   r   r   r   flask.viewsr   flask_mongorestr   r]   r   	constantsr   r   marshmallow_apispecr   r   r   r   rD   r8   r   r   r   r   r   r   r   r   r   r  r  r   r  rl   r   r5  r%  r   r[   rY   rQ  objectrR  rn  rs  r  r  rm   r   r   r#   r#   r#   r$   <module>   s   
 
h-
 


	

+
:
$
P
@1