Get state machine of given type, create it if necessary.

@return AbstractMachine|null
163294
public function getMachine(Smalldb $smalldb, string $type)
	{
		if (isset($this->machine_type_cache[$type])) {
			return $this->machine_type_cache[$type];
		} if (!$this->initialized) {
			throw new InitializationException("Backend not initialized.");
		} else {
			$m = $this->machine_type_cache[$type] = $this->createMachine($smalldb, $type);
			if ($m && $this->debug_logger) {
				$m->setDebugLogger($this->debug_logger);
				$this->debug_logger->afterMachineCreated($this, $type, $m);
			}
			return $m;
		}
	}
259469
public function describeMachineState($state, $field = null)
	{
		if ($field === null) {
			return @ $this->states[$state];
		} else {
			return @ $this->states[$state][$field];
		}
	}
947366
function get_type()
    {
        if ($this->subkeys[0]->has_private)
            return enigma_key::TYPE_KEYPAIR;
        else if (!empty($this->subkeys[0]))
            return enigma_key::TYPE_PUBLIC;

        return enigma_key::TYPE_UNKNOWN;
    }
504002
public function object($objectType = null): ObjectInterface
    {
        //====================================================================//
        // Build Objects Type Index Key
        $index = get_class($this->getConnector())."::".$objectType;

        //====================================================================//
        // If Object Manager is New
        if (!isset($this->objectManagers[$index])) {
            $this->objectManagers[$index] = new Manager($this->getConnector(), $objectType);
        }

        //====================================================================//
        // Return Object Manager
        return $this->objectManagers[$index];
    }
200268
public function nullRef(string $type): Reference
	{
		foreach ($this->backends as $b => $backend) {
			$m = $backend->getMachine($this, $type);
			if ($m !== null) {
				$ref = $m->nullRef();

				// Emit events
				if ($this->debug_logger) {
					$this->debug_logger->afterReferenceCreated($backend, $ref);
				}
				if ($this->after_reference_created) {
					$this->after_reference_created->emit($ref);
				}

				return $ref;
			}
		}
		throw new RuntimeException('Cannot create machine: '.$type);
	}
1278526
public MachineType getMachineType() {
        long value = get(MACHINE);
        try {
            return MachineType.getForValue(value);
        } catch (IllegalArgumentException e) {
            logger.error("Unable to resolve machine type for value: " + value);
            return MachineType.UNKNOWN;
        }
    }
140409
public function proto()
    {
        if (!$this->proto) {
            $this->proto = $this->modelFactory()->get($this->objType());
        }

        return $this->proto;
    }
534866
private function determineState()
    {
        // If the state was provided via config, then just use it.
        if ($this->config['state'] instanceof UploadState) {
            return $this->config['state'];
        }

        // Otherwise, construct a new state from the provided identifiers.
        $required = $this->info['id'];
        $id = [$required['upload_id'] => null];
        unset($required['upload_id']);
        foreach ($required as $key => $param) {
            if (!$this->config[$key]) {
                throw new IAE('You must provide a value for "' . $key . '" in '
                    . 'your config for the MultipartUploader for '
                    . $this->client->getApi()->getServiceFullName() . '.');
            }
            $id[$param] = $this->config[$key];
        }
        $state = new UploadState($id);
        $state->setPartSize($this->determinePartSize());

        return $state;
    }
511329
def get_state_machine_selection(self):
        
        if self._selected_sm_model:
            return self._selected_sm_model.selection, self._selected_sm_model.selection.states
        else:
            return None, set()
549300
public static function getInstance()
    {
        $controller = get_called_class();

        if (! isset(self::$instance[$controller])) {
            self::$instance[$controller] = new $controller;
        }

        if (is_null(self::$instance[$controller]->view)) {
            self::getViewInstance(self::$instance[$controller]);
        }

        self::getModelInstance(self::$instance[$controller], $controller);

        return self::$instance[$controller];
    }
563260
public function getCurrentState()
    {
        if ($this->circuitState instanceof CloseState) {
            return self::CLOSE;
        }
        if ($this->circuitState instanceof HalfOpenState) {
            return self::HALF_OPEN_STATE;
        }

        if ($this->circuitState instanceof OpenState) {
            return self::OPEN;
        }
        return self::PENDING;
    }
176008
public function get()
    {
        if ($this->requiredType == self::TYPE_DEFAULT) {
            $this->requiredType = (extension_loaded('gmp') ? self::TYPE_GMP : self::TYPE_NATIVE);
        }

        return $this->requiredType;
    }
562756
protected function getState()
    {
        $serviceService = $this->getServiceLocator()->get(StateStorage::SERVICE_ID);
        $userUri = $this->getSession()->getUserUri();
        return is_null($userUri) ? null : $serviceService->get($userUri, $this->getServiceCallId());
    }
579261
public function getResolver()
    {
        if (null !== $this->typeResolver) {
            return $this->typeResolver;
        }

        $classResolver = $this->getDefaultTypeResolverClass();
        $r = new ReflectionClass($classResolver);
        $resolver = $r->newInstance();
        $this->typeResolver = $resolver;

        return $this->typeResolver;
    }
1138441
protected function getMachineToMachine() {
        if (!$this->_machineToMachine) {
            $this->_machineToMachine = new MachineToMachineList(
                $this->version,
                $this->solution['accountSid'],
                $this->solution['countryCode']
            );
        }

        return $this->_machineToMachine;
    }
1222674
public function getObjectStateService()
    {
        if ($this->objectStateService !== null) {
            return $this->objectStateService;
        }

        $this->objectStateService = new ObjectStateService(
            $this,
            $this->persistenceHandler->objectStateHandler(),
            $this->serviceSettings['objectState']
        );

        return $this->objectStateService;
    }
561068
public static State getStateImpl() {
        State s = null;
        try {
             DiscoverClass dc = new DiscoverClass();
             s = (State) dc.newInstance(
             State.class,
             State.DEFAULT_STATE_IMPL);
        } catch (Exception ex) {
             // ignore as default implementation will be used.
        }
        return s;
    }