(value)
Get GC property.
Get GC property.
Get GC property .
def get_gc_property(value):
    """Get GC property."""

    if value.startswith('^'):
        negate = True
        value = value[1:]
    else:
        negate = False

    value = unidata.unicode_alias['generalcategory'].get(value, value)

    assert 1 <= len(value) <= 2, 'Invalid property!'

    if not negate:
        p1, p2 = (value[0], value[1]) if len(value) > 1 else (value[0], None)
        return ''.join(
            [v for k, v in unidata.unicode_properties.get(p1, {}).items() if not k.startswith('^')]
        ) if p2 is None else unidata.unicode_properties.get(p1, {}).get(p2, '')
    else:
        p1, p2 = (value[0], value[1]) if len(value) > 1 else (value[0], '')
        return unidata.unicode_properties.get(p1, {}).get('^' + p2, '')
def get_gc_property ( value ) : if value . startswith ( '^' ) : negate = True value = value [ 1 : ] else : negate = False value = unidata . unicode_alias [ 'generalcategory' ] . get ( value , value ) assert 1 <= len ( value ) <= 2 , 'Invalid property!' if not negate : p1 , p2 = ( value [ 0 ] , value [ 1 ] ) if len ( value ) > 1 else ( value [ 0 ] , None ) return '' . join ( [ v for k , v in unidata . unicode_properties . get ( p1 , { } ) . items ( ) if not k . startswith ( '^' ) ] ) if p2 is None else unidata . unicode_properties . get ( p1 , { } ) . get ( p2 , '' ) else : p1 , p2 = ( value [ 0 ] , value [ 1 ] ) if len ( value ) > 1 else ( value [ 0 ] , '' ) return unidata . unicode_properties . get ( p1 , { } ) . get ( '^' + p2 , '' )