<commit_before>"""Representation of clowder.yaml fork"""

from __future__ import print_function

import os

from termcolor import cprint

from clowder.git.repo import GitRepo


class Fork(object):
    """clowder.yaml fork class"""

    def __init__(self, fork, root_directory, path, source):
        self.root_directory = root_directory
        self.path = path
        self.name = fork['name']
        self.remote_name = fork['remote']
        self.url = source.get_url_prefix() + self.name + ".git"

    def full_path(self):
        """Return full path to project"""
        return os.path.join(self.root_directory, self.path)

    def get_yaml(self):
        """Return python object representation for saving yaml"""
        return {'name': self.name, 'remote': self.remote_name}

    def print_status(self):
        """Print formatted fork status"""
        if not GitRepo.existing_git_repository(self.path):
            cprint(self.path, 'green')
            return
        project_output = GitRepo.format_project_string(self.path, self.path)
        current_ref_output = GitRepo.format_project_ref_string(self.full_path())<commit_msg>Fix bugs in fork<commit_after>"""Representation of clowder.yaml fork"""

from __future__ import print_function

import os

from termcolor import cprint

from clowder.git.project_repo import ProjectRepo


class Fork(object):
    """clowder.yaml fork class"""

    def __init__(self, fork, root_directory, path, source):
        self.root_directory = root_directory
        self.path = path
        self.name = fork['name']
        self.remote_name = fork['remote']
        self.url = source.get_url_prefix() + self.name + ".git"

    def full_path(self):
        """Return full path to project"""
        return os.path.join(self.root_directory, self.path)

    def get_yaml(self):
        """Return python object representation for saving yaml"""
        return {'name': self.name, 'remote': self.remote_name}

    def print_status(self):
        """Print formatted fork status"""
        if not ProjectRepo.existing_git_repository(self.path):
            cprint(self.path, 'green')
            return
        project_output = ProjectRepo.format_project_string(self.path, self.path)
        current_ref_output = ProjectRepo.format_project_ref_string(self.full_path())
{'fraction_non_alphanumeric': 0.10923276983094929, 'fraction_numerical': 0.0, 'mean_word_length': 3.181159420289855, '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': '6788606', 'n_tokens_mistral': 672, 'n_tokens_neox': 665, 'n_words': 166}