def _safely_get_members(component, member_names=None):
  """Gather stable members of a component.

  Args:
      component (object): The component from which to get the members from.
      member_names (list): List of names of members to gather.

  Returns:
      list: of stable component members as tuples (member name, member
      instance).

  Note:
      This function was designed to silence exceptions thrown by unstable
      devices when all
      device properties were previously accessed by inspect.getmembers.
  """
  all_member_names = dir(component)
  member_names = member_names or all_member_names

  members = []
  for attr_name in member_names:
    if attr_name in all_member_names:
      try:
        attribute = getattr(component, attr_name)
        members.append((attr_name, attribute))
      except Exception:
        pass  # ignore members that raise exceptions

  return members