def __get_instance_info(self, instances, status, keyname):
    instance_ids = []
    public_ips = []
    private_ips = []
    for i in instances:
      if i.state == status and i.key_name == keyname:
        instance_ids.append(i.id)
        public_ips.append(i.public_dns_name)
        private_ips.append(i.private_dns_name)
    return public_ips, private_ips, instance_ids
Filter out a list of instances by instance status and keyname.
dataset/ETHPy150Open AppScale/appscale-tools/lib/agents/ec2_agent.py/EC2Agent.__get_instance_info