import os


SHOULD_CACHE = os.environ['ENV'] == 'production'


def cached_function(func):
    data = {}

    def wrapper(*args):
        if not SHOULD_CACHE:
            return func(*args)
        cache_key = ' '.join([str(x) for x in args])
        if cache_key not in data:
            data[cache_key] = func(*args)
        return data[cache_key]

    return wrapper

import os


SHOULD_CACHE = os.environ['ENV'] == 'production'


def cached_function(func):
    data = {}

    def wrapper(*args):
        if not SHOULD_CACHE:
            return func(*args)
        cache_key = ' '.join([str(x) for x in args])
        if cache_key not in data:
            data[cache_key] = func(*args)
        return data[cache_key]

    wrapper.__name__ = func.__name__
    return wrapper

Make cached_function not modify function name
Make cached_function not modify function name

  import os
  
  
  SHOULD_CACHE = os.environ['ENV'] == 'production'
  
  
  def cached_function(func):
      data = {}
  
      def wrapper(*args):
          if not SHOULD_CACHE:
              return func(*args)
          cache_key = ' '.join([str(x) for x in args])
          if cache_key not in data:
              data[cache_key] = func(*args)
          return data[cache_key]
  
+     wrapper.__name__ = func.__name__
      return wrapper
  
Make cached_function not modify function name
## Code Before:
import os


SHOULD_CACHE = os.environ['ENV'] == 'production'


def cached_function(func):
    data = {}

    def wrapper(*args):
        if not SHOULD_CACHE:
            return func(*args)
        cache_key = ' '.join([str(x) for x in args])
        if cache_key not in data:
            data[cache_key] = func(*args)
        return data[cache_key]

    return wrapper

## Instruction:
Make cached_function not modify function name
## Code After:
import os


SHOULD_CACHE = os.environ['ENV'] == 'production'


def cached_function(func):
    data = {}

    def wrapper(*args):
        if not SHOULD_CACHE:
            return func(*args)
        cache_key = ' '.join([str(x) for x in args])
        if cache_key not in data:
            data[cache_key] = func(*args)
        return data[cache_key]

    wrapper.__name__ = func.__name__
    return wrapper
