Return path from current profile.
193952
def profile_path(self, path, must_exist=False):
        """"""
        full_path = self.session.profile / path
        if must_exist and not full_path.exists():
            raise FileNotFoundError(
                errno.ENOENT,
                os.strerror(errno.ENOENT),
                PurePath(full_path).name,
            )
        return full_path
1021380
def getProfile(self, profile=None):
    '''
    
    '''
    if profile is None:
      # todo: what if the configuration `profile.default` does not exist?
      profile = self.config.get('DEFAULT', 'profile.default')
    if profile in self.profiles:
      return self.profiles[profile].init()
    for prof in self.profiles.values():
      if prof.name == profile:
        return prof.init()
    for prof in self.profiles.values():
      if prof.name.lower() == profile.lower():
        return prof.init()
    raise KeyError(profile)
371509
def get_path(self, obj, default):
        """"""
        path = obj.get("path")
        if path is None:
            path = join(self._base, default)
        if not isabs(path):
            path = join(self._base, path)
        return path
984303
def profile(self, name):
        """"""
        self.selected_profile = self.profiles.get(name)
        return self.profiles.get(name)
220115
def update_path(self):
        
        if WINDOWS:
            return self.add_to_windows_path()

        # Updating any profile we can on UNIX systems
        export_string = self.get_export_string()

        addition = "\n{}\n".format(export_string)

        updated = []
        profiles = self.get_unix_profiles()
        for profile in profiles:
            if not os.path.exists(profile):
                continue

            with open(profile, "r") as f:
                content = f.read()

            if addition not in content:
                with open(profile, "a") as f:
                    f.write(addition)

                updated.append(os.path.relpath(profile, HOME))
451638
def get_path(self):
        ''''''
        model, tree_iter = self.selection.get_selected()
        if not tree_iter:
            return '/'
        else:
            return model[tree_iter][PATH_COL]
1172626
def _GetRelPath(self, filename):
		""""""
		assert filename.startswith(self.subdir), (filename, self.subdir)
		return filename[len(self.subdir):].lstrip(r"\/")
997845
def path(self) -> Tuple[InstanceKey]:
        """"""
        res = []
        inst: InstanceNode = self
        while inst.parinst:
            res.insert(0, inst._key)
            inst = inst.parinst
        return tuple(res)
251894
def _path(self, attrpath):
        """"""

        attr, _, subpath = attrpath.partition(".")
        if attr not in self.__dict__:
            self.__dict__[attr] = Namespace()
            self.__namespaces.add(attr)

        if subpath:
            return self.__dict__[attr]._path(subpath)
        else:
            return self.__dict__[attr]
908230
def path(self):
        """"""
        out = self.datetime.strftime("%Y-%m-%d")
        out += " "
        ssm = (
            self.datetime - self.datetime.replace(hour=0, minute=0, second=0, microsecond=0)
        ).total_seconds()
        out += str(int(ssm)).zfill(5)
        return out
778822
def find_path(self, in_, out):
        '''
        
        '''
        if in_.arguments:
            raise ValueError('Cannot originate path in argumented TypeString')

        # Determine conversion profile. This is either simply the output, OR,
        # if a custom profile has been specified for this output, that custom
        # path or type is used.
        profile = self.conversion_profiles.get(str(out), str(out))
        if isinstance(profile, str):
            profile = (profile, )
        types_by_format = {_format(s): TypeString(s) for s in profile}

        # Normalize input and output types to string
        in_str = str(in_)
        out_str = _format(profile[0])

        # First check for direct conversions, returning immediately if found
        direct_converter = self.direct_converters.get((in_str, out_str))
        if direct_converter:
            out_ts = types_by_format.get(out_str, TypeString(out_str))
            return [(direct_converter, TypeString(in_str), out_ts)]

        # No direct conversions was found, so find path through graph.
        # If profile was plural, add in extra steps.
        path = self.dgraph.shortest_path(in_str, out_str)
        path += profile[1:]

        # Loop through each edge traversal, adding converters and type
        # string pairs as we go along. This is to ensure conversion
        # profiles that have arguments mid-profile get included.
        results = []
        for left, right in pair_looper(path):
            converter = self.converters.get((_format(left), _format(right)))
            right_typestring = types_by_format.get(right, TypeString(right))
            results.append((converter, TypeString(left), right_typestring))
        return results
958700
def get_profile_dir ():
    """"""
    if os.name == 'nt':
        basedir = unicode(os.environ["APPDATA"], nt_filename_encoding)
        dirpath = os.path.join(basedir, u"Opera", u"Opera")
    elif os.name == 'posix':
        basedir = unicode(os.environ["HOME"])
        dirpath = os.path.join(basedir, u".opera")
    return dirpath
922519
def print_path(path: Path) -> str:
    """"""
    path_str = ""
    current_path: Optional[Path] = path
    while current_path:
        path_str = (
            f".{current_path.key}"
            if isinstance(current_path.key, str)
            else f"[{current_path.key}]"
        ) + path_str
        current_path = current_path.prev
    return f"value{path_str}" if path_str else ""
85728
def get_profile(name=None, **kwargs):
    
    if isinstance(name, Profile):
        return name

    clazz = get_profile_class(name or 'default')
    return clazz(**kwargs)
561146
def _GetUsernameFromProfilePath(self, path):
    
    # Strip trailing key separators.
    while path and path[-1] == '\\':
      path = path[:-1]

    if path:
      _, _, path = path.rpartition('\\')
    return path
493893
def get_profile(session):
    """"""
    try:
        profile = session.get(PROFILE_URL).json()
        if 'errorCode' in profile and profile['errorCode'] == '403':
            raise MoparError("not logged in")
        return profile
    except JSONDecodeError:
        raise MoparError("not logged in")
565952
def get_gopath(self, target):
    """"""
    return os.path.join(self.workdir, target.id)