code: def test_issue_5183():
      s = (x + 1 / x).lseries()
      assert list(s) == [1 / x, x]
      assert next((x + x**2).lseries()) == x
      assert next(((1 + x) ** 7).lseries(x)) == 1
      assert next((sin(x + y)).series(x, n=3).lseries(y)) == x
      # it would be nice if all terms were grouped, but in the
      # following case that would mean that all the terms would have
      # to be known since, for example, every term has a constant in it.
      s = ((1 + x) ** 7).series(x, 1, n=None)
      assert [next(s) for i in range(2)] == [128, -448 + 448 * x]
  
file_path: sympy/sympy/series/tests/test_lseries.py
imports: from sympy.core.numbers import E
  from sympy.core.singleton import S
  from sympy.functions.elementary.exponential import exp
  from sympy.functions.elementary.hyperbolic import tanh
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.series.order import Order
  from sympy.abc import x, y
label_desc: Use image node_id 6 for calling a global function with example usage: test_issue_5183() without return types