code: def ignore_invalid(condition=True):
      if condition:
          with np.errstate(invalid="ignore"):
              yield
      else:
          yield
  
file_path: shapely/shapely/tests/common.py
imports: import warnings
  from contextlib import contextmanager
  import numpy
  import pytest
  import shapely
label_desc: Use image node_id 1 for calling a global function with example usage: ignore_invalid(condition) without return types