docstr: Raises if there were n calls before this call.
  Returns the number of calls before this call, if it's > n.
docstr_tok: ["Raises","if","there","were","n","calls","before","this","call",".","Returns","the","number","of","calls","before","this","call",",","if","it","'s",">","n","."]
code: def may_raise_n_times(self, counter, n):
      """
      Raises if there were n calls before this call.
      Returns the number of calls before this call, if it's > n.
      """
      c = ray.get(counter.increment.remote())
      print(f"may_raise_n_times, n = {n}, count = {c}")
      if c < n:
          print(f"method raises in {c} th call, want {n} times")
          raise MyError()
      return c
  
imports: import os
  import sys
  import pytest
  import ray
label_desc: Use image node_id 1 for calling the TroubleMaker obj's underlying member method code with example usage: obj.may_raise_n_times(counter, n) and returns: c