
    j                    (    d Z ddlmZ ddlmZ ddZy)u.  blast_radius parser: list/dict 모두 안전 처리.

AST(ast_dependency_map.py)는 파일 1개면 dict, 여러 개면 list 반환.
또한 데이터는 {"blast_radius": {...}} 중첩 또는 (legacy) 평탄 dict.
본 모듈은 모든 변형을 흡수하여 (direct_importers, test_files) 튜플 반환.
    )annotations)Anyc                z   t        | t              r| n| g}g }g }|D ]  }t        |t              s|j                  d      }t        |t              r-|j                  dg       xs g }|j                  dg       xs g }n,|j                  dg       xs g }|j                  dg       xs g }t        |t              r|j	                  d |D               t        |t              s|j	                  d |D                t        t        j                  |            }t        t        j                  |            }||fS )uG  AST 결과에서 direct_importers, test_files를 추출.

    Args:
        data: ast_dependency_map.py --json 출력의 json.loads 결과.
              list (다파일), dict (단일파일/legacy), 기타 타입 모두 허용.

    Returns:
        (direct_importers, test_files) — 중복 제거, 입력 순서 유지.
    blast_radiusdirect_importers
test_filesc              3  2   K   | ]  }t        |        y wNstr.0xs     J/home/jay/workspace/.worktrees/task-2723-dev2/utils/blast_radius_parser.py	<genexpr>z%parse_blast_radius.<locals>.<genexpr>'   s     #7qCF#7   c              3  2   K   | ]  }t        |        y wr
   r   r   s     r   r   z%parse_blast_radius.<locals>.<genexpr>)   s     1c!f1r   )
isinstancelistdictgetextendfromkeys)dataitemsr   r   itembrditfs           r   parse_blast_radiusr       s    tT*DE"$J 2$%XXn%b$*B/52Bb)/RB ,b17RB,+1rBb$###7B#77b$1b112" DMM*:;<dmmJ/0JZ''    N)r   r   returnztuple[list[str], list[str]])__doc__
__future__r   typingr   r     r!   r   <module>r'      s    # #(r!   