code: def test_astype_dispatches(frame_or_series):
      # This is a dtype-specific test that ensures Series[decimal].astype
      # gets all the way through to ExtensionArray.astype
      # Designing a reliable smoke test that works for arbitrary data types
      # is difficult.
      data = pd.Series(DecimalArray([decimal.Decimal(2)]), name="a")
      ctx = decimal.Context()
      ctx.prec = 5
  
      data = frame_or_series(data)
  
      result = data.astype(DecimalDtype(ctx))
  
      if frame_or_series is pd.DataFrame:
          result = result["a"]
  
      assert result.dtype.context.prec == ctx.prec
  
imports: from __future__ import annotations
  import decimal
  import operator
  import numpy
  import pytest
  import pandas
  import pandas._testing
  from pandas.tests.extension import base
  from pandas.tests.extension.decimal.array import DecimalArray, DecimalDtype, make_data, to_decimal
label_desc: Use image node_id 13 for calling a global function with example usage: test_astype_dispatches(frame_or_series) without return types