code: def setup_security_group_for_encryption(
      ec2_client, security_group_id
  ):
      sg_desc = ec2_client.describe_security_groups(
          GroupIds=[security_group_id]
      )
      ingress_perms = sg_desc["SecurityGroups"][0]["IpPermissions"]
      if len(ingress_perms) == 1:
          ec2_client.authorize_security_group_ingress(
              GroupId=security_group_id,
              IpPermissions=[
                  {
                      "IpProtocol": "50",
                      "UserIdGroupPairs": [
                          {"GroupId": security_group_id}
                      ],
                  },
                  {
                      "IpProtocol": "udp",
                      "FromPort": 500,
                      "ToPort": 500,
                      "UserIdGroupPairs": [
                          {"GroupId": security_group_id}
                      ],
                  },
              ],
          )
  
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 12 for calling a global function with example usage: setup_security_group_for_encryption(ec2_client, security_group_id) without return types