Unique identifier of user object
190393
def id(self):
        
        return sa.Column(sa.Integer, primary_key=True, autoincrement=True)
1155541
def user_id(self):
        
        if self._user_id is None:
            if self.has_logged_in:
                self._user_id = self._req_get_user_aq()['data']['uid']
            else:
                raise AuthenticationError('Not logged in.')
        return self._user_id
513804
def get_user(uid, **kwargs):
    
    user_id=kwargs.get('user_id')
    if uid is None:
        uid = user_id
    user_i = _get_user(uid)
    return user_i
1159326
def gen_unique_id(serialized_name, args, kwargs):
    
    return hashlib.sha256(json.dumps({
        'func': serialized_name,
        'args': args,
        'kwargs': kwargs,
    }, sort_keys=True).encode('utf8')).hexdigest()
1371275
private UUID registerObject(final Object object) {
        UUID id = UUID.randomUUID();
        registerObject(object, id);
        return id;
    }
529210
def get_object_id(self, datum):
        """"""

        # Role assignment doesn't have identifier so one will be created
        # from the identifier of scope, user and role. This will guaranty the
        # unicity.
        scope_id = ""
        if "project" in datum.scope:
            scope_id = datum.scope["project"]["id"]
        elif "domain" in datum.scope:
            scope_id = datum.scope["domain"]["id"]

        assignee_id = ""
        if hasattr(datum, "user"):
            assignee_id = datum.user["id"]
        elif hasattr(datum, "group"):
            assignee_id = datum.group["id"]

        return "%s%s%s" % (assignee_id, datum.role["id"], scope_id)
640177
def id(self, value):
        """"""
        i = value.rfind('/')
        if (i > 0):
            self.server_and_prefix = value[:i]
            self.identifier = value[(i + 1):]
        elif (i == 0):
            self.server_and_prefix = ''
            self.identifier = value[(i + 1):]
        else:
            self.server_and_prefix = ''
            self.identifier = value
934132
def __identify_user(self, username, csrf):
        
        data = {
            "username": username,
            "csrf": csrf,
            "apiClient": "WEB",
            "bindDevice": "false",
            "skipLinkAccount": "false",
            "redirectTo": "",
            "skipFirstUse": "",
            "referrerId": "",
        }

        r = self.post("/login/identifyUser", data)

        if r.status_code == requests.codes.ok:
            result = r.json()
            new_csrf = getSpHeaderValue(result, CSRF_KEY)
            auth_level = getSpHeaderValue(result, AUTH_LEVEL_KEY)
            return (new_csrf, auth_level)

        return (None, None)
25911
private Long getUserIdArg(Object[] arguments) {
        if (arguments.length <= USER_ID_INDEX) {
            log.error("Illegal number of args: " + arguments.length);
        }
        return (Long) arguments[USER_ID_INDEX];
    }
53579
def _usernamesToSidObjects(cls, val, **kwargs):
        '''
        
        '''
        if not val:
            return val
        if isinstance(val, six.string_types):
            val = val.split(',')
        sids = []
        for _user in val:
            try:
                sid = win32security.LookupAccountName('', _user)[0]
                sids.append(sid)
            # This needs to be more specific
            except Exception as e:
                log.exception('Handle this explicitly')
                raise CommandExecutionError((
                    'There was an error obtaining the SID of user "{0}". Error '
                    'returned: {1}'
                    ).format(_user, e))
        return sids
927359
def _CaptureUserId(self):
    """"""
    user_kind, user_id = user_id_collector()
    if user_kind and user_id:
      self.breakpoint['evaluatedUserId'] = {'kind': user_kind, 'id': user_id}
333968
def get_identities(self, item):
        """"""

        user = self.get_sh_identity(item, self.get_field_author())
        yield user
685726
def uniqueId(self, prefix=""):
        
        _IdCounter.count += 1
        id = _IdCounter.count
        if prefix:
            return self._wrap(prefix + str(id))
        else:
            return self._wrap(id)
340008
function User(data){
    var self = this;
    Object.keys(data).map(function(k){
      self[k] = data[k];
    });
  }
375808
def _getUserSid(user):
    '''
    
    '''
    ret = {}

    sid_pattern = r'^S-1(-\d+){1,}$'

    if user and re.match(sid_pattern, user, re.I):
        try:
            sid = win32security.GetBinarySid(user)
        except Exception as e:
            ret['result'] = False
            ret['comment'] = 'Unable to obtain the binary security identifier for {0}.  The exception was {1}.'.format(
                user, e)
        else:
            try:
                win32security.LookupAccountSid('', sid)
                ret['result'] = True
                ret['sid'] = sid
            except Exception as e:
                ret['result'] = False
                ret['comment'] = 'Unable to lookup the account for the security identifier {0}.  The exception was {1}.'.format(
                    user, e)
    else:
        try:
            sid = win32security.LookupAccountName('', user)[0] if user else None
            ret['result'] = True
            ret['sid'] = sid
        except Exception as e:
            ret['result'] = False
            ret['comment'] = 'Unable to obtain the security identifier for {0}.  The exception was {1}.'.format(
                user, e)
    return ret
1064976
def identifier(self):
        """"""
        ident = self._json['coredata']['dc:identifier'].split(":")[-1]
        if ident != self._id:
            text = "Profile with ID {} has been merged and the new ID is "\
                   "{}.  Please update your records manually.  Files have "\
                   "been cached with the old ID.".format(self._id, ident)
            warn(text, UserWarning)
        return ident
669202
def user_to_uid(user):
    '''
    
    '''
    if user is None:
        user = salt.utils.user.get_user()
    try:
        if isinstance(user, int):
            return user
        return pwd.getpwnam(user).pw_uid
    except KeyError:
        return ''