def _create_entity_dofs(fiat_cell, num_dofs):
    """This function is ripped from FIAT/discontinuous_lagrange.py"""
    entity_dofs = {}
    top = fiat_cell.get_topology()
    for dim in sorted(top):
        entity_dofs[dim] = {}
        for entity in sorted(top[dim]):
            entity_dofs[dim][entity] = []
    entity_dofs[dim][0] = list(range(num_dofs))
    return entity_dofs
