code: def put(self, filename, encoding=None):
          
          from . import LocalFile
  
          if os.path.isdir(filename) and self.source is None:
              raise ValueError("Cannot write this object to "
                               "directory %s without an explicit filename." % filename)
  
          target = get_target_path(filename, self.source)
  
          if (encoding is not None) and (encoding != self.encoded_with):
              raise ValueError('%s is already encoded as "%s"' % self, self.encoded_with)
  
          with self.open('rb') as infile, open(target, 'wb') as outfile:
              for line in infile:
                  outfile.write(line)
          return LocalFile(target)
docs: Write the file to the given path
  
          Args:
              filename(str): path to write this file to
  
          Returns:
              LocalFile: reference to the copy of the file stored at ``filename``