start joiner

        Args:
            strPSKd: Joiner's PSKd

        Returns:
            True: successful to start joiner
            False: fail to start joiner
974421
def joinCommissioned(self, strPSKd='threadjpaketest', waitTime=20):
        
        print '%s call joinCommissioned' % self.port
        self.__sendCommand('ifconfig up')
        cmd = 'joiner start %s %s' %(strPSKd, self.provisioningUrl)
        print cmd
        if self.__sendCommand(cmd)[0] == "Done":
            maxDuration = 150 # seconds
            self.joinCommissionedStatus = self.joinStatus['ongoing']

            if self.logThreadStatus == self.logStatus['stop']:
                self.logThread = ThreadRunner.run(target=self.__readCommissioningLogs, args=(maxDuration,))

            t_end = time.time() + maxDuration
            while time.time() < t_end:
                if self.joinCommissionedStatus == self.joinStatus['succeed']:
                    break
                elif self.joinCommissionedStatus == self.joinStatus['failed']:
                    return False

                time.sleep(1)

            self.__sendCommand('thread start')
            time.sleep(30)
            return True
        else:
            return False
420567
public static void startDoing(String str) {
    System.err.print(str);
    System.err.print(" ... ");
    System.err.flush();
    startTime();
  }
601022
def join_impl(other, join_type, sequence):
    
    if join_type == "inner":
        return inner_join_impl(other, sequence)
    seq_dict = {}
    for element in sequence:
        seq_dict[element[0]] = element[1]
    seq_kv = seq_dict
    other_kv = dict(other)
    if join_type == "left":
        keys = seq_kv.keys()
    elif join_type == "right":
        keys = other_kv.keys()
    elif join_type == "outer":
        keys = set(list(seq_kv.keys()) + list(other_kv.keys()))
    else:
        raise TypeError("Wrong type of join specified")
    result = {}
    for k in keys:
        result[k] = (seq_kv.get(k), other_kv.get(k))
    return six.viewitems(result)
1347411
def pprnt(input, return_data=False):
    
    HEADER = '\033[95m'
    OKBLUE = '\033[94m'
    OKGREEN = '\033[32m'
    WARNING = '\033[93m'
    FAIL = '\033[91m'
    ENDC = '\033[0m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'
    import json, re
    result = json.dumps(input, sort_keys=True, indent=4)
    result = re.sub(r'(")(\w*?_id)(":)', r'\1%s%s\2%s\3' % (BOLD, HEADER, ENDC), result)
    result = re.sub(r'(")(\w*?_set)(":)', r'\1%s%s\2%s\3' % (BOLD, HEADER, ENDC), result)
    result = re.sub(r'(\n *?")(\w*?)(":)', r'\1%s%s\2%s\3' % (BOLD, OKGREEN, ENDC), result)
    if not return_data:
        print(result)
    else:
        return result
71870
def start(self, trunk_type):
        
        if not isinstance(trunk_type, basestring):
            raise TypeError("trunk_type can only be an instance of type basestring")
        self._call("start",
                     in_p=[trunk_type])
863568
def join(cls, root, subkey):
        
        if subkey is None:
            return root
        return enums.SPLITTER.join((root, subkey))
186502
def join(self, *args):
        
        call_args = list(args)
        joiner = call_args.pop(0)
        self.random.shuffle(call_args)
        return joiner.join(call_args)
815750
def join_channel(self, channel, key=None, tags=None):
        """"""
        params = [channel]
        if key:
            params.append(key)
        self.send('JOIN', params=params, tags=tags)
715913
public static StringBuilder join(final StringBuilder sb, final String sep, final String... tokens) {
        boolean first = true;
        for (Object t: tokens) {
            if (!first) sb.append(sep);
            else first = false;
            sb.append(t);
        }
        return sb;
    }
810401
def start(self, *args, **kwargs):
        
        self._stop = False
        super(ReadProbes, self).start(*args, **kwargs)
31922
static boolean checkPidPgrpidForMatch(String pidStr, String procfsDir) {
    Integer pId = Integer.parseInt(pidStr);
    // Get information for this process
    ProcessInfo pInfo = new ProcessInfo(pId);
    pInfo = constructProcessInfo(pInfo, procfsDir);
    if (pInfo == null) {
      // process group leader may have finished execution, but we still need to
      // kill the subProcesses in the process group.
      return true;
    }

    //make sure that pId and its pgrpId match
    if (!pInfo.getPgrpId().equals(pId)) {
      LOG.warn("Unexpected: Process with PID " + pId +
               " is not a process group leader.");
      return false;
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug(pId + " is a process group leader, as expected.");
    }
    return true;
  }
506445
protected boolean installViewIfValidJoinRsp(final Promise<JoinRsp> join_promise, boolean block_for_rsp) {
        boolean success=false;
        JoinRsp rsp=null;
        try {
            if(join_promise.hasResult())
                rsp=join_promise.getResult(1, true);
            else if(block_for_rsp)
                rsp=join_promise.getResult(gms.join_timeout, true);

            return success=rsp != null && isJoinResponseValid(rsp) && installView(rsp.getView(), rsp.getDigest());
        }
        finally {
            if(success)
                gms.sendViewAck(rsp.getView().getCreator());
        }
    }
1153890
def start_ppp_link(self):
        ''''''
        cmd = ['pppd']
        cmd.extend(self.command)
        (self.pid, self.ppp_fd) = pty.fork()
        if self.pid == 0:
            os.execvp("pppd", cmd)
            raise RuntimeError("pppd exited")
        if self.ppp_fd == -1:
            print("Failed to create link fd")
            return

        # ensure fd is non-blocking
        fcntl.fcntl(self.ppp_fd, fcntl.F_SETFL, fcntl.fcntl(self.ppp_fd, fcntl.F_GETFL) | os.O_NONBLOCK)
        self.byte_count = 0
        self.packet_count = 0

        # ask mavproxy to add us to the select loop
        self.mpself.select_extra[self.ppp_fd] = (self.ppp_read, self.ppp_fd)
620388
def join(sleep_seconds_before_join = 1)
      # check already existing TCPServers
      return if @tcp_servers.empty?
      # wait some seconds before joininig the upcoming threads
      # and check that all TCPServers gots one thread
      while (@tcp_server_threads.length < @tcp_servers.length) && (sleep_seconds_before_join > 0)
        sleep_seconds_before_join -= 1
        sleep 1
      end
      # try to join any thread
      begin
        @tcp_server_threads.each(&:join)

      # catch ctrl-c to stop service
      rescue Interrupt
      end
    end
148271
def do_kpl_on(self, args):
        
        params = args.split()
        address = None
        group = None

        try:
            address = params[0]
            group = int(params[1])
        except IndexError:
            _LOGGING.error("Address and group are regquired")
            self.do_help('kpl_status')
        except TypeError:
            _LOGGING.error("Group must be an integer")
            self.do_help('kpl_status')

        if address and group:
            self.tools.kpl_on(address, group)
221379
def join_strings(key, value, fmt, meta):  # pylint: disable=unused-argument
    """"""
    if key in ['Para', 'Plain']:
        _join_strings(value)
    elif key == 'Image':
        _join_strings(value[-2])
    elif key == 'Table':
        _join_strings(value[-5])
81451
public static String join(String joinChar, String... args) {
        String next = ""; //$NON-NLS-1$
        StringBuilder result = new StringBuilder(length(args) + (args.length - 1));

        for (String arg : args) {
            result.append(next);
            result.append(arg);
            next = joinChar;
        }
        return result.toString();
    }