parameters: (self, orig_node)
docstring: Copy the node only if it can't have an data-if added to it.
  
          We leave nodes that have a data-if or data-else in-place and new
          <span> wrappers are generated instead.
docstring_summary: Copy the node only if it can't have an data-if added to it.
docstring_tokens: Copy the node only if it can t have an data - if added to it .
function: def copy_node(self, orig_node):
          """Copy the node only if it can't have an data-if added to it.
  
          We leave nodes that have a data-if or data-else in-place and new
          <span> wrappers are generated instead.
          """
          if self.can_have_if(orig_node):
              # Run the BaseFilter copy_node
              return super(IfElseFilter, self).copy_node(orig_node)
          else:
              # We clone the node to make sure we don't unintentionally modify
              # the original node.
              node = copy.deepcopy(orig_node)
              node.tail = ''
  
              # Change the tag names to just be a boring 'span'
              node.tag = self.cloned_node.tag = 'span'
  
              # Remove all existing attributes on both the original and the
              # cloned node
              for attr in node.attrib:
                  node.attrib.pop(attr)
              for attr in self.cloned_node.attrib:
                  self.cloned_node.attrib.pop(attr)
  
              # Set the data-unwrap attribute to get the exercise framework
              # to automatically remove the <span> wrapper that we added
              node.set('data-unwrap', '')
              self.cloned_node.set('data-unwrap', '')
  
              return node
function_tokens: def copy_node ( self , orig_node ) : if self . can_have_if ( orig_node ) : # Run the BaseFilter copy_node return super ( IfElseFilter , self ) . copy_node ( orig_node ) else : # We clone the node to make sure we don't unintentionally modify # the original node. node = copy . deepcopy ( orig_node ) node . tail = '' # Change the tag names to just be a boring 'span' node . tag = self . cloned_node . tag = 'span' # Remove all existing attributes on both the original and the # cloned node for attr in node . attrib : node . attrib . pop ( attr ) for attr in self . cloned_node . attrib : self . cloned_node . attrib . pop ( attr ) # Set the data-unwrap attribute to get the exercise framework # to automatically remove the <span> wrapper that we added node . set ( 'data-unwrap' , '' ) self . cloned_node . set ( 'data-unwrap' , '' ) return node