<commit_before># Copyright (C) 2017-2020  The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information

from django.shortcuts import redirect

from swh.web.common.identifiers import resolve_swhid


def swhid_browse(request, swhid):
    """
    Django view enabling to browse the archive using :ref:`<persistent-identifiers>`.

    The url that points to it is :http:get:`/(swhid)/`.
    """
    swhid_resolved = resolve_swhid(swhid, query_params=request.GET)

    return redirect(swhid_resolved["browse_url"])<commit_msg>Fix syntax of reference to persistent-identifiers.<commit_after># Copyright (C) 2017-2020  The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information

from django.shortcuts import redirect

from swh.web.common.identifiers import resolve_swhid


def swhid_browse(request, swhid):
    """
    Django view enabling to browse the archive using :ref:`persistent-identifiers`.

    The url that points to it is :http:get:`/(swhid)/`.
    """
    swhid_resolved = resolve_swhid(swhid, query_params=request.GET)

    return redirect(swhid_resolved["browse_url"])
{'fraction_non_alphanumeric': 0.08186309103740297, 'fraction_numerical': 0.012702893436838392, 'mean_word_length': 4.717741935483871, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3077251', 'n_tokens_mistral': 433, 'n_tokens_neox': 402, 'n_words': 146}