<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_attributes(schema, location):
 """Return the schema's children, filtered by location."""

        schema = DottedNameResolver(__name__).maybe_resolve(schema)

        def _filter(attr):
            if not hasattr(attr, "location"):
                valid_location = 'body' in location
            else:
                valid_location = attr.location in to_list(location)
            return valid_location

        return list(filter(_filter, schema().children))