<commit_before>﻿using System.Web.Mvc;
using System.Web.Routing;
using MvcHaack.Ajax;
using RouteMagic;

namespace NuGetGallery
{
    public static class Routes
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute(
                RouteName.Home,
                "",
                MVC.Pages.Home());

            routes.MapRoute(
                RouteName.Stats,
                "stats",
                MVC.Pages.Stats());

            routes.Add(new JsonRoute("json/{controller}"));

            routes.MapRoute(
                RouteName.Policies,
                "policies/{action}",
                MVC.Pages.Terms());

            var packageListRoute = routes.MapRoute(
                RouteName.ListPackages,
                "packages",
                MVC.Packages.ListPackages());

            var uploadPackageRoute = routes.MapRoute(
                RouteName.UploadPackage,
                "packages/upload",
                MVC.Packages.UploadPackage());

            routes.MapRoute(
                RouteName.VerifyPackage,
                "packages/verify-upload",
                MVC.Packages.VerifyPackage());

            routes.MapRoute(
                RouteName.CancelUpload,
                "packages/cancel-upload",
                MVC.Packages.CancelUpload());

            routes.MapRoute(
                RouteName.PackageOwnerConfirmation,
                "packages/{id}/owners/{username}/confirm/{token}",
                new { controller = MVC.Packages.Name, action = "ConfirmOwner" });

            // We need the following two routes (rather than just one) due to Routing's 
            // Consecutive Optional Parameter bug. :(
            var packageDisplayRoute = routes.MapRoute(
                RouteName.DisplayPackage,
                "packages/{id}/{version}",
                MVC.Packages.DisplayPackage().AddRouteValue("version", UrlParameter.Optional),
                null /*defaults*/,
                new { version = new VersionRouteConstraint() });

            routes.MapRoute(
                RouteName.PackageFileContentsAction,
                "packages/{id}/{version}/Contents",
                new { controller = MVC.PackageFiles.Name, action = "Contents" },
                new { version = new VersionRouteConstraint() });

            routes.MapRoute(
                RouteName.PackageFilePathAction,
                "packagefiles/{id}/{version}/{action}",
                new { controller = MVC.PackageFiles.Name },
                new { version = new VersionRouteConstraint() });

            var packageVersionActionRoute = routes.MapRoute(
                RouteName.PackageVersionAction,
                "packagefiles/{id}/{version}/{action}",
                new { controller = MVC.Packages.Name },
                new { version = new VersionRouteConstraint() });

            var packageActionRoute = routes.MapRoute(
                RouteName.PackageAction,
                "packages/{id}/{action}",
                new { controller = MVC.Packages.Name });

            var resendRoute = routes.MapRoute(
                "ResendConfirmation",
                "account/ResendConfirmation",
                MVC.Users.ResendConfirmation());

            //Redirecting v1 Confirmation Route
            routes.Redirect(
                r => r.MapRoute(
                    "v1Confirmation",
                    "Users/Account/ChallengeEmail")).To(resendRoute);

            routes.MapRoute(
                RouteName.Authentication,
                "users/account/{action}",
                new { controller = MVC.Authentication.Name });

            routes.MapRoute(
                RouteName.Profile,
                "profiles/{username}",
                MVC.Users.Profiles());
<commit_msg>Fix a bad merge in Routes.cs<commit_after>﻿using System.Web.Mvc;
using System.Web.Routing;
using MvcHaack.Ajax;
using RouteMagic;

namespace NuGetGallery
{
    public static class Routes
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute(
                RouteName.Home,
                "",
                MVC.Pages.Home());

            routes.MapRoute(
                RouteName.Stats,
                "stats",
                MVC.Pages.Stats());

            routes.Add(new JsonRoute("json/{controller}"));

            routes.MapRoute(
                RouteName.Policies,
                "policies/{action}",
                MVC.Pages.Terms());

            var packageListRoute = routes.MapRoute(
                RouteName.ListPackages,
                "packages",
                MVC.Packages.ListPackages());

            var uploadPackageRoute = routes.MapRoute(
                RouteName.UploadPackage,
                "packages/upload",
                MVC.Packages.UploadPackage());

            routes.MapRoute(
                RouteName.VerifyPackage,
                "packages/verify-upload",
                MVC.Packages.VerifyPackage());

            routes.MapRoute(
                RouteName.CancelUpload,
                "packages/cancel-upload",
                MVC.Packages.CancelUpload());

            routes.MapRoute(
                RouteName.PackageOwnerConfirmation,
                "packages/{id}/owners/{username}/confirm/{token}",
                new { controller = MVC.Packages.Name, action = "ConfirmOwner" });

            // We need the following two routes (rather than just one) due to Routing's 
            // Consecutive Optional Parameter bug. :(
            var packageDisplayRoute = routes.MapRoute(
                RouteName.DisplayPackage,
                "packages/{id}/{version}",
                MVC.Packages.DisplayPackage().AddRouteValue("version", UrlParameter.Optional),
                null /*defaults*/,
                new { version = new VersionRouteConstraint() });

            routes.MapRoute(
                RouteName.PackageFileContentsAction,
                "packages/{id}/{version}/Contents",
                new { controller = MVC.PackageFiles.Name, action = "Contents" },
                new { version = new VersionRouteConstraint() });

            routes.MapRoute(
                RouteName.PackageFilePathAction,
                "packagefiles/{id}/{version}/{action}",
                new { controller = MVC.PackageFiles.Name },
                new { version = new VersionRouteConstraint() });

            var packageVersionActionRoute = routes.MapRoute(
                RouteName.PackageVersionAction,
                "packages/{id}/{version}/{action}",
                new { controller = MVC.Packages.Name },
                new { version = new VersionRouteConstraint() });

            var packageActionRoute = routes.MapRoute(
                RouteName.PackageAction,
                "packages/{id}/{action}",
                new { controller = MVC.Packages.Name });

            var resendRoute = routes.MapRoute(
                "ResendConfirmation",
                "account/ResendConfirmation",
                MVC.Users.ResendConfirmation());

            //Redirecting v1 Confirmation Route
            routes.Redirect(
                r => r.MapRoute(
                    "v1Confirmation",
                    "Users/Account/ChallengeEmail")).To(resendRoute);

            routes.MapRoute(
                RouteName.Authentication,
                "users/account/{action}",
                new { controller = MVC.Authentication.Name });

            routes.MapRoute(
                RouteName.Profile,
                "profiles/{username}",
                MVC.Users.Profiles());

{'fraction_non_alphanumeric': 0.10208360634255012, 'fraction_numerical': 0.000524177696239025, 'mean_word_length': 1.5113524185587364, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '939049', 'n_tokens_mistral': 1894, 'n_tokens_neox': 1761, 'n_words': 319}