Return a stat_result object for this entry.

        Args:
            follow_symlinks: If False and the entry is a symlink, return the
                result for the symlink, otherwise for the object it points to.
333542
def stat(self, follow_symlinks=True):
        
        if follow_symlinks:
            if self._statresult_symlink is None:
                file_object = self._filesystem.resolve(self.path)
                if self._filesystem.is_windows_fs:
                    file_object.st_nlink = 0
                self._statresult_symlink = file_object.stat_result.copy()
            return self._statresult_symlink

        if self._statresult is None:
            file_object = self._filesystem.lresolve(self.path)
            self._inode = file_object.st_ino
            if self._filesystem.is_windows_fs:
                file_object.st_nlink = 0
            self._statresult = file_object.stat_result.copy()
        return self._statresult
131736
def _write_symlink(self, zf, link_target, link_path):
        """"""
        info = zipfile.ZipInfo()
        info.filename = link_path
        info.create_system = 3
        # Magic code for symlinks / py2/3 compat
        # 27166663808 = (stat.S_IFLNK | 0755) << 16
        info.external_attr = 2716663808
        zf.writestr(info, link_target)
452750
def _get_entry_link(self, entry):
        
        entry_link = None
        for link in entry.link:
            if '/data/' not in link.href and '/lh/' not in link.href:
                entry_link = link.href
                break
        return entry_link or entry.link[0].href
423248
def post_link_hook(linker, bb)
      basic_name = get_basic_name(linker, bb)
      symlink_lib_to(basic_name, bb)
    end
2790
def symlink_to_bytes(symlink_target):
    # type: (str) -> bytes
    '''
    
    '''
    symlink_data = bytearray()
    for comp in symlink_target.split('/'):
        if comp == '':
            # If comp is empty, then we know this is the leading slash
            # and we should make an absolute entry (double slashes and
            # such are weeded out by the earlier utils.normpath).
            symlink_data.extend(b'\x02\x00\x00\x00')
        elif comp == '.':
            symlink_data.extend(b'\x04\x00\x00\x00')
        elif comp == '..':
            symlink_data.extend(b'\x03\x00\x00\x00')
        else:
            symlink_data.extend(b'\x05')
            ostaname = _ostaunicode(comp)
            symlink_data.append(len(ostaname))
            symlink_data.extend(b'\x00\x00')
            symlink_data.extend(ostaname)

    return symlink_data
1069703
def is_symlink(self):
        
        try:
            return S_ISLNK(self.lstat().st_mode)
        except OSError as e:
            if e.errno != ENOENT:
                raise
            # Path doesn't exist
            return False
1218193
def islink(self, path=None, header=None):
        
        if header is None:
            header = self._head(self.get_client_kwargs(path))

        for key in ('x-oss-object-type', 'type'):
            try:
                return header.pop(key) == 'Symlink'
            except KeyError:
                continue
        return False
1039864
def IsLink(self):
    
    if self._stat_object is None:
      self._stat_object = self._GetStat()
    if self._stat_object is not None:
      self.entry_type = self._stat_object.type
    return self.entry_type == definitions.FILE_ENTRY_TYPE_LINK
635988
def symlink(target, link, target_is_directory=False):
	
	target_is_directory = (
		target_is_directory or
		_is_target_a_directory(link, target)
	)
	# normalize the target (MS symlinks don't respect forward slashes)
	target = os.path.normpath(target)
	handle_nonzero_success(
		api.CreateSymbolicLink(link, target, target_is_directory))
98624
def stat(filename):
    """"""
    import os
    try:
        # on the host, lstat won't try to follow symlinks
        rstat = os.lstat(filename)
    except:
        rstat = os.stat(filename)
    return rstat[:7] + tuple(tim + TIME_OFFSET for tim in rstat[7:])
1273396
def follow_info(self, index=None, params=None):
        
        return self.transport.perform_request(
            "GET", _make_path(index, "_ccr", "info"), params=params
        )
310769
def _get_result_paths(self, data):
        
        assignment_fp = str(self.Parameters['-o'].Value).strip('"')
        if not os.path.isabs(assignment_fp):
            assignment_fp = os.path.relpath(assignment_fp, self.WorkingDir)
        return {'Assignments': ResultPath(assignment_fp, IsWritten=True)}
144729
def symlink(target, linkname):
    
    target = os.path.abspath(target)
    linkname = os.path.abspath(linkname)
    if not os.path.exists(target):
        raise ValueError("target {} not found".format(target))

    link_dir = os.path.dirname(linkname)
    if not os.path.exists(link_dir):
        os.makedirs(link_dir)

    run(['ln', '-s', '-f', target, linkname])
    return linkname
529618
def get_outcome_results(self, course_id, include=None, outcome_ids=None, user_ids=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # OPTIONAL - user_ids
        """If specified, only the users whose ids are given will be included in the
        results. SIS ids can be used, prefixed by "sis_user_id:".
        It is an error to specify an id for a user who is not a student in
        the context."""
        if user_ids is not None:
            params["user_ids"] = user_ids

        # OPTIONAL - outcome_ids
        """If specified, only the outcomes whose ids are given will be included in the
        results. it is an error to specify an id for an outcome which is not linked
        to the context."""
        if outcome_ids is not None:
            params["outcome_ids"] = outcome_ids

        # OPTIONAL - include
        """[String, "alignments"|"outcomes"|"outcomes.alignments"|"outcome_groups"|"outcome_links"|"outcome_paths"|"users"]
        Specify additional collections to be side loaded with the result.
        "alignments" includes only the alignments referenced by the returned
        results.
        "outcomes.alignments" includes all alignments referenced by outcomes in the
        context."""
        if include is not None:
            params["include"] = include

        self.logger.debug("GET /api/v1/courses/{course_id}/outcome_results with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/courses/{course_id}/outcome_results".format(**path), data=data, params=params, no_data=True)
946550
def script_dir(pyobject, follow_symlinks=True):
    
    if getattr(sys, 'frozen', False):  # py2exe, PyInstaller, cx_Freeze
        path = abspath(sys.executable)
    else:
        path = inspect.getabsfile(pyobject)
    if follow_symlinks:
        path = realpath(path)
    return dirname(path)
258583
function symlink($target, $link)
    {
        if (!($this->bitmap & SSH2::MASK_LOGIN)) {
            return false;
        }

        //$target = $this->_realpath($target);
        $link = $this->_realpath($link);

        $packet = pack('Na*Na*', strlen($target), $target, strlen($link), $link);
        if (!$this->_send_sftp_packet(NET_SFTP_SYMLINK, $packet)) {
            return false;
        }

        $response = $this->_get_sftp_packet();
        if ($this->packet_type != NET_SFTP_STATUS) {
            user_error('Expected SSH_FXP_STATUS');
            return false;
        }

        if (strlen($response) < 4) {
            return false;
        }
        extract(unpack('Nstatus', $this->_string_shift($response, 4)));
        if ($status != NET_SFTP_STATUS_OK) {
            $this->_logError($response, $status);
            return false;
        }

        return true;
    }
175871
def create_symlink(source, link_name):
    
    os_symlink = getattr(os, "symlink", None)
    if isinstance(os_symlink, collections.Callable):
        os_symlink(source, link_name)
    else:
        import ctypes
        csl = ctypes.windll.kernel32.CreateSymbolicLinkW
        csl.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_uint32)
        csl.restype = ctypes.c_ubyte
        flags = 1 if os.path.isdir(source) else 0
        if csl(link_name, source, flags) == 0:
            raise ctypes.WinError()