<commit_before>from django.conf.urls.defaults import *

cluster = 'cluster/(?P<cluster_slug>\w+)'
instance = '/(?P<instance>[^/]+)'

urlpatterns = patterns('ganeti_webmgr.ganeti.views.general',
    # Example:
    # (r'^ganeti_webmgr/', include('ganeti_webmgr.foo.urls')),
    url(r'^$', 'index', name="cluster-overview"),
    #   Orphans
    url(r'^orphans/','orphans', name='instance-orphans'),
    # Authentication
    url(r'^accounts/login/?', 'login_view', name="login"),
    url(r'^accounts/logout/?', 'logout_view', name="logout"),
)

# Clusters
urlpatterns += patterns('ganeti_webmgr.ganeti.views.cluster',
    #   List
    url(r'^clusters/$', 'list', name="cluster-list"),
    #   Detail
    url(r'^' + cluster + '/?$', 'detail', name="cluster-detail"),
    url(r'^%s/users/?$' % cluster, 'cluster_users', name="cluster-users"),
    url(r'^%s/user/?$' % cluster, 'permissions', name="cluster-permissions"),
    url(r'^%s/user/quota/?$'% cluster, 'quota', name="cluster-quota"),
)

# Instances
urlpatterns += patterns('ganeti_webmgr.ganeti.views.instances',
    #  List
    url(r'^vms/$', 'list', name="virtualmachine-list"),
    #  Detail
    url(r'^' + cluster + instance, 'detail', name="instance-detail"),
    #  Create
    url(r'^create/$', 'create', name="instance-create"),
    url(r'^create/(?P<cluster_slug>\w+)$', 
        'create', name="instance-create"),
    #  Start, Stop, Reboot
    url(r'^' + cluster + instance + '/vnc/?$',
        'vnc', name="instance-vnc"),
    url(r'^' + cluster + instance + '/shutdown/?$',
        'shutdown', name="instance-shutdown"),
    url(r'^' + cluster + instance + '/startup/?$',
        'startup', name="instance-startup"),
    url(r'^' + cluster + instance + '/reboot/?$',
        'reboot', name="instance-reboot"),
)<commit_msg>fixing url mappings to use format strings<commit_after>from django.conf.urls.defaults import *

cluster = 'cluster/(?P<cluster_slug>\w+)'
instance = '/(?P<instance>[^/]+)'

urlpatterns = patterns('ganeti_webmgr.ganeti.views.general',
    # Example:
    # (r'^ganeti_webmgr/', include('ganeti_webmgr.foo.urls')),
    url(r'^$', 'index', name="cluster-overview"),
    #   Orphans
    url(r'^orphans/','orphans', name='instance-orphans'),
    # Authentication
    url(r'^accounts/login/?', 'login_view', name="login"),
    url(r'^accounts/logout/?', 'logout_view', name="logout"),
)

# Clusters
urlpatterns += patterns('ganeti_webmgr.ganeti.views.cluster',
    #   List
    url(r'^clusters/$', 'list', name="cluster-list"),
    #   Detail
    url(r'^%s/?$' % cluster, 'detail', name="cluster-detail"),
    url(r'^%s/users/?$' % cluster, 'cluster_users', name="cluster-users"),
    url(r'^%s/user/?$' % cluster, 'permissions', name="cluster-permissions"),
    url(r'^%s/user/quota/?$'% cluster, 'quota', name="cluster-quota"),
)

# Instances
prefix = '%s%s' %  (cluster, instance)
urlpatterns += patterns('ganeti_webmgr.ganeti.views.instances',
    #  List
    url(r'^vms/$', 'list', name="virtualmachine-list"),
    #  Detail
    url(r'^%s' % prefix, 'detail', name="instance-detail"),
    #  Create
    url(r'^create/$', 'create', name="instance-create"),
    url(r'^create/(?P<cluster_slug>\w+)$', 'create', name="instance-create"),
    #  Start, Stop, Reboot
    url(r'^%s/vnc/?$' % prefix, 'vnc', name="instance-vnc"),
    url(r'^%s/shutdown/?$' % prefix, 'shutdown', name="instance-shutdown"),
    url(r'^%s/startup/?$' % prefix, 'startup', name="instance-startup"),
    url(r'^%s/reboot/?$' % prefix, 'reboot', name="instance-reboot"),
)
{'fraction_non_alphanumeric': 0.23277573008222285, 'fraction_numerical': 0.0, 'mean_word_length': 4.273542600896861, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1918324', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1280, 'n_words': 193}