Set jid of the sender

        Args:
          jid (str): jid of the sender
14019
def sender(self, jid: str):
        
        if jid is not None and not isinstance(jid, str):
            raise TypeError("'sender' MUST be a string")
        self._sender = aioxmpp.JID.fromstr(jid) if jid is not None else None
1062396
def prep_jid(nocache=False, passed_jid=None, recurse_count=0):
    '''
    
    '''
    if recurse_count >= 5:
        err = 'prep_jid could not store a jid after {0} tries.'.format(recurse_count)
        log.error(err)
        raise salt.exceptions.SaltCacheError(err)
    if passed_jid is None:  # this can be a None or an empty string.
        jid = salt.utils.jid.gen_jid(__opts__)
    else:
        jid = passed_jid

    jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type'])

    # Make sure we create the jid dir, otherwise someone else is using it,
    # meaning we need a new jid.
    if not os.path.isdir(jid_dir):
        try:
            os.makedirs(jid_dir)
        except OSError:
            time.sleep(0.1)
            if passed_jid is None:
                return prep_jid(nocache=nocache, recurse_count=recurse_count+1)

    try:
        with salt.utils.files.fopen(os.path.join(jid_dir, 'jid'), 'wb+') as fn_:
            fn_.write(salt.utils.stringutils.to_bytes(jid))
        if nocache:
            with salt.utils.files.fopen(os.path.join(jid_dir, 'nocache'), 'wb+'):
                pass
    except IOError:
        log.warning(
            'Could not write out jid file for job %s. Retrying.', jid)
        time.sleep(0.1)
        return prep_jid(passed_jid=jid, nocache=nocache,
                        recurse_count=recurse_count+1)

    return jid
1056826
def sanitize_jid(s):
    """"""
    jid = unicode_to_ascii(s).lower()
    jid = WHITESPACE.sub('-', jid)
    jid = INVALID_JID_CHARS.sub('', jid)
    return jid.strip()[:256]
1113359
def get_jid(jid):
    '''
    
    '''
    jid = _escape_jid(jid)
    conn = _get_conn()
    if conn is None:
        return None
    cur = conn.cursor()
    sql = '''SELECT id, return FROM salt_returns WHERE jid = %s'''

    cur.execute(sql, (jid,))
    data = cur.fetchall()
    ret = {}
    if data:
        for minion, full_ret in data:
            ret_data = salt.utils.json.loads(full_ret)
            if not isinstance(ret_data, dict) or 'return' not in ret_data:
                # Convert the old format in which the return contains the only return data to the
                # new that is dict containing 'return' and optionally 'retcode' and 'success'.
                ret_data = {'return': ret_data}
            ret[minion] = ret_data
    _close_conn(conn)
    return ret
703092
def _gen_jid(cur):
    '''
    
    '''
    jid = salt.utils.jid.gen_jid(__opts__)
    sql = '''SELECT jid FROM jids WHERE jid = %s'''
    cur.execute(sql, (jid,))
    data = cur.fetchall()
    if not data:
        return jid
    return None
1119760
def _prep_jid(self, clear_load, extra):
        '''
        
        '''
        # the jid in clear_load can be None, '', or something else. this is an
        # attempt to clean up the value before passing to plugins
        passed_jid = clear_load['jid'] if clear_load.get('jid') else None
        nocache = extra.get('nocache', False)

        # Retrieve the jid
        fstr = '{0}.prep_jid'.format(self.opts['master_job_cache'])
        try:
            # Retrieve the jid
            jid = self.mminion.returners[fstr](nocache=nocache,
                                               passed_jid=passed_jid)
        except (KeyError, TypeError):
            # The returner is not present
            msg = (
                'Failed to allocate a jid. The requested returner \'{0}\' '
                'could not be loaded.'.format(fstr.split('.')[0])
            )
            log.error(msg)
            return {'error': msg}
        return jid
36759
def set_owner_process(uid, gid):
    
    if gid:
        try:
            os.setgid(gid)
        except OverflowError:
            # versions of python < 2.6.2 don't manage unsigned int for
            # groups like on osx or fedora
            os.setgid(-ctypes.c_int(-gid).value)
    if uid:
        os.setuid(uid)
473159
public void sendComposingNotification(Jid to, String packetID) throws NotConnectedException, InterruptedException {
        // Create the message to send
        Message msg = new Message(to);
        // Create a MessageEvent Package and add it to the message
        MessageEvent messageEvent = new MessageEvent();
        messageEvent.setComposing(true);
        messageEvent.setStanzaId(packetID);
        msg.addExtension(messageEvent);
        // Send the packet
        connection().sendStanza(msg);
    }
314011
def set_joint_mode(self, ids):
        
        self.set_control_mode(dict(zip(ids, itertools.repeat('joint'))))
1369905
def kill(self, jid):
        ''''''
        greenlet = self.greenlets.get(jid)
        if greenlet is not None:
            logger.warn('Lost ownership of %s' % jid)
            greenlet.kill()
1036178
def __set_identifier(self, value):
        '''
        
        '''
        if not value or not len(value):
            raise ValueError("Invalid invoice ID")

        self.__identifier = value
712487
def get_jid(jid):
    '''
    
    '''
    cb_ = _get_connection()
    _verify_views()

    ret = {}

    for result in cb_.query(DESIGN_NAME, 'jid_returns', key=six.text_type(jid), include_docs=True):
        ret[result.value] = result.doc.value

    return ret
297087
def get_jids():
    '''
    
    '''
    serv = _get_serv(ret=None)
    ret = {}
    for s in serv.mget(serv.keys('load:*')):
        if s is None:
            continue
        load = salt.utils.json.loads(s)
        jid = load['jid']
        ret[jid] = salt.utils.jid.format_jid_instance(jid, load)
    return ret
210771
def set(self, id, translation, domain='messages'):
        
        assert isinstance(id, (str, unicode))
        assert isinstance(translation, (str, unicode))
        assert isinstance(domain, (str, unicode))

        self.add({id: translation}, domain)
813964
public void setMsgId(long msgId) 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "setMsgId", Long.valueOf(msgId)); 

    // No need to harden this. We only call this as part of restoring an AOValue->AIMessageItem link
    // for an IME (remote gathering). If the ME goes down we dont need the msgId anyway.
    this.msgId = msgId;
    restored = true;
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "setMsgId"); 
  }
985973
def prep_jid(nocache=False, passed_jid=None):
    '''
    
    '''
    if passed_jid is None:
        jid = salt.utils.jid.gen_jid(__opts__)
    else:
        jid = passed_jid

    cb_ = _get_connection()

    try:
        cb_.add(six.text_type(jid),
               {'nocache': nocache},
               ttl=_get_ttl(),
               )
    except couchbase.exceptions.KeyExistsError:
        # TODO: some sort of sleep or something? Spinning is generally bad practice
        if passed_jid is None:
            return prep_jid(nocache=nocache)

    return jid
1009397
def update_endtime(jid, time):
    '''
    
    '''
    jid_dir = salt.utils.jid.jid_dir(jid, _job_dir(), __opts__['hash_type'])
    try:
        if not os.path.exists(jid_dir):
            os.makedirs(jid_dir)
        with salt.utils.files.fopen(os.path.join(jid_dir, ENDTIME), 'w') as etfile:
            etfile.write(salt.utils.stringutils.to_str(time))
    except IOError as exc:
        log.warning('Could not write job invocation cache file: %s', exc)