<commit_before>#
# Copyright (c) 2004-2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/licenses/CPL-1.0.
#
# This program is distributed in the hope that it will be useful, but
# without any warranty; without even the implied warranty of merchantability
# or fitness for a particular purpose. See the Common Public License for
# full details.
#
"""
Provides output methods for displaying troves
"""

import itertools
import time

#conary
from conary import files
from conary import trove
from conary.deps import deps
from conary.lib import log
from conary.lib.sha1helper import sha1ToString, md5ToString
from conary import metadata
from conary.repository import errors

def jobKey(x):
    return (x[0], (str(x[1][0]), str(x[1][1])),
                  (str(x[2][0]), str(x[2][1])), x[3])

def displayTroves(dcfg, formatter, troveTups):
    """
    display the given list of source troves 

    @param dcfg: stores information about the type of display to perform
    @type dcfg: display.DisplayConfig
    @param formatter: contains methods to display the troves
    @type formatter: display.TroveFormatter
    @param troveTups: the trove tuples to display
    @type troveTups: ordered list of (n,v,f) tuples
    """
    troveTups = list(filterComponents(troveTups, dcfg.getPrimaryTroves()))

    iter = iterTroveList(dcfg.getTroveSource(),
                         troveTups,
                         recurseAll=dcfg.recurseAll,
                         recurseOne=dcfg.recurseOne,
                         recursePackages=not dcfg.hideComponents(),
                         needTroves = dcfg.needTroves(),
                         getPristine = dcfg.getPristine(),
                         showNotByDefault = dcfg.showNotByDefault,
                         showWeakRefs = dcfg.showWeakRefs,
                         checkExists = dcfg.checkExists,
                         showNotExists = dcfg.showNotExists,
                         showFlags = dcfg.showTroveFlags,
                         primaryTroves = dcfg.getPrimaryTroves())<commit_msg>handle cases when there is no relative flag<commit_after>#
# Copyright (c) 2004-2005 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/licenses/CPL-1.0.
#
# This program is distributed in the hope that it will be useful, but
# without any warranty; without even the implied warranty of merchantability
# or fitness for a particular purpose. See the Common Public License for
# full details.
#
"""
Provides output methods for displaying troves
"""

import itertools
import time

#conary
from conary import files
from conary import trove
from conary.deps import deps
from conary.lib import log
from conary.lib.sha1helper import sha1ToString, md5ToString
from conary import metadata
from conary.repository import errors

def jobKey(x):
    return (x[0], (str(x[1][0]), str(x[1][1])),
                  (str(x[2][0]), str(x[2][1]))) + x[3:]

def displayTroves(dcfg, formatter, troveTups):
    """
    display the given list of source troves 

    @param dcfg: stores information about the type of display to perform
    @type dcfg: display.DisplayConfig
    @param formatter: contains methods to display the troves
    @type formatter: display.TroveFormatter
    @param troveTups: the trove tuples to display
    @type troveTups: ordered list of (n,v,f) tuples
    """
    troveTups = list(filterComponents(troveTups, dcfg.getPrimaryTroves()))

    iter = iterTroveList(dcfg.getTroveSource(),
                         troveTups,
                         recurseAll=dcfg.recurseAll,
                         recurseOne=dcfg.recurseOne,
                         recursePackages=not dcfg.hideComponents(),
                         needTroves = dcfg.needTroves(),
                         getPristine = dcfg.getPristine(),
                         showNotByDefault = dcfg.showNotByDefault,
                         showWeakRefs = dcfg.showWeakRefs,
                         checkExists = dcfg.checkExists,
                         showNotExists = dcfg.showNotExists,
                         showFlags = dcfg.showTroveFlags,
                         primaryTroves = dcfg.getPrimaryTroves())
{'fraction_non_alphanumeric': 0.07890185905750108, 'fraction_numerical': 0.010808473843493299, 'mean_word_length': 2.551036070606293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1020998', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1280, 'n_words': 430}