receiving user data
559399
protected function _receive_post($task = false, $primary = false)
    {
        if (!$this->table_name && !$this->query)
            $this->table_name = $this->_humanize(mb_substr($this->table, mb_strlen($this->prefix)));
        if ($task)
        {
            switch ($task)
            {
                case 'create':
                    $this->task = $task;
                    $this->before = $task;
                    return;
                    break;
                case 'edit':
                case 'view':
                    if ($primary !== false)
                    {
                        $this->task = $task;
                        $this->before = $task;
                        $this->primary_val = $primary;
                        return;
                    }
                    break;
                case 'list':
                    $this->task = $task;
                    return;
                    break;
            }
        }
        else
        {
            $this->task = $this->_post('task', 'list');
        }
        if ($this->is_get)
        {
            $this->task = $this->_get('task');
            $this->primary_val = $this->_get('primary');
        }
        else
        {
            $this->order_column = $this->_post('orderby', false, 'key');
            $this->order_direct = $this->_post('order') == 'desc' ? 'desc' : 'asc';
            if ($this->order_column)
            {
                if (!$this->query)
                    $this->order_column = key($this->_parse_field_names($this->order_column, 'receive_post', false, false));
                if (isset($this->order_by[$this->order_column]))
                    unset($this->order_by[$this->order_column]);
                $this->order_by = array_merge(array($this->order_column => $this->order_direct), $this->order_by);
            }

            $this->search = $this->_post('search', $this->search, 'int');
            if ($this->search)
            {
                $this->column = $this->_post('column', false, 'key');
                $this->phrase = $this->_post('phrase');
                $this->range = $this->_post('range', '');
            }
            $this->start = $this->_post('start', 0, 'int');
            $this->limit = $this->_post('limit', ($this->limit ? $this->limit : Fruit_config::$limit));
            $this->after = $this->_post('after');
            $this->primary_val = $this->_post('primary');

        }
    }
92802
def fetchAllUsers(self, rawResults = False) :
        """"""
        r = self.connection.session.get(self.URL)
        if r.status_code == 200 :
            data = r.json()
            if rawResults :
                return data["result"]
            else :
                res = []
                for resu in data["result"] :
                    u = User(self, resu)
                    res.append(u)
                return res
        else :
            raise ConnectionError("Unable to get user list", r.url, r.status_code)
1214063
def user_parse(data):
        """"""
        _user = data.get('response', {}).get('user', {})
        yield 'id', _user.get('name')
        yield 'username', _user.get('name')
        yield 'link', _user.get('blogs', [{}])[0].get('url')
1348057
def _get_user(self, username):
        """"""
        data = self.client.get(self._key(username))
        if data is None:
            return None
        return json.loads(data.decode())
1231057
def user_parse(data):
        """"""
        yield 'id', data.get('id') or data.get('user_id')
        first_name, _, last_name = data['name'].partition(' ')
        yield 'first_name', first_name
        yield 'last_name', last_name
        yield 'picture', data.get('profile_image_url')
        yield 'locale', data.get('lang')
        yield 'link', data.get('url')
        yield 'username', data.get('screen_name')
        city, _, country = map(lambda s: s.strip(),
                               data.get('location', '').partition(','))
        yield 'city', city
        yield 'country', country
582424
def _data(self, received_data):
        
        if self.listener.on_data(received_data) is False:
            self.stop()
            raise ListenerError(self.listener.connection_id, received_data)
942117
def _get_user_data(self):
        
        key = ipa_utils.generate_public_ssh_key(
            self.ssh_private_key_file
        ).decode()
        script = BASH_SSH_SCRIPT.format(user=self.ssh_user, key=key)
        return script
352685
def get(self, user_ids=None, usernames=None, status=None):
        
        return self.connection.get('user/array',
                                   user_ids=user_ids,
                                   usernames=usernames,
                                   status=status)
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
1189133
async def get_user_data(self):
        """"""
        userdata = {}
        sessions = self.session_data.get('sessions', {})
        try:
            async with async_timeout.timeout(8, loop=self._loop):
                for username in self.tautulli_users:
                    userdata[username] = {}
                    userdata[username]['Activity'] = None
                    for session in sessions:
                        if session['username'].lower() == username.lower():
                            userdata[username]['Activity'] = session['state']
                            for key in session:
                                if key != 'Username':
                                    userdata[username][key] = session[key]
                            break

            self.tautulli_user_data = userdata
        except (asyncio.TimeoutError, aiohttp.ClientError, KeyError):
            msg = "Can not load data from Tautulli."
            logger(msg, 40)
544551
function getDataForUserId(formName) {
  var userId = pad.getUserId();
  var message = {};
  message.type = 'USERINFO_GET';
  message.padId = pad.getPadId();
  message.userInfo = {};
  message.userInfo.userId = userId;
  message.userInfo.formName = formName;

  pad.collabClient.sendMessage(message);
}
353602
def data_received(self, data):
        
        if self.state == STATE_STARTING:
            self.state = STATE_RUNNING
            _LOGGER.debug('Websocket handshake: %s', data.decode())
            return
        _LOGGER.debug('Websocket data: %s', data)

        while len(data) > 0:
            payload, extra_data = self.get_payload(data)
            self._data = payload ###
            self.async_session_handler_callback('data')###
            #self.async_callback(payload)
            data = extra_data
898223
def get_user_info(self, steamID):
        """"""
        url = self.create_request_url(self.USER, steamID)
        data = self.retrieve_request(url)
        return self.return_data(data, format='xml')
312982
def get_users(self):
        
        self.read_sizes()
        if self.users == 0:
            self.next_uid = 1
            self.next_user_id='1'
            return []
        users = []
        max_uid = 0
        userdata, size = self.read_with_buffer(const.CMD_USERTEMP_RRQ, const.FCT_USER)
        if self.verbose: print("user size {} (= {})".format(size, len(userdata)))
        if size <= 4:
            print("WRN: missing user data")
            return []
        total_size = unpack("I",userdata[:4])[0]
        self.user_packet_size = total_size / self.users
        if not self.user_packet_size in [28, 72]:
            if self.verbose: print("WRN packet size would be  %i" % self.user_packet_size)
        userdata = userdata[4:]
        if self.user_packet_size == 28:
            while len(userdata) >= 28:
                uid, privilege, password, name, card, group_id, timezone, user_id = unpack('<HB5s8sIxBhI',userdata.ljust(28, b'\x00')[:28])
                if uid > max_uid: max_uid = uid
                password = (password.split(b'\x00')[0]).decode(self.encoding, errors='ignore')
                name = (name.split(b'\x00')[0]).decode(self.encoding, errors='ignore').strip()
                group_id = str(group_id)
                user_id = str(user_id)
                #TODO: check card value and find in ver8
                if not name:
                    name = "NN-%s" % user_id
                user = User(uid, name, privilege, password, group_id, user_id, card)
                users.append(user)
                if self.verbose: print("[6]user:",uid, privilege, password, name, card, group_id, timezone, user_id)
                userdata = userdata[28:]
        else:
            while len(userdata) >= 72:
                uid, privilege, password, name, card, group_id, user_id = unpack('<HB8s24sIx7sx24s', userdata.ljust(72, b'\x00')[:72])
                password = (password.split(b'\x00')[0]).decode(self.encoding, errors='ignore')
                name = (name.split(b'\x00')[0]).decode(self.encoding, errors='ignore').strip()
                group_id = (group_id.split(b'\x00')[0]).decode(self.encoding, errors='ignore').strip()
                user_id = (user_id.split(b'\x00')[0]).decode(self.encoding, errors='ignore')
                if uid > max_uid: max_uid = uid
                if not name:
                    name = "NN-%s" % user_id
                user = User(uid, name, privilege, password, group_id, user_id, card)
                users.append(user)
                userdata = userdata[72:]
        max_uid += 1
        self.next_uid = max_uid
        self.next_user_id = str(max_uid)
        while True:
            if any(u for u in users if u.user_id == self.next_user_id):
                max_uid += 1
                self.next_user_id = str(max_uid)
            else:
                break
        return users
1070470
def get_user(self, username):
        """"""
        ret = {}
        tmp = self._get_user(self._byte_p2(username), ALL_ATTRS)
        if tmp is None:
            raise UserDoesntExist(username, self.backend_name)
        attrs_tmp = tmp[1]
        for attr in attrs_tmp:
            value_tmp = attrs_tmp[attr]
            if len(value_tmp) == 1:
                ret[attr] = value_tmp[0]
            else:
                ret[attr] = value_tmp
        return ret
162392
def send(self, event):
        """"""

        try:
            jsonpacket = json.dumps(event.packet, cls=ComplexEncoder)
            if event.sendtype == "user":
                # TODO: I think, caching a user name <-> uuid table would
                # make sense instead of looking this up all the time.

                if event.uuid is None:
                    userobject = objectmodels['user'].find_one({
                        'name': event.username
                    })
                else:
                    userobject = objectmodels['user'].find_one({
                        'uuid': event.uuid
                    })

                if userobject is None:
                    self.log("No user by that name known.", lvl=warn)
                    return
                else:
                    uuid = userobject.uuid

                self.log("Broadcasting to all of users clients: '%s': '%s" % (
                    uuid, str(event.packet)[:20]), lvl=network)
                if uuid not in self._users:
                    self.log("User not connected!", event, lvl=critical)
                    return
                clients = self._users[uuid].clients

                for clientuuid in clients:
                    sock = self._clients[clientuuid].sock

                    if not event.raw:
                        self.log("Sending json to client", jsonpacket[:50],
                                 lvl=network)

                        self.fireEvent(write(sock, jsonpacket), "wsserver")
                    else:
                        self.log("Sending raw data to client")
                        self.fireEvent(write(sock, event.packet), "wsserver")
            else:  # only to client
                self.log("Sending to user's client: '%s': '%s'" % (
                    event.uuid, jsonpacket[:20]), lvl=network)
                if event.uuid not in self._clients:
                    if not event.fail_quiet:
                        self.log("Unknown client!", event.uuid, lvl=critical)
                        self.log("Clients:", self._clients, lvl=debug)
                    return

                sock = self._clients[event.uuid].sock
                if not event.raw:
                    self.fireEvent(write(sock, jsonpacket), "wsserver")
                else:
                    self.log("Sending raw data to client", lvl=network)
                    self.fireEvent(write(sock, event.packet[:20]), "wsserver")

        except Exception as e:
            self.log("Exception during sending: %s (%s)" % (e, type(e)),
                     lvl=critical, exc=True)
779872
def _get_user_data(self):
        

        url = self.session.host + '/sessions/' + str(self.session.id) + '/visualizations/' + str(self.id) + '/settings/'
        r = requests.get(url)
        if r.status_code == 200:
            content = r.json()
        else:
            raise Exception('Error retrieving user data from server')

        return content