code: def file_uri(fname):
      
      if os.name == 'nt':
          # Local file
          if re.search(r'^[a-zA-Z]:', fname):
              return 'file:///' + fname
          # UNC based path
          else:
              return 'file://' + fname
      else:
          return 'file://' + fname
docs: Select the right file uri scheme according to the operating system