code: def sanitize(vpc_config):
      """Checks and removes unexpected keys from VpcConfig or raises error for violations.
  
      Checks that an instance of VpcConfig has the expected keys and values,
      removes unexpected keys, and raises ValueErrors if any expectations are
      violated.
  
      Args:
          vpc_config (dict): a VpcConfig dict containing 'Subnets' and
              'SecurityGroupIds'
  
      Returns:
          A valid VpcConfig dict containing only 'Subnets' and 'SecurityGroupIds'
          from the vpc_config parameter If vpc_config parameter is None, returns
          None
  
      Raises:
          ValueError if any expectations are violated:
              * vpc_config must be a non-empty dict
              * vpc_config must have key `Subnets` and the value must be a non-empty list
              * vpc_config must have key `SecurityGroupIds` and the value must be a non-empty list
      """
      if vpc_config is None:
          return vpc_config
      if not isinstance(vpc_config, dict):
          raise ValueError(
              "vpc_config is not a dict: {}".format(vpc_config)
          )
      if not vpc_config:
          raise ValueError("vpc_config is empty")
  
      subnets = vpc_config.get(SUBNETS_KEY)
      if subnets is None:
          raise ValueError(
              "vpc_config is missing key: {}".format(SUBNETS_KEY)
          )
      if not isinstance(subnets, list):
          raise ValueError(
              "vpc_config value for {} is not a list: {}".format(
                  SUBNETS_KEY, subnets
              )
          )
      if not subnets:
          raise ValueError(
              "vpc_config value for {} is empty".format(SUBNETS_KEY)
          )
  
      security_group_ids = vpc_config.get(SECURITY_GROUP_IDS_KEY)
      if security_group_ids is None:
          raise ValueError(
              "vpc_config is missing key: {}".format(
                  SECURITY_GROUP_IDS_KEY
              )
          )
      if not isinstance(security_group_ids, list):
          raise ValueError(
              "vpc_config value for {} is not a list: {}".format(
                  SECURITY_GROUP_IDS_KEY, security_group_ids
              )
          )
      if not security_group_ids:
          raise ValueError(
              "vpc_config value for {} is empty".format(
                  SECURITY_GROUP_IDS_KEY
              )
          )
  
      return to_dict(subnets, security_group_ids)
  
label_desc: Use image node_id 3 for calling a global function with example usage: sanitize(vpc_config) and returns: to_dict, vpc_config