def _get_obj_attrs_map(obj, attrs):
 out = {}
 for attr in attrs:
  val = getattr(obj, attr, None)
  if (val is not None):
   if six.PY2:
    attr = str(attr)
    if isinstance(val, six.text_type):
     val = str(val)
   out[attr] = val
 return out

def _get_obj_attrs_map ( obj , attrs ) : out = { } for attr in attrs : val = getattr ( obj , attr , None ) if ( val is not None ) : if six . PY2 : attr = str ( attr ) if isinstance ( val , six . text_type ) : val = str ( val ) out [ attr ] = val return out
get the values for object attrs and return as a dict .