def read_json(path_or_buf=None, orient=None, typ='frame', dtype=True, convert_axes=True, convert_dates=True, keep_default_dates=True, numpy=False, precise_float=False, date_unit=None, encoding=None, lines=False):
 (filepath_or_buffer, _, _) = get_filepath_or_buffer(path_or_buf, encoding=encoding)
 if isinstance(filepath_or_buffer, compat.string_types):
  try:
   exists = os.path.exists(filepath_or_buffer)
  except (TypeError, ValueError):
   exists = False
  if exists:
   (fh, handles) = _get_handle(filepath_or_buffer, 'r', encoding=encoding)
   json = fh.read()
   fh.close()
  else:
   json = filepath_or_buffer
 elif hasattr(filepath_or_buffer, 'read'):
  json = filepath_or_buffer.read()
 else:
  json = filepath_or_buffer
 if lines:
  lines = list(StringIO(json.strip()))
  json = (('[' + ','.join(lines)) + ']')
 obj = None
 if (typ == 'frame'):
  obj = FrameParser(json, orient, dtype, convert_axes, convert_dates, keep_default_dates, numpy, precise_float, date_unit).parse()
 if ((typ == 'series') or (obj is None)):
  if (not isinstance(dtype, bool)):
   dtype = dict(data=dtype)
  obj = SeriesParser(json, orient, dtype, convert_axes, convert_dates, keep_default_dates, numpy, precise_float, date_unit).parse()
 return obj

def read_json ( path_or_buf = None , orient = None , typ = 'frame' , dtype = True , convert_axes = True , convert_dates = True , keep_default_dates = True , numpy = False , precise_float = False , date_unit = None , encoding = None , lines = False ) : ( filepath_or_buffer , _ , _ ) = get_filepath_or_buffer ( path_or_buf , encoding = encoding ) if isinstance ( filepath_or_buffer , compat . string_types ) : try : exists = os . path . exists ( filepath_or_buffer ) except ( TypeError , ValueError ) : exists = False if exists : ( fh , handles ) = _get_handle ( filepath_or_buffer , 'r' , encoding = encoding ) json = fh . read ( ) fh . close ( ) else : json = filepath_or_buffer elif hasattr ( filepath_or_buffer , 'read' ) : json = filepath_or_buffer . read ( ) else : json = filepath_or_buffer if lines : lines = list ( StringIO ( json . strip ( ) ) ) json = ( ( '[' + ',' . join ( lines ) ) + ']' ) obj = None if ( typ == 'frame' ) : obj = FrameParser ( json , orient , dtype , convert_axes , convert_dates , keep_default_dates , numpy , precise_float , date_unit ) . parse ( ) if ( ( typ == 'series' ) or ( obj is None ) ) : if ( not isinstance ( dtype , bool ) ) : dtype = dict ( data = dtype ) obj = SeriesParser ( json , orient , dtype , convert_axes , convert_dates , keep_default_dates , numpy , precise_float , date_unit ) . parse ( ) return obj
read a json file if path is a file .