code: def count_by_tag(stack, descriptor):
      
      ec2_conn = boto.ec2.connection.EC2Connection()
      resses = ec2_conn.get_all_instances(
                      filters={
                          'tag:stack': stack,
                          'tag:descriptor': descriptor
                      })
      instance_list_raw = list()
      [[instance_list_raw.append(x) for x in res.instances] for res in resses]
      instance_list = [x for x in instance_list_raw if state_filter(x)]
      instances = len(instance_list)
      return instances
docs: Returns the count of currently running or pending instances
      that match the given stack and deployer combo