docs: def info(gandi, resource, stat):
      """Display information about a virtual machine.
  
      Resource can be a Hostname or an ID
      """
      output_keys = ['hostname', 'state', 'cores', 'memory', 'console',
                     'datacenter', 'ip']
      justify = 14
      if stat is True:
          sampler = {'unit': 'hours', 'value': 1, 'function': 'max'}
          time_range = 3600 * 24
          query_vif = 'vif.bytes.all'
          query_vbd = 'vbd.bytes.all'
  
      resource = sorted(tuple(set(resource)))
      datacenters = gandi.datacenter.list()
      ret = []
      for num, item in enumerate(resource):
          if num:
              gandi.separator_line()
          vm = gandi.iaas.info(item)
          output_vm(gandi, vm, datacenters, output_keys, justify)
          ret.append(vm)
          for disk in vm['disks']:
              gandi.echo('')
              disk_out_keys = ['label', 'kernel_version', 'name', 'size']
              output_image(gandi, disk, datacenters, disk_out_keys, justify,
                           warn_deprecated=False)
          if stat is True:
              metrics_vif = gandi.metric.query(vm['id'], time_range, query_vif,
                                               'vm', sampler)
              metrics_vbd = gandi.metric.query(vm['id'], time_range, query_vbd,
                                               'vm', sampler)
              gandi.echo('')
              gandi.echo('vm network stats')
              output_metric(gandi, metrics_vif, 'direction', justify)
              gandi.echo('disk network stats')
              output_metric(gandi, metrics_vbd, 'direction', justify)
  
      return ret