RW a thrift map to an array of [k, v] entries ktype:1 vtype:1 length:4 (k... v...){length}
766012
function MapEntriesRW(ktype, vtype) {
    this.ktype = ktype;
    this.vtype = vtype;

    if (this.ktype.rw.width && this.vtype.rw.width) {
        this.poolByteLength = this.mapFixFixbyteLength;
    } else if (this.ktype.rw.width) {
        this.poolByteLength = this.mapFixVarbyteLength;
    } else if (this.vtype.rw.width) {
        this.poolByteLength = this.mapVarFixbyteLength;
    }

    bufrw.Base.call(this);
}
1163111
function readType (type, returnType = false) {
  const [t] = Array.isArray(type) ? type : [type]
  // Base types
  if (typeof t === 'string') return { t }

  // Map, Tuple, List
  if (typeof t === 'object') {
    const [[baseType, generic]] = Object.entries(t)
    return { t: baseType, generic }
  }
}
805949
function arrayToList ( arr ) {
	const length = arr.length;
	const data = new types.List(length);
	for ( let i = 0; i < length; i++ ) {
		data.setValue(i, setJsonValueToSassValue(arr[i]));
	}
	return data;
}
1223072
def _get_dtype_maps():
    
    
    # Define pairs
    tmp = [ (np.float32, 'MET_FLOAT'),  (np.float64, 'MET_DOUBLE'),
            (np.uint8, 'MET_UCHAR'),    (np.int8, 'MET_CHAR'),
            (np.uint16, 'MET_USHORT'),  (np.int16, 'MET_SHORT'),
            (np.uint32, 'MET_UINT'),    (np.int32, 'MET_INT'),
            (np.uint64, 'MET_ULONG'),   (np.int64, 'MET_LONG') ]
    
    # Create dictionaries
    map1, map2 = {}, {}
    for np_type, itk_type in tmp:
        map1[np_type.__name__] = itk_type
        map2[itk_type] = np_type.__name__
    
    # Done
    return map1, map2
1039386
function array(length, value) {
      var tmpArr = [], tmpVal = 0, i = -1;
      while (++i < length) {
        if (isUdf(value)) {
          tmpArr.push(tmpVal++);
        } else if (isFun(value)) {
          tmpArr.push(value.length > 0 ? value(i) : value());
        } else {
          tmpArr.push(value);
        }
      }
      return tmpArr;
    }
681478
def _type_container(self, value, _type):
        '  '
        if value is None:
            # normalize null containers to empty list
            return []
        elif not isinstance(value, list):
            raise ValueError("expected list type, got: %s" % type(value))
        else:
            return sorted(self._type_single(item, _type) for item in value)
321828
def _to_array(value):
    """"""
    if hasattr(value, 'shape'):
        return value
    elif hasattr(value, '__len__'):
        return array(value)
    else:
        return float_(value)
1085271
function map (f, arr) {
    var result = [], i, n;
    for (i = 0, n = arr.length; i < n; i++) {
      result.push(f(arr[i]));
    }
    return result;
  }
663124
function objectFromLists(keys, vals) {
  var result = {};
  for (let i = 0, len = keys.length; i < len; i++) {
    result[keys[i]] = vals[i];
  }
  return result;
}
1337304
function __map(items, fn, includeNull) {
  // whether to return nulls in array of results; default = true;
  includeNull = includeNull == null ? true : includeNull;
  if (items == null) return items;
  var result;
  if (Array.isArray(items)) {
    result = [];
    items.forEach(function (v, ix) {
      var r = fn(v, ix);
      if (r != null || includeNull) {
        result[ix] = r;
      }
    });
  } else {
    result = fn(items);
  }
  return result;
}
857380
def toList(value):
        
        if type(value) == list:
            return value
        elif type(value) in [np.ndarray, tuple, xrange, array.array]:
            return list(value)
        elif isinstance(value, Vector):
            return list(value.toArray())
        else:
            raise TypeError("Could not convert %s to list" % value)
240689
function () {
                var t, entries = []
                for (t in map) {
                  if (t.charAt(0) === '$')
                    entries = entries.concat(map[t])
                }
                return entries
              }
1141088
def itemtypes(cls, mapped_types, coll_type, visitor):
        
        rv = list(v for k, v in mapped_types)
        return rv[0] if len(rv) == 1 else rv
1221827
def _variable_type_to_read_fn(vartype, records):
    
    fn_map = {"String": "read_string", "Array[String]": "read_lines",
              "Array[Array[String]]": "read_tsv",
              "Object": "read_object", "Array[Object]": "read_objects",
              "Array[Array[Object]]": "read_objects",
              "Int": "read_int", "Float": "read_float"}
    for rec_name in records.keys():
        fn_map["%s" % rec_name] = "read_struct"
        fn_map["Array[%s]" % rec_name] = "read_struct"
        fn_map["Array[Array[%s]]" % rec_name] = "read_struct"
    # Read in Files as Strings
    vartype = vartype.replace("File", "String")
    # Can't read arrays of Ints/Floats
    vartype = vartype.replace("Array[Int]", "Array[String]")
    vartype = vartype.replace("Array[Float]", "Array[String]")
    return fn_map[vartype]
847748
function map(obj, func) {
    var index = -1;
    var res = [];
    for(var key in obj) { if(obj[key]) { res[++index] = func(obj[key], key, obj); } }
    return res;
}
1050429
function map (type) {
  if (!type) throw new Error('got falsey "type" to map ('+type+'). this should NOT happen!');
  if (type.type) type = type.type;
  if (isStruct(type)) return getStruct(type);
  type = type.replace(methodEncodingsTest, '')
  // if the first letter is a ^ then it's a "pointer" type
  if (type[0] === '^') return 'pointer'
  // now we can try matching from the typeEncodings map
  var rtn = typeEncodings[type]
  if (rtn) return rtn
  // last shot... try the last char? this may be a bad idea...
  rtn = typeEncodings[type[type.length-1]]
  if (rtn) return rtn
  // couldn't find the type. throw a descriptive error as to why:
  if (type[0] == '[') return 'pointer';
    //throw new Error('Array types not yet supported: ' + type)
  if (type[0] == '(') return 'pointer';
    //throw new Error('Union types not yet supported: ' + type)
  if (type[0] == 'b') return 'pointer';
    //throw new Error('Bit field types not yet supported: ' + type)
  throw new Error('Could not convert type: ' + type)
}
724763
def map_to_array(pairs):
    
    if pairs:
        pairs = [TuidMap(*p) for p in pairs]
        max_line = max(p.line for p in pairs)
        tuids = [None] * max_line
        for p in pairs:
            if p.line:  # line==0 IS A PLACEHOLDER FOR FILES THAT DO NOT EXIST
                tuids[p.line-1] = p.tuid
        return tuids
    else:
        return None