List available reserved capacity plans
199656
def get_create_options(self):
        """"""
        mask = "mask[attributes,prices[pricingLocationGroup]]"
        results = self.ordering_manager.list_items(self.capacity_package, mask=mask)
        return results
346938
def list_available_providers(self):
        
        providers = []

        if self.alternative_config_dir:
            for f in os.listdir(os.path.join(self.alternative_config_dir, self.CLOUD_PROVIDERS_DIR)):
                if os.path.splitext(f)[1] in ['.conf', '.json']:
                    try:
                        n = os.path.join(self.alternative_config_dir, self.CLOUD_PROVIDERS_DIR, f)
                        providers.append(ServiceProviderConfiguration(n))
                    except ControllerConfigurationException:
                        pass


        for f in os.listdir(os.path.join(self.default_config_dir, self.CLOUD_PROVIDERS_DIR)):
            if os.path.splitext(f)[1] in ['.conf', '.json']:
                try:
                    n = os.path.join(self.default_config_dir, self.CLOUD_PROVIDERS_DIR, f)
                    providers.append(ServiceProviderConfiguration(n))
                except ControllerConfigurationException:
                    pass

        return providers
120801
private int reservePondLife(boolean available)
        throws Exception
    {
        int id=-1;
        synchronized(this)
        {
            id=_index[_size++];
            if (available)
                _index[_available++]=id;
        }
        return id;
    }
755095
public java.util.List<ReservedInstancesListing> getReservedInstancesListings() {
        if (reservedInstancesListings == null) {
            reservedInstancesListings = new com.amazonaws.internal.SdkInternalList<ReservedInstancesListing>();
        }
        return reservedInstancesListings;
    }
188533
def checkIfAvailable(self, dateTime=timezone.now()):
        '''
        
        '''
        return (
            self.startTime >= dateTime + timedelta(days=getConstant('privateLessons__closeBookingDays')) and
            self.startTime <= dateTime + timedelta(days=getConstant('privateLessons__openBookingDays')) and not
            self.eventRegistration and (
                self.status == self.SlotStatus.available or (
                    self.status == self.SlotStatus.tentative and
                    getattr(getattr(self.temporaryEventRegistration,'registration',None),'expirationDate',timezone.now()) <= timezone.now()
                )
            )
        )
1141538
def reserve(ctx, amount, symbol, account):
    
    print_tx(
        ctx.bitshares.reserve(
            Amount(amount, symbol, bitshares_instance=ctx.bitshares), account=account
        )
    )
264506
def avail(df):
    """"""
    avail = DataFrame(
        {
            "start": df.apply(lambda col: col.first_valid_index()),
            "end": df.apply(lambda col: col.last_valid_index()),
        }
    )
    return avail[["start", "end"]]
1130
def list_available(cls) -> List[str]:
        """"""
        keys = list(Registrable._registry[cls].keys())
        default = cls.default_implementation

        if default is None:
            return keys
        elif default not in keys:
            message = "Default implementation %s is not registered" % default
            raise ConfigurationError(message)
        else:
            return [default] + [k for k in keys if k != default]
243302
def _set_available_combinations(self):
        
        available = set()
        combinations_map = {}

        whitelist = None
        if self.output_combinations:
            whitelist = self.output_combinations.split("|")

        self.max_width = 0
        for output in range(len(self.layout["connected"])):
            for comb in combinations(self.layout["connected"], output + 1):
                for mode in ["clone", "extend"]:
                    string = self._get_string_and_set_width(comb, mode)
                    if whitelist and string not in whitelist:
                        continue
                    if len(comb) == 1:
                        combinations_map[string] = (comb, None)
                    else:
                        combinations_map[string] = (comb, mode)
                    available.add(string)

        # Preserve the order in which user defined the output combinations
        if whitelist:
            available = reversed([comb for comb in whitelist if comb in available])

        self.available_combinations = deque(available)
        self.combinations_map = combinations_map
793216
def avail_sizes(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_sizes function must be called with '
            '-f or --function, or with the --list-sizes option'
        )

    rcode, items = query(command='my/packages')
    if rcode not in VALID_RESPONSE_CODES:
        return {}
    return key_list(items=items)
757670
def reservations(self):
        """"""
        command = [SINFO, '--reservation']
        output = subprocess.check_output(command, env=SINFO_ENV)
        output = output.decode()
        it = iter(output.splitlines())
        next(it)
        for line in it:
            rsv = Reservation.from_sinfo(line)
            yield rsv.name, rsv
457190
def reserve(self, force=False):
        

        p_reservation = self.get_attribute('p_reservation')
        if p_reservation == 'RESERVED_BY_YOU':
            return
        elif p_reservation == 'RESERVED_BY_OTHER' and not force:
            raise TgnError('Port {} reserved by {}'.format(self, self.get_attribute('p_reservedby')))
        self.relinquish()
        self.send_command('p_reservation', 'reserve')
564669
private int available()
  {
    long sent = sent();
    
    int available = Math.max(0, (int) (_creditsIn - sent));
    
    available = Math.min(available, _queue.remainingCapacity());
    
    if (available <= 0) {
      outFull();
    }

    return available;
  }
1095750
def available(name):
    '''
    
    '''
    (enabled_services, disabled_services) = _get_service_list(include_enabled=True,
                                                              include_disabled=True)
    return name in enabled_services or name in disabled_services
393381
def avail_sizes(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudException(
            'The avail_locations function must be called with -f or --function.'
        )

    response = _query('avail', 'LinodePlans')

    ret = {}
    for item in response['DATA']:
        name = item['LABEL']
        ret[name] = item

    return ret
206150
def cli(env, name, backend_router_id, flavor, instances, test=False):
    
    manager = CapacityManager(env.client)

    result = manager.create(
        name=name,
        backend_router_id=backend_router_id,
        flavor=flavor,
        instances=instances,
        test=test)
    if test:
        table = formatting.Table(['Name', 'Value'], "Test Order")
        container = result['orderContainers'][0]
        table.add_row(['Name', container['name']])
        table.add_row(['Location', container['locationObject']['longName']])
        for price in container['prices']:
            table.add_row(['Contract', price['item']['description']])
        table.add_row(['Hourly Total', result['postTaxRecurring']])
    else:
        table = formatting.Table(['Name', 'Value'], "Reciept")
        table.add_row(['Order Date', result['orderDate']])
        table.add_row(['Order ID', result['orderId']])
        table.add_row(['status', result['placedOrder']['status']])
        table.add_row(['Hourly Total', result['orderDetails']['postTaxRecurring']])
    env.fout(table)
907542
def per_core_reservation():
    
    per_core = apply_bparams(per_core_reserve_from_stream)
    if per_core:
        if per_core.upper() == "Y":
            return True
        else:
            return False

    per_core = apply_lsadmin(per_core_reserve_from_stream)
    if per_core:
        if per_core.upper() == "Y":
            return True
        else:
            return False

    per_core = apply_conf_file(per_core_reserve_from_stream, LSB_PARAMS_FILENAME)
    if per_core and per_core.upper() == "Y":
        return True
    else:
        return False
    return False