docstr: Takes an override list and separate the overrides describing
  parameter sweeps from the rest of the overrides.
  
  Then use those sweeping overrides to generate all possible
  parameter sweep thought grid search.
  
  Outputs 2 lists:
  - the non sweep overrides
  - all possible sweep combinations
docstr_tok: ["Takes","an","override","list","and","separate","the","overrides","describing","parameter","sweeps","from","the","rest","of","the","overrides",".","Then","use","those","sweeping","overrides","to","generate","all","possible","parameter","sweep","thought","grid","search",".","Outputs","2","lists",":","-","the","non","sweep","overrides","-","all","possible","sweep","combinations"]
code: def from_overrides(
      cls, cli_overrides: List[Any]
  ) -> "SweepHydraOverrides":
      """
      Takes an override list and separate the overrides describing
      parameter sweeps from the rest of the overrides.
  
      Then use those sweeping overrides to generate all possible
      parameter sweep thought grid search.
  
      Outputs 2 lists:
      - the non sweep overrides
      - all possible sweep combinations
      """
  
      # Separate the normal overrides from the sweep ones
      overrides = []
      sweep_overrides = []
      parser = OverridesParser.create()
      parsed_overrides = parser.parse_overrides(overrides=cli_overrides)
      for parsed_override in parsed_overrides:
          if parsed_override.is_sweep_override():
              sweep_overrides.append(parsed_override)
          else:
              overrides.append(parsed_override.input_line)
  
      # If not parameter sweep specified, return early
      if not sweep_overrides:
          return SweepHydraOverrides(overrides=overrides, sweeps=[])
  
      # Generate all combinations of sweeps
      sweeps = [[]]
      for parsed_override in sweep_overrides:
          key = parsed_override.key_or_group
          prev_sweeps = sweeps
          sweeps = []
          for combination in prev_sweeps:
              for value in parsed_override.value().list:
                  sweeps.append(combination + [f"{key}={value}"])
  
      # Return parameters to schedule the hyper-parameter sweep
      return SweepHydraOverrides(overrides=overrides, sweeps=sweeps)
  
imports: import contextlib
  import copy
  import logging
  import math
  import os
  import pprint
  import re
  import sys
  from typing import Any, List, NamedTuple, Tuple
  import torch
  from hydra.core.override_parser.overrides_parser import OverridesParser
  from omegaconf import DictConfig, OmegaConf, open_dict
  from vissl.config import AttrDict, check_cfg_version
  from vissl.utils.io import save_file
  from vissl.utils.misc import is_augly_available
label_desc: Use image node_id 1 for calling the SweepHydraOverrides obj's underlying member method code with example usage: obj.from_overrides(cls, cli_overrides) and returns: SweepHydraOverrides, SweepHydraOverrides