Returns the appropriate config block from the machines config.
 Also adds the following unless otherwise specified:
 :region, :zone, :environment, :role, :position
339919
def fetch_script_config
      sconf = fetch_machine_param :config
      sconf ||= {}
      extras = {
        :region => @@global.region,
        :zone => @@global.zone,
        :environment => @@global.environment,
        :role => @@global.role,
        :position => @@global.position
      }
      sconf.merge! extras
      sconf
    end
542673
def get_config(self):
        ''
        return (self.bus.read_byte_data(self.address, self.CONTROL_PORT0), self.bus.read_byte_data(self.address, self.CONTROL_PORT1));
541106
def _rule_block(self):
        

        name = self._get_token(self.RE_NAME)
        self._expect_token('{')

        # consume additional options if available
        options = []
        while self._lookahead_token() != '}':
            options.append(self._rule_option())

        self._expect_token('}')
        return [name, options]
1198556
def settings_get(self, block_id, settings):
        ''''''

        block = self._get_blocks([block_id.hex()])[0]

        block_header = BlockHeader()
        block_header.ParseFromString(block.header)

        try:
            settings_view = self._settings_view_factory.create_settings_view(
                block_header.state_root_hash)
        except KeyError:
            LOGGER.error(
                'Settings from block %s requested, but root hash %s was '
                'missing. Returning no setting values.',
                block_id.hex(),
                block_header.state_root_hash)
            # The state root does not exist, which may indicate a pruned root
            # from a dropped fork or an invalid state.
            return []

        result = []
        for setting in settings:
            try:
                value = settings_view.get_setting(setting)
            except KeyError:
                # if the key is missing, leave it out of the response
                continue

            result.append((setting, value))

        return result
673024
def get_default_config(self):
        
        config = super(DiskSpaceCollector, self).get_default_config()
        config.update({
            'path': 'diskspace',
            # filesystems to examine
            'filesystems': 'ext2, ext3, ext4, xfs, glusterfs, nfs, nfs4, ' +
                           ' ntfs, hfs, fat32, fat16, btrfs',

            # exclude_filters
            #   A list of regex patterns
            #   A filesystem matching any of these patterns will be excluded
            #   from disk space metrics collection.
            #
            # Examples:
            #       exclude_filters =,
            # no exclude filters at all
            #       exclude_filters = ^/boot, ^/mnt
            # exclude everything that begins /boot or /mnt
            #       exclude_filters = m,
            # exclude everything that includes the letter "m"
            'exclude_filters': ['^/export/home'],

            # Default numeric output
            'byte_unit': ['byte']
        })
        return config
13132
def get_config(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    if not conn:
        return None
    try:
        cc = conn.describe_cache_clusters(name,
                                          show_cache_node_info=True)
    except boto.exception.BotoServerError as e:
        msg = 'Failed to get config for cache cluster {0}.'.format(name)
        log.error(msg)
        log.debug(e)
        return {}
    cc = cc['DescribeCacheClustersResponse']['DescribeCacheClustersResult']
    cc = cc['CacheClusters'][0]
    ret = odict.OrderedDict()
    attrs = ['engine', 'cache_parameter_group', 'cache_cluster_id',
             'cache_security_groups', 'replication_group_id',
             'auto_minor_version_upgrade', 'num_cache_nodes',
             'preferred_availability_zone', 'security_groups',
             'cache_subnet_group_name', 'engine_version', 'cache_node_type',
             'notification_configuration', 'preferred_maintenance_window',
             'configuration_endpoint', 'cache_cluster_status', 'cache_nodes']
    for key, val in six.iteritems(cc):
        _key = boto.utils.pythonize_name(key)
        if _key not in attrs:
            continue
        if _key == 'cache_parameter_group':
            if val:
                ret[_key] = val['CacheParameterGroupName']
            else:
                ret[_key] = None
        elif _key == 'cache_nodes':
            if val:
                ret[_key] = [k for k in val]
            else:
                ret[_key] = []
        elif _key == 'cache_security_groups':
            if val:
                ret[_key] = [k['CacheSecurityGroupName'] for k in val]
            else:
                ret[_key] = []
        elif _key == 'configuration_endpoint':
            if val:
                ret['port'] = val['Port']
                ret['address'] = val['Address']
            else:
                ret['port'] = None
                ret['address'] = None
        elif _key == 'notification_configuration':
            if val:
                ret['notification_topic_arn'] = val['TopicArn']
            else:
                ret['notification_topic_arn'] = None
        else:
            ret[_key] = val
    return ret
123522
def area_for_roles(*user_roles, &block)
      options = last_option(user_roles)

      return area(&block) if user_roles.empty?
      
      not_for_roles(user_roles, &block) if user_roles.first == false
      
      for_roles user_roles do
        area(options, &block)
      end
    end
1200387
public static function config($config_block)
    {
        if (!empty(self::$config)) {
            return self::$config[$config_block];
        }

        $config_file = "database.php";
        $path = __DIR__ . "/../config/" .$config_file;

        $env =  (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : '');

        if ($config_block == "default" && $env) {
            $config_block = $env;
        }

        if (file_exists($path)) {
            $config = (include $path);
            if (isset($config[$config_block])) {
                return $config[$config_block];
            } else {
                throw new \Exception("Database config section '{$config_block}' not exists.");
            }

            return $config['default'];
        } else {
            throw new \Exception("Database config not found.");
        }

    }
285349
private Block getConfigurationBlock() throws TransactionException {

        logger.debug(format("getConfigurationBlock for channel %s", name));

        try {
            Orderer orderer = getRandomOrderer();

            long lastConfigIndex = getLastConfigIndex(orderer);

            logger.debug(format("Last config index is %d", lastConfigIndex));

            Block configBlock = getBlockByNumber(lastConfigIndex);

            //Little extra parsing but make sure this really is a config block for this channel.
            Envelope envelopeRet = Envelope.parseFrom(configBlock.getData().getData(0));
            Payload payload = Payload.parseFrom(envelopeRet.getPayload());
            ChannelHeader channelHeader = ChannelHeader.parseFrom(payload.getHeader().getChannelHeader());
            if (channelHeader.getType() != HeaderType.CONFIG.getNumber()) {
                throw new TransactionException(format("Bad last configuration block type %d, expected %d",
                        channelHeader.getType(), HeaderType.CONFIG.getNumber()));
            }

            if (!name.equals(channelHeader.getChannelId())) {
                throw new TransactionException(format("Bad last configuration block channel id %s, expected %s",
                        channelHeader.getChannelId(), name));
            }

            if (null != diagnosticFileDumper) {
                logger.trace(format("Channel %s getConfigurationBlock returned %s", name,
                        diagnosticFileDumper.createDiagnosticFile(String.valueOf(configBlock).getBytes())));
            }

            if (!logger.isTraceEnabled()) {
                logger.debug(format("Channel %s getConfigurationBlock returned", name));
            }

            return configBlock;

        } catch (TransactionException e) {
            logger.error(e.getMessage(), e);
            throw e;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            throw new TransactionException(e);
        }
    }
262442
def block_perms(self):
        
        if not self._block_perms:
            self._block_perms = permutation_to_block_permutations(
                self.permutation)
        return self._block_perms
975488
def _parse_config(self):
        
        config = self.get_block('mlag configuration')
        cfg = dict()
        cfg.update(self._parse_domain_id(config))
        cfg.update(self._parse_local_interface(config))
        cfg.update(self._parse_peer_address(config))
        cfg.update(self._parse_peer_link(config))
        cfg.update(self._parse_shutdown(config))
        return dict(config=cfg)
1146396
def get_config(self):
        
        config = super(MaxBoltzmannQPolicy, self).get_config()
        config['eps'] = self.eps
        config['tau'] = self.tau
        config['clip'] = self.clip
        return config
173962
def get_roles(self):
        

        machines = self.c_resources["machines"]
        result = {}
        for desc in machines:
            roles = utils.get_roles_as_list(desc)
            hosts = self._denormalize(desc)
            for role in roles:
                result.setdefault(role, [])
                result[role].extend(hosts)
        return result
88923
def known_machine_group?
      raise NoConfig unless @@config
      return true if default_machine_group?
      raise NoMachinesConfig unless @@config.machines
      return false if !@@config && !@@global
      zon, env, rol = @@global.zone, @@global.environment, @@global.role
      conf = @@config.machines.find_deferred(@@global.region, zon, [env, rol])
      conf ||= @@config.machines.find_deferred(zon, [env, rol])
      !conf.nil?
    end
16873
def _scheduling_block_config(num_blocks=5, start_sbi_id=0, start_pb_id=0,
                             project='sip'):
    """"""
    pb_id = start_pb_id
    for sb_id, sbi_id in _scheduling_block_ids(num_blocks, start_sbi_id,
                                               project):
        sub_array_id = 'subarray-{:02d}'.format(random.choice(range(5)))
        config = dict(id=sbi_id,
                      sched_block_id=sb_id,
                      sub_array_id=sub_array_id,
                      processing_blocks=_generate_processing_blocks(pb_id))
        pb_id += len(config['processing_blocks'])
        yield config
655249
def config(*args, **kwargs, &block)
      if block
        configuration_builder.config(*args, **kwargs, &block)
      else
        configuration_builder.config(*args, **kwargs)
      end
    end
314686
def yaml_block(self):
        
        if LOAD_YAML and self._yaml_block is not None:
            try:
                yaml_dict = yaml.load(self._yaml_block)
                return yaml_dict
            except yaml.error.YAMLError:
                print("Error parsing yaml block. Check formatting.")
        return None