code: def get_workspace_disk_usage(workspace, summarize=False):
      
      command = ['du', '-h']
      if summarize:
          command.append('-s')
      else:
          command.append('-a')
      command.append(workspace)
      disk_usage_info = subprocess.check_output(command).decode().split()
      # create pairs of (size, filename)
      filesize_pairs = list(zip(disk_usage_info[::2], disk_usage_info[1::2]))
      filesizes = []
      for filesize_pair in filesize_pairs:
          size, name = filesize_pair
          # trim workspace path in every file name
          filesizes.append({'name': name[len(workspace):],
                            'size': size})
      return filesizes
docs: Retrieve disk usage information of a workspace.