import yaml


def read_yaml(file_name, fix_none=True):
    """Read yaml file and set None if str is 'None'."""
    def fix_dict_none(dict_):
        """Fix dict item 'None' as None"""
        for k in dict_:
            if isinstance(dict_[k], dict):
                fix_dict_none(dict_[k])
            elif isinstance(dict_[k], str) and dict_[k] == 'None':
                dict_[k] = None

    with open(file_name) as f:
        yaml_data = yaml.safe_load(f)
    if fix_none:
        fix_dict_none(yaml_data)
    return yaml_data