#NEWLINE# def expand_constraints( component , constraints ) : #NEWLINE# #INDENT# ' A function which expands any ConstraintHelper in the list.\n\n    Parameters\n    ----------\n    component : Constrainable\n        The constrainable component with which the constraints are\n        associated. This will be passed to the .create_constraints()\n        method of any ConstraintHelper instance.\n\n    constraints : list\n        The list of constraints to expand.\n\n    Returns\n    -------\n    result : list\n        The list of expanded constraints.\n\n    ' #NEWLINE# cns = [ ] #NEWLINE# for cn in constraints : #NEWLINE# #INDENT# if isinstance ( cn , ConstraintHelper ) : #NEWLINE# #INDENT# cns . extend ( cn . create_constraints ( component ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( cn is not None ) : #NEWLINE# #INDENT# cns . append ( cn ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return cns