code: def discover(self, exclude=None):
          
          if exclude is None:
              exclude = []
          elif not isinstance(exclude, (list, tuple)):
              exclude = [exclude]
  
          if 'json' not in exclude and 'json' not in self.registered_formats:
              self.discover_json()
          if 'yaml' not in exclude and 'yaml' not in self.registered_formats:
              self.discover_yaml()
docs: Automatically discovers and registers installed formats.
  
          If a format is already registered with an exact same name, the
          discovered format will not be registered.
  
          :param exclude: (optional) Exclude formats from registering