Return a tupple of values representing the unicity of the object
778430
def get_comparable_values_for_ordering(self):
        

        return (0 if self.position >= 0 else 1, int(self.position), str(self.name), str(self.description))
1107766
def get_value_tuple(self):
        
        retval = tuple()
        for val in self.VALUES:
            retval += (getattr(self, val),)
        return retval
163437
function objectFromPairs(pairs) {
  var result = {};

  for (let i = 0, len = pairs.length; i < len; i++) {
    let pair = pairs[i];
    result[pair[0]] = pair[1];
  }

  return result;
}
1319933
def as_tuple(obj):
    "  "

    if not obj:
        return tuple()

    if isinstance(obj, (tuple, set, list)):
        return tuple(obj)

    if hasattr(obj, '__iter__') and not isinstance(obj, dict):
        return obj

    return obj,
705164
function getMatchData(object) {
        var result = toPairs(object), length = result.length;
        while (length--) {
          result[length][2] = isStrictComparable(result[length][1]);
        }
        return result;
      }
1045556
private static Collection<Tuple> getTuples( List<VarDef> varDefs, int varStart, int varEnd, int tupleSize)
    {
    Collection<Tuple> tuples = new ArrayList<Tuple>();

    // For each variable up to the last included...
    for( int i = varStart; i < varEnd; i++)
      {
      // Combine each valid value...
      VarDef                nextVar   = varDefs.get(i);
      Iterator<VarValueDef> values    = nextVar.getValidValues();
      if( !values.hasNext())
        {
        throw new IllegalStateException( "Can't complete tuples -- no valid values defined for var=" + nextVar);
        }

      // With all subtuples from the remaining variables.
      Collection<Tuple> subTuples =
        tupleSize==1
        ? null
        : getTuples( varDefs, i + 1, varEnd + 1, tupleSize - 1);

      // Only one variable to combine?
      if( subTuples == null)
        {
        // Yes, return list of 1-tuples for this variable.
        while( values.hasNext())
          {
          tuples.add( new Tuple( new VarBindingDef( nextVar, values.next())));
          }
        }

      // Any compatible subtuples for remaining variables?
      else if( !subTuples.isEmpty())
        {
        // Yes, add all compatible combinations with values for this variable.
        while( values.hasNext())
          {
          VarBindingDef nextBinding = new VarBindingDef( nextVar, values.next());
          for( Tuple subTuple : subTuples)
            {
            Tuple nextTuple = new Tuple( nextBinding).addAll( subTuple);
            if( nextTuple.isCompatible())
              {
              tuples.add( nextTuple);
              }
            }
          }
        }
      }
    
    return tuples;
    }
856795
def randtuple(self):
        
        return tuple(
            self.randint
            for x in range(0, self.random.randint(3, 10)))
665304
def get_single_value(d):
    """"""
    assert len(d) == 1, 'Single-item dict must have just one item, not %d.' % len(d)
    return next(six.itervalues(d))
70004
def unidec(fnx):
    '''
    
    '''

    return lambda *ax, **kx: (
        wraps(ax[0])(lambda *ay, **ky: fnx(ax[0], *ay, **ky)) \
        if len(ax) == 1 and not kx and callable(ax[0]) else \
        lambda fny: wraps(fny)(lambda *ay, **ky: \
        fnx(fny, *ay, **dict(kx, **ky)) if not ax else throw(
            TypeError('wrapper get *args'))))
522389
def u(d):
    
    if six.PY2:
        if isinstance(d, six.binary_type):
            return d.decode("utf8", "ignore")
        elif isinstance(d, list):
            return [u(x) for x in d]
        elif isinstance(d, tuple):
            return tuple(u(x) for x in d)
        elif isinstance(d, dict):
            return dict( (u(k), u(v)) for k, v in six.iteritems(d))

    return d
874969
def unpack_value(self, tup_tree):
        

        valtype = attrs(tup_tree)['TYPE']

        raw_val = self.list_of_matching(tup_tree, ('VALUE', 'VALUE.ARRAY'))

        if not raw_val:
            return None

        if len(raw_val) > 1:
            raise CIMXMLParseError(
                _format("Element {0!A} has too many child elements {1!A} "
                        "(allowed is one of 'VALUE' or 'VALUE.ARRAY')",
                        name(tup_tree)),
                conn_id=self.conn_id)

        raw_val = raw_val[0]

        if type(raw_val) == list:  # pylint: disable=unidiomatic-typecheck
            return [self.unpack_single_value(data, valtype)
                    for data in raw_val]

        return self.unpack_single_value(raw_val, valtype)
586544
def itervalues(d, **kw):
    """"""
    if not PY2:
        return iter(d.values(**kw))
    return d.itervalues(**kw)
1003274
def _str(obj):
    """"""
    values = []
    for name in obj._attribs:
        val = getattr(obj, name)
        if isinstance(val, str):
            val = repr(val)
        val = str(val) if len(str(val)) < 10 else "(...)"
        values.append((name, val))
    values = ", ".join("{}={}".format(k, v) for k, v in values)
    return "{}({})".format(obj.__class__.__name__, values)
1188365
def itervalues(self):
        ""
        return chain(self._pb.StringMap.values(),
                     self._pb.IntMap.values(),
                     self._pb.FloatMap.values(),
                     self._pb.BoolMap.values())
60418
def values(cls):
        
        if not hasattr(cls, '__values_'):
            cls.__values_ = tuple([c.value for c in list(cls)])
        return cls.__values_
264758
def as_tuple(self):
        
        ptr = self._pointer
        return (ptr.xx, ptr.yx, ptr.xy, ptr.yy, ptr.x0, ptr.y0)
526464
def to_tuple(self):
        """"""
        return (
            self.data_type,
            self.unit,
            self.analysis_period,
            self.metadata
        )