Get a user's OneDrive
330759
def get_users_drive id_or_user_principal_name
      url = base_api_url + "/users/#{id_or_user_principal_name}/drive"
      @drives = JSON.parse(HTTParty.get(url,headers: set_headers).body)
    end
681808
def getent(refresh=False):
    '''
    
    '''
    if 'user.getent' in __context__ and not refresh:
        return __context__['user.getent']

    ret = []
    for data in pwd.getpwall():
        ret.append(_format_info(data))
    __context__['user.getent'] = ret
    return ret
895255
def get_partitions_with_auth(self, db_name, tbl_name, max_parts, user_name, group_names):
    
    self.send_get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names)
    return self.recv_get_partitions_with_auth()
1347678
def Name(self):
    """"""
    return (self.name or self.device_path or self.windowsvolume.drive_letter or
            self.unixvolume.mount_point or None)
288607
def _get_drive_url(self, url, session):
    """"""
    response = session.get(url, stream=True)
    if response.status_code != 200:
      raise DownloadError(
          'Failed to get url %s. HTTP code: %d.' % (url, response.status_code))
    for k, v in response.cookies.items():
      if k.startswith('download_warning'):
        return url + '&confirm=' + v  # v is the confirm token
    # No token found, let's try with original URL:
    return url
666441
def get_uid(user=None):
    '''
    
    '''
    if not HAS_PWD:
        return None
    elif user is None:
        try:
            return os.geteuid()
        except AttributeError:
            return None
    else:
        try:
            return pwd.getpwnam(user).pw_uid
        except KeyError:
            return None
150645
def user_owns_file(path, uid=None):
    
    if uid is None:
        uid = os.getuid()
    path = os.path.expandvars(os.path.expanduser(path))
    return os.stat(path).st_uid == uid
20367
def islink(path, user=None):
    
    host, _, path_ = split(path, user)
    if host:
        return False  # libhdfs does not support fs.FileStatus.isSymlink()
    return os.path.islink(path_)
807629
def _remote_chown(self, paths, user, sudoable=False):
        
        LOG.debug('_remote_chown(%r, user=%r, sudoable=%r)',
                  paths, user, sudoable)
        ent = self._connection.get_chain().call(pwd.getpwnam, user)
        return self.fake_shell(lambda: mitogen.select.Select.all(
            self._connection.get_chain().call_async(
                os.chown, path, ent.pw_uid, ent.pw_gid
            )
            for path in paths
        ))
353071
def get_file(self, user, handle):
        
        user_dir = self.user_dir(user)
        if not user_dir.exists():
            return None

        if not is_valid_handle(handle):
            return None

        file_path = user_dir / handle

        if not file_path.exists() and not file_path.is_file():
            return None

        return file_path
455927
def can_share_folder(self, user, folder):
        
        return folder.parent_id is None and folder.author_id == user.id
1298664
def get_user_dir_and_dst(init_filename):
    """"""
    user_dir = get_user_dir()
    dst_file = os.path.join(user_dir, init_filename)
    return user_dir, dst_file
699519
def _rsync_cmd(self):
        """"""
        cmd = ['rsync']
        if self._identity_file:
            cmd += ['-e', 'ssh -i ' + os.path.expanduser(self._identity_file)]
        return cmd
1086942
def get_user(self, key = None):
		'''
		''' 	
		if key:
			uri = self.api_uri + "/users/" + key
		else:
			uri = self.api_uri + "/users/me"

		return self._req('get', uri)
936341
def get_specific_user():
    '''
    
    '''
    user = get_user()
    if salt.utils.platform.is_windows():
        if _win_current_user_is_admin():
            return 'sudo_{0}'.format(user)
    else:
        env_vars = ('SUDO_USER',)
        if user == 'root':
            for evar in env_vars:
                if evar in os.environ:
                    return 'sudo_{0}'.format(os.environ[evar])
    return user
11807
def user_specific_data_directory(user_context):
  """"""
  return  os.path.join(
    user_context.steam.userdata_directory,
    user_context.user_id
  )
547323
def updrive(path):
    
    drive, rest = os.path.splitdrive(path)
    if drive:
        path = drive.upper() + rest
    return path