code: def to_dict(subnets, security_group_ids):
      """Prepares a VpcConfig dict containing keys 'Subnets' and 'SecurityGroupIds'.
  
      This is the dict format expected by SageMaker CreateTrainingJob and CreateModel APIs.
      See https://docs.aws.amazon.com/sagemaker/latest/dg/API_VpcConfig.html
  
      Args:
          subnets (list): list of subnet IDs to use in VpcConfig
          security_group_ids (list): list of security group IDs to use in
              VpcConfig
  
      Returns:
          A VpcConfig dict containing keys 'Subnets' and 'SecurityGroupIds' If
          either or both parameters are None, returns None
      """
      if subnets is None or security_group_ids is None:
          return None
      return {
          SUBNETS_KEY: subnets,
          SECURITY_GROUP_IDS_KEY: security_group_ids,
      }
  
label_desc: Use image node_id 1 for calling a global function with example usage: to_dict(subnets, security_group_ids) and returns: dict, None