def get_header_from_yaml(lines):
 try:
  import yaml
 except ImportError:
  raise ImportError('`import yaml` failed, PyYAML package is required for ECSV format')
 from ..io.misc.yaml import AstropyLoader
 class TableLoader(AstropyLoader, ):
  '\n        Custom Loader that constructs OrderedDict from an !!omap object.\n        This does nothing but provide a namespace for adding the\n        custom odict constructor.\n        '
 TableLoader.add_constructor(u'tag:yaml.org,2002:omap', _construct_odict)
 header_yaml = textwrap.dedent('\n'.join(lines))
 try:
  header = yaml.load(header_yaml, Loader=TableLoader)
 except Exception as err:
  raise YamlParseError(str(err))
 return header

def get_header_from_yaml ( lines ) : try : import yaml except ImportError : raise ImportError ( '`import yaml` failed, PyYAML package is required for ECSV format' ) from . . io . misc . yaml import AstropyLoader class TableLoader ( AstropyLoader , ) : TableLoader . add_constructor ( u'tag:yaml.org,2002:omap' , _construct_odict ) header_yaml = textwrap . dedent ( '\n' . join ( lines ) ) try : header = yaml . load ( header_yaml , Loader = TableLoader ) except Exception as err : raise YamlParseError ( str ( err ) ) return header
get a header dict from input lines which should be valid yaml in the ecsv meta format .