parameters: (include=None, exclude=None)
return_statement: return [v for v in vars_to_include if v not in vars_to_exclude]
docstring: Gets the list of the variables to restore.
  
    Args:
      include: an optional list/tuple of scope strings for filtering which
        variables from the VARIABLES collection to include. None would include all
        the variables.
      exclude: an optional list/tuple of scope strings for filtering which
        variables from the VARIABLES collection to exclude. None it would not
        exclude any.
  
    Returns:
      a list of variables to restore.
  
    Raises:
      TypeError: include or exclude is provided but is not a list or a tuple.
docstring_summary: Gets the list of the variables to restore.
docstring_tokens: Gets the list of the variables to restore .
function: def get_variables_to_restore(include=None, exclude=None):
    """Gets the list of the variables to restore.
  
    Args:
      include: an optional list/tuple of scope strings for filtering which
        variables from the VARIABLES collection to include. None would include all
        the variables.
      exclude: an optional list/tuple of scope strings for filtering which
        variables from the VARIABLES collection to exclude. None it would not
        exclude any.
  
    Returns:
      a list of variables to restore.
  
    Raises:
      TypeError: include or exclude is provided but is not a list or a tuple.
    """
    if include is None:
      # Include all variables.
      vars_to_include = get_variables()
    else:
      if not isinstance(include, (list, tuple)):
        raise TypeError('include is provided but is not a list or a tuple.')
      vars_to_include = []
      for scope in include:
        vars_to_include += get_variables(scope)
    vars_to_exclude = set()
    if exclude is not None:
      if not isinstance(exclude, (list, tuple)):
        raise TypeError('exclude is provided but is not a list or a tuple.')
      for scope in exclude:
        vars_to_exclude |= set(get_variables(scope))
    # Exclude the variables in vars_to_exclude
    return [v for v in vars_to_include if v not in vars_to_exclude]
function_tokens: def get_variables_to_restore ( include = None , exclude = None ) : if include is None : # Include all variables. vars_to_include = get_variables ( ) else : if not isinstance ( include , ( list , tuple ) ) : raise TypeError ( 'include is provided but is not a list or a tuple.' ) vars_to_include = [ ] for scope in include : vars_to_include += get_variables ( scope ) vars_to_exclude = set ( ) if exclude is not None : if not isinstance ( exclude , ( list , tuple ) ) : raise TypeError ( 'exclude is provided but is not a list or a tuple.' ) for scope in exclude : vars_to_exclude |= set ( get_variables ( scope ) ) # Exclude the variables in vars_to_exclude return [ v for v in vars_to_include if v not in vars_to_exclude ]