(self, yaml_file_path)
return yaml_contents
Load and read given YAML file.

        Args:
            file_path: location of yaml file to read (str).

        Returns:
            Either list or string, depending on structure of given yaml file

        Raises:
            CouldNotFindYAMLFileError: when a given config file cannot be found.
            InvalidYAMLFileError: when a given config file is incorrectly formatted.
            EmptyYAMLFileError: when a give config file is empty.
Load and read given YAML file.
Load and read given YAML file .
def load_yaml_file(self, yaml_file_path):
        """Load and read given YAML file.

        Args:
            file_path: location of yaml file to read (str).

        Returns:
            Either list or string, depending on structure of given yaml file

        Raises:
            CouldNotFindYAMLFileError: when a given config file cannot be found.
            InvalidYAMLFileError: when a given config file is incorrectly formatted.
            EmptyYAMLFileError: when a give config file is empty.
        """
        try:
            yaml_file = open(yaml_file_path, encoding="UTF-8").read()
        except FileNotFoundError:
            raise CouldNotFindYAMLFileError(yaml_file_path)

        try:
            yaml_contents = yaml.load(yaml_file)
        except yaml.YAMLError:
            raise InvalidYAMLFileError(yaml_file_path)

        if yaml_contents is None:
            raise EmptyYAMLFileError(yaml_file_path)

        if isinstance(yaml_contents, dict) is False:
            raise InvalidYAMLFileError(yaml_file_path)

        return yaml_contents
def load_yaml_file ( self , yaml_file_path ) : try : yaml_file = open ( yaml_file_path , encoding = "UTF-8" ) . read ( ) except FileNotFoundError : raise CouldNotFindYAMLFileError ( yaml_file_path ) try : yaml_contents = yaml . load ( yaml_file ) except yaml . YAMLError : raise InvalidYAMLFileError ( yaml_file_path ) if yaml_contents is None : raise EmptyYAMLFileError ( yaml_file_path ) if isinstance ( yaml_contents , dict ) is False : raise InvalidYAMLFileError ( yaml_file_path ) return yaml_contents