
import sys
from functools import wraps
from StringIO import StringIO

from mock import patch


def redirect_stdout(func):
    """temporarily redirect stdout to new output stream"""
    @wraps(func)
    def wrapper(*args, **kwargs):
        original_stdout = sys.stdout
        out = StringIO()
        try:
            sys.stdout = out
            return func(out, *args, **kwargs)
        finally:
            sys.stdout = original_stdout
    return wrapper


def use_user_prefs(user_prefs):
    """temporarily use the given values for user preferences"""
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            with patch('yvs.shared.get_user_prefs', return_value=user_prefs):
                return func(*args, **kwargs)
        return wrapper
    return decorator


import sys
from functools import wraps
from StringIO import StringIO


def redirect_stdout(func):
    """temporarily redirect stdout to new output stream"""
    @wraps(func)
    def wrapper(*args, **kwargs):
        original_stdout = sys.stdout
        out = StringIO()
        try:
            sys.stdout = out
            return func(out, *args, **kwargs)
        finally:
            sys.stdout = original_stdout
    return wrapper

Remove use_user_prefs decorator for add_language
Remove use_user_prefs decorator for add_language

  
  import sys
  from functools import wraps
  from StringIO import StringIO
- 
- from mock import patch
  
  
  def redirect_stdout(func):
      """temporarily redirect stdout to new output stream"""
      @wraps(func)
      def wrapper(*args, **kwargs):
          original_stdout = sys.stdout
          out = StringIO()
          try:
              sys.stdout = out
              return func(out, *args, **kwargs)
          finally:
              sys.stdout = original_stdout
      return wrapper
  
- 
- def use_user_prefs(user_prefs):
-     """temporarily use the given values for user preferences"""
-     def decorator(func):
-         @wraps(func)
-         def wrapper(*args, **kwargs):
-             with patch('yvs.shared.get_user_prefs', return_value=user_prefs):
-                 return func(*args, **kwargs)
-         return wrapper
-     return decorator
- 
Remove use_user_prefs decorator for add_language
## Code Before:

import sys
from functools import wraps
from StringIO import StringIO

from mock import patch


def redirect_stdout(func):
    """temporarily redirect stdout to new output stream"""
    @wraps(func)
    def wrapper(*args, **kwargs):
        original_stdout = sys.stdout
        out = StringIO()
        try:
            sys.stdout = out
            return func(out, *args, **kwargs)
        finally:
            sys.stdout = original_stdout
    return wrapper


def use_user_prefs(user_prefs):
    """temporarily use the given values for user preferences"""
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            with patch('yvs.shared.get_user_prefs', return_value=user_prefs):
                return func(*args, **kwargs)
        return wrapper
    return decorator

## Instruction:
Remove use_user_prefs decorator for add_language
## Code After:

import sys
from functools import wraps
from StringIO import StringIO


def redirect_stdout(func):
    """temporarily redirect stdout to new output stream"""
    @wraps(func)
    def wrapper(*args, **kwargs):
        original_stdout = sys.stdout
        out = StringIO()
        try:
            sys.stdout = out
            return func(out, *args, **kwargs)
        finally:
            sys.stdout = original_stdout
    return wrapper
