

class cached_property(object):
    """
    Copied from Django.
    """
    def __init__(self, func):
        self.func = func

    def __get__(self, instance, type=None):
        if instance is None:
            return self
        res = instance.__dict__[self.func.__name__] = self.func(instance)
        return res


def attach_attribute(target, name, attr):
    attr.__name__ = name
    setattr(target, name, attr)


def attach_cached_property(target, name, prop):
    method = cached_property(prop)
    attach_attribute(target, name, method)



class cached_property(object):
    """
    Copied from Django.
    """
    def __init__(self, func):
        self.func = func

    def __get__(self, instance, type=None):
        res = instance.__dict__[self.func.__name__] = self.func(instance)
        return res


def attach_attribute(target, name, attr):
    attr.__name__ = name
    setattr(target, name, attr)


def attach_cached_property(target, name, prop):
    method = cached_property(prop)
    attach_attribute(target, name, method)

Remove unused line from cached_property
Remove unused line from cached_property

  
  
  class cached_property(object):
      """
      Copied from Django.
      """
      def __init__(self, func):
          self.func = func
  
      def __get__(self, instance, type=None):
-         if instance is None:
-             return self
          res = instance.__dict__[self.func.__name__] = self.func(instance)
          return res
  
  
  def attach_attribute(target, name, attr):
      attr.__name__ = name
      setattr(target, name, attr)
  
  
  def attach_cached_property(target, name, prop):
      method = cached_property(prop)
      attach_attribute(target, name, method)
  
Remove unused line from cached_property
## Code Before:


class cached_property(object):
    """
    Copied from Django.
    """
    def __init__(self, func):
        self.func = func

    def __get__(self, instance, type=None):
        if instance is None:
            return self
        res = instance.__dict__[self.func.__name__] = self.func(instance)
        return res


def attach_attribute(target, name, attr):
    attr.__name__ = name
    setattr(target, name, attr)


def attach_cached_property(target, name, prop):
    method = cached_property(prop)
    attach_attribute(target, name, method)

## Instruction:
Remove unused line from cached_property
## Code After:


class cached_property(object):
    """
    Copied from Django.
    """
    def __init__(self, func):
        self.func = func

    def __get__(self, instance, type=None):
        res = instance.__dict__[self.func.__name__] = self.func(instance)
        return res


def attach_attribute(target, name, attr):
    attr.__name__ = name
    setattr(target, name, attr)


def attach_cached_property(target, name, prop):
    method = cached_property(prop)
    attach_attribute(target, name, method)
