Retrieve the appropriate data library for the current user.
559299
def _get_library(gi, sample_info, config):
    
    galaxy_lib = sample_info.get("galaxy_library",
                                 config.get("galaxy_library"))
    role = sample_info.get("galaxy_role",
                           config.get("galaxy_role"))
    if galaxy_lib:
        return _get_library_from_name(gi, galaxy_lib, role, sample_info, create=True)
    elif config.get("private_libs") or config.get("lab_association") or config.get("researcher"):
        return _library_from_nglims(gi, sample_info, config)
    else:
        raise ValueError("No Galaxy library specified for sample: %s" %
                         sample_info["description"])
1058263
def get(context, request, username=None):
    
    user_ids = []

    # Don't allow anonymous users to query a user other than themselves
    if api.is_anonymous():
        username = "current"

    # query all users if no username was given
    if username is None:
        user_ids = api.get_member_ids()
    elif username == "current":
        current_user = api.get_current_user()
        user_ids = [current_user.getId()]
    else:
        user_ids = [username]

    # Prepare batch
    size = req.get_batch_size()
    start = req.get_batch_start()
    batch = api.make_batch(user_ids, size, start)

    # get the user info for the user ids in the current batch
    users = map(get_user_info, batch.get_batch())

    return {
        "pagesize": batch.get_pagesize(),
        "next": batch.make_next_url(),
        "previous": batch.make_prev_url(),
        "page": batch.get_pagenumber(),
        "pages": batch.get_numpages(),
        "count": batch.get_sequence_length(),
        "items": users,
    }
108222
def fetch_extra_data(resource):
    """"""
    person_id = resource.get('PersonID', [None])[0]
    identity_class = resource.get('IdentityClass', [None])[0]
    department = resource.get('Department', [None])[0]

    return dict(
        person_id=person_id,
        identity_class=identity_class,
        department=department
    )
167232
def get_database_users(self):
        """"""
        url = "db/{0}/users".format(self._database)

        response = self.request(
            url=url,
            method='GET',
            expected_response_code=200
        )

        return response.json()
551465
def get_user(self, userPk):
        """"""
        r = self._request('user/' + str(userPk))
        if r:
            # Set base properties and copy data inside the user
            u = User()
            u.pk = u.id = userPk
            u.__dict__.update(r.json())
            return u
        return None
1140130
protected function getData()
    {
        $currentLanguage = $this->getLanguage();
        if (!isset($this->data[$currentLanguage])) {
            $this->init();
        }

        return $this->data[$currentLanguage];
    }
343264
def dataset(self):
        """"""
        data = tablib.Dataset()
        data.headers = self.keys()

        row = _reduce_datetimes(self.values())
        data.append(row)

        return data
915691
async def user_info(self, loop=None, **kwargs):
        """"""
        if not self.user_info_url:
            raise NotImplementedError(
                'The provider doesnt support user_info method.')

        data = await self.request('GET', self.user_info_url, loop=loop, **kwargs)
        user = User(**dict(self.user_parse(data)))
        return user, data
1026323
def get(method, hmc, uri, uri_parms, logon_required):
        """"""
        query_str = uri_parms[0]
        try:
            console = hmc.consoles.lookup_by_oid(None)
        except KeyError:
            raise InvalidResourceError(method, uri)
        result_users = []
        filter_args = parse_query_parms(method, uri, query_str)
        for user in console.users.list(filter_args):
            result_user = {}
            for prop in user.properties:
                if prop in ('object-uri', 'name', 'type'):
                    result_user[prop] = user.properties[prop]
            result_users.append(result_user)
        return {'users': result_users}
1308328
public String getDataset() {
    if (isReference()) {
      final LibrarySet master = (LibrarySet) getCheckedRef(LibrarySet.class, "LibrarySet");
      return master.getDataset();
    }
    return this.dataset;
  }
744068
def get(self, key, default=None):
        """"""

        return self._data.get(key, compat_builtins.__dict__.get(key, default))
148244
def get_data (self):
        """"""
        data = u"".join(self.buf)
        self.buf = []
        return data
59675
def get_by_user(cls, user_id, with_deleted=False):
        """"""
        query = cls.query.filter_by(
            id_user=user_id
        )
        if not with_deleted:
            query = query.filter(cls.deleted_at.is_(None))

        return query.order_by(db.asc(Community.title))
900497
def get_current_user():
    
    process = OpenProcessToken(
        ctypes.windll.kernel32.GetCurrentProcess(), TokenAccess.TOKEN_QUERY
    )
    return GetTokenInformation(process, TOKEN_USER)
154312
def get():
    """"""
    uptime = time.time() - START_TIME
    response = dict(uptime=f'{uptime:.2f}s',
                    links=dict(root='{}'.format(get_root_url())))

    # TODO(BM) check if we can connect to the config database ...
    # try:
    #     DB.get_sub_array_ids()
    # except ConnectionError as error:
    #     response['state'] = 'ERROR'
    #     response['message'] = str(error)
    return response, HTTPStatus.OK
601123
def me(cls, api=None):
        
        api = api if api else cls._API
        extra = {
            'resource': cls.__name__,
            'query': {}
        }
        logger.info('Fetching user information', extra=extra)
        user_data = api.get(cls._URL['me']).json()
        return User(api=api, **user_data)
601932
def get(self, user_name: str) -> User:
        
        user = current_user()
        if user.is_admin or user.name == user_name:
            return self._get_or_abort(user_name)
        else:
            abort(403)