def countsurprises(expected, actual, action, antiaction, allran, resource_denieds):
    printlist(actual)
    if not expected.isvalid():
        print "Ask someone to teach regrtest.py about which tests are"
        print "expected to %s on %s." % (action, sys.platform)
        return 1#Surprising not to know what to expect....
    good_surprise = expected.getexpected() - set(actual)
    if allran and good_surprise:
        print count(len(good_surprise), 'test'), antiaction, 'unexpectedly:'
        printlist(good_surprise)
    bad_surprise = set(actual) - expected.getexpected() - set(resource_denieds)
    if bad_surprise:
        print count(len(bad_surprise), action), "unexpected:"
        printlist(bad_surprise)
    return len(bad_surprise)

# Map sys.platform to a string containing the basenames of tests
# expected to be skipped on that platform.
#
# Special cases:
#     test_pep277
#         The _ExpectedSkips constructor adds this to the set of expected
#         skips if not os.path.supports_unicode_filenames.
#     test_socket_ssl
#         Controlled by test_socket_ssl.skip_expected.  Requires the network
#         resource, and a socket module with ssl support.
#     test_timeout
#         Controlled by test_timeout.skip_expected.  Requires the network
#         resource and a socket module.
#
# Tests that are expected to be skipped everywhere except on one platform
# are also handled separately.
returns the number of items in actual that aren't in expected.
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/regrtest.py/countsurprises