code: def set_pkg_chk_sum(self, doc, chk_sum):
          
          self.assert_package_exists()
          if not self.package_chk_sum_set:
              self.package_chk_sum_set = True
              doc.package.check_sum = checksum_from_sha1(chk_sum)
              return True
          else:
              raise CardinalityError('Package::CheckSum')
docs: Sets the package check sum, if not already set.
          chk_sum - A string
          Raises CardinalityError if already defined.
          Raises OrderError if no package previously defined.