parameters: (properties, requirements)
return_statement: return sequence.unique(list(result) + requirements)
docstring: Refines 'properties' by overriding any non-free properties 
          for which a different value is specified in 'requirements'. 
          Conditional requirements are just added without modification.
          Returns the resulting list of properties.
docstring_summary: Refines 'properties' by overriding any non-free properties 
          for which a different value is specified in 'requirements'. 
          Conditional requirements are just added without modification.
          Returns the resulting list of properties.
docstring_tokens: Refines properties by overriding any non - free properties for which a different value is specified in requirements . Conditional requirements are just added without modification . Returns the resulting list of properties .
function: def refine (properties, requirements):
      """ Refines 'properties' by overriding any non-free properties 
          for which a different value is specified in 'requirements'. 
          Conditional requirements are just added without modification.
          Returns the resulting list of properties.
      """
      # The result has no duplicates, so we store it in a set
      result = set()
      
      # Records all requirements.
      required = {}
      
      # All the elements of requirements should be present in the result
      # Record them so that we can handle 'properties'.
      for r in requirements:
          # Don't consider conditional requirements.
          if not r.condition():
              required[r.feature()] = r
  
      for p in properties:
          # Skip conditional properties
          if p.condition():
              result.add(p)
          # No processing for free properties
          elif p.feature().free():
              result.add(p)
          else:
              if required.has_key(p.feature()):
                  result.add(required[p.feature()])
              else:
                  result.add(p)
  
      return sequence.unique(list(result) + requirements)
function_tokens: def refine ( properties , requirements ) : # The result has no duplicates, so we store it in a set result = set ( ) # Records all requirements. required = { } # All the elements of requirements should be present in the result # Record them so that we can handle 'properties'. for r in requirements : # Don't consider conditional requirements. if not r . condition ( ) : required [ r . feature ( ) ] = r for p in properties : # Skip conditional properties if p . condition ( ) : result . add ( p ) # No processing for free properties elif p . feature ( ) . free ( ) : result . add ( p ) else : if required . has_key ( p . feature ( ) ) : result . add ( required [ p . feature ( ) ] ) else : result . add ( p ) return sequence . unique ( list ( result ) + requirements )