code: def check_or_create_vpc_resources_efs_fsx(
      sagemaker_session, name=VPC_NAME
  ):
      # use lock to prevent race condition when tests are running concurrently
      with lock.lock(LOCK_PATH_EFS):
          ec2_client = sagemaker_session.boto_session.client("ec2")
  
          if _vpc_exists(ec2_client, name):
              vpc_id = _vpc_id_by_name(ec2_client, name)
              return (
                  _get_subnet_ids_by_name(ec2_client, name),
                  _security_group_ids_by_vpc_id(
                      sagemaker_session, vpc_id
                  ),
              )
          else:
              return _create_vpc_with_name_efs_fsx(ec2_client, name)
  
file_path: sagemaker-python-sdk/tests/integ/vpc_test_utils.py
imports: from __future__ import absolute_import
  import os
  import tempfile
  import tests.integ.lock
label_desc: Use image node_id 7 for calling a global function with example usage: check_or_create_vpc_resources_efs_fsx(sagemaker_session, name) and returns: _get_subnet_ids_by_name,  _security_group_ids_by_vpc_id, _create_vpc_with_name_efs_fsx