docstr: Create a new AutoMLContext from an ExecutionContext.
  
  :param context: ExecutionContext
docstr_tok: ["Create","a","new","AutoMLContext","from","an","ExecutionContext",".",":","param","context",":","ExecutionContext"]
code: def from_context(
      context: CX = None,
      repo: HyperparamsRepository = None,
      loc: ScopedLocation = None,
      disable_repo_lock: bool = False,
  ) -> "AutoMLContext":
      """
      Create a new AutoMLContext from an ExecutionContext.
  
      :param context: ExecutionContext
      """
      new_context: AutoMLContext = AutoMLContext._copy(
          context if context is not None else AutoMLContext()
      )
      if not new_context.has_service(HyperparamsRepository):
          new_context.register_service(
              HyperparamsRepository,
              (
                  repo
                  or VanillaHyperparamsRepository(
                      new_context.get_path()
                  )
              ).with_lock(),
          )
      if not new_context.has_service(ScopedLocation):
          new_context.register_service(
              ScopedLocation, loc or ScopedLocation()
          )
      if not disable_repo_lock:
          new_context = new_context.synchroneous()
      return new_context
  
imports: import logging
  from neuraxle.base import ExecutionContext, ExecutionPhase
  from neuraxle.logging.logging import NeuraxleLogger
  from neuraxle.metaopt.data.vanilla import BaseDataclass, ScopedLocation, SubDataclassT
  from neuraxle.metaopt.repositories.repo import HyperparamsRepository, SynchronizedHyperparamsRepositoryWrapper, VanillaHyperparamsRepository
label_desc: Use image node_id 12 for calling the AutoMLContext obj's underlying member method code with example usage: obj.from_context(context, repo, loc, disable_repo_lock) and returns: new_context