code: def commit(self):
          
          true_mutations = self._get_mutations(state=True)
          false_mutations = self._get_mutations(state=False)
          num_true_mutations = len(true_mutations)
          num_false_mutations = len(false_mutations)
          if num_true_mutations == 0 and num_false_mutations == 0:
              return
          if num_true_mutations > MAX_MUTATIONS or num_false_mutations > MAX_MUTATIONS:
              raise ValueError(
                  "Exceed the maximum allowable mutations (%d). Had %s true "
                  "mutations and %d false mutations."
                  % (MAX_MUTATIONS, num_true_mutations, num_false_mutations)
              )
  
          data_client = self._table._instance._client.table_data_client
          resp = data_client.check_and_mutate_row(
              table_name=self._table.name,
              row_key=self._row_key,
              predicate_filter=self._filter.to_pb(),
              true_mutations=true_mutations,
              false_mutations=false_mutations,
          )
          self.clear()
          return resp.predicate_matched
docs: Makes a ``CheckAndMutateRow`` API request.
  
          If no mutations have been created in the row, no request is made.
  
          The mutations will be applied conditionally, based on whether the
          filter matches any cells in the :class:`ConditionalRow` or not. (Each
          method which adds a mutation has a ``state`` parameter for this
          purpose.)
  
          Mutations are applied atomically and in order, meaning that earlier
          mutations can be masked / negated by later ones. Cells already present
          in the row are left unchanged unless explicitly changed by a mutation.
  
          After committing the accumulated mutations, resets the local
          mutations.
  
          For example:
  
          .. literalinclude:: snippets_table.py
              :start-after: [START bigtable_row_commit]
              :end-before: [END bigtable_row_commit]
  
          :rtype: bool
          :returns: Flag indicating if the filter was matched (which also
                    indicates which set of mutations were applied by the server).
          :raises: :class:`ValueError <exceptions.ValueError>` if the number of
                   mutations exceeds the :data:`MAX_MUTATIONS`.