def _CheckSupplementalColumn(name, value):
    'Returns a possibly modified value for a supplemental column, or None.'
    name = str(name)
    if (len(name) > _MAX_COLUMN_NAME_LENGTH):
        logging.warn('Supplemental column name too long.')
        return None
    if (name[:2] not in ('d_', 'r_', 'a_')):
        logging.warn('Bad column name "%s", invalid prefix.', name)
        return None
    if name.startswith('d_'):
        try:
            value = float(value)
        except (ValueError, TypeError):
            logging.warn('Bad value for column "%s", should be numerical.', name)
            return None
    if name.startswith('r_'):
        revision_patterns = ['^\\d+$', '^\\d+\\.\\d+\\.\\d+\\.\\d+$', '^[A-Fa-f0-9]{40}$']
        if ((not value) or (len(str(value)) > _STRING_COLUMN_MAX_LENGTH) or (not any((re.match(p, str(value)) for p in revision_patterns)))):
            logging.warn('Bad value for revision column "%s".', name)
            return None
        value = str(value)
    if name.startswith('a_'):
        if (len(str(value)) > _STRING_COLUMN_MAX_LENGTH):
            logging.warn('Value for "%s" too long, max length is %d.', name, _STRING_COLUMN_MAX_LENGTH)
            return None
    return value
Returns a possibly modified value for a supplemental column, or None.
def _CheckSupplementalColumn(name, value):
    
    name = str(name)
    if (len(name) > _MAX_COLUMN_NAME_LENGTH):
        logging.warn('Supplemental column name too long.')
        return None
    if (name[:2] not in ('d_', 'r_', 'a_')):
        logging.warn('Bad column name "%s", invalid prefix.', name)
        return None
    if name.startswith('d_'):
        try:
            value = float(value)
        except (ValueError, TypeError):
            logging.warn('Bad value for column "%s", should be numerical.', name)
            return None
    if name.startswith('r_'):
        revision_patterns = ['^\\d+$', '^\\d+\\.\\d+\\.\\d+\\.\\d+$', '^[A-Fa-f0-9]{40}$']
        if ((not value) or (len(str(value)) > _STRING_COLUMN_MAX_LENGTH) or (not any((re.match(p, str(value)) for p in revision_patterns)))):
            logging.warn('Bad value for revision column "%s".', name)
            return None
        value = str(value)
    if name.startswith('a_'):
        if (len(str(value)) > _STRING_COLUMN_MAX_LENGTH):
            logging.warn('Value for "%s" too long, max length is %d.', name, _STRING_COLUMN_MAX_LENGTH)
            return None
    return value