
    >'h#              	           d dl Z d dlmZmZmZmZ dedefdZddedede	defd	Z
d
edefdZdedeeeeef   f   fdZy)    N)	Docstringparse_googleparse_numpyparse_sphinxvalreturnc                 V    | j                         } | dv ry| dv ryd|  }t        |      )z
    Convert a string representation of truth to True or False.

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )yyesttrueon1T)nnoffalseoff0Fzinvalid truth value )lower
ValueError)r   msgs     R/home/kushmeetdev/Regenta/Chatbot/venv/lib/python3.12/site-packages/banks/utils.py	strtoboolr      s=     ))+C
22
33 
&C
S/    prefixsuffixtoken_lengthc                 >    |  t        j                  |dz         | S )N   )secrets	token_hex)r   r   r   s      r   generate_canary_wordr#      s&    Xg''(9:;F8DDr   python_typec                     | t         u ry| t        u ry| t        u ry| t        u ry| t        u ry| t
        u ryd|  }t        |      )zAGiven a Python type, returns the jsonschema string describing it.stringintegernumberbooleanarrayobjectzUnsupported type: )strintfloatboollistdictr   )r$   r   s     r   python_type_to_jsonschemar2      sZ    cceddd{m
,C
S/r   	docstringc                    g }t        |       }t        t        t        fD ]2  } ||      }|D ]  }|j                  dk(  s|j
                  } n |s2 n i }|D ]&  }|j                         }|||j                  d      <   ( |S )N
parametersname)r   r   r   r   kindvalueas_dictpop)	r3   
param_docsdsparsersectionssectionretdd_dicts	            r   parse_params_from_docstringrC   0   s    J	9	Bl; ": 	G|||+$]]
	  C )"(FJJv) Jr   )zBANKS[]   )r!   griffer   r   r   r   r,   r/   r   r-   r#   typer2   r1   rC    r   r   <module>rI      s     E E3 4 &E E ERU E^a E4 C &3 4T#s(^8K3L r   