<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process_text(text, out_format='json_ld', save_json='eidos_output.json', webservice=None):
 """Return an EidosProcessor by processing the given text. This constructs a reader object via Java and extracts mentions from the text. It then serializes the mentions into JSON and processes the result with process_json. Parameters text : str The text to be processed. out_format : Optional[str] The type of Eidos output to read into and process. Currently only 'json-ld' is supported which is also the default value used. save_json : Optional[str] The name of a file in which to dump the JSON output of Eidos. webservice : Optional[str] An Eidos reader web service URL to send the request to. If None, the reading is assumed to be done with the Eidos JAR rather than via a web service. Default: None Returns ------- ep : EidosProcessor An EidosProcessor containing the extracted INDRA Statements in its statements attribute. """

    if not webservice:
        if eidos_reader is None:
            logger.error('Eidos reader is not available.')
            return None
        json_dict = eidos_reader.process_text(text, out_format)
    else:
        res = requests.post('%s/process_text' % webservice,
                            json={'text': text})
        json_dict = res.json()
    if save_json:
        with open(save_json, 'wt') as fh:
            json.dump(json_dict, fh, indent=2)
    return process_json(json_dict)