def _entity_from_response_type(feature_type, results):
 detected_objects = []
 if (feature_type == _FACE_ANNOTATIONS):
  detected_objects.extend((Face.from_api_repr(face) for face in results))
 elif (feature_type == _IMAGE_PROPERTIES_ANNOTATION):
  return ImagePropertiesAnnotation.from_api_repr(results)
 elif (feature_type == _SAFE_SEARCH_ANNOTATION):
  return SafeSearchAnnotation.from_api_repr(results)
 else:
  for result in results:
   detected_objects.append(EntityAnnotation.from_api_repr(result))
 return detected_objects

def _entity_from_response_type ( feature_type , results ) : detected_objects = [ ] if ( feature_type == _FACE_ANNOTATIONS ) : detected_objects . extend ( ( Face . from_api_repr ( face ) for face in results ) ) elif ( feature_type == _IMAGE_PROPERTIES_ANNOTATION ) : return ImagePropertiesAnnotation . from_api_repr ( results ) elif ( feature_type == _SAFE_SEARCH_ANNOTATION ) : return SafeSearchAnnotation . from_api_repr ( results ) else : for result in results : detected_objects . append ( EntityAnnotation . from_api_repr ( result ) ) return detected_objects
convert a json result to an entity type based on the feature .