def document_metas_from_data(document_data, claimant):
    def transform_meta_(document_meta_dicts, items, path_prefix=None):
        """Fill document_meta_dicts with document meta dicts for the items."""
        if path_prefix is None:
            path_prefix = []

        for key, value in items.iteritems():
            keypath = path_prefix[:]
            keypath.append(key)

            if isinstance(value, dict):
                transform_meta_(document_meta_dicts,
                                value,
                                path_prefix=keypath)
            else:
                if not isinstance(value, list):
                    value = [value]

                document_meta_dicts.append({
                    'type': '.'.join(keypath),
                    'value': value,
                    'claimant': claimant,
                })

    items = {k: v for k, v in document_data.iteritems() if k != 'link'}
    document_meta_dicts = []
    transform_meta_(document_meta_dicts, items)
    return document_meta_dicts
Type: Flow or Auxiliary
dataset/ETHPy150Open hypothesis/h/h/api/parse_document_claims.py/document_metas_from_data--crossover with--dataset/ETHPy150Open JamesPHoughton/pysd/tests/old_tests/vensim/test_smooth.py/Components.function_output