Get price options to create a load balancer with.
519547
def cli(env):
    """"""

    mgr = SoftLayer.LoadBalancerManager(env.client)

    table = formatting.Table(['price_id', 'capacity', 'description', 'price'])

    table.sortby = 'price'
    table.align['price'] = 'r'
    table.align['capacity'] = 'r'
    table.align['id'] = 'r'

    packages = mgr.get_lb_pkgs()

    for package in packages:
        table.add_row([
            package['prices'][0]['id'],
            package.get('capacity'),
            package['description'],
            '%.2f' % float(package['prices'][0]['recurringFee'])
        ])

    env.fout(table)
985378
def calculateOptionPrice(self, reqId, contract, volatility, underPrice):
        """"""
        return _swigibpy.EClient_calculateOptionPrice(self, reqId, contract, volatility, underPrice)
333721
def collection_get_options(collection_name, **kwargs):
    '''
    
    '''

    cluster = cluster_status(**kwargs)

    options = {
        "collection.configName": cluster["collections"][collection_name]["configName"],
        "router.name": cluster["collections"][collection_name]["router"]["name"],
        "replicationFactor": int(cluster["collections"][collection_name]["replicationFactor"]),
        "maxShardsPerNode": int(cluster["collections"][collection_name]["maxShardsPerNode"]),
        "autoAddReplicas": cluster["collections"][collection_name]["autoAddReplicas"] is True
    }

    if 'rule' in cluster["collections"][collection_name]:
        options['rule'] = cluster["collections"][collection_name]['rule']
    if 'snitch' in cluster["collections"][collection_name]:
        options['snitch'] = cluster["collections"][collection_name]['rule']

    return options
480666
def get_price(item):
    """"""
    the_price = "No Default Pricing"
    for price in item.get('prices', []):
        if not price.get('locationGroupId'):
            the_price = "%0.4f" % float(price['hourlyRecurringFee'])
    return the_price
1213355
def format_load_balancer_configuration(result):
    '''
    
    '''
    from collections import OrderedDict
    # Only display parameters that have content
    order_dict = OrderedDict()
    if result.private_ip_address is not None:
        order_dict['privateIpAddress'] = format_private_ip_address(result.private_ip_address)
    if result.public_ip_address_resource_id is not None:
        order_dict['publicIpAddressResourceId'] = result.public_ip_address_resource_id
    if result.load_balancer_resource_id is not None:
        order_dict['loadBalancerResourceId'] = result.load_balancer_resource_id
    if result.probe_port is not None:
        order_dict['probePort'] = result.probe_port
    if result.sql_virtual_machine_instances is not None:
        order_dict['sqlVirtualMachineInstances'] = result.sql_virtual_machine_instances

    return order_dict
226357
def create_pool(lb, name, method='ROUND_ROBIN'):
    '''
    
    '''
    if __opts__['load_balancers'].get(lb, None):
        (username, password) = list(__opts__['load_balancers'][lb].values())
    else:
        raise Exception('Unable to find `{0}` load balancer'.format(lb))
    F5 = F5Mgmt(lb, username, password)
    F5.create_pool(name, method)
    return True
723940
function getChoices() {
    // First, retrieve possible values for the api-identifiers parameter
    return {
      httpMethod: plugin.httpMethods,
      auth: [
        { value: 'none', name: 'None' },
        { value: 'aws_iam', name: 'AWS authorization' }
      ],
      integration: [
        { value: 'lambda', name: 'Lambda function' },
        { value: 'lambda-proxy', name: 'Lambda function with proxy integration' },
        { value: 'http', name: 'Existing HTTP endpoint' },
        { value: 'mock', name: 'Mock' },
        { value: 'aws-service', name: 'AWS service' }
      ],
      apis: () => {
        return plugin.loadApis()
        .then(apis => {
          return _.map(apis, api => {
            return {
              value: api.getIdentifier(),
              name: icli.format.info(api.getIdentifier()) + (api.spec.info && api.spec.info.title ? ' - ' + api.spec.info.title : '')
            };
          });
        });
      },
      roleOrigins: () => {
        if (plugin.myrmex.isPluginRegistered('iam')) {
          const choices = [];
          choices.push({
            value: 'myrmex',
            name: 'Select a role managed by the plugin @myrmex/iam'
          });
          choices.push({
            value: 'aws',
            name: 'Select a role in your AWS account'
          });
          choices.push({
            value: '',
            name: 'Enter the value manually'
          });
          return choices;
        }
        return [];
      },
      roles: (answers) => {
        if (answers && answers.roleOrigin === 'aws') {
          return plugin.myrmex.call('iam:getAWSRoles', [])
          .then(roles => {
            const eligibleRoles = [];
            _.forEach(roles, role => {
              const trustRelationship = JSON.parse(decodeURIComponent(role.AssumeRolePolicyDocument))
              if (_.find(trustRelationship.Statement, (o) => { return o.Principal.Service === 'apigateway.amazonaws.com'; })) {
                eligibleRoles.push({
                  value: role.RoleName,
                  name: icli.format.info(role.RoleName)
                });
              }
            });
            return eligibleRoles;
          });
        } else {
          return plugin.myrmex.call('iam:getRoles', [])
          .then(roles => {
            const eligibleRoles = [];
            _.forEach(roles, role => {
              if (_.find(role.config['trust-relationship'].Statement, (o) => { return o.Principal.Service === 'apigateway.amazonaws.com'; })) {
                eligibleRoles.push({
                  value: role.getName(),
                  name: icli.format.info(role.getName())
                });
              }
            });
            return eligibleRoles;
          });
        }
      }
    };
  }
672647
def _get_options(raw_options, apply_config):
    """"""
    if not raw_options:
        return parse_args([''], apply_config=apply_config)

    if isinstance(raw_options, dict):
        options = parse_args([''], apply_config=apply_config)
        for name, value in raw_options.items():
            if not hasattr(options, name):
                raise ValueError("No such option '{}'".format(name))

            # Check for very basic type errors.
            expected_type = type(getattr(options, name))
            if not isinstance(expected_type, (str, unicode)):
                if isinstance(value, (str, unicode)):
                    raise ValueError(
                        "Option '{}' should not be a string".format(name))
            setattr(options, name, value)
    else:
        options = raw_options

    return options
321253
def get_options():
    """"""
    options = collections.defaultdict(list)
    for opt_class in config_factory.get_options():
        if not issubclass(opt_class, config_base.Options):
            continue
        config_options = opt_class(None)
        options[config_options.group_name].extend(config_options.list())
    return [(key, value) for key, value in options.items()]
837055
def get_options(self):
        
        args = self.parse_options(self.args)

        if args:
            self.directory = args[0]

        if self.develop:
            self.skiptag = True
        if not self.develop:
            self.develop = self.defaults.develop
        if not self.develop:
            self.infoflags = self.setuptools.infoflags

        if not self.formats:
            self.formats = self.defaults.formats

        for format in self.formats:
            if format == 'zip':
                self.distributions.append(('sdist', ['--formats="zip"']))
            elif format == 'gztar':
                self.distributions.append(('sdist', ['--formats="gztar"']))
            elif format == 'egg':
                self.distributions.append(('bdist', ['--formats="egg"']))
            elif format == 'wheel':
                self.distributions.append(('bdist_wheel', []))

        if not self.distributions:
            self.distributions.append(('sdist', ['--formats="zip"']))

        if self.list:
            self.list_locations()

        if not self.locations:
            self.locations.extend(self.locations.get_default_location())

        if not (self.skipregister and self.skipupload):
            if not (self.get_skipregister() and self.get_skipupload()):
                self.locations.check_empty_locations()
            self.locations.check_valid_locations()

        if len(args) > 1:
            if self.urlparser.is_url(self.directory):
                self.branch = args[1]
            elif self.urlparser.is_ssh_url(self.directory):
                self.branch = args[1]
            else:
                err_exit('mkrelease: invalid arguments\n%s' % USAGE)

        if len(args) > 2:
            err_exit('mkrelease: too many arguments\n%s' % USAGE)
103181
def get_rate_limits():
    """"""
    client = get_rates_api()

    with catch_raise_api_exception():
        data, _, headers = client.rates_limits_list_with_http_info()

    ratelimits.maybe_rate_limit(client, headers)

    return {
        k: RateLimitsInfo.from_dict(v)
        for k, v in six.iteritems(data.to_dict().get("resources", {}))
    }
492201
private function loadOptionsFromCache() 
    {
        $cache = $this->getEndpointsCache();

        if ($cache === null) {
            return;
        }
        
        $endpoints = $cache->get($this->_values[self::OPTION_MEMCACHED_ENDPOINTS_KEY]);
        if ($endpoints) {
            $this->_values[self::OPTION_ENDPOINT] = $endpoints;
            if (!is_array($this->_values[self::OPTION_ENDPOINT])) {
                $this->_values[self::OPTION_ENDPOINT] = [ $this->_values[self::OPTION_ENDPOINT] ];
            }
        }
    }
478731
public java.util.List<Integer> getLoadBalancerPorts() {
        if (loadBalancerPorts == null) {
            loadBalancerPorts = new com.amazonaws.internal.SdkInternalList<Integer>();
        }
        return loadBalancerPorts;
    }
179154
def load_balancers_list_all(**kwargs):
    '''
    

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        load_balancers = __utils__['azurearm.paged_object_to_list'](netconn.load_balancers.list_all())

        for load_balancer in load_balancers:
            result[load_balancer['name']] = load_balancer
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
1314675
def create_vs(lb, name, ip, port, protocol, profile, pool_name):
    '''
    
    '''
    if __opts__['load_balancers'].get(lb, None):
        (username, password) = list(__opts__['load_balancers'][lb].values())
    else:
        raise Exception('Unable to find `{0}` load balancer'.format(lb))

    F5 = F5Mgmt(lb, username, password)
    F5.create_vs(name, ip, port, protocol, profile, pool_name)
    return True
289192
def PriceHourly(self):
		

		units = self.PriceUnits()

		return(units['cpu']*self.cpu+units['memory']*self.memory+units['storage']*self.storage+units['managed_os'])
988890
def get_price(self, **kwargs):
        
        def fmt_p(out):
            return pd.DataFrame(out, index=self.symbols)

        return self._get_endpoint("price", fmt_p=fmt_p, params=kwargs)