class_docstr: Abstract filesystem interface
class_docstr_tok: ["Abstract","filesystem","interface"]
docstr: Compute bytes used by all contents under indicated path in file tree
  
  Parameters
  ----------
  path : string
      Can be a file path or directory
  
  Returns
  -------
  usage : int
docstr_tok: ["Compute","bytes","used","by","all","contents","under","indicated","path","in","file","tree","Parameters","--","--","--","--","--","path",":","string","Can","be","a","file","path","or","directory","Returns","--","--","--","-","usage",":","int"]
code: def disk_usage(self, path: path_type) -> int:
      """
      Compute bytes used by all contents under indicated path in file tree
  
      Parameters
      ----------
      path : string
          Can be a file path or directory
  
      Returns
      -------
      usage : int
      """
      path = stringify_path(path)
      path_info = self.stat(path)
      if path_info["type"] == "file":
          return path_info["size"]
  
      total = 0
      for root, directories, files in self.walk(path):
          for child_path in files:
              abspath = self.path_join(root, child_path)
              total += self.stat(abspath)["size"]
  
      return total
  
imports: import os
  from abc import ABC, abstractmethod
  from urllib.parse import urlparse
  from typing import Union, List, Dict, Tuple, BinaryIO, TextIO, Iterator
  from ...utils import stringify_path
label_desc: Use image node_id 4 for calling the FileSystem obj's underlying member method code with example usage: obj.disk_usage(path) and returns: total, path_info