@classmethod
  def GetFirewall(cls):
    """Returns a BaseFirewall.

    This method is used instead of directly calling the class's constructor.
    It creates BaseFirewall instances and registers them.
    If a BaseFirewall object has already been registered, that object
    will be returned rather than creating a new one. This enables multiple
    VMs to call this method and all share the same BaseFirewall object.
    """
    if cls.CLOUD is None:
      raise errors.Error('Firewalls should have CLOUD attributes.')
    benchmark_spec = context.GetThreadBenchmarkSpec()
    if benchmark_spec is None:
      raise errors.Error('GetFirewall called in a thread without a '
                         'BenchmarkSpec.')
    with benchmark_spec.firewalls_lock:
      key = cls.CLOUD
      if benchmark_spec.firewalls not in key:
        benchmark_spec.firewalls[key] = cls()
      return benchmark_spec.firewalls[key]
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/network.py/BaseFirewall.GetFirewall/swapped operands of `not in`