def SplitMeta(meta):
    """Split and validate metacharacters.

  Example: '{}' -> ('{', '}')

  This is public so the syntax highlighter and other tools can use it.
  """
    n = len(meta)
    if n % 2 == 1:
        raise ConfigurationError(
            '%r has an odd number of metacharacters' % meta)
    return meta[:n // 2], meta[n // 2:]