コード例 #1
0
ファイル: job.py プロジェクト: vvalorous/cartography
def _get_statements_from_json(blob):
    """
    Deserialize all statements from the JSON blob.
    """
    statements = []
    for statement_data in blob["statements"]:
        statement = GraphStatement.create_from_json(statement_data)
        statements.append(statement)

    return statements
コード例 #2
0
ファイル: job.py プロジェクト: rajkrishnamurthy/cartography
def _get_statements_from_json(blob: Dict, short_job_name: Optional[str] = None) -> List[GraphStatement]:
    """
    Deserialize all statements from the JSON blob.
    """
    statements: List[GraphStatement] = []
    for i, statement_data in enumerate(blob["statements"]):
        # i+1 to make it 1-based and not 0-based to help with log readability
        statement: GraphStatement = GraphStatement.create_from_json(statement_data, short_job_name, i + 1)
        statements.append(statement)

    return statements