old_contents: """
  sentry.tasks.base
  ~~~~~~~~~~~~~~~~~
  
  :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
  :license: BSD, see LICENSE for more details.
  """
  
  from celery.task import task
  from django_statsd.clients import statsd
  from functools import wraps
  
  
  def instrumented_task(name, queue, stat_suffix=None, **kwargs):
      statsd_key = 'jobs.duration.{name}'.format(name=name)
      if stat_suffix:
          statsd_key += '.{key}'.format(key=stat_suffix)
  
      def wrapped(func):
          @wraps(func)
          def _wrapped(*args, **kwargs):
              with statsd.timer(statsd_key):
                  result = func(*args, **kwargs)
              return result
          return task(name=name, queue=queue, **kwargs)(func)
      return wrapped
  
new_contents: """
  sentry.tasks.base
  ~~~~~~~~~~~~~~~~~
  
  :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
  :license: BSD, see LICENSE for more details.
  """
  
  from celery.task import task
  from django_statsd.clients import statsd
  from functools import wraps
  
  
  def instrumented_task(name, queue, stat_suffix=None, **kwargs):
      statsd_key = 'jobs.duration.{name}'.format(name=name)
      if stat_suffix:
          statsd_key += '.{key}'.format(key=stat_suffix)
  
      def wrapped(func):
          @wraps(func)
          def _wrapped(*args, **kwargs):
              with statsd.timer(statsd_key):
                  result = func(*args, **kwargs)
              return result
          return task(name=name, queue=queue, **kwargs)(_wrapped)
      return wrapped
  
subject: Return wrapped func