code: def wrsamp(self, expanded=False, write_dir=''):
          
          # Perform field validity and cohesion checks, and write the
          # header file.
          self.wrheader(write_dir=write_dir)
          if self.n_sig > 0:
              # Perform signal validity and cohesion checks, and write the
              # associated dat files.
              self.wr_dats(expanded=expanded, write_dir=write_dir)
docs: Write a wfdb header file and any associated dat files from this
          object.
  
          Parameters
          ----------
          expanded : bool, optional
              Whether to write the expanded signal (e_d_signal) instead
              of the uniform signal (d_signal).
          write_dir : str, optional
              The directory in which to write the files.