3 �ga* � @ sj d dl Z d dlZd dlmZ ddlmZ ddlmZ eeee j f d�dd �Z eeeef d�d d�ZdS )� N)�Tuple� )�&load_json_preserve_order_and_dupe_keys� )�PREFIX_REGEX)�data�returnc C s\ ydt | �fS tk r Y nX t| �\}}y|t |�fS tk rV td��Y nX dS )z&Simple JSON loading from `data`. � zInvalid JSONN)r � ValueError�parse_prefixed_json)r �data_prefix�body� r �/usr/lib/python3.6/utils.py�load_prefixed_json s r c C s4 t jt| �}|r|d nd}| t|�d� }||fS )z�Find the potential JSON body from `data`. Sometimes the JSON body is prefixed with a XSSI magic string, specific to the server. Return a tuple (data prefix, actual JSON body). r r N)�re�findallr �len)r Zmatchesr r r r r r s r )Zjsonr Ztypingr Zutilsr Zlexers.jsonr �strZJSONDecoderr r r r r r �<module> s
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__init__.cpython-36.opt-1.pyc | File | 113 B | 0644 |
|
__init__.cpython-36.pyc | File | 113 B | 0644 |
|
processing.cpython-36.opt-1.pyc | File | 2.06 KB | 0644 |
|
processing.cpython-36.pyc | File | 2.06 KB | 0644 |
|
streams.cpython-36.opt-1.pyc | File | 6.38 KB | 0644 |
|
streams.cpython-36.pyc | File | 6.44 KB | 0644 |
|
utils.cpython-36.opt-1.pyc | File | 1.06 KB | 0644 |
|
utils.cpython-36.pyc | File | 1.06 KB | 0644 |
|
writer.cpython-36.opt-1.pyc | File | 3.31 KB | 0644 |
|
writer.cpython-36.pyc | File | 3.31 KB | 0644 |
|