code: def test_context_can_access_services_from_apply_method(tmpdir):
      data_inputs = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
      expected_outputs = data_inputs * 2
  
      cx = CX(
          tmpdir,
          services={
              SomeBaseService: SomeService(),
              AnotherService: AnotherService(),
          },
      )
      p = Pipeline(
          [
              Identity().assert_has_services(AnotherService),
              SomeStep().assert_has_services_at_execution(
                  SomeBaseService
              ),
          ]
      ).with_context(context=cx)
  
      for i in cx.services.values():
          assert isinstance(i, BaseService)
          assert i.get_config().to_flat_dict() == dict()
  
      p.fit(data_inputs, expected_outputs)
  
      service = cx.get_service(SomeBaseService)
      assert np.array_equal(service.data, data_inputs)
  
      for i in cx.services.values():
          assert i.get_config().to_flat_dict() == dict()
  
imports: import os
  import shutil
  from abc import ABC, abstractmethod
  import numpy
  import pytest
  from neuraxle.base import CX, BaseService, BaseStep, BaseTransformerT, ForceHandleIdentity, Identity, NonFittableMixin, StepWithContext
  from neuraxle.data_container import DataContainer
  from neuraxle.metaopt.auto_ml import AutoML
  from neuraxle.metaopt.callbacks import ScoringCallback
  from neuraxle.metaopt.optimizer import GridExplorationSampler
  from neuraxle.metaopt.validation import ValidationSplitter
  from neuraxle.pipeline import Pipeline
  from sklearn.metrics import mean_squared_error
label_desc: Use image node_id 8 for calling a global function with example usage: test_context_can_access_services_from_apply_method(tmpdir) without return types