async def METHOD_NAME(
    num_p2pds,
    security_protocol,
    is_gossipsub,
    is_pubsub_signing,
    is_pubsub_signing_strict,
):
    async with AsyncExitStack() as stack:
        METHOD_NAME = [
            await stack.enter_async_context(
                make_p2pd(
                    get_unused_tcp_port(),
                    get_unused_tcp_port(),
                    security_protocol,
                    is_gossipsub=is_gossipsub,
                    is_pubsub_signing=is_pubsub_signing,
                    is_pubsub_signing_strict=is_pubsub_signing_strict,
                )
            )
            for _ in range(num_p2pds)
        ]
        try:
            yield METHOD_NAME
        finally:
            for p2pd in METHOD_NAME:
                await p2pd.close()