docs: def get(self, return_type='object', target=None, extensions=None,
              scope='all', regex_search=False, defined_fields=None,
              absolute_paths=None,
              **kwargs):
          """
          Retrieve files and/or metadata from the current Layout.
  
          Args:
              return_type (str): Type of result to return. Valid values:
                  'object' (default): return a list of matching BIDSFile objects.
                  'file': return a list of matching filenames.
                  'dir': return a list of directories.
                  'id': return a list of unique IDs. Must be used together with
                      a valid target.
              target (str): Optional name of the target entity to get results for
                  (only used if return_type is 'dir' or 'id').
              extensions (str, list): One or more file extensions to filter on.
                  BIDSFiles with any other extensions will be excluded.
              scope (str, list): Scope of the search space. If passed, only
                  nodes/directories that match the specified scope will be
                  searched. Possible values include:
                      'all' (default): search all available directories.
                      'derivatives': search all derivatives directories
                      'raw': search only BIDS-Raw directories
                      <PipelineName>: the name of a BIDS-Derivatives pipeline
              regex_search (bool or None): Whether to require exact matching
                  (False) or regex search (True) when comparing the query string
                  to each entity.
              defined_fields (list): Optional list of names of metadata fields
                  that must be defined in JSON sidecars in order to consider the
                  file a match, but which don't need to match any particular
                  value.
              absolute_paths (bool): Optionally override the instance-wide option
                  to report either absolute or relative (to the top of the
                  dataset) paths. If None, will fall back on the value specified
                  at BIDSLayout initialization.
              kwargs (dict): Any optional key/values to filter the entities on.
                  Keys are entity names, values are regexes to filter on. For
                  example, passing filter={'subject': 'sub-[12]'} would return
                  only files that match the first two subjects.
  
          Returns:
              A list of BIDSFiles (default) or strings (see return_type).
  
          Notes:
              As of pybids 0.7.0 some keywords have been changed. Namely: 'type'
              becomes 'suffix', 'modality' becomes 'datatype', 'acq' becomes 
              'acquisition' and 'mod' becomes 'modality'. Using the wrong version 
              could result in get() silently returning wrong or no results. See 
              the changelog for more details.
          """
  
          # Warn users still expecting 0.6 behavior
          if 'type' in kwargs:
              raise ValueError("As of pybids 0.7.0, the 'type' argument has been"
                               " replaced with 'suffix'.")
  
          layouts = self._get_layouts_in_scope(scope)
          
          # Create concatenated file, node, and entity lists
          files, entities, nodes = {}, {}, []
          for l in layouts:
              files.update(l.files)
              entities.update(l.entities)
              nodes.extend(l.nodes)
  
          # Separate entity kwargs from metadata kwargs
          ent_kwargs, md_kwargs = {}, {}
          for k, v in kwargs.items():
              if k in entities:
                  ent_kwargs[k] = v
              else:
                  md_kwargs[k] = v
  
          # Provide some suggestions if target is specified and invalid.
          if target is not None and target not in entities:
              import difflib
              potential = list(entities.keys())
              suggestions = difflib.get_close_matches(target, potential)
              if suggestions:
                  message = "Did you mean one of: {}?".format(suggestions)
              else:
                  message = "Valid targets are: {}".format(potential)
              raise ValueError(("Unknown target '{}'. " + message)
                               .format(target))
  
          results = []
  
          # Search on entities
          filters = ent_kwargs.copy()
  
          for f in files.values():
              if f._matches(filters, extensions, regex_search):
                  results.append(f)
  
          # Search on metadata
          if return_type not in {'dir', 'id'}:
  
              if md_kwargs:
                  results = [f.path for f in results]
                  results = self.metadata_index.search(results, defined_fields,
                                                      **md_kwargs)
                  results = [files[f] for f in results]
  
          # Convert to relative paths if needed
          if absolute_paths is None:  # can be overloaded as option to .get
              absolute_paths = self.absolute_paths
  
          if not absolute_paths:
              for i, f in enumerate(results):
                  f = copy.copy(f)
                  f.path = os.path.relpath(f.path, self.root)
                  results[i] = f
  
          if return_type == 'file':
              results = natural_sort([f.path for f in results])
  
          elif return_type in ['id', 'dir']:
              if target is None:
                  raise ValueError('If return_type is "id" or "dir", a valid '
                                   'target entity must also be specified.')
              results = [x for x in results if target in x.entities]
  
              if return_type == 'id':
                  results = list(set([x.entities[target] for x in results]))
                  results = natural_sort(results)
  
              elif return_type == 'dir':
                  template = entities[target].directory
                  if template is None:
                      raise ValueError('Return type set to directory, but no '
                                       'directory template is defined for the '
                                       'target entity (\"%s\").' % target)
                  # Construct regex search pattern from target directory template
                  template = self.root + template
                  to_rep = re.findall(r'\{(.*?)\}', template)
                  for ent in to_rep:
                      patt = entities[ent].pattern
                      template = template.replace('{%s}' % ent, patt)
                  template += r'[^\%s]*$' % os.path.sep
                  matches = [
                      f.dirname if absolute_paths else os.path.relpath(f.dirname, self.root)
                      for f in results
                      if re.search(template, f.dirname)
                  ]
  
                  results = natural_sort(list(set(matches)))
  
              else:
                  raise ValueError("Invalid return_type specified (must be one "
                                   "of 'tuple', 'file', 'id', or 'dir'.")
          else:
              results = natural_sort(results, 'path')
  
          return results