<commit_before># -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.  
# ****** END LICENSE BLOCK ******



__all__ = ["ColorText"]

import platform

if platform.system() == 'Windows':
    from winconsole import ColorText
else:
    from posixconsole import ColorText


def test():
  """Simple test for color_console."""
  import os
  import sys
  ctext = ColorText

  ctext('blue', txt='==========================================='+os.linesep)<commit_msg>Added check for cygwin or msys environment<commit_after># -*- coding: UTF8 -*-
# ***** BEGIN LICENSE BLOCK *****
# Sconspiracy - Copyright (C) IRCAD, 2004-2010.
# Distributed under the terms of the BSD Licence as
# published by the Open Source Initiative.  
# ****** END LICENSE BLOCK ******



__all__ = ["ColorText"]

import platform
import os

is_win  = platform.system() == 'Windows'
is_msys = "msys"   in os.environ.get('OSTYPE').lower()
is_cygw = "cygwin" in os.environ.get('OSTYPE').lower()

if is_win and not any([is_msys, is_cygw]) :
    from winconsole import ColorText
else:
    from posixconsole import ColorText


def test():
  """Simple test for color_console."""
  import os
  import sys
  ctext = ColorText

  ctext('blue', txt='==========================================='+os.linesep)
{'fraction_non_alphanumeric': 0.19686162624821682, 'fraction_numerical': 0.012838801711840228, 'mean_word_length': 4.375478927203065, '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': '2886569', 'n_tokens_mistral': 462, 'n_tokens_neox': 418, 'n_words': 139}