<commit_before>#------------------------------------------------------------------------------
#
#  Copyright (c) 2005, Enthought, Inc.
#  All rights reserved.
#  
#  This software is provided without warranty under the terms of the BSD
#  license included in enthought/LICENSE.txt and may be redistributed only
#  under the conditions described in the aforementioned license.  The license
#  is also available online at http://www.enthought.com/licenses/BSD.txt
#
#  Thanks for using Enthought open source!
#  
#  Author: <NAME>
#  Date:   02/14/2005
#
#------------------------------------------------------------------------------

""" Trait definition for a null-based (i.e., no UI) color.
"""

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from enthought.traits.api    import Trait, TraitError
from enthought.traits.ui.editors.color_editor import ColorEditor

#-------------------------------------------------------------------------------
#  Convert a number into a wxColour object:
#-------------------------------------------------------------------------------

def convert_to_color ( object, name, value ):
    """ Converts a number into a wxColour object.
    """
    if type( value ) is int:
        return num & 0xFFFFFF
    raise TraitError

convert_to_color.info = ('an integer which in hex is of the form 0xRRGGBB, '
                         'where RR is red, GG is green, and BB is blue')
             
#-------------------------------------------------------------------------------
#  Standard colors:<commit_msg>Trivial bug in color_traits.py<commit_after>#------------------------------------------------------------------------------
#
#  Copyright (c) 2005, Enthought, Inc.
#  All rights reserved.
#  
#  This software is provided without warranty under the terms of the BSD
#  license included in enthought/LICENSE.txt and may be redistributed only
#  under the conditions described in the aforementioned license.  The license
#  is also available online at http://www.enthought.com/licenses/BSD.txt
#
#  Thanks for using Enthought open source!
#  
#  Author: <NAME>
#  Date:   02/14/2005
#
#------------------------------------------------------------------------------

""" Trait definition for a null-based (i.e., no UI) color.
"""

#-------------------------------------------------------------------------------
#  Imports:
#-------------------------------------------------------------------------------

from enthought.traits.api    import Trait, TraitError
from enthought.traits.ui.editors.color_editor import ColorEditor

#-------------------------------------------------------------------------------
#  Convert a number into a wxColour object:
#-------------------------------------------------------------------------------

def convert_to_color ( object, name, value ):
    """ Converts a number into a wxColour object.
    """
    if type( value ) is int:
        return value & 0xFFFFFF
    raise TraitError

convert_to_color.info = ('an integer which in hex is of the form 0xRRGGBB, '
                         'where RR is red, GG is green, and BB is blue')
             
#-------------------------------------------------------------------------------
#  Standard colors:
{'fraction_non_alphanumeric': 0.3903679329943165, 'fraction_numerical': 0.008375710439724798, 'mean_word_length': 1.0132450331125828, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1674955', 'n_tokens_mistral': 758, 'n_tokens_neox': 712, 'n_words': 258}