
    VhK                         d dl mZ d dlZddZy)    )annotationsNc                b   g }| j                         }t        |      D ]B  \  }}|j                         }|j                  d      rd} n%|r.|j                  d      s@d} n t	        d      ||d }t        t        |            D ]&  \  }}|j                         j                  |      s& n t	        d      |dkD  rM|t        |      |z
  d }|D ]7  }|j                         s|j                  d	d
j                  |      z          n |dt        |      |z
   }d
j                  |      |fS )ac  
    Used to filter unrelated output around module JSON output, like messages from
    tcagetattr, or where dropbear spews MOTD on every single command (which is nuts).

    Filters leading lines before first line-starting occurrence of '{' or '[', and filter all
    trailing lines after matching close character (working from the bottom of output).
    {}[]zNo start of json char foundNzNo end of json char foundr   z2Module invocation had junk after the JSON data: %s
)

splitlines	enumeratestrip
startswith
ValueErrorreversedendswithlenappendjoin)	dataobjects_onlywarningslinesstartlineendcharreverse_end_offsettrailing_junks	            O/home/dcms/DCMS/lib/python3.12/site-packages/ansible/module_utils/json_utils.py_filter_non_json_linesr   "   sJ    H OOE ' 	8tzz|??4 G$//$"7G	8 677 %&ME$-huo$> 6 D::<  )6 455A c%j+==>?! 	Dzz| TW[W`W`anWo op	
 4CJ!335EIIeh''    )F)
__future__r   jsonr    r   r   <module>r#      s   6 # 
,(r   