def read_spec(filename, verbose=False):
contents = None<EOL>with open(filename, '<STR_LIT:r>') as f:<EOL><INDENT>contents = yaml.load(f)<EOL>if contents is None:<EOL><INDENT>raise Exception("<STR_LIT>" % filename)<EOL><DEDENT>try:<EOL><INDENT>s.package_schema(contents)<EOL><DEDENT>except Exception as e:<EOL><INDENT>sys.stderr.write("<STR_LIT>" % filename)<EOL>raise e<EOL><DEDENT><DEDENT>return contents<EOL>
Read an SBP specification.

Parameters
----------
filename : str
  Local filename for specification.
verbose : bool
  Print out some debugging info

Returns
----------

Raises
----------
Exception
  On empty file.
yaml.YAMLError
  On Yaml parsing error
voluptuous.Invalid
  On invalid SBP schema