Attempt to determine Satellite 5 Configuration
431219
def _try_satellite5_configuration(config):
    
    logger.debug("Trying Satellite 5 auto_config")
    rhn_config = '/etc/sysconfig/rhn/up2date'
    systemid = '/etc/sysconfig/rhn/systemid'
    if os.path.isfile(rhn_config):
        if os.path.isfile(systemid):
            config.systemid = _read_systemid_file(systemid)
        else:
            logger.debug("Could not find Satellite 5 systemid file.")
            return False

        logger.debug("Found Satellite 5 Config")
        rhn_conf_file = open(rhn_config, 'r')
        hostname = None
        for line in rhn_conf_file:
            if line.startswith('serverURL='):
                url = urlparse(line.split('=')[1])
                hostname = url.netloc + '/redhat_access'
                logger.debug("Found hostname %s", hostname)
            if line.startswith('sslCACert='):
                rhn_ca = line.strip().split('=')[1]

            # Auto discover proxy stuff
            if line.startswith('enableProxy='):
                proxy_enabled = line.strip().split('=')[1]
            if line.startswith('httpProxy='):
                proxy_host_port = line.strip().split('=')[1]
            if line.startswith('proxyUser='):
                proxy_user = line.strip().split('=')[1]
            if line.startswith('proxyPassword='):
                proxy_password = line.strip().split('=')[1]

        if hostname:
            proxy = None
            if proxy_enabled == "1":
                proxy = "http://"
                if proxy_user != "" and proxy_password != "":
                    logger.debug("Found user and password for rhn_proxy")
                    proxy = proxy + proxy_user + ':' + proxy_password
                    proxy = proxy + "@" + proxy_host_port
                else:
                    proxy = proxy + proxy_host_port
                    logger.debug("RHN Proxy: %s", proxy)
            set_auto_configuration(config, hostname, rhn_ca, proxy)
        else:
            logger.debug("Could not find hostname")
            return False
        return True
    else:
        logger.debug("Could not find rhn config")
        return False
939384
def check_configuration(ctx, base_key, needed_keys):
    

    # check for valid configuration
    if base_key not in ctx.keys():
        exit("[{}ERROR{}] missing configuration for '{}'"
             .format(ERROR_COLOR, RESET_COLOR, base_key))
        # TODO: offer to create configuration file
    if ctx.releaser is None:
        exit("[{}ERROR{}] empty configuration for '{}' found"
             .format(ERROR_COLOR, RESET_COLOR, base_key))
        # TODO: offer to create configuration file

    # TODO: allow use of default values
    for my_key in needed_keys:
        if my_key not in ctx[base_key].keys():
            exit("[{}ERROR{}] missing configuration key '{}.{}'"
                 .format(ERROR_COLOR, RESET_COLOR, base_key, my_key))
131006
def check_motor_eprom_configuration(config, dxl_io, motor_names):
    
    changed_angle_limits = {}
    changed_return_delay_time = {}

    for name in motor_names:
        m = config['motors'][name]
        id = m['id']

        try:
            old_limits = dxl_io.get_angle_limit((id, ))[0]
            old_return_delay_time = dxl_io.get_return_delay_time((id, ))[0]
        except IndexError:  # probably a broken motor so we just skip
            continue

        if old_return_delay_time != 0:
            logger.warning("Return delay time of %s changed from %s to 0",
                           name, old_return_delay_time)
            changed_return_delay_time[id] = 0

        new_limits = m['angle_limit']
        if 'wheel_mode' in m and m['wheel_mode']:
            dxl_io.set_wheel_mode([m['id']])
            time.sleep(0.5)
        else:
            # TODO: we probably need a better fix for this.
            # dxl_io.set_joint_mode([m['id']])

            d = numpy.linalg.norm(numpy.asarray(new_limits) - numpy.asarray(old_limits))
            if d > 1:
                logger.warning("Limits of '%s' changed from %s to %s",
                               name, old_limits, new_limits,
                               extra={'config': config})
                changed_angle_limits[id] = new_limits

    if changed_angle_limits:
        dxl_io.set_angle_limit(changed_angle_limits)
        time.sleep(0.5)

    if changed_return_delay_time:
        dxl_io.set_return_delay_time(changed_return_delay_time)
        time.sleep(0.5)
995192
protected function _determineI5()
    {
        // first us the compiled flag.
        $this->_isI5 = (php_uname('s') == 'OS400') ? true : false;

        // if this is set, then us it
        if (isset($this->_config['os'])){
            if (strtolower($this->_config['os']) === 'i5') {
                $this->_isI5 = true;
            } else {
                // any other value passed in, its null
                $this->_isI5 = false;
            }
        }

    }
607979
def _init_sbc_config(self, config):
        
        if (config.channel_mode == SBCChannelMode.CHANNEL_MODE_MONO):
            self.config.mode = self.codec.SBC_MODE_MONO
        elif (config.channel_mode == SBCChannelMode.CHANNEL_MODE_STEREO):
            self.config.mode = self.codec.SBC_MODE_STEREO
        elif (config.channel_mode == SBCChannelMode.CHANNEL_MODE_DUAL):
            self.config.mode = self.codec.SBC_MODE_DUAL_CHANNEL
        elif (config.channel_mode == SBCChannelMode.CHANNEL_MODE_JOINT_STEREO):
            self.config.mode = self.codec.SBC_MODE_JOINT_STEREO

        if (config.frequency == SBCSamplingFrequency.FREQ_16KHZ):
            self.config.frequency = self.codec.SBC_FREQ_16000
        elif (config.frequency == SBCSamplingFrequency.FREQ_32KHZ):
            self.config.frequency = self.codec.SBC_FREQ_32000
        elif (config.frequency == SBCSamplingFrequency.FREQ_44_1KHZ):
            self.config.frequency = self.codec.SBC_FREQ_44100
        elif (config.frequency == SBCSamplingFrequency.FREQ_48KHZ):
            self.config.frequency = self.codec.SBC_FREQ_48000

        if (config.allocation_method == SBCAllocationMethod.LOUDNESS):
            self.config.allocation = self.codec.SBC_AM_LOUDNESS
        elif (config.allocation_method == SBCAllocationMethod.SNR):
            self.config.allocation = self.codec.SBC_AM_SNR

        if (config.subbands == SBCSubbands.SUBBANDS_4):
            self.config.subbands = self.codec.SBC_SB_4
        elif (config.subbands == SBCSubbands.SUBBANDS_8):
            self.config.subbands = self.codec.SBC_SB_8

        if (config.block_length == SBCBlocks.BLOCKS_4):
            self.config.blocks = self.codec.SBC_BLK_4
        elif (config.block_length == SBCBlocks.BLOCKS_8):
            self.config.blocks = self.codec.SBC_BLK_8
        elif (config.block_length == SBCBlocks.BLOCKS_12):
            self.config.blocks = self.codec.SBC_BLK_12
        elif (config.block_length == SBCBlocks.BLOCKS_16):
            self.config.blocks = self.codec.SBC_BLK_16

        self.config.bitpool = config.max_bitpool
        self.config.endian = self.codec.SBC_LE
1112285
def calibration(date, satellite):
    
    counts_shift = CountsShift()
    space_measurement = SpaceMeasurement()
    prelaunch = PreLaunch()
    postlaunch = PostLaunch()
    return {
        'counts_shift': counts_shift.coefficient(satellite),
        'space_measurement': space_measurement.coefficient(satellite),
        'prelaunch': prelaunch.coefficient(satellite),
        'postlaunch': postlaunch.coefficient(date, satellite)
    }
1340445
def get_satellites_by_type(self, s_type):
        

        if hasattr(self, s_type + 's'):
            return getattr(self, s_type + 's')

        logger.debug("[realm %s] do not have this kind of satellites: %s", self.name, s_type)
        return []
820991
def get_a_satellite_link(sat_type, sat_dict):
        
        cls = get_alignak_class('alignak.objects.%slink.%sLink' % (sat_type, sat_type.capitalize()))
        return cls(params=sat_dict, parsing=False)
1321970
def _dsinit(
       whichconst,
       cosim,  emsq,   argpo,   s1,     s2,
       s3,     s4,     s5,      sinim,  ss1,
       ss2,    ss3,    ss4,     ss5,    sz1,
       sz3,    sz11,   sz13,    sz21,   sz23,
       sz31,   sz33,   t,       tc,     gsto,
       mo,     mdot,   no,      nodeo,  nodedot,
       xpidot, z1,     z3,      z11,    z13,
       z21,    z23,    z31,     z33,    ecco,
       eccsq,  em,    argpm,  inclm, mm,
       nm,    nodem,
       irez,
       atime, d2201, d2211,  d3210, d3222,
       d4410, d4422, d5220,  d5232, d5421,
       d5433, dedt,  didt,   dmdt,
       dnodt, domdt, del1,   del2,  del3,
       xfact, xlamo, xli,    xni,
     ):

     q22    = 1.7891679e-6;
     q31    = 2.1460748e-6;
     q33    = 2.2123015e-7;
     root22 = 1.7891679e-6;
     root44 = 7.3636953e-9;
     root54 = 2.1765803e-9;
     rptim  = 4.37526908801129966e-3; # equates to 7.29211514668855e-5 rad/sec
     root32 = 3.7393792e-7;
     root52 = 1.1428639e-7;
     x2o3   = 2.0 / 3.0;
     znl    = 1.5835218e-4;
     zns    = 1.19459e-5;

     #  sgp4fix identify constants and allow alternate values
     xke = whichconst.xke

     #  -------------------- deep space initialization ------------
     irez = 0;
     if 0.0034906585 < nm < 0.0052359877:
         irez = 1;
     if 8.26e-3 <= nm <= 9.24e-3 and em >= 0.5:
         irez = 2;

     #  ------------------------ do solar terms -------------------
     ses  =  ss1 * zns * ss5;
     sis  =  ss2 * zns * (sz11 + sz13);
     sls  = -zns * ss3 * (sz1 + sz3 - 14.0 - 6.0 * emsq);
     sghs =  ss4 * zns * (sz31 + sz33 - 6.0);
     shs  = -zns * ss2 * (sz21 + sz23);
     #  sgp4fix for 180 deg incl
     if inclm < 5.2359877e-2 or inclm > pi - 5.2359877e-2:
       shs = 0.0;
     if sinim != 0.0:
       shs = shs / sinim;
     sgs  = sghs - cosim * shs;

     #  ------------------------- do lunar terms ------------------
     dedt = ses + s1 * znl * s5;
     didt = sis + s2 * znl * (z11 + z13);
     dmdt = sls - znl * s3 * (z1 + z3 - 14.0 - 6.0 * emsq);
     sghl = s4 * znl * (z31 + z33 - 6.0);
     shll = -znl * s2 * (z21 + z23);
     #  sgp4fix for 180 deg incl
     if inclm < 5.2359877e-2 or inclm > pi - 5.2359877e-2:
         shll = 0.0;
     domdt = sgs + sghl;
     dnodt = shs;
     if sinim != 0.0:

         domdt = domdt - cosim / sinim * shll;
         dnodt = dnodt + shll / sinim;


     #  ----------- calculate deep space resonance effects --------
     dndt   = 0.0;
     theta  = (gsto + tc * rptim) % twopi
     em     = em + dedt * t;
     inclm  = inclm + didt * t;
     argpm  = argpm + domdt * t;
     nodem  = nodem + dnodt * t;
     mm     = mm + dmdt * t;
     

     #  -------------- initialize the resonance terms -------------
     if irez != 0:

         aonv = pow(nm / xke, x2o3);

         #  ---------- geopotential resonance for 12 hour orbits ------
         if irez == 2:

             cosisq = cosim * cosim;
             emo    = em;
             em     = ecco;
             emsqo  = emsq;
             emsq   = eccsq;
             eoc    = em * emsq;
             g201   = -0.306 - (em - 0.64) * 0.440;

             if em <= 0.65:

                 g211 =    3.616  -  13.2470 * em +  16.2900 * emsq;
                 g310 =  -19.302  + 117.3900 * em - 228.4190 * emsq +  156.5910 * eoc;
                 g322 =  -18.9068 + 109.7927 * em - 214.6334 * emsq +  146.5816 * eoc;
                 g410 =  -41.122  + 242.6940 * em - 471.0940 * emsq +  313.9530 * eoc;
                 g422 = -146.407  + 841.8800 * em - 1629.014 * emsq + 1083.4350 * eoc;
                 g520 = -532.114  + 3017.977 * em - 5740.032 * emsq + 3708.2760 * eoc;

             else:

                 g211 =   -72.099 +   331.819 * em -   508.738 * emsq +   266.724 * eoc;
                 g310 =  -346.844 +  1582.851 * em -  2415.925 * emsq +  1246.113 * eoc;
                 g322 =  -342.585 +  1554.908 * em -  2366.899 * emsq +  1215.972 * eoc;
                 g410 = -1052.797 +  4758.686 * em -  7193.992 * emsq +  3651.957 * eoc;
                 g422 = -3581.690 + 16178.110 * em - 24462.770 * emsq + 12422.520 * eoc;
                 if em > 0.715:
                     g520 =-5149.66 + 29936.92 * em - 54087.36 * emsq + 31324.56 * eoc;
                 else:
                     g520 = 1464.74 -  4664.75 * em +  3763.64 * emsq;

             if em < 0.7:

                 g533 = -919.22770 + 4988.6100 * em - 9064.7700 * emsq + 5542.21  * eoc;
                 g521 = -822.71072 + 4568.6173 * em - 8491.4146 * emsq + 5337.524 * eoc;
                 g532 = -853.66600 + 4690.2500 * em - 8624.7700 * emsq + 5341.4  * eoc;

             else:

                 g533 =-37995.780 + 161616.52 * em - 229838.20 * emsq + 109377.94 * eoc;
                 g521 =-51752.104 + 218913.95 * em - 309468.16 * emsq + 146349.42 * eoc;
                 g532 =-40023.880 + 170470.89 * em - 242699.48 * emsq + 115605.82 * eoc;

             sini2=  sinim * sinim;
             f220 =  0.75 * (1.0 + 2.0 * cosim+cosisq);
             f221 =  1.5 * sini2;
             f321 =  1.875 * sinim  *  (1.0 - 2.0 * cosim - 3.0 * cosisq);
             f322 = -1.875 * sinim  *  (1.0 + 2.0 * cosim - 3.0 * cosisq);
             f441 = 35.0 * sini2 * f220;
             f442 = 39.3750 * sini2 * sini2;
             f522 =  9.84375 * sinim * (sini2 * (1.0 - 2.0 * cosim- 5.0 * cosisq) +
                     0.33333333 * (-2.0 + 4.0 * cosim + 6.0 * cosisq) );
             f523 = sinim * (4.92187512 * sini2 * (-2.0 - 4.0 * cosim +
                    10.0 * cosisq) + 6.56250012 * (1.0+2.0 * cosim - 3.0 * cosisq));
             f542 = 29.53125 * sinim * (2.0 - 8.0 * cosim+cosisq *
                    (-12.0 + 8.0 * cosim + 10.0 * cosisq));
             f543 = 29.53125 * sinim * (-2.0 - 8.0 * cosim+cosisq *
                    (12.0 + 8.0 * cosim - 10.0 * cosisq));
             xno2  =  nm * nm;
             ainv2 =  aonv * aonv;
             temp1 =  3.0 * xno2 * ainv2;
             temp  =  temp1 * root22;
             d2201 =  temp * f220 * g201;
             d2211 =  temp * f221 * g211;
             temp1 =  temp1 * aonv;
             temp  =  temp1 * root32;
             d3210 =  temp * f321 * g310;
             d3222 =  temp * f322 * g322;
             temp1 =  temp1 * aonv;
             temp  =  2.0 * temp1 * root44;
             d4410 =  temp * f441 * g410;
             d4422 =  temp * f442 * g422;
             temp1 =  temp1 * aonv;
             temp  =  temp1 * root52;
             d5220 =  temp * f522 * g520;
             d5232 =  temp * f523 * g532;
             temp  =  2.0 * temp1 * root54;
             d5421 =  temp * f542 * g521;
             d5433 =  temp * f543 * g533;
             xlamo =  (mo + nodeo + nodeo-theta - theta) % twopi
             xfact =  mdot + dmdt + 2.0 * (nodedot + dnodt - rptim) - no;
             em    = emo;
             emsq  = emsqo;

         #  ---------------- synchronous resonance terms --------------
         if irez == 1:

             g200  = 1.0 + emsq * (-2.5 + 0.8125 * emsq);
             g310  = 1.0 + 2.0 * emsq;
             g300  = 1.0 + emsq * (-6.0 + 6.60937 * emsq);
             f220  = 0.75 * (1.0 + cosim) * (1.0 + cosim);
             f311  = 0.9375 * sinim * sinim * (1.0 + 3.0 * cosim) - 0.75 * (1.0 + cosim);
             f330  = 1.0 + cosim;
             f330  = 1.875 * f330 * f330 * f330;
             del1  = 3.0 * nm * nm * aonv * aonv;
             del2  = 2.0 * del1 * f220 * g200 * q22;
             del3  = 3.0 * del1 * f330 * g300 * q33 * aonv;
             del1  = del1 * f311 * g310 * q31 * aonv;
             xlamo = (mo + nodeo + argpo - theta) % twopi
             xfact = mdot + xpidot - rptim + dmdt + domdt + dnodt - no;

         #  ------------ for sgp4, initialize the integrator ----------
         xli   = xlamo;
         xni   = no;
         atime = 0.0;
         nm    = no + dndt;

     return (
       em,    argpm,  inclm, mm,
       nm,    nodem,
       irez, atime,
       d2201, d2211,  d3210, d3222,
       d4410, d4422, d5220,  d5232,
       d5421, d5433, dedt,  didt,
       dmdt,  dndt, dnodt, domdt,
       del1,   del2,  del3, xfact,
       xlamo, xli,    xni,
       )
659602
def configure(self):
        

        # Convert standard SPI sheme to USBISS scheme
        lookup_table = [0, 2, 1, 3]
        mode = lookup_table[self._mode]

        # Add signal for SPI switch
        iss_mode = self._usbiss.SPI_MODE + mode

        # Configure USB-ISS
        self._usbiss.mode = [iss_mode, self.sck_divisor]
1255994
def get_launch_config(self, scaling_group):
        
        key_map = {
            "OS-DCF:diskConfig": "disk_config",
            "flavorRef": "flavor",
            "imageRef": "image",
        }
        uri = "/%s/%s/launch" % (self.uri_base, utils.get_id(scaling_group))
        resp, resp_body = self.api.method_get(uri)
        ret = {}
        data = resp_body.get("launchConfiguration")
        ret["type"] = data.get("type")
        args = data.get("args", {})
        ret["load_balancers"] = args.get("loadBalancers")
        for key, value in args.get("server", {}).items():
            norm_key = key_map.get(key, key)
            ret[norm_key] = value
        return ret
334133
def main():
    
    # Detector positions in ENU relative to the station GPS
    x = [-6.34, -2.23, -3.6, 3.46]
    y = [6.34, 2.23, -3.6, 3.46]

    # Scale mips to fit the graph
    n = [35.0, 51.9, 35.8, 78.9]

    # Make times relative to first detection
    t = [15., 17.5, 20., 27.5]
    dt = [ti - min(t) for ti in t]

    plot = Plot()
    plot.scatter([0], [0], mark='triangle')
    plot.add_pin_at_xy(0, 0, 'Station 503', use_arrow=False, location='below')
    plot.scatter_table(x, y, dt, n)

    plot.set_scalebar(location="lower right")
    plot.set_colorbar('$\Delta$t [ns]')
    plot.set_axis_equal()
    plot.set_mlimits(max=16.)
    plot.set_slimits(min=10., max=100.)

    plot.set_xlabel('x [m]')
    plot.set_ylabel('y [m]')

    plot.save('event_display')


    # Add event by Station 508
    # Detector positions in ENU relative to the station GPS
    x508 = [6.12, 0.00, -3.54, 3.54]
    y508 = [-6.12, -13.23, -3.54, 3.54]

    # Event GPS timestamp: 1371498167.016412100
    # MIPS
    n508 = [5.6, 16.7, 36.6, 9.0]
    # Arrival Times
    t508 = [15., 22.5, 22.5, 30.]
    dt508 = [ti - min(t508) for ti in t508]

    plot = MultiPlot(1, 2, width=r'.33\linewidth')
    plot.set_xlimits_for_all(min=-10, max=15)
    plot.set_ylimits_for_all(min=-15, max=10)
    plot.set_mlimits_for_all(min=0., max=16.)
    plot.set_colorbar('$\Delta$t [ns]', False)
    plot.set_colormap('blackwhite')
    plot.set_scalebar_for_all(location="upper right")

    p = plot.get_subplot_at(0, 0)
    p.scatter([0], [0], mark='triangle')
    p.add_pin_at_xy(0, 0, 'Station 503', use_arrow=False, location='below')
    p.scatter_table(x, y, dt, n)
    p.set_axis_equal()

    p = plot.get_subplot_at(0, 1)
    p.scatter([0], [0], mark='triangle')
    p.add_pin_at_xy(0, 0, 'Station 508', use_arrow=False, location='below')
    p.scatter_table(x508, y508, dt508, n508)
    p.set_axis_equal()

    plot.show_yticklabels_for_all([(0, 0)])
    plot.show_xticklabels_for_all([(0, 0), (0, 1)])

    plot.set_xlabel('x [m]')
    plot.set_ylabel('y [m]')

    plot.save('multi_event_display')
503695
def get_pending_boot_mode(self):
        
        sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
        try:
            return BOOT_MODE_MAP.get(
                sushy_system.bios_settings.pending_settings.boot_mode)
        except sushy.exceptions.SushyError as e:
            msg = (self._('The pending BIOS Settings was not found. Error '
                          '%(error)s') %
                   {'error': str(e)})
            LOG.debug(msg)
            raise exception.IloError(msg)
532468
def check_gps_status(self, gps_status_int):
        
        gps_mode_string = self.gps_mode.get(gps_status_int, "unknown")

        if gps_mode_string == "unknown":
            return unknown, ("GPS status: " + gps_mode_string)

        elif gps_mode_string != "normalOperation" \
                and gps_mode_string != "gpsSync":
            # that is a warning condition, NTP could still work without the GPS antenna
            return warning, ("GPS status: " + gps_mode_string)

        return None
1025793
def determine_device(kal_out):
    """"""
    device = ""
    while device == "":
        for line in kal_out.splitlines():
            if "Using device " in line:
                device = str(line.split(' ', 2)[-1])
        if device == "":
            device = None
    return device
359303
def configuration_dispatch(self, not_configured=None):
        
        if not not_configured:
            self.dispatcher = Dispatcher(self.conf, self.link_to_myself)
            # I set my own dispatched configuration as the provided one...
            # because I will not push a configuration to myself :)
            self.cur_conf = self.conf

            # Loop for the first configuration dispatching, if the first dispatch fails, bail out!
            # Without a correct configuration, Alignak daemons will not run correctly
            first_connection_try_count = 0
            logger.info("Connecting to my satellites...")
            while True:
                first_connection_try_count += 1

                # Initialize connection with all our satellites
                self.all_connected = True
                for satellite in self.dispatcher.all_daemons_links:
                    if satellite == self.link_to_myself:
                        continue
                    if not satellite.active:
                        continue
                    connected = self.daemon_connection_init(satellite, set_wait_new_conf=True)
                    logger.debug("  %s is %s", satellite, connected)
                    self.all_connected = self.all_connected and connected

                if self.all_connected:
                    logger.info("- satellites connection #%s is ok", first_connection_try_count)
                    break
                else:
                    logger.warning("- satellites connection #%s is not correct; "
                                   "let's give another chance after %d seconds...",
                                   first_connection_try_count,
                                   self.link_to_myself.polling_interval)
                    if first_connection_try_count >= 3:
                        self.request_stop("All the daemons connections could not be established "
                                          "despite %d tries! "
                                          "Sorry, I bail out!" % first_connection_try_count,
                                          exit_code=4)
                    time.sleep(self.link_to_myself.polling_interval)

            # Now I have a connection with all the daemons I need to contact them,
            # check they are alive and ready to run
            _t0 = time.time()
            self.all_connected = self.dispatcher.check_reachable()
            statsmgr.timer('dispatcher.check-alive', time.time() - _t0)

            _t0 = time.time()
            # Preparing the configuration for dispatching
            logger.info("Preparing the configuration for dispatching...")
            self.dispatcher.prepare_dispatch()
            statsmgr.timer('dispatcher.prepare-dispatch', time.time() - _t0)
            logger.info("- configuration is ready to dispatch")

        # Loop for the first configuration dispatching, if the first dispatch fails, bail out!
        # Without a correct configuration, Alignak daemons will not run correctly
        first_dispatch_try_count = 0
        logger.info("Dispatching the configuration to my satellites...")
        while True:
            first_dispatch_try_count += 1

            # Check reachable - if a configuration is prepared, this will force the
            # daemons communication, and the dispatching will be launched
            _t0 = time.time()
            logger.info("- configuration dispatching #%s...", first_dispatch_try_count)
            self.dispatcher.check_reachable(forced=True)
            statsmgr.timer('dispatcher.dispatch', time.time() - _t0)

            # Make a pause to let our satellites get ready...
            pause = max(1, max(self.conf.daemons_dispatch_timeout, len(self.my_daemons) * 0.5))
            # pause = len(self.my_daemons) * 0.2
            logger.info("- pausing %d seconds...", pause)
            time.sleep(pause)

            _t0 = time.time()
            logger.info("- checking configuration dispatch...")
            # Checking the dispatch is accepted
            self.dispatcher.check_dispatch()
            statsmgr.timer('dispatcher.check-dispatch', time.time() - _t0)
            if self.dispatcher.dispatch_ok:
                logger.info("- configuration dispatching #%s is ok", first_dispatch_try_count)
                break
            else:
                logger.warning("- configuration dispatching #%s is not correct; "
                               "let's give another chance...", first_dispatch_try_count)
                if first_dispatch_try_count >= 3:
                    self.request_stop("The configuration could not be dispatched despite %d tries! "
                                      "Sorry, I bail out!" % first_connection_try_count,
                                      exit_code=4)
824560
def get_ht_op(_, data):
    
    protection = ('no', 'nonmember', 20, 'non-HT mixed')
    sta_chan_width = (20, 'any')
    answers = {
        'primary channel': data[0],
        'secondary channel offset': ht_secondary_offset[data[1] & 0x3],
        'STA channel width': sta_chan_width[(data[1] & 0x4) >> 2],
        'RIFS': (data[1] & 0x8) >> 3,
        'HT protection': protection[data[2] & 0x3],
        'non-GF present': (data[2] & 0x4) >> 2,
        'OBSS non-GF present': (data[2] & 0x10) >> 4,
        'dual beacon': (data[4] & 0x40) >> 6,
        'dual CTS protection': (data[4] & 0x80) >> 7,
        'STBC beacon': data[5] & 0x1,
        'L-SIG TXOP Prot': (data[5] & 0x2) >> 1,
        'PCO active': (data[5] & 0x4) >> 2,
        'PCO phase': (data[5] & 0x8) >> 3,
    }
    return answers