def scope2index(scope, descr, where=None):
try:<EOL><INDENT>return scopes.index(scope)<EOL><DEDENT>except ValueError:<EOL><INDENT>fail(<EOL>"<STR_LIT>".format(<EOL>descr, "<STR_LIT>".format(where) if where else "<STR_LIT>", scope<EOL>),<EOL>pytrace=False,<EOL>)<EOL><DEDENT>
Look up the index of ``scope`` and raise a descriptive value error
    if not defined.