o
    ذf                     @   s    d dl mZ dd Zdd ZdS )    )Documentc                    s,   | j d }dd |jD   fdd|D S )Nr   c                 S   s   g | ]}|j  qS  )textstrip).0cellr   r   /home/ubuntu/flask/hi.py
<listcomp>   s    z&get_column_indices.<locals>.<listcomp>c                    s   g | ]}| v r  |qS r   )index)r   headerheadersr   r   r	      s    )rowscells)tablerequired_headers
header_rowr   r   r   get_column_indices   s   
r   c                    s   i }ddgdgd}| |g }t| jD ]P\}}|jD ]H}|jD ]B t fdd|D rcd jv r@|t|g dd|d< q!d jv rR|t|d	d
gd|d< q!d jv rc|t|dd
gd|d< q!qq|S )NzWAIS-V IndexzWAIS-IV SubtestzBrown Score Summary)WAISBrownc                 3   s    | ]}| j v V  qd S )N)r   )r   termr   r   r   	<genexpr>   s    zget_indices.<locals>.<genexpr>)zComposite Score
PercentileDescription)table_indexcolumnszScaled Scorer   zT Score)get	enumeratetablesr   r   anyr   r   )doc	test_typeindicessearch_termsterms_to_searchr
   r   rowr   r   r   get_indices
   s2   





r'   N)docxr   r   r'   r   r   r   r   <module>   s    