code: def is_file_like(obj) -> bool:
      """
      Check if the object is a file-like object.
  
      For objects to be considered file-like, they must
      be an iterator AND have either a `read` and/or `write`
      method as an attribute.
  
      Note: file-like objects must be iterable, but
      iterable objects need not be file-like.
  
      Parameters
      ----------
      obj : The object to check
  
      Returns
      -------
      bool
          Whether `obj` has file-like properties.
  
      Examples
      --------
      >>> import io
      >>> from pandas.api.types import is_file_like
      >>> buffer = io.StringIO("data")
      >>> is_file_like(buffer)
      True
      >>> is_file_like([1, 2, 3])
      False
      """
      if not (hasattr(obj, "read") or hasattr(obj, "write")):
          return False
  
      return bool(hasattr(obj, "__iter__"))
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/dtypes/inference.py
imports: from __future__ import annotations
  from collections import abc
  from numbers import Number
  import re
  from typing import Pattern
  import numpy
  from pandas._libs import lib
label_desc: Use image node_id 3 for calling a global function with example usage: is_file_like(obj) and returns: bool, False