(cls, cfg_file_obj_or_str)
Load a cfg.
        Args:
            cfg_file_obj_or_str (str or file):
                Supports loading from:
                - A file object backed by a YAML file
                - A file object backed by a Python source file that exports an attribute
                  "cfg" that is either a dict or a CfgNode
                - A string that can be parsed as valid YAML
Load a cfg.
        Args:
            cfg_file_obj_or_str (str or file):
                Supports loading from:
                - A file object backed by a YAML file
                - A file object backed by a Python source file that exports an attribute
                  "cfg" that is either a dict or a CfgNode
                - A string that can be parsed as valid YAML
Load a cfg . Args : cfg_file_obj_or_str ( str or file ) : Supports loading from : - A file object backed by a YAML file - A file object backed by a Python source file that exports an attribute cfg that is either a dict or a CfgNode - A string that can be parsed as valid YAML
def load_cfg(cls, cfg_file_obj_or_str):
        """
        Load a cfg.
        Args:
            cfg_file_obj_or_str (str or file):
                Supports loading from:
                - A file object backed by a YAML file
                - A file object backed by a Python source file that exports an attribute
                  "cfg" that is either a dict or a CfgNode
                - A string that can be parsed as valid YAML
        """
        _assert_with_logging(
            isinstance(cfg_file_obj_or_str, _FILE_TYPES + (str,)),
            "Expected first argument to be of type {} or {}, but it was {}".format(
                _FILE_TYPES, str, type(cfg_file_obj_or_str)
            ),
        )
        if isinstance(cfg_file_obj_or_str, str):
            return cls._load_cfg_from_yaml_str(cfg_file_obj_or_str)
        elif isinstance(cfg_file_obj_or_str, _FILE_TYPES):
            return cls._load_cfg_from_file(cfg_file_obj_or_str)
        else:
            raise NotImplementedError("Impossible to reach here (unless there's a bug)")
def load_cfg ( cls , cfg_file_obj_or_str ) : _assert_with_logging ( isinstance ( cfg_file_obj_or_str , _FILE_TYPES + ( str , ) ) , "Expected first argument to be of type {} or {}, but it was {}" . format ( _FILE_TYPES , str , type ( cfg_file_obj_or_str ) ) , ) if isinstance ( cfg_file_obj_or_str , str ) : return cls . _load_cfg_from_yaml_str ( cfg_file_obj_or_str ) elif isinstance ( cfg_file_obj_or_str , _FILE_TYPES ) : return cls . _load_cfg_from_file ( cfg_file_obj_or_str ) else : raise NotImplementedError ( "Impossible to reach here (unless there's a bug)" )