def _get_data_from_filepath(self, filepath_or_buffer):
data = filepath_or_buffer<EOL>exists = False<EOL>if isinstance(data, str):<EOL><INDENT>try:<EOL><INDENT>exists = os.path.exists(filepath_or_buffer)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if exists or self.compression is not None:<EOL><INDENT>data, _ = _get_handle(filepath_or_buffer, '<STR_LIT:r>',<EOL>encoding=self.encoding,<EOL>compression=self.compression)<EOL>self.should_close = True<EOL>self.open_stream = data<EOL><DEDENT>return data<EOL>
The function read_json accepts three input types:
    1. filepath (string-like)
    2. file-like object (e.g. open file object, StringIO)
    3. JSON string

This method turns (1) into (2) to simplify the rest of the processing.
It returns input types (2) and (3) unchanged.