(synsets)
return all_ancestors
Create a set consisting of all and only the ancestors of leaves.

  Args:
    synsets: A list of Synsets.

  Returns:
    A set of Synsets.
Create a set consisting of all and only the ancestors of leaves.
Create a set consisting of all and only the ancestors of leaves .
def get_ancestors(synsets):
  """Create a set consisting of all and only the ancestors of leaves.

  Args:
    synsets: A list of Synsets.

  Returns:
    A set of Synsets.
  """
  all_ancestors = set()
  for s in synsets:
    all_ancestors = all_ancestors | get_node_ancestors(s)
  return all_ancestors
def get_ancestors ( synsets ) : all_ancestors = set ( ) for s in synsets : all_ancestors = all_ancestors | get_node_ancestors ( s ) return all_ancestors