<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pull(self, cartname=None, env=None):
 """ `cartname` - Name of cart Pull remote cart from the pre release (base) environment """

        if not env:
            env = self._defaults['start_in']
        juicer.utils.Log.log_debug("Initializing pulling cart: %s ...", cartname)

        cart_file = os.path.join(juicer.common.Cart.CART_LOCATION, cartname)
        cart_file += '.json'

        cart_check = juicer.utils.download_cart(cartname, env)
        if cart_check is None:
            print 'error: cart \'%s\' does not exist' % cartname
            return None
        else:
            juicer.utils.write_json_document(cart_file, juicer.utils.download_cart(cartname, env))
            return cart_check