<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(self, text):
 """Create entries from catalog text Normally the text comes from the file at self.path via the ``_load()`` method, but could be explicitly set instead. A copy of the text is kept in attribute ``.text`` . Parameters text : str YAML formatted catalog spec """

        self.text = text
        data = yaml_load(self.text)

        if data is None:
            raise exceptions.CatalogException('No YAML data in file')

        # Second, we validate the schema and semantics
        context = dict(root=self._dir)
        result = CatalogParser(data, context=context, getenv=self.getenv,
                               getshell=self.getshell)
        if result.errors:
            raise exceptions.ValidationError(
                "Catalog '{}' has validation errors:\n\n{}"
                "".format(self.path, "\n".join(result.errors)), result.errors)

        cfg = result.data

        self._entries = {}
        for entry in cfg['data_sources']:
            entry._catalog = self
            self._entries[entry.name] = entry

        self.metadata = cfg.get('metadata', {})
        self.name = self.name or cfg.get('name') or self.name_from_path
        self.description = self.description or cfg.get('description')