message: Add bounds checking when looking at the stack in deprecation messages.
  This was breaking integration with R, fixes
diff: @@ -100,7 +100,13 @@ def _validate_deprecation_args(date, instructions):
  def _call_location(outer=False):
  """Returns call location given level up from current call."""
  stack = tf_stack.extract_stack()
  - frame = stack[-4 if outer else -3]
  + length = len(stack)
  + if length == 0: # should never happen as we're in a function
  + return 'UNKNOWN'
  + index = length-4 if outer else length-3
  + if index < 0:
  + index = 0
  + frame = stack[index]
  return '{filename}:{lineno}'.format(filename=frame[0], lineno=frame[1])
  