def _valid_object_with_name(ui_object):
  """Checks if a ui object has a valid name.

  Args:
    ui_object: ui object.

  Returns:
     A boolean to indicate if a ui object has a valid name.
  """
  return ui_object.obj_name