def atoms(cls, instance_or_dict):
    """
    Iterator for the atomic components of a model definition and relevant
    data that creates a 3-tuple of the field's name, its type instance and
    its value.

    :param cls:
        The model definition.
    :param instance_or_dict:
        The structure where fields from cls are mapped to values. The only
        expectation for this structure is that it implements a ``Mapping``
        interface.
    """
    field_getter = serializable_getter = instance_or_dict.get
    try:
        field_getter = instance_or_dict._data.get
    except __HOLE__:
        pass

    sequences = ((cls._field_list, field_getter),
                 (cls._serializables.items(), serializable_getter))
    for sequence, get in sequences:
        for field_name, field in sequence:
            yield (field_name, field, get(field_name, Undefined))



###
# Field filtering
###
dataset/ETHPy150Open schematics/schematics/schematics/transforms.py/atoms