parameters: (flag, value)
return_statement: return members, not_covered
docstring: Extract all members from the value.
docstring_summary: Extract all members from the value.
docstring_tokens: Extract all members from the value .
function: def _decompose(flag, value):
      """Extract all members from the value."""
      # _decompose is only called if the value is not named
      not_covered = value
      negative = value < 0
      # issue29167: wrap accesses to _value2member_map_ in a list to avoid race
      #             conditions between iterating over it and having more pseudo-
      #             members added to it
      if negative:
          # only check for named flags
          flags_to_check = [
                  (m, v)
                  for v, m in list(flag._value2member_map_.items())
                  if m.name is not None
                  ]
      else:
          # check for named flags and powers-of-two flags
          flags_to_check = [
                  (m, v)
                  for v, m in list(flag._value2member_map_.items())
                  if m.name is not None or _power_of_two(v)
                  ]
      members = []
      for member, member_value in flags_to_check:
          if member_value and member_value & value == member_value:
              members.append(member)
              not_covered &= ~member_value
      if not members and value in flag._value2member_map_:
          members.append(flag._value2member_map_[value])
      members.sort(key=lambda m: m._value_, reverse=True)
      if len(members) > 1 and members[0].value == value:
          # we have the breakdown, don't need the value member itself
          members.pop(0)
      return members, not_covered
function_tokens: def _decompose ( flag , value ) : # _decompose is only called if the value is not named not_covered = value negative = value < 0 # issue29167: wrap accesses to _value2member_map_ in a list to avoid race #             conditions between iterating over it and having more pseudo- #             members added to it if negative : # only check for named flags flags_to_check = [ ( m , v ) for v , m in list ( flag . _value2member_map_ . items ( ) ) if m . name is not None ] else : # check for named flags and powers-of-two flags flags_to_check = [ ( m , v ) for v , m in list ( flag . _value2member_map_ . items ( ) ) if m . name is not None or _power_of_two ( v ) ] members = [ ] for member , member_value in flags_to_check : if member_value and member_value & value == member_value : members . append ( member ) not_covered &= ~ member_value if not members and value in flag . _value2member_map_ : members . append ( flag . _value2member_map_ [ value ] ) members . sort ( key = lambda m : m . _value_ , reverse = True ) if len ( members ) > 1 and members [ 0 ] . value == value : # we have the breakdown, don't need the value member itself members . pop ( 0 ) return members , not_covered