docs: def get_network_by_device(vm, device, pyvmomi_service, logger):
          """
          Get a Network connected to a particular Device (vNIC)
          @see https://github.com/vmware/pyvmomi/blob/master/docs/vim/dvs/PortConnection.rst
  
          :param vm:
          :param device: <vim.vm.device.VirtualVmxnet3> instance of adapter
          :param pyvmomi_service:
          :param logger:
          :return: <vim Network Obj or None>
          """
  
          try:
              backing = device.backing
              if hasattr(backing, 'network'):
                  return backing.network
              elif hasattr(backing, 'port') and hasattr(backing.port, 'portgroupKey'):
                  return VNicService._network_get_network_by_connection(vm, backing.port, pyvmomi_service)
          except:
              logger.debug(u"Cannot determinate which Network connected to device {}".format(device))
              return None