import inspect


def _call_location(levels=2):
  """Return caller's location a number of levels up."""
  f = inspect.currentframe()
  if not f:
    return '<unknown location>'
  for _ in range(levels):
    f = f.f_back or f
  return '%s:%s' % (f.f_code.co_filename, f.f_lineno)