<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filtered_cell(cell, preserve_outputs, cell_metadata_filter):
 """Cell type, metadata and source from given cell"""

    metadata = copy(cell.metadata)
    filter_metadata(metadata, cell_metadata_filter, _IGNORE_CELL_METADATA)

    filtered = {'cell_type': cell.cell_type,
                'source': cell.source,
                'metadata': metadata}

    if preserve_outputs:
        for key in ['execution_count', 'outputs']:
            if key in cell:
                filtered[key] = cell[key]

    return filtered