def _get_codeobj(pyfile):
 from imp import PY_COMPILED, PY_SOURCE
 (result, fileobj, fullpath) = _check_if_pyc(pyfile)
 try:
  data = fileobj.read()
 finally:
  fileobj.close()
 if (result is PY_COMPILED):
  import marshal
  code_obj = marshal.loads(data[8:])
 elif (result is PY_SOURCE):
  code_obj = compile(data, fullpath, 'exec')
 else:
  raise Exception('Input file is unknown format: {0}'.format(fullpath))
 return code_obj

def _get_codeobj ( pyfile ) : from imp import PY_COMPILED , PY_SOURCE ( result , fileobj , fullpath ) = _check_if_pyc ( pyfile ) try : data = fileobj . read ( ) finally : fileobj . close ( ) if ( result is PY_COMPILED ) : import marshal code_obj = marshal . loads ( data [ 8 : ] ) elif ( result is PY_SOURCE ) : code_obj = compile ( data , fullpath , 'exec' ) else : raise Exception ( 'Input file is unknown format: {0}' . format ( fullpath ) ) return code_obj
returns the code object .