<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_static_file(self, filename):
 """ Send static files from the static folder in the current selected theme prior to the global static folder. :param filename: static filename :return: response object """

        if self.config['MODE'] == 'api-only':
            # if 'api-only' mode is set, we should not send static files
            abort(404)

        theme_static_folder = getattr(self, 'theme_static_folder', None)
        if theme_static_folder:
            try:
                return send_from_directory(theme_static_folder, filename)
            except NotFound:
                pass
        return super(CustomFlask, self).send_static_file(filename)