def make_name ( estimator ) : if estimator is not None : if isinstance ( estimator , six . string_types ) : estimator_name = estimator else : estimator_name = estimator . __class__ . __name__ else : estimator_name = None return estimator_name
python generic name for a string
Helper function that returns the name of estimator or the given string if a string is given
def make_name(estimator):
  """Helper function that returns the name of estimator or the given string
  if a string is given
  """
  if estimator is not None:
    if isinstance(estimator, six.string_types):
      estimator_name = estimator
    else:
      estimator_name = estimator.__class__.__name__
  else:
    estimator_name = None
  return estimator_name