original_docstring: 
      Remove "bad" characters from a filename. Right now just punctuation that Windows doesn't like
      If any chars are removed, we append _{hash} so that we don't accidentally clobber other files
      since eg `Model 1/2` and `Model 1 2` would otherwise have the same name
      
docstring: Remove "bad" characters from a filename. Right now just punctuation that Windows doesn't like
  If any chars are removed, we append _{hash} so that we don't accidentally clobber other files
  since eg `Model 1/2` and `Model 1 2` would otherwise have the same name
docstring_tokens: Remove " bad " characters from a filename . Right now just punctuation that Windows doesn ' t like If any chars are removed we append _ { hash } so that we don ' t accidentally clobber other files since eg ` Model 1 / 2 ` and ` Model 1 2 ` would otherwise have the same name
code: def sanitize_filename(name: str) -> str:
      """
      Remove "bad" characters from a filename. Right now just punctuation that Windows doesn't like
      If any chars are removed, we append _{hash} so that we don't accidentally clobber other files
      since eg `Model 1/2` and `Model 1 2` would otherwise have the same name
      """
      name = name.replace(" ","_")
      with_replacement = re.sub(r'[:\\*?<>|\/]', '_', name)
      if name == with_replacement:
          return name
      hash = hashlib.sha256(name.encode()).hexdigest()[:8]
      return f'{with_replacement}_{hash}'
code_tokens: def sanitize_filename ( name : str ) -> str : name = name . replace ( " " , "_" ) with_replacement = re . sub ( r'[:\\*?<>|\/]' , '_' , name ) if name == with_replacement : return name hash = hashlib . sha256 ( name . encode ( ) ) . hexdigest ( ) [ : 8 ] return f'{with_replacement}_{hash}'
short_docstring: Remove "bad" characters from a filename.
short_docstring_tokens: Remove " bad " characters from a filename .
comment: """
      Remove "bad" characters from a filename. Right now just punctuation that Windows doesn't like
      If any chars are removed, we append _{hash} so that we don't accidentally clobber other files
      since eg `Model 1/2` and `Model 1 2` would otherwise have the same name
      """