code: def _security_group_ids_by_vpc_id(sagemaker_session, vpc_id):
      ec2_resource = sagemaker_session.boto_session.resource("ec2")
      security_group_ids = []
      vpc = ec2_resource.Vpc(vpc_id)
      for sg in vpc.security_groups.all():
          security_group_ids.append(sg.id)
      return security_group_ids
  
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 3 for calling a global function with example usage: _security_group_ids_by_vpc_id(sagemaker_session, vpc_id) and returns: security_group_ids