coerce the value into an array of key strings
510091
function (path) {
  if (!types.isArray(path)) {
    path = [path]
  }
  return _.map(path, toKey)
}
580033
def to_a
        a = []
        keys.each { |k| a.push [ k, self.fetch( k ) ] }
        a
    end
61683
def coerce(cls, key, value):
        """"""
        if isinstance(value, PasswordHash):
            return value
        return super(PasswordHash, cls).coerce(key, value)
32514
def keys_values(data, *keys):
    """"""
    values = []
    if is_mapping(data):
        for key in keys:
            if key in data:
                values.extend(ensure_list(data[key]))
    return values
1090167
function ( obj, key, value ) {
		if ( value !== undefined ) {
			obj.setAttribute( "data-" + key, regex.json_wrap.test( value ) ? json.encode( value ) : value );
			return obj;
		}
		else {
			return utility.coerce( obj.getAttribute( "data-" + key ) );
		}
	}
87539
def encode(cls, value):
        
        try:
            coerced = [str(v) for v in value]
            if coerced == value:
                return ",".join(coerced).encode(cls._encoding) if len(
                    value) > 0 else None
        except TypeError:
            pass

        raise InvalidValue('not a list of strings')
821947
function () {
        var keys = Object.keys(this),
            i = -1,
            len = keys.length,
            values = [];

        while (++i < len) {
            values.push(this[keys[i]]);
        }

        return values;
    }
397684
def _compile_key_val(self, data, indent_level):
        """"""
        buffer = ''
        for (key, val) in data.items():
            buffer += self._indent * indent_level
            # TODO: assumes key is a string
            buffer += key + ':'

            if isinstance(val, dict):
                buffer += '\n'
                buffer += self._compile_key_val(val, indent_level+1)
            elif (
                isinstance(val, list) and
                any(isinstance(i, (dict, list)) for i in val)
            ):
                buffer += self._compile_list(val, indent_level+1)
            else:
                buffer += ' '
                buffer += self._compile_value(val, indent_level)
                buffer += '\n'

        return buffer
302176
def coerce(self, value):
        """"""
        if self._coerce is not None:
            value = self._coerce(value)
        return value
371266
def keys_to_values(self, keys):
        ""
        return dict((k, v) for k, v in self.data.items() if k in keys)
860125
def _stringifyKeys(d):
    
    return dict((k.encode('ascii'), v)  for (k, v) in d.iteritems())
497001
function toIterable(value) {
      if (value == null) {
        return [];
      }
      if (!isArrayLike(value)) {
        return values(value);
      }
      if (lodash.support.unindexedChars && isString(value)) {
        return value.split('');
      }
      return isObject(value) ? value : Object(value);
    }
727710
def coerce(cls, key, value):
        ""

        if not isinstance(value, MutableDict):
            if isinstance(value, dict):
                return MutableDict(value)

            # this call will raise ValueError
            return Mutable.coerce(key, value)
        else:
            return value
3708
def encode(cls, value):
        
        try:
            coerced = list(value)
            if coerced == value:
                return json.dumps(coerced).encode(cls._encoding)
        except TypeError:
            pass

        raise InvalidValue('not a list')
500497
function coerce (type, obj, path, value) {
  if (isNil(path)) return;

  // Turn positive integer into string
  if (isPositiveInteger(path)) path = String(path);

  // Parse string path into an array
  if (isString(path)) {
    path = compact(path.trim().split(SEPERATOR));
  }

  // Return if path is invalid
  if (!path || !isArray(path) || path.length === 0) return;

  // Copy array for future use
  path = path.slice();

  // Shift the first path value
  var key = path.shift();

  // Return `undefined` if obj is `NaN` or `null` or `undefined`
  if (isNil(obj)) return;

  switch (type) {
    case 'get':
      if (path.length === 0) {
        return obj[key];
      }
      break;
    case 'set':
      if (path.length) {
        if (typeof obj[key] === 'undefined') {
          obj[key] = {};
        }

        if (isNil(obj[key])) return false;
      } else {
        obj[key] = value;
        return true;
      }
      break;
    case 'remove':
      if (path.length === 0) {

        if (isArray(obj) && isPositiveInteger(key)) {
          key = Number(key);

          if (obj.length - 1 < key) return false;

          obj.splice(key, 1);
        } else {
          if (!Object.hasOwnProperty.call(obj, key)) return false;

          delete obj[key];
        }

        return true;
      }
      break;
    case 'exists':
      if (path.length === 0) {
        if (isArray(obj) && isPositiveInteger(key)) {
          key = Number(key);
          return obj.length - 1 >= key;
        } else {
          return Object.hasOwnProperty.call(obj, key);
        }
      }
      break;
    default:
      return;
  }

  return coerce(type, obj[key], path, value);
}
218197
function toKeyValueStrings(dynamoDBMap) {
  return dynamoDBMap && typeof dynamoDBMap === 'object' ?
    Object.getOwnPropertyNames(dynamoDBMap).map(key => `${key}:${stringify(toValueFromAttributeValue(dynamoDBMap[key]))}`) : [];
}
1048256
def _coerceValue(self,value,strict=0):
        
        try:
            if isinstance(value,str):
                # allow single blank-separated string as input
                value = value.split()
            if len(value) != len(self.value):
                raise IndexError
            v = len(self.value)*[0]
            for i in range(len(v)):
                v[i] = self._coerceOneValue(value[i],strict)
            return v
        except (IndexError, TypeError):
            raise ValueError("Value must be a " + repr(len(self.value)) +
                    "-element array for " + self.name)