code: def as_f_sign_1(e):
      """If ``e`` is a sum that can be written as ``g*(a + s)`` where
      ``s`` is ``+/-1``, return ``g``, ``a``, and ``s`` where ``a`` does
      not have a leading negative coefficient.
  
      Examples
      ========
  
      >>> from sympy.simplify.fu import as_f_sign_1
      >>> from sympy.abc import x
      >>> as_f_sign_1(x + 1)
      (1, x, 1)
      >>> as_f_sign_1(x - 1)
      (1, x, -1)
      >>> as_f_sign_1(-x + 1)
      (-1, x, -1)
      >>> as_f_sign_1(-x - 1)
      (-1, x, 1)
      >>> as_f_sign_1(2*x + 2)
      (2, x, 1)
      """
      if not e.is_Add or len(e.args) != 2:
          return
      # exact match
      a, b = e.args
      if a in (S.NegativeOne, S.One):
          g = S.One
          if b.is_Mul and b.args[0].is_Number and b.args[0] < 0:
              a, b = -a, -b
              g = -g
          return g, b, a
      # gcd match
      a, b = [Factors(i) for i in e.args]
      ua, ub = a.normal(b)
      gcd = a.gcd(b).as_expr()
      if S.NegativeOne in ua.factors:
          ua = ua.quo(S.NegativeOne)
          n1 = -1
          n2 = 1
      elif S.NegativeOne in ub.factors:
          ub = ub.quo(S.NegativeOne)
          n1 = 1
          n2 = -1
      else:
          n1 = n2 = 1
      a, b = [i.as_expr() for i in (ua, ub)]
      if a is S.One:
          a, b = b, a
          n1, n2 = n2, n1
      if n1 == -1:
          gcd = -gcd
          n2 = -n2
  
      if b is S.One:
          return gcd, a, n2
  
imports: from collections import defaultdict
  from sympy.core.add import Add
  from sympy.core.expr import Expr
  from sympy.core.exprtools import Factors, gcd_terms, factor_terms
  from sympy.core.function import expand_mul
  from sympy.core.mul import Mul
  from sympy.core.numbers import pi, I
  from sympy.core.power import Pow
  from sympy.core.singleton import S
  from sympy.core.sorting import ordered
  from sympy.core.symbol import Dummy
  from sympy.core.sympify import sympify
  from sympy.core.traversal import bottom_up
  from sympy.functions.combinatorial.factorials import binomial
  from sympy.functions.elementary.hyperbolic import cosh, sinh, tanh, coth, sech, csch, HyperbolicFunction
  from sympy.functions.elementary.trigonometric import cos, sin, tan, cot, sec, csc, sqrt, TrigonometricFunction
  from sympy.ntheory.factor_ import perfect_power
  from sympy.polys.polytools import factor
  from sympy.strategies.tree import greedy
  from sympy.strategies.core import identity, debug
  from sympy import SYMPY_DEBUG
label_desc: Use image node_id 32 for calling a global function with example usage: as_f_sign_1(e) and returns: g,  b,  a, gcd,  a,  n2