def _create_route(self, env, item):
if item.name in env:<EOL><INDENT>if isinstance(env[item.name], ApiRoutesByVersion):<EOL><INDENT>if item.version in env[item.name].at_version:<EOL><INDENT>existing_dt = env[item.name].at_version[item.version]<EOL>raise InvalidSpec(<EOL>'<STR_LIT>' % (<EOL>quote(item.name), item.version, existing_dt._ast_node.path,<EOL>existing_dt._ast_node.lineno),<EOL>item.lineno, item.path)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>existing_dt = env[item.name]<EOL>raise InvalidSpec(<EOL>'<STR_LIT>' % (<EOL>quote(item.name), existing_dt._ast_node.path,<EOL>existing_dt._ast_node.lineno),<EOL>item.lineno, item.path)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>env[item.name] = ApiRoutesByVersion()<EOL><DEDENT>route = ApiRoute(<EOL>name=item.name,<EOL>version=item.version,<EOL>ast_node=item,<EOL>)<EOL>env[route.name].at_version[route.version] = route<EOL>return route<EOL>
Constructs a route and adds it to the environment.

Args:
    env (dict): The environment of defined symbols. A new key is added
        corresponding to the name of this new route.
    item (AstRouteDef): Raw route definition from the parser.

Returns:
    stone.api.ApiRoutesByVersion: A group of fully-defined routes indexed by versions.