Prints out lowest card prices for an application.
    Comma-separated list of application IDs is supported.
501553
def get_card_prices(ctx, currency):
    
    appid = ctx.obj['appid']

    detailed = True

    appids = [appid]
    if ',' in appid:
        appids = [appid.strip() for appid in appid.split(',')]
        detailed = False

    for appid in appids:
        print_card_prices(appid, currency, detailed=detailed)
        click.echo('')
384292
public function getLowestPrice()
    {
        $prices = $this->getPrices();
        $lowest = $prices[0]->value;
        foreach ($prices as $price) {
            if ($price->value < $lowest) {
                $lowest = $price->value;
            }
        }
        return $lowest;
    }
636409
def main(symbol: str):
    
    print("Displaying the balance for", symbol)

    with BookAggregate() as svc:
        security = svc.book.get(Commodity, mnemonic=symbol)
		#security.transactions, security.prices

        sec_svc = SecurityAggregate(svc.book, security)

        # Display number of shares
        shares_no = sec_svc.get_quantity()
        print("Quantity:", shares_no)

        # Calculate average price.
        avg_price = sec_svc.get_avg_price()
        print("Average price:", avg_price)
236860
public String discount(Discount discount) {
        Card card = new Card();
        card.setCardType("DISCOUNT");
        card.setDiscount(discount);

        return createCard(card);
    }
409488
function OptPrint()
    {
        $max = 0;
        foreach (self::$_options as $label => $info) {
            $len = strlen($label) + 1;
            switch ($info['type']) {
            case self::OPT_FLAG:
            case self::OPT_FFLAG:
                break;
            case self::OPT_INT:
            case self::OPT_FINT:
                $len += 9;       /* length of "<integer>" */
                break;
            case self::OPT_DBL:
            case self::OPT_FDBL:
                $len += 6;       /* length of "<real>" */
                break;
            case self::OPT_STR:
            case self::OPT_FSTR:
                $len += 8;       /* length of "<string>" */
                break;
            }
            if ($len > $max) {
                $max = $len;
            }
        }
        foreach (self::$_options as $label => $info) {
            switch ($info['type']) {
            case self::OPT_FLAG:
            case self::OPT_FFLAG:
                echo "  -$label";
                echo str_repeat(' ', $max - strlen($label));
                echo "  $info[message]\n";
                break;
            case self::OPT_INT:
            case self::OPT_FINT:
                echo "  $label=<integer>" . str_repeat(' ', $max - strlen($label) - 9);
                echo "  $info[message]\n";
                break;
            case self::OPT_DBL:
            case self::OPT_FDBL:
                echo "  $label=<real>" . str_repeat(' ', $max - strlen($label) - 6);
                echo "  $info[message]\n";
                break;
            case self::OPT_STR:
            case self::OPT_FSTR:
                echo "  $label=<string>" . str_repeat(' ', $max - strlen($label) - 8);
                echo "  $info[message]\n";
                break;
            }
        }
    }
1368626
public function lowest_rate($carriers=array(), $services=array())
    {
        $lowest_rate = false;
        $carriers_include = array();
        $carriers_exclude = array();
        $services_include = array();
        $services_exclude = array();

        if(!is_array($carriers)) {
            $carriers = explode(',', $carriers);
        }
        for ($a = 0, $b = count($carriers); $a < $b; $a++) {
            $carriers[$a] = trim(strtolower($carriers[$a]));
            if (substr($carriers[$a], 0, 1) == '!') {
                $carriers_exclude[] = substr($carriers[$a], 1);
            } else {
                $carriers_include[] = $carriers[$a];
            }
        }

        if(!is_array($services)) {
            $services = explode(',', $services);
        }
        for ($c = 0, $d = count($services); $c < $d; $c++) {
            $services[$c] = trim(strtolower($services[$c]));
            if (substr($services[$c], 0, 1) == '!') {
                $services_exclude[] = substr($services[$c], 1);
            } else {
                $services_include[] = $services[$c];
            }
        }

        for ($i = 0, $k = count($this->rates); $i < $k; $i++) {
            $rate_carrier = strtolower($this->rates[$i]->carrier);
            if (!empty($carriers_include[0]) && !in_array($rate_carrier, $carriers_include)) {
                continue;
            }
            if (!empty($carriers_exclude[0]) && in_array($rate_carrier, $carriers_exclude)) {
                continue;
            }

            $rate_service = strtolower($this->rates[$i]->service);
            if (!empty($services_include[0]) && !in_array($rate_service, $services_include)) {
                continue;
            }
            if (!empty($services_exclude[0]) && in_array($rate_service, $services_exclude)) {
                continue;
            }

            if (!$lowest_rate || floatval($this->rates[$i]->rate) < floatval($lowest_rate->rate)) {
                $lowest_rate = clone($this->rates[$i]);
            }
        }

        if ($lowest_rate == false) {
            throw new Error('No rates found.');
        }

        return $lowest_rate;
    }
779077
function buildInquirerChoices(cards) {
  return cards.sources.map(source => {
    const _default =
      source.id === cards.defaultSource ? ` ${chalk.bold('(default)')}` : '';
    const id = `${chalk.cyan(`ID: ${source.id}`)}${_default}`;
    const number = `${chalk.gray('#### ').repeat(3)}${source.last4 ||
      source.card.last4}`;
    const str = [
      id,
      indent(source.name || source.owner.name, 2),
      indent(`${source.brand || source.card.brand} ${number}`, 2)
    ].join('\n');

    return {
      name: str, // Will be displayed by Inquirer
      value: source.id, // Will be used to identify the answer
      short: source.id // Will be displayed after the users answers
    };
  });
}
234688
def print_values(self, parameter):
        
        if parameter in self.VALUES:
            self.print_info(u"Available values for parameter '%s':" % parameter)
            self.print_generic(u"\n".join(self.VALUES[parameter]))
            return self.HELP_EXIT_CODE
        if parameter not in [u"?", u""]:
            self.print_error(u"Invalid parameter name '%s'" % parameter)
        self.print_info(u"Parameters for which values can be listed:")
        self.print_generic(u"\n".join(sorted(self.VALUES.keys())))
        return self.HELP_EXIT_CODE
129889
public function toOptionArray() {
        return [
            [
                'value' => self::CARD_VISA,
                'label' => __('Visa')
            ],
            [
                'value' => self::CARD_MASTERCARD,
                'label' => __('Mastercard')
            ],
            [
                'value' => self::CARD_AMEX,
                'label' => __('American Express')
            ],
            [
                'value' => self::CARD_JCB,
                'label' => __('JCB')
            ],
            [
                'value' => self::CARD_DISCOVER,
                'label' => __('Discover')
            ],
        ];
    }
865719
def subscription_pricing_tiers(app_id)
      @subscription_pricing_tiers ||= begin
        r = request(:get, "ra/apps/#{app_id}/iaps/pricing/matrix/recurring")
        data = parse_response(r, "data")["pricingTiers"]
        data.map { |tier| Spaceship::Tunes::IAPSubscriptionPricingTier.factory(tier) }
      end
    end
662875
def print_options(self):
        
        summary = []
        for opt_name, opt in self.options.items():
            if opt.hidden:
                continue
            summary.append(opt.summary())
        print("\n".join(summary))
642566
protected final void printApplicationInfo(final String applicationName) {
        final StringBuilder bldr = new StringBuilder();
        bldr.append("\n");
        bldr.append(BELFrameworkVersion.VERSION_LABEL).append(": ")
                .append(applicationName).append("\n");
        bldr.append("Copyright (c) 2011-2012, Selventa. All Rights Reserved.\n");
        bldr.append("\n");
        reportable.output(bldr.toString());
    }
229700
def price_range
      prices = variants.collect(&:price).collect(&:to_f)
      format =  "%0.2f"
      if prices.min != prices.max
        "#{format % prices.min} - #{format % prices.max}"
      else
        format % prices.min
      end
    end
476091
def _get_price(self, package):
        """"""

        for price in package['prices']:
            if not price.get('locationGroupId'):
                return price['id']

        raise SoftLayer.SoftLayerError("Could not find valid price")
1304822
def pricing(sort='cost', **kwargs):
    '''
    
    '''
    for name, provider in env.providers.items():
        print name
        provider.pricing(sort, **kwargs)
        print
264267
def _print_installed_apps(self, controller):
        
        print('\nInstalled Sprockets %s Apps\n' % controller.upper())
        print("{0:<25} {1:>25}".format('Name', 'Module'))
        print(string.ljust('', 51, '-'))
        for app in self._get_applications(controller):
            print('{0:<25} {1:>25}'.format(app.name, '(%s)' % app.module_name))
        print('')
556659
def print_(rows, limit=15, sort='size', order='descending'):
    
    localrows = []
    for row in rows:
        localrows.append(list(row))
    # input validation
    sortby = ['type', '#', 'size']
    if sort not in sortby:
        raise ValueError("invalid sort, should be one of" + str(sortby))
    orders = ['ascending', 'descending']
    if order not in orders:
        raise ValueError("invalid order, should be one of" + str(orders))
    # sort rows
    if sortby.index(sort) == 0:
        if order == "ascending":
            localrows.sort(key=lambda x: _repr(x[0]))
        elif order == "descending":
            localrows.sort(key=lambda x: _repr(x[0]), reverse=True)
    else:
        if order == "ascending":
            localrows.sort(key=lambda x: x[sortby.index(sort)])
        elif order == "descending":
            localrows.sort(key=lambda x: x[sortby.index(sort)], reverse=True)
    # limit rows
    localrows = localrows[0:limit]
    for row in localrows:
        row[2] = stringutils.pp(row[2])
    # print rows
    localrows.insert(0,["types", "# objects", "total size"])
    _print_table(localrows)