<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_order(self, kitchen, save_to_file=None):
 """ List the orders for a kitchen or recipe """

        rc = DKReturnCode()
        if kitchen is None or isinstance(kitchen, basestring) is False:
            rc.set(rc.DK_FAIL, 'issue with kitchen parameter')
            return rc

        url = '%s/v2/order/status/%s' % (self.get_url_for_direct_rest_call(), kitchen)
        try:
            response = requests.get(url, headers=self._get_common_headers())
            rdict = self._get_json(response)
            pass
        except (RequestException, ValueError, TypeError), c:
            s = "get_recipe: exception: %s" % str(c)
            rc.set(rc.DK_FAIL, s)
            return rc
        if not DKCloudAPI._valid_response(response):
            arc = DKAPIReturnCode(rdict)
            rc.set(rc.DK_FAIL, arc.get_message())
        else:
            if save_to_file is not None:
                import pickle
                pickle.dump(rdict, open(save_to_file, "wb"))

            rc.set(rc.DK_SUCCESS, None, rdict)
        return rc