code: def profile_dir(name):
      
      if name:
          possible_path = Path(name)
          if possible_path.exists():
              return possible_path
      profiles = list(read_profiles())
      try:
          if name:
              profile = next(p for p in profiles if p.name == name)
          else:
              profile = next(p for p in profiles if p.default)
      except StopIteration:
          raise ProfileNotFoundError(name)
      return profile.path
docs: Return path to FF profile for a given profile name or path.