def count_changes(change):
 if isinstance(change, ChangeSet):
  result = 0
  for child in change.changes:
   result += count_changes(child)
  return result
 return 1

def count_changes ( change ) : if isinstance ( change , ChangeSet ) : result = 0 for child in change . changes : result += count_changes ( child ) return result return 1
counts the number of basic changes a change will make .