def index(self, sym):
        """Returns the index of the specified symbol"""
        assert isinstance(sym, str)
        if sym in self.indices:
            return self.indices[sym]
        return self.unk_index
Returns the index of the specified symbol
structured_prompting/fairseq-version/fairseq/fairseq/data/dictionary.py