class_docstr: Representation of a DataLad dataset/repository
  
  This is the core data type of DataLad: a representation of a dataset.
  At its core, datasets are (git-annex enabled) Git repositories. This
  class provides all operations that can be performed on a dataset.
  
  Creating a dataset instance is cheap, all actual operations are
  delayed until they are actually needed. Creating multiple `Dataset`
  class instances for the same Dataset location will automatically
  yield references to the same object.
  
  A dataset instance comprises of two major components: a `repo`
  attribute, and a `config` attribute. The former offers access to
  low-level functionality of the Git or git-annex repository. The
  latter gives access to a dataset's configuration manager.
  
  Most functionality is available via methods of this class, but also
  as stand-alone functions with the same name in `datalad.api`.
class_docstr_tok: ["Representation","of","a","DataLad","dataset\/repository","This","is","the","core","data","type","of","DataLad",":","a","representation","of","a","dataset",".","At","its","core",",","datasets","are","(","git-annex","enabled",")","Git","repositories",".","This","class","provides","all","operations","that","can","be","performed","on","a","dataset",".","Creating","a","dataset","instance","is","cheap",",","all","actual","operations","are","delayed","until","they","are","actually","needed",".","Creating","multiple","`","Dataset","`","class","instances","for","the","same","Dataset","location","will","automatically","yield","references","to","the","same","object",".","A","dataset","instance","comprises","of","two","major","components",":","a","`","repo","`","attribute",",","and","a","`","config","`","attribute",".","The","former","offers","access","to","low-level","functionality","of","the","Git","or","git-annex","repository",".","The","latter","gives","access","to","a","dataset","'s","configuration","manager",".","Most","functionality","is","available","via","methods","of","this","class",",","but","also","as","stand-alone","functions","with","the","same","name","in","`","datalad.api","`","."]
docstr: Get the dataset's superdataset
  
  Parameters
  ----------
  datalad_only : bool, optional
    Whether to consider only "datalad datasets" (with non-None
    id), or (if False, which is default) - any git repository
  topmost : bool, optional
    Return the topmost super-dataset. Might then be the current one.
  registered_only : bool, optional
    Test whether any discovered superdataset actually contains the
    dataset in question as a registered subdataset (as opposed to
    just being located in a subdirectory without a formal relationship).
  
  Returns
  -------
  Dataset or None
docstr_tok: ["Get","the","dataset","'s","superdataset","Parameters","--","--","--","--","--","datalad_only",":","bool",",","optional","Whether","to","consider","only","``","datalad","datasets","''","(","with","non-None","id",")",",","or","(","if","False",",","which","is","default",")","-","any","git","repository","topmost",":","bool",",","optional","Return","the","topmost","super-dataset",".","Might","then","be","the","current","one",".","registered_only",":","bool",",","optional","Test","whether","any","discovered","superdataset","actually","contains","the","dataset","in","question","as","a","registered","subdataset","(","as","opposed","to","just","being","located","in","a","subdirectory","without","a","formal","relationship",")",".","Returns","--","--","--","-","Dataset","or","None"]
code: def get_superdataset(
      self, datalad_only=False, topmost=False, registered_only=True
  ):
      """Get the dataset's superdataset
  
      Parameters
      ----------
      datalad_only : bool, optional
        Whether to consider only "datalad datasets" (with non-None
        id), or (if False, which is default) - any git repository
      topmost : bool, optional
        Return the topmost super-dataset. Might then be the current one.
      registered_only : bool, optional
        Test whether any discovered superdataset actually contains the
        dataset in question as a registered subdataset (as opposed to
        just being located in a subdirectory without a formal relationship).
  
      Returns
      -------
      Dataset or None
      """
      path = self.path
      sds_path = path if topmost else None
  
      def res_filter(res):
          return (
              res.get("status") == "ok" and res.get("type") == "dataset"
          )
  
      def subds_contains_path(ds, path):
          return path in sds.subdatasets(
              recursive=False,
              contains=path,
              result_filter=res_filter,
              on_failure="ignore",
              result_xfm="paths",
              result_renderer="disabled",
          )
  
      while path:
          # normalize the path after adding .. so we guaranteed to not
          # follow into original directory if path itself is a symlink
          par_path = normpath(opj(path, pardir))
          sds_path_ = get_dataset_root(par_path)
          if sds_path_ is None:
              # no more parents, use previous found
              break
  
          sds = Dataset(sds_path_)
          if datalad_only:
              # test if current git is actually a dataset?
              if not sds.id:
                  break
          if registered_only:
              if not subds_contains_path(sds, path):
                  break
  
          # That was a good candidate
          sds_path = sds_path_
          path = par_path
          if not topmost:
              # no looping
              break
  
      if sds_path is None:
          # None was found
          return None
  
      # No postprocessing now should be necessary since get_toppath
      # tries its best to not resolve symlinks now
  
      return Dataset(sds_path)
  
imports: import inspect
  import logging
  from functools import wraps
  from os.path import curdir, exists, join, normpath, pardir
  from weakref import WeakValueDictionary
  from datalad import cfg
  from datalad.config import ConfigManager
  from datalad.core.local.repo import repo_from_path
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.constraints import Constraint
  from datalad.support.due import due
  from datalad.support.due_utils import duecredit_dataset
  from datalad.support.exceptions import NoDatasetFound
  from datalad.dataset.repo import path_based_str_repr, PathBasedFlyweight
  from datalad.support.gitrepo import GitRepo
  from datalad.support import path
  import datalad.utils
  from datalad.utils import getpwd, optional_args, get_dataset_root, get_sig_param_names, get_dataset_root, Path, PurePath, ensure_list
label_desc: Use image node_id 16 for calling the Dataset obj's underlying member method code with example usage: obj.get_superdataset(datalad_only, topmost, registered_only) and returns: Dataset, unknown, unknown, None