parameters: (self, local_file, remote_file, flags="wct", mode=None)
docstring: Copy a file from the execute machine to the submit machine.
  
          Specifying flags other than 'wct' (i.e. 'create or truncate file') when
          putting large files is not recommended as the entire file must be read
          into memory.
  
          To put individual bytes into a file on the submit machine instead of
          an entire file, see the write() method.
  
          :param local_file: Path to file to be sent from the execute machine
          :param remote_file: Path to file to be written to on the submit machine
          :param flags: File open modes (one or more of 'rwatcx') [default: 'wct']
          :param mode: Permission mode to set [default: 0777]
          :returns: Size of written file
docstring_summary: Copy a file from the execute machine to the submit machine.
docstring_tokens: Copy a file from the execute machine to the submit machine .
function: def put(self, local_file, remote_file, flags="wct", mode=None):
          """Copy a file from the execute machine to the submit machine.
  
          Specifying flags other than 'wct' (i.e. 'create or truncate file') when
          putting large files is not recommended as the entire file must be read
          into memory.
  
          To put individual bytes into a file on the submit machine instead of
          an entire file, see the write() method.
  
          :param local_file: Path to file to be sent from the execute machine
          :param remote_file: Path to file to be written to on the submit machine
          :param flags: File open modes (one or more of 'rwatcx') [default: 'wct']
          :param mode: Permission mode to set [default: 0777]
          :returns: Size of written file
  
          """
  
          # Set default flags
          if flags is None:
              flags = "wct"
  
          flags = set(flags)
  
          if flags == set("wct"):
              # If default mode ('wct'), use putfile (efficient)
              return self.putfile(local_file, remote_file, mode)
  
          else:
              # If non-default mode, have to read entire file (inefficient)
              with open(local_file, "rb") as rfd:
                  data = rfd.read()
              # And then use write
              wb = self.write(data, remote_file, flags, mode)
              # Better check how much data was written
              if wb < len(data):
                  raise UserWarning(
                      "Only {0} bytes of {1} bytes in {2} were written".format(
                          wb, len(data), local_file
                      )
                  )
              return wb
function_tokens: def put ( self , local_file , remote_file , flags = "wct" , mode = None ) : # Set default flags if flags is None : flags = "wct" flags = set ( flags ) if flags == set ( "wct" ) : # If default mode ('wct'), use putfile (efficient) return self . putfile ( local_file , remote_file , mode ) else : # If non-default mode, have to read entire file (inefficient) with open ( local_file , "rb" ) as rfd : data = rfd . read ( ) # And then use write wb = self . write ( data , remote_file , flags , mode ) # Better check how much data was written if wb < len ( data ) : raise UserWarning ( "Only {0} bytes of {1} bytes in {2} were written" . format ( wb , len ( data ) , local_file ) ) return wb