Get an instance of block rule services facade.
19384
def create_rule(self):
        """"""
        return BlockRule(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
454142
private static RuleController getRule(String baseUri, UnitRequest controllerRequest, TransactionalNotifyHandler handler) {
        if (ruleMap == null) {
            synchronized (LOCK_FOR_LAZY_INITIALIZATION) {
                if (ruleMap == null) {
                    loadRules();
                }
            }
        }
        try {
            if (ruleMap.get(baseUri) != null) {
                Constructor<? extends RuleController> constructor = ruleMap.get(baseUri).getConstructor();
                //rule controller is stateful, so we need to create new instance for each request.
                RuleController controller = constructor.newInstance();
                controller.setHandler(handler.setTransactional(controller.isTransactional()));
                controller.setControllerRequest(controllerRequest);
                LOG.debug("rule found: " + controller.getClass() + " for uri " + baseUri);
                return controller;
            }
            LOG.debug("rule controller not mapped:" + baseUri);
            return null;
        } catch (Throwable e) {
            throw new RuntimeException("error while mapping rule controller for uri " + baseUri, e);
        }
    }
1317642
def get_all_rules(cls):
        ""
        from adblockparser import AdblockRules
        
        raw_rules = []
        for url in [
            config.ADBLOCK_EASYLIST_URL, config.ADBLOCK_EXTRALIST_URL]:
            raw_rules.extend(cls.load_raw_rules(url))

        rules = AdblockRules(raw_rules)
        return rules
1106332
def _load(self, **kwargs):
        """"""

        if self._check_existence_by_collection(
                self._meta_data['container'], kwargs['name']):
            return super(Rules, self)._load(**kwargs)
        msg = 'The rule named, {}, does not exist on the device.'.format(
            kwargs['name'])
        raise NonExtantPolicyRule(msg)
1056071
static BlockCanaryInternals getInstance() {
        if (sInstance == null) {
            synchronized (BlockCanaryInternals.class) {
                if (sInstance == null) {
                    sInstance = new BlockCanaryInternals();
                }
            }
        }
        return sInstance;
    }
696619
def construct_xblock(self, block_type, scope_ids, field_data=None, *args, **kwargs):
        
        """
        return self.construct_xblock_from_class(
            cls=self.load_block_type(block_type),
            scope_ids=scope_ids,
            field_data=field_data,
            *args, **kwargs
        )
96124
def construct_xblock_from_class(self, cls, scope_ids, field_data=None, *args, **kwargs):
        
        return self.mixologist.mix(cls)(
            runtime=self,
            field_data=field_data,
            scope_ids=scope_ids,
            *args, **kwargs
        )
536294
def get_random_service(
        service_registry: ServiceRegistry,
        block_identifier: BlockSpecification,
) -> Tuple[Optional[str], Optional[str]]:
    
    count = service_registry.service_count(block_identifier=block_identifier)
    if count == 0:
        return None, None
    index = random.SystemRandom().randint(0, count - 1)
    address = service_registry.get_service_address(
        block_identifier=block_identifier,
        index=index,
    )
    # We are using the same blockhash for both blockchain queries so the address
    # should exist for this query. Additionally at the moment there is no way for
    # services to be removed from the registry.
    assert address, 'address should exist for this index'
    url = service_registry.get_service_url(
        block_identifier=block_identifier,
        service_hex_address=address,
    )
    return url, address
235092
public function getService($block)
    {
        $blockType = ($block instanceof BlockInterface) ? $block->getBlockType() : $block;
        if (!isset($this->services[$blockType])) {
            throw new \Exception(sprintf("No BlockService available by the alias %s, available: %s", $blockType, implode(', ', array_keys($this->services))));
        }

        return $this->services[$blockType];
    }
562744
public Block getBlock(String sqlquery, Collection queryParams, int startIndex, int count) {
		return blockStrategy.getBlock(sqlquery, queryParams, startIndex, count);
	}
571276
public Block getBlock(BigInteger blockNumber)
    {
        return EtherObjectConverterUtil.convertEtherBlockToKunderaBlock(client.getBlock(blockNumber, false), false);
    }
16942
def _get_instance(project_id, instance_zone, name, service):
    '''
    
    '''
    return service.instances().get(project=project_id,
                                   zone=instance_zone,
                                   instance=name).execute()
1327795
def get(self, block_id):
        

        pool = current_app.config['bigchain_pool']

        with pool() as bigchain:
            block = bigchain.get_block(block_id=block_id)

        if not block:
            return make_error(404)

        return block
1050871
def get_scheduling_block(sub_array_id, block_id):
    """"""
    block_ids = DB.get_sub_array_sbi_ids(sub_array_id)
    if block_id in block_ids:
        block = DB.get_block_details([block_id]).__next__()
        return block, HTTPStatus.OK

    return dict(error="unknown id"), HTTPStatus.NOT_FOUND
881561
public RuleEnvelope getRule(String ruleId) throws ApiException {
        ApiResponse<RuleEnvelope> resp = getRuleWithHttpInfo(ruleId);
        return resp.getData();
    }
918659
def get_blocks_this_year(self):
        """"""

        date_start, date_end = get_date_range_this_year()

        return EighthBlock.objects.filter(date__gte=date_start, date__lte=date_end)
973848
public function getBlockFilter(BlockInterface $block)
    {
        $type = $block->getType();

        $name = isset($this->blockFilters[$type]) ? $this->blockFilters[$type] : $this->defaultFilter;
        $service = $this->getFilterService($name);

        if (!$service instanceof FilterInterface) {
            throw new \RuntimeException(sprintf('The service "%s" is not an exception filter', $name));
        }

        return $service;
    }