@classmethod
    def parse(cls, line, ns={}):
        """
        Parse an options specification, returning a dictionary with
        path keys and {'plot':<options>, 'style':<options>} values.
        """
        parses  = [p for p in cls.opts_spec.scanString(line)]
        if len(parses) != 1:
            raise SyntaxError("Invalid specification syntax.")
        else:
            (k,s,e) = parses[0]
            processed = line[:e]
            if (processed.strip() != line.strip()):
                raise SyntaxError("Failed to parse remainder of string: %r" % line[e:])

        parse = {}
        for group in cls.opts_spec.parseString(line):
            options = {}

            normalization = cls.process_normalization(group)
            if normalization is not None:
                options['norm'] = Options(**normalization)

            if 'plot_options' in group:
                plotopts =  group['plot_options'][0]
                opts = cls.todict(plotopts, 'brackets', ns=ns)
                options['plot'] = Options(**{cls.aliases.get(k,k):v for k,v in opts.items()})

            if 'style_options' in group:
                styleopts = group['style_options'][0]
                opts = cls.todict(styleopts, 'parens', ns=ns)
                options['style'] = Options(**{cls.aliases.get(k,k):v for k,v in opts.items()})

            if group['pathspec'] in parse:
                # Update in case same pathspec accidentally repeated by the user.
                parse[group['pathspec']].update(options)
            else:
                parse[group['pathspec']] = options
        return parse
dataset/ETHPy150Open ioam/holoviews/holoviews/ipython/parser.py/OptsSpec.parse/original