code: def is_regular(self):
          r
          warn = False
          msg = 'The given matrix'
  
          # check symmetry
          if np.abs(self.A - self.A.T).sum() > 0:
              warn = True
              msg = '{} is not symmetric,'.format(msg)
  
          # check parallel edged
          if self.A.max(axis=None) > 1:
              warn = True
              msg = '{} has parallel edges,'.format(msg)
  
          # check that d is d-regular
          if np.min(self.d) != np.max(self.d):
              warn = True
              msg = '{} is not d-regular,'.format(msg)
  
          # check that g doesn't contain any self-loop
          if self.A.diagonal().any():
              warn = True
              msg = '{} has self loop.'.format(msg)
  
          if warn:
              self.logger.warning('{}.'.format(msg[:-1]))
docs: r"""
          Troubleshoot a given regular graph.