<commit_before>from cement.ext.ext_argparse import expose

from clowder.cli.abstract_base_controller import AbstractBaseController


class YAMLController(AbstractBaseController):
    class Meta:
        label = 'yaml'
        stacked_on = 'base'
        stacked_type = 'nested'
        description = 'Print clowder.yaml information'
        arguments = [
            (['--resolved', '-r'], dict(action='store_true', help='print resolved clowder.yaml'))
            ]

    @expose(help="second-controller default command", hide=True)
    def default(self):
        print("Inside SecondController.default()")<commit_msg>Add `clowder yaml` logic to Cement controller<commit_after>from __future__ import print_function

import sys

from cement.ext.ext_argparse import expose

import clowder.util.formatting as fmt
from clowder.cli.abstract_base_controller import AbstractBaseController
from clowder.util.decorators import (
    print_clowder_repo_status,
    valid_clowder_yaml_required
)
from clowder.yaml.printing import print_yaml


class YAMLController(AbstractBaseController):
    class Meta:
        label = 'yaml'
        stacked_on = 'base'
        stacked_type = 'nested'
        description = 'Print clowder.yaml information'
        arguments = [
            (['--resolved', '-r'], dict(action='store_true', help='print resolved clowder.yaml'))
            ]

    @expose(help="second-controller default command", hide=True)
    @valid_clowder_yaml_required
    @print_clowder_repo_status
    def default(self):
        if self.app.pargs.resolved:
            print(fmt.yaml_string(self.clowder.get_yaml_resolved()))
        else:
            print_yaml(self.clowder.root_directory)
        sys.exit()  # exit early to prevent printing extra newline
{'fraction_non_alphanumeric': 0.09453302961275627, 'fraction_numerical': 0.0, 'mean_word_length': 3.4035087719298245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7233904', 'n_tokens_mistral': 510, 'n_tokens_neox': 499, 'n_words': 111}