(value)
Raise ValueError if the label value is invalid.
Raise ValueError if the label value is invalid.
Raise ValueError if the label value is invalid .
def _check_label_value(value):
    """Raise ValueError if the label value is invalid."""
    if not value:
      return

    if len(value) > 63:
      raise ValueError(
          'Label values must not be longer than 63 characters: "%s"' % value)

    if not re.match(r'^([-_a-z0-9]*)?$', value):
      raise ValueError(
          'Invalid value for label: "%s". Must contain only lowercase letters, '
          'numeric characters, underscores, and dashes.' % value)
def _check_label_value ( value ) : if not value : return if len ( value ) > 63 : raise ValueError ( 'Label values must not be longer than 63 characters: "%s"' % value ) if not re . match ( r'^([-_a-z0-9]*)?$' , value ) : raise ValueError ( 'Invalid value for label: "%s". Must contain only lowercase letters, ' 'numeric characters, underscores, and dashes.' % value )