parameters: (cpu1, cpu2)
return_statement: return retval
docstring: Find the lowest common denominator of two CPU sets.
docstring_summary: Find the lowest common denominator of two CPU sets.
docstring_tokens: Find the lowest common denominator of two CPU sets .
function: def cpu_lcd(cpu1, cpu2):
      """Find the lowest common denominator of two CPU sets."""
      retval = set()
  
      # CPU
      cpu1cpus = set(ordered_cpus) & set(cpu1)
      if not cpu1cpus:
          cpu1cpus.add("086")
      cpu1mincpu = min(ordered_cpus.index(x) for x in cpu1cpus)
      cpu2cpus = set(ordered_cpus) & set(cpu2)
      if not cpu2cpus:
          cpu2cpus.add("086")
      cpu2mincpu = min(ordered_cpus.index(x) for x in cpu1cpus)
      cpumin = ordered_cpus[min(cpu1mincpu, cpu2mincpu)]
      if cpumin == "086":
          cpumin = "Any"
  
      if cpumin != "Any":
          retval.add(cpumin)
  
      # Feature
      cpu1features = set(ordered_cpu_features) & set(cpu1)
      if not cpu1features:
          cpu1minfeature = -1
      else:
          cpu1minfeature = min(ordered_cpu_features.index(x)
                               for x in cpu1features)
  
      cpu2features = set(ordered_cpu_features) & set(cpu2)
      if not cpu2features:
          cpu2minfeature = -1
      else:
          cpu2minfeature = min(ordered_cpu_features.index(x)
                               for x in cpu2features)
  
      if cpu1minfeature != -1 and cpu2minfeature != -1:
          featuremin = ordered_cpu_features[min(cpu1minfeature, cpu2minfeature)]
          retval.add(featuremin)
  
      # Unordered features
      for feature in set(unordered_cpu_features) & set(cpu1) & set(cpu2):
          retval.add(feature)
  
      return retval
function_tokens: def cpu_lcd ( cpu1 , cpu2 ) : retval = set ( ) # CPU cpu1cpus = set ( ordered_cpus ) & set ( cpu1 ) if not cpu1cpus : cpu1cpus . add ( "086" ) cpu1mincpu = min ( ordered_cpus . index ( x ) for x in cpu1cpus ) cpu2cpus = set ( ordered_cpus ) & set ( cpu2 ) if not cpu2cpus : cpu2cpus . add ( "086" ) cpu2mincpu = min ( ordered_cpus . index ( x ) for x in cpu1cpus ) cpumin = ordered_cpus [ min ( cpu1mincpu , cpu2mincpu ) ] if cpumin == "086" : cpumin = "Any" if cpumin != "Any" : retval . add ( cpumin ) # Feature cpu1features = set ( ordered_cpu_features ) & set ( cpu1 ) if not cpu1features : cpu1minfeature = - 1 else : cpu1minfeature = min ( ordered_cpu_features . index ( x ) for x in cpu1features ) cpu2features = set ( ordered_cpu_features ) & set ( cpu2 ) if not cpu2features : cpu2minfeature = - 1 else : cpu2minfeature = min ( ordered_cpu_features . index ( x ) for x in cpu2features ) if cpu1minfeature != - 1 and cpu2minfeature != - 1 : featuremin = ordered_cpu_features [ min ( cpu1minfeature , cpu2minfeature ) ] retval . add ( featuremin ) # Unordered features for feature in set ( unordered_cpu_features ) & set ( cpu1 ) & set ( cpu2 ) : retval . add ( feature ) return retval