Get an instance of equipamento_acesso services facade.
338200
def create_equipamento_acesso(self):
        """"""
        return EquipamentoAcesso(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
882762
public static function singleton() {
        $returnValue = null;

        
        $serviceName = get_called_class();
        if (!isset(self::$instances[$serviceName])) {
            self::$instances[$serviceName] = new $serviceName();
        }

        $returnValue = self::$instances[$serviceName];
        

        return $returnValue;
    }
161706
def create_direito_grupo_equipamento(self):
        """"""
        return DireitoGrupoEquipamento(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
817763
def get_instance(self, service_name):
        
        for resource in self.space._get_instances():
            if resource['entity']['name'] == service_name:
                return resource['entity']
364789
def _get_from_prototype(self, factory, svc_registration):
        # type: (Any, ServiceRegistration) -> Any
        
        svc_ref = svc_registration.get_reference()
        service = factory.get_service(self.__bundle, svc_registration)

        try:
            # Check if the service already exists
            services, counter = self.__factored[svc_ref]
            services.append(service)
            counter.inc()
        except KeyError:
            counter = _UsageCounter()
            counter.inc()

            # Store the counter
            self.__factored[svc_ref] = ([service], counter)

        return service
1224922
protected static AbatisService getInstance(Context context, int version) {
      if (instance == null) {
         instance = new AbatisService(context, version);
      }
      return instance;
   }
844913
public function chamar(
        Request $request,
        AtendimentoService $atendimentoService,
        FilaService $filaService,
        UsuarioService $usuarioService,
        TranslatorInterface $translator
    ) {
        $envelope = new Envelope();
        
        $attempts = 5;
        $proximo = null;
        $success = false;
        $usuario = $this->getUser();
        $unidade = $usuario->getLotacao()->getUnidade();
        
        // verifica se ja esta atendendo alguem
        $atual = $atendimentoService->atendimentoAndamento($usuario->getId(), $unidade);

        // se ja existe um atendimento em andamento (chamando senha novamente)
        if ($atual) {
            $success = true;
            $proximo = $atual;
        } else {
            $local    = $this->getNumeroLocalAtendimento($usuarioService, $usuario);
            $servicos = $usuarioService->servicos($usuario, $unidade);

            do {
                $tipo         = $this->getTipoAtendimento($usuarioService, $usuario);
                $atendimentos = $filaService->filaAtendimento($unidade, $usuario, $servicos, $tipo, 1);
                if (count($atendimentos)) {
                    $proximo = $atendimentos[0];
                    $success = $atendimentoService->chamar($proximo, $usuario, $local);
                    if (!$success) {
                        usleep(100);
                    }
                    --$attempts;
                } else {
                    // nao existe proximo
                    break;
                }
            } while (!$success && $attempts > 0);
        }
        
        // response
        if (!$success) {
            if (!$proximo) {
                throw new Exception(
                    $translator->trans('error.queue.empty', [], self::DOMAIN)
                );
            } else {
                throw new Exception(
                    $translator->trans('error.attendance.in_process', [], self::DOMAIN)
                );
            }
        }

        $atendimentoService->chamarSenha($unidade, $proximo);

        $data = $proximo->jsonSerialize();
        $envelope->setData($data);

        return $this->json($envelope);
    }
1361469
public function withAccess($access)
    {
        $choices = [
            NewsInterface::ACCESS_REGISTRATION,
            NewsInterface::ACCESS_SUBSCRIPTION,
        ];

        Assertion::choice($access, $choices);

        $instance = clone $this;

        $instance->access = $access;

        return $instance;
    }
1143792
public function acquireAccessToken() {
    $grant = new PasswordGrant($this->clientId, $this->clientSecret, $this->username, $this->password, $this->scopes);
    $tokens = $grant->getTokens();

    $accessToken = $tokens->{"access_token"};
    $refreshToken = $tokens->{"refresh_token"};
    $expiresAt = Util::calculateExpiryTime($tokens->{"expires_in"});

    return new RefreshableAccessToken($this->clientId, $this->clientSecret, $accessToken, $expiresAt, $refreshToken);
  }
127926
def get_instance(self, payload):
        
        return EntityInstance(self._version, payload, service_sid=self._solution['service_sid'], )
563567
public function getAccessLevels()
    {
        // Give the modules the opportunity to add additional access levels
        $runtimeManager = $this->framework->getRuntimeManager();
        
        $accessLevels = $runtimeManager->executeFilter('\\Zepi\\Core\\AccessControl\\Filter\\AccessLevelManager\\RegisterAccessLevels', $this->accessLevels);
        
        return $accessLevels;
    }
146787
function getSetting()
    {
        $setting = $this->setting;

        if (is_string($setting)) {
            ## it is service
            if (!$this->services()->has($setting))
                throw new \InvalidArgumentException(sprintf(
                    'Service with name (%s) defined as Sapi Config but not found.'
                ));

            $services = $this->services();
            $setting  = $services->get($setting);
        }

        return $setting;
    }
1036785
public static function get_instance() {

        if (self::$_entityManager === null) {
            self::initConfig();
            //setando as configurações definidas anteriormente
            $config = Setup::createAnnotationMetadataConfiguration(self::$settings['entidades'], self::$settings['isDevMod']);
            $config->addCustomStringFunction('group_concat', 'Oro\ORM\Query\AST\Functions\String\GroupConcat');
            $config->addCustomNumericFunction('hour', 'Oro\ORM\Query\AST\Functions\SimpleFunction');
            $config->addCustomNumericFunction('timestampdiff', 'Oro\ORM\Query\AST\Functions\Numeric\TimestampDiff');
            $config->addCustomDatetimeFunction('date', 'Oro\ORM\Query\AST\Functions\SimpleFunction');
            //criando o Entity Manager com base nas configurações de dev e banco de dados
            self::$_entityManager = Em::create(self::$settings['dbParams'], $config);
        }

        return self::$_entityManager;
    }
1077765
@Override
  public I get()
  {
    I instance = _instance;
    
    if (instance == null || instance.isModified()) {
      _instance = instance = service().get();
    }
    
    return instance;
  }
1232262
def instance_admin_api(self):
        """"""
        if self._instance_admin_api is None:
            self._instance_admin_api = InstanceAdminClient(
                credentials=self.credentials, client_info=_CLIENT_INFO
            )
        return self._instance_admin_api
304103
def create_equipamento_roteiro(self):
        """"""
        return EquipamentoRoteiro(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
116271
public function encerrar(
        Request $request,
        AtendimentoService $atendimentoService,
        TranslatorInterface $translator
    ) {
        $envelope = new Envelope();
        $data     = json_decode($request->getContent());

        $usuario = $this->getUser();
        $unidade = $usuario->getLotacao()->getUnidade();
        $atual   = $atendimentoService->atendimentoAndamento($usuario->getId(), $unidade);

        if (!$atual) {
            throw new Exception(
                $translator->trans('error.attendance.not_in_process', [], self::DOMAIN)
            );
        }

        $servicos   = explode(',', $data->servicos);
        $resolucao  = $data->resolucao;
        $observacao = $data->observacao;
        
        if (empty($servicos)) {
            throw new Exception(
                $translator->trans('error.attendance.no_service', [], self::DOMAIN)
            );
        }
        
        $em = $this->getDoctrine()->getManager();

        $novoUsuario = null;
        $servicoRedirecionado = null;
        
        if ($data->redirecionar) {
            $servicoRedirecionado = $em
                ->getRepository(Servico::class)
                ->find($data->novoServico);
            
            if (isset($data->novoUsuario)) {
                $novoUsuario = $em
                    ->getRepository(Usuario::class)
                    ->find($data->novoServico);
            }
        }
        
        if (in_array($resolucao, [ AtendimentoService::RESOLVIDO, AtendimentoService::PENDENTE ])) {
            $atual->setResolucao($resolucao);
        }
        
        if ($observacao) {
            $atual->setObservacao($observacao);
        }

        $atendimentoService->encerrar($atual, $unidade, $servicos, $servicoRedirecionado, $novoUsuario);

        return $this->json($envelope);
    }