def _get_declared_fields(bases, attrs):
 fields = [(field_name, attrs.pop(field_name)) for (field_name, obj) in list(six.iteritems(attrs)) if isinstance(obj, Field)]
 fields.sort(key=(lambda x: x[1].creation_counter))
 for base in bases[::(-1)]:
  if hasattr(base, 'base_fields'):
   fields = (list(base.base_fields.items()) + fields)
 return OrderedDict(fields)

def _get_declared_fields ( bases , attrs ) : fields = [ ( field_name , attrs . pop ( field_name ) ) for ( field_name , obj ) in list ( six . iteritems ( attrs ) ) if isinstance ( obj , Field ) ] fields . sort ( key = ( lambda x : x [ 1 ] . creation_counter ) ) for base in bases [ : : ( - 1 ) ] : if hasattr ( base , 'base_fields' ) : fields = ( list ( base . base_fields . items ( ) ) + fields ) return OrderedDict ( fields )
create a list of serializer field instances from the passed in "attrs" .