def _clean_attrib(obj, attrs):
 out = {}
 for key in attrs:
  val = getattr(obj, key)
  if (val is not None):
   out[key] = _serialize(val)
 return out

def _clean_attrib ( obj , attrs ) : out = { } for key in attrs : val = getattr ( obj , key ) if ( val is not None ) : out [ key ] = _serialize ( val ) return out
create a dictionary from an objects specified .