<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function

import click
import sys

import os
from polyaxon_schemas.polyaxonfile.polyaxonfile import PolyaxonFile
from polyaxon_schemas.polyaxonfile.specification import PluginSpecification
from polyaxon_schemas.utils import to_list

from polyaxon_cli.utils import constants
from polyaxon_cli.utils.formatting import Printer


def check_polyaxonfile(file, log=True, is_plugin=True):
    file = to_list(file)
    exists = [os.path.isfile(f) for f in file]

    if not any(exists):
        Printer.print_error('Polyaxonfile is not present, '
                            'please run {}'.format(constants.INIT_COMMAND))
        sys.exit(1)

    try:
        plx_file = PolyaxonFile.read(file)
        if is_plugin:
            plx_file = PluginSpecification.read(plx_file._data)
        if log:
            Printer.print_success("Polyaxonfile valid")
        return plx_file
    except Exception as e:
        Printer.print_error("Polyaxonfile is not valid")
        sys.exit(1)


@click.command()
@click.option('--file', '-f', multiple=True, type=click.Path(exists=True),
              help='The polyaxon file to check.')
@click.option('--all', '-a', is_flag=True, default=False,
              help='Checks and prints the validated file.')
@click.option('--version', '-v', is_flag=True, default=False, help='Checks and prints the version.')
@click.option('--run-type', is_flag=True, default=False, help='Checks and prints the run_type.')
@click.option('--project', '-p', is_flag=True, default=False,
              help='Checks and prints the project def.')
@click.option('--log-path', is_flag=True, default=False, help='Checks and prints the log path.')<commit_msg>Fix check polyaxonfile: is_plugin false by default<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function

import click
import sys

import os
from polyaxon_schemas.polyaxonfile.polyaxonfile import PolyaxonFile
from polyaxon_schemas.polyaxonfile.specification import PluginSpecification
from polyaxon_schemas.utils import to_list

from polyaxon_cli.utils import constants
from polyaxon_cli.utils.formatting import Printer


def check_polyaxonfile(file, log=True, is_plugin=False):
    file = to_list(file)
    exists = [os.path.isfile(f) for f in file]

    if not any(exists):
        Printer.print_error('Polyaxonfile is not present, '
                            'please run {}'.format(constants.INIT_COMMAND))
        sys.exit(1)

    try:
        plx_file = PolyaxonFile.read(file)
        if is_plugin:
            plx_file = PluginSpecification.read(plx_file._data)
        if log:
            Printer.print_success("Polyaxonfile valid")
        return plx_file
    except Exception as e:
        Printer.print_error("Polyaxonfile is not valid")
        sys.exit(1)


@click.command()
@click.option('--file', '-f', multiple=True, type=click.Path(exists=True),
              help='The polyaxon file to check.')
@click.option('--all', '-a', is_flag=True, default=False,
              help='Checks and prints the validated file.')
@click.option('--version', '-v', is_flag=True, default=False, help='Checks and prints the version.')
@click.option('--run-type', is_flag=True, default=False, help='Checks and prints the run_type.')
@click.option('--project', '-p', is_flag=True, default=False,
              help='Checks and prints the project def.')
@click.option('--log-path', is_flag=True, default=False, help='Checks and prints the log path.')
{'fraction_non_alphanumeric': 0.12028169014084507, 'fraction_numerical': 0.0016901408450704226, 'mean_word_length': 3.558408215661104, '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': '484524', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1070, 'n_words': 277}