code: def set_attributes(self, doc, data_type):
          
          self.raw_doc = doc
          self.doc = doc_unwrap(doc)
          self.data_type = data_type
  
          # Make sure we don't have a cyclic reference.
          # Since attributes are set one data type at a time, only the last data
          # type to be populated in a cycle will be able to detect the cycle.
          # Before that, the cycle will be broken by an alias with no populated
          # source.
          cur_data_type = data_type
          while is_alias(cur_data_type):
              cur_data_type = cur_data_type.data_type
              if cur_data_type == self:
                  raise InvalidSpec(
                      "Alias '%s' is part of a cycle." % self.name,
                      self._ast_node.lineno, self._ast_node.path)
docs: :param Optional[str] doc: Documentation string of alias.
          :param data_type: The source data type referenced by the alias.