class_docstr: Helper for globbing paths.
  
  Parameters
  ----------
  patterns : list of str
      Call `glob.glob` with each of these patterns. "." is considered as
      datalad's special "." path argument; it is not passed to glob and is
      always left unexpanded. Each set of glob results is sorted
      alphabetically.
  pwd : str, optional
      Glob in this directory.
  expand : bool, optional
     Whether the `paths` property returns unexpanded or expanded paths.
class_docstr_tok: ["Helper","for","globbing","paths",".","Parameters","--","--","--","--","--","patterns",":","list","of","str","Call","`","glob.glob","`","with","each","of","these","patterns",".","``",".","''","is","considered","as","datalad","'s","special","``",".","''","path","argument",";","it","is","not","passed","to","glob","and","is","always","left","unexpanded",".","Each","set","of","glob","results","is","sorted","alphabetically",".","pwd",":","str",",","optional","Glob","in","this","directory",".","expand",":","bool",",","optional","Whether","the","`","paths","`","property","returns","unexpanded","or","expanded","paths","."]
code: def __init__(
      self,
      patterns: Optional[Iterable[str | bytes]],
      pwd: Optional[str] = None,
      expand: bool = False,
  ) -> None:
      self.pwd = pwd or getpwd()
      self._expand = expand
  
      self._maybe_dot: list[str]
      self._patterns: list[str]
      if patterns is None:
          self._maybe_dot = []
          self._patterns = []
      else:
          pattern_strs = list(map(ensure_unicode, patterns))
          pattern_iter, dots = partition(
              pattern_strs, lambda i: i.strip() == "."
          )
          self._maybe_dot = ["."] if list(dots) else []
          self._patterns = [
              op.relpath(p, start=pwd) if op.isabs(p) else p
              for p in pattern_iter
          ]
      self._cache: dict[str, dict[str, list[str]]] = {}
      self._expanded_cache: dict[tuple[str, bool, bool], list[str]] = {}
  
imports: from __future__ import annotations
  import glob
  import logging
  import os.path
  from functools import lru_cache
  from itertools import chain
  from typing import Iterable, Optional
  from datalad.utils import chpwd, ensure_unicode, getpwd, partition
label_desc: Use image node_id 1 to create a new GlobbedPaths object from inherited base classes: object with example: obj = GlobbedPaths(patterns, pwd, expand)