text stringlengths 0 828 |
|---|
# print |
# 'A'+`state_a.id`+','+`i`+':'+read_a+' |
# A'+`j`+','+`state_b.id` |
found = 1 |
if found == 0: |
print ""ERROR: symbol "" + repr(state_a.sym) \ |
+ "". It was not found anywhere in the graph.""" |
1783,"def get_rules(self, optimized): |
"""""" |
Args: |
optimized (bool): Enable or Disable optimization - Do not produce O(n^3) |
Return: |
list: The CFG rules |
"""""" |
self.insert_start_to_accepting() |
# If CFG is not requested, avoid the following O(n^3) rule. |
# It can be solved and a string can be generated faster with BFS of DFS |
if optimized == 0: |
self.insert_self_to_empty_and_insert_all_intemediate(optimized) |
self.insert_symbol_pushpop() |
return self.rules" |
1784,"def provision(self, instance_id: str, service_details: ProvisionDetails, async_allowed: bool) -> ProvisionedServiceSpec: |
""""""Provision the new instance |
see openbrokerapi documentation |
Returns: |
ProvisionedServiceSpec |
"""""" |
if service_details.plan_id == self._backend.config.UUID_PLANS_EXISTING_CLUSTER: |
# Provision the instance on an Existing Atlas Cluster |
# Find or create the instance |
instance = self._backend.find(instance_id) |
# Create the instance if needed |
return self._backend.create(instance, service_details.parameters, existing=True) |
# Plan not supported |
raise ErrPlanUnsupported(service_details.plan_id)" |
1785,"def unbind(self, instance_id: str, binding_id: str, details: UnbindDetails): |
""""""Unbinding the instance |
see openbrokerapi documentation |
Raises: |
ErrBindingDoesNotExist: Binding does not exist. |
"""""" |
# Find the instance |
instance = self._backend.find(instance_id) |
# Find the binding |
binding = self._backend.find(binding_id, instance) |
if not binding.isProvisioned(): |
# The binding does not exist |
raise ErrBindingDoesNotExist() |
# Delete the binding |
self._backend.unbind(binding)" |
1786,"def bind(self, instance_id: str, binding_id: str, details: BindDetails) -> Binding: |
""""""Binding the instance |
see openbrokerapi documentation |
"""""" |
# Find the instance |
instance = self._backend.find(instance_id) |
# Find or create the binding |
binding = self._backend.find(binding_id, instance) |
# Create the binding if needed |
return self._backend.bind(binding, details.parameters)" |
1787,"def deprovision(self, instance_id: str, details: DeprovisionDetails, async_allowed: bool) -> DeprovisionServiceSpec: |
""""""Deprovision an instance |
see openbrokerapi documentation |
Raises: |
ErrInstanceDoesNotExist: Instance does not exist. |
"""""" |
# Find the instance |
instance = self._backend.find(instance_id) |
if not instance.isProvisioned(): |
# the instance does not exist |
raise ErrInstanceDoesNotExist() |
return self._backend.delete(instance)" |
1788,"def _ddns(self, ip): |
"""""" |
curl -X POST https://dnsapi.cn/Record.Ddns -d 'login_token=LOGIN_TOKEN&format=json&domain_id=2317346&record_id=16894439&record_line=默认&sub_domain=www' |
:return: |
"""""" |
headers = {""Accept"": ""text/json"", ""User-Agent"": ""ddns/0.1.0 (imaguowei@gmail.com)""} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.