a Eg@sFddlZddlmZddlmZddZddZd d d Zd d ZdS)N)BytesIO)name_mapcCs*|d}d|d}|dt||S)Nzfiles/r)splitrget)s3_pathZs3_paths file_pathr 8/home/cmiss/Jenkins/workspace/SPARC-API/app/utilities.pyget_path_from_mangled_lists  r cCs<t}|j|dd|d|}dt|}|S)zQ Take in a Pillow image and convert it to a base64 string in PNG format. PNG)formatrzdata:image/png;base64,)rsaveseekgetvaluebase64 b64encodedecode)imgbufferedZimg_byteZimg_strr r r img_to_base64_strs  rcCs|D]}t||t||tr>t|||dqt||trt|dt||rt||dtrt||d|dt|dqdS)Nz [r])keysprint isinstancedict print_dictlistlen)dindentkr r r rs rcCstdt|trt|dS)Nzhit:)rrrr)hitr r r print_hit_structure&s r%)r) riorZ"app.manifest_name_to_discover_namerr rrr%r r r r s