def marshall(self, definition, entity, *, skip_none=False, as_list=False, use_foreign_key=False):
    if (entity is None):
        return None
    if as_list:
        return [self.marshall(definition, e, skip_none=skip_none, as_list=False, use_foreign_key=use_foreign_key) for e in entity]
    values = {}
    for field in definition.fields:
        self._marshall_object(values, field, entity, skip_none, use_foreign_key)
    return values
def marshall(self, definition, entity, *, skip_none=False, as_list=False, use_foreign_key=False):
    if (entity is None):
        return None
    if as_list:
        return [self.marshall(definition, e, skip_none=skip_none, as_list=False, use_foreign_key=use_foreign_key) for e in entity]
    values = {}
    for field in definition.fields:
        self._marshall_object(values, field, entity, skip_none, use_foreign_key)
    return values