Get pk values from object

        :param obj: sqlalchemy object
320026
def _pk(self, obj):
        
        pk_values = tuple(getattr(obj, c.name)
                          for c in obj.__mapper__.primary_key)
        if len(pk_values) == 1:
            return pk_values[0]
        return pk_values
56097
def _get_value(obj, key, default=missing):
    
    if "." in key:
        return _get_value_for_keys(obj, key.split("."), default)
    else:
        return _get_value_for_key(obj, key, default)
1321086
def field_pklist_from_json(self, data):
        
        model = get_model(data['app'], data['model'])
        return PkOnlyQueryset(self, model, data['pks'])
841147
def get_properties(self, obj):
        """"""
        properties = {}

        for field_name, field in sorted(obj.fields.items()):
            schema = self._get_schema_for_field(obj, field)
            properties[field.name] = schema

        return properties
773921
def value_to_string(self, obj):
        
        statefield = self.to_python(self.value_from_object(obj))
        return statefield.state.name
1173378
def _get_object(objname, objtype):
    '''
    
    '''
    ret = None
    if objname is None:
        return ret

    if isinstance(objname, string_types):
        if objname in __opts__:
            ret = __opts__[objname]
        master_opts = __pillar__.get('master', {})
        if objname in master_opts:
            ret = master_opts[objname]
        if objname in __pillar__:
            ret = __pillar__[objname]
    elif isinstance(objname, objtype):
        ret = objname

    if not isinstance(ret, objtype):
        ret = None

    return ret
265610
def get_properties(obj):
    
    if hasattr(obj, 'keys'):
        return obj.keys()
    elif hasattr(obj, '__dict__'):
        return obj.__dict__.keys()

    return []
124593
public static PBES2Parameters getInstance(Object obj)
    {
        if (obj instanceof PBES2Parameters) {
            return (PBES2Parameters) obj;
        }
        if (obj instanceof org.bouncycastle.asn1.pkcs.PBES2Parameters) {
            return new PBES2Parameters(((org.bouncycastle.asn1.pkcs.PBES2Parameters) obj).getKeyDerivationFunc(),
                ((org.bouncycastle.asn1.pkcs.PBES2Parameters) obj).getEncryptionScheme());
        }
        if (obj != null) {
            return new PBES2Parameters(ASN1Sequence.getInstance(obj));
        }
        return null;
    }
473473
function parseValues(obj) {
        Object.keys(obj).forEach(function (key) {
            obj[key] = parseValue(obj[key]);
        });
        return obj;
    }
235234
def value_from_object(self, obj):
        """"""
        val = super(JSONField, self).value_from_object(obj)
        return self.get_prep_value(val)
1007186
public static PBKDF2Params getInstance(Object obj)
    {
        if (obj instanceof PBKDF2Params) {
            return (PBKDF2Params) obj;
        }

        if (obj instanceof org.bouncycastle.asn1.pkcs.PBKDF2Params) {
            org.bouncycastle.asn1.pkcs.PBKDF2Params params = (org.bouncycastle.asn1.pkcs.PBKDF2Params) obj;
            if (params.getKeyLength() != null) {
                return new PBKDF2Params(params.getSalt(),
                    params.getIterationCount().intValue(), params.getKeyLength().intValue());
            } else {
                return new PBKDF2Params(params.getSalt(), params.getIterationCount().intValue());
            }
        }

        if (obj != null) {
            return new PBKDF2Params(ASN1Sequence.getInstance(obj));
        }

        return null;
    }
261044
function toObject (obj, keyValuePair) {
        var _keyValuePair = slicedToArray(keyValuePair, 2),
            key = _keyValuePair[0],
            value = _keyValuePair[1];

        obj[key] = value;

        return obj;
    }
1496
def pks(self):
        """"""
        if self._primary_keys is None:
            self._primary_keys = list(
                self.queryset.values_list('pk', flat=True))
        return self._primary_keys
1258200
def getEncodableAttributes(self, obj, **kwargs):
        
        attrs = pyamf.ClassAlias.getEncodableAttributes(self, obj, **kwargs)

        if not self.exclude_sa_key:
            # primary_key_from_instance actually changes obj.__dict__ if
            # primary key properties do not already exist in obj.__dict__
            attrs[self.KEY_ATTR] = self.mapper.primary_key_from_instance(obj)

        if not self.exclude_sa_lazy:
            lazy_attrs = []

            for attr in self.properties:
                if attr not in obj.__dict__:
                    lazy_attrs.append(attr)

            attrs[self.LAZY_ATTR] = lazy_attrs

        return attrs
1047577
def _get_column_value(self, obj, column):
        
        return self._get_formatted_val(obj, column['__col__'].key, column)
1315674
function getObjectValues(oObject) {
		var aKeys = Object.keys(oObject),
			aValues = [];

		aKeys.forEach(function(sKey) {
			aValues.push(oObject[sKey]);
		});

		return aValues;
	}
845329
def _extract_key_value(obj):
    """"""
    key = None; value = None

    # Parse a Value object, which includes Properties
    if isinstance(obj, Value):
        key = _construct_new_key(obj.name, obj.units)
        value = []
        if obj.scalars:
            value = [(val.value if isinstance(val, Scalar) else val)
                     for val in obj.scalars]
        elif obj.vectors and len(obj.vectors) == 1:
            value = [(val.value if isinstance(val, Scalar) else val)
                     for val in obj.vectors[0]]
        if len(value) == 1:
            value = value[0]
        elif len(value) == 0:
            value = None

    # If there is a process step, pul out its name as the value
    # TODO: resolve duplicates
    if isinstance(obj, ProcessStep):
        key = "Processing"
        value = obj.name
        
    return key, value