<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def locateChild(self, ctx, segments):
 """ Return a Deferred which will fire with the customized version of the resource being located. """

        D = defer.maybeDeferred(
            self.currentResource.locateChild, ctx, segments)

        def finishLocating((nextRes, nextPath)):
            custom = ixmantissa.ICustomizable(nextRes, None)
            if custom is not None:
                return (custom.customizeFor(self.forWho), nextPath)
            self.currentResource = nextRes
            if nextRes is None:
                return (nextRes, nextPath)
            return (_CustomizingResource(nextRes, self.forWho), nextPath)

        return D.addCallback(finishLocating)