parameters: (action, new_project, new_action_name, new_properties)
return_statement: return cloned_action
docstring: Takes an 'action' instances and creates new instance of it
      and all produced target. The rule-name and properties are set
      to 'new-rule-name' and 'new-properties', if those are specified.
      Returns the cloned action.
docstring_summary: Takes an 'action' instances and creates new instance of it
      and all produced target. The rule-name and properties are set
      to 'new-rule-name' and 'new-properties', if those are specified.
      Returns the cloned action.
docstring_tokens: Takes an action instances and creates new instance of it and all produced target . The rule - name and properties are set to new - rule - name and new - properties if those are specified . Returns the cloned action .
function: def clone_action (action, new_project, new_action_name, new_properties):
      """Takes an 'action' instances and creates new instance of it
      and all produced target. The rule-name and properties are set
      to 'new-rule-name' and 'new-properties', if those are specified.
      Returns the cloned action."""
  
      if not new_action_name:
          new_action_name = action.action_name()
  
      if not new_properties:
          new_properties = action.properties()
  
      cloned_action = action.__class__(action.manager_, action.sources(), new_action_name,
                                       new_properties)
                            
      cloned_targets = []
      for target in action.targets():
  
          n = target.name()
          # Don't modify the name of the produced targets. Strip the directory f
          cloned_target = FileTarget(n, target.type(), new_project,
                                     cloned_action, exact=True)
  
          d = target.dependencies()
          if d:
              cloned_target.depends(d)
          cloned_target.root(target.root())
          cloned_target.creating_subvariant(target.creating_subvariant())
  
          cloned_targets.append(cloned_target)
  
      return cloned_action
function_tokens: def clone_action ( action , new_project , new_action_name , new_properties ) : if not new_action_name : new_action_name = action . action_name ( ) if not new_properties : new_properties = action . properties ( ) cloned_action = action . __class__ ( action . manager_ , action . sources ( ) , new_action_name , new_properties ) cloned_targets = [ ] for target in action . targets ( ) : n = target . name ( ) # Don't modify the name of the produced targets. Strip the directory f cloned_target = FileTarget ( n , target . type ( ) , new_project , cloned_action , exact = True ) d = target . dependencies ( ) if d : cloned_target . depends ( d ) cloned_target . root ( target . root ( ) ) cloned_target . creating_subvariant ( target . creating_subvariant ( ) ) cloned_targets . append ( cloned_target ) return cloned_action