def textract_block_to_block_relationship()

in src/pre_human_task_lambda.py [0:0]


def textract_block_to_block_relationship(tr):
    """Return a block relationship object from a Textract block object."""
    ids = []
    if tr:
        for r in tr:
            if r['Type'] != 'CHILD':
                continue
            ids.extend(r['Ids'])
            break
    return Relationship(ids, 'CHILD')