parameters: (cmp, eq, order, default_eq)
return_statement: return eq, eq_key, order, order_key
docstring: Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
      values of eq and order.  If *eq* is None, set it to *default_eq*.
docstring_summary: Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
      values of eq and order.  If *eq* is None, set it to *default_eq*.
docstring_tokens: Validate the combination of * cmp * * eq * and * order * . Derive the effective values of eq and order . If * eq * is None set it to * default_eq * .
function: def _determine_attrib_eq_order(cmp, eq, order, default_eq):
      """
      Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
      values of eq and order.  If *eq* is None, set it to *default_eq*.
      """
      if cmp is not None and any((eq is not None, order is not None)):
          raise ValueError("Don't mix `cmp` with `eq' and `order`.")
  
      def decide_callable_or_boolean(value):
          """
          Decide whether a key function is used.
          """
          if callable(value):
              value, key = True, value
          else:
              key = None
          return value, key
  
      # cmp takes precedence due to bw-compatibility.
      if cmp is not None:
          cmp, cmp_key = decide_callable_or_boolean(cmp)
          return cmp, cmp_key, cmp, cmp_key
  
      # If left None, equality is set to the specified default and ordering
      # mirrors equality.
      if eq is None:
          eq, eq_key = default_eq, None
      else:
          eq, eq_key = decide_callable_or_boolean(eq)
  
      if order is None:
          order, order_key = eq, eq_key
      else:
          order, order_key = decide_callable_or_boolean(order)
  
      if eq is False and order is True:
          raise ValueError("`order` can only be True if `eq` is True too.")
  
      return eq, eq_key, order, order_key
function_tokens: def _determine_attrib_eq_order ( cmp , eq , order , default_eq ) : if cmp is not None and any ( ( eq is not None , order is not None ) ) : raise ValueError ( "Don't mix `cmp` with `eq' and `order`." ) def decide_callable_or_boolean ( value ) : """
          Decide whether a key function is used.
          """ if callable ( value ) : value , key = True , value else : key = None return value , key # cmp takes precedence due to bw-compatibility. if cmp is not None : cmp , cmp_key = decide_callable_or_boolean ( cmp ) return cmp , cmp_key , cmp , cmp_key # If left None, equality is set to the specified default and ordering # mirrors equality. if eq is None : eq , eq_key = default_eq , None else : eq , eq_key = decide_callable_or_boolean ( eq ) if order is None : order , order_key = eq , eq_key else : order , order_key = decide_callable_or_boolean ( order ) if eq is False and order is True : raise ValueError ( "`order` can only be True if `eq` is True too." ) return eq , eq_key , order , order_key