code: def yaw(b, component, solve_for=None, **kwargs):
      
  
      hier = b.get_hierarchy()
      if not len(hier.get_value()):
          # TODO: change to custom error type to catch in bundle.add_component
          # TODO: check whether the problem is 0 hierarchies or more than 1
          raise NotImplementedError("constraint for yaw requires hierarchy")
  
      component_ps = _get_system_ps(b, component)
  
      parentorbit = hier.get_parent_of(component)
      parentorbit_ps = _get_system_ps(b, parentorbit)
  
      long_an_comp = component_ps.get_parameter(qualifier='long_an')
      yaw_comp = component_ps.get_parameter(qualifier='yaw')
      long_an_orb = parentorbit_ps.get_parameter(qualifier='long_an')
  
      if solve_for in [None, long_an_comp]:
          lhs = long_an_comp
          rhs = long_an_orb + yaw_comp
  
      elif solve_for == long_an_orb:
          lhs = long_an_orb
          rhs = long_an_comp - yaw_comp
  
      elif solve_for == yaw_comp:
          lhs = yaw_comp
          rhs = long_an_comp - long_an_orb
  
      else:
          raise NotImplementedError
  
      return lhs, rhs, {'component': component}
docs: Create a constraint for the inclination of a star relative to its parent orbit
  
      :parameter b: the :class:`phoebe.frontend.bundle.Bundle`
      :parameter str component: the label of the star in which this
          constraint should be built
      :parameter str solve_for:  if 'long_an@star' should not be the derived/constrained
          parameter, provide which other parameter should be derived
          (ie 'long_an@orbit', 'yaw@star')
      :returns: lhs (Parameter), rhs (ConstraintParameter), args (list of arguments
          that were passed to this function)