Compile the function with array-like objects
349294
def compile_with_value(self, func, args=None, owner=None):
        ''''''
        # format args
        if args is None:
            args = []

        # cast numpy.ndarray into theano.tensor
        theano_args = [self.cast2theano_var(a, 'extheano.jit.Compiler-arg-%d' % i)
                       for a, i in zip(args, range(len(args)))]

        # compiled value with symbol
        return self.compile_with_symbol(func, theano_args, owner)
90559
function template(strings, ...keys) {
  return function(...values) {
    let dict = values[values.length - 1] || {};
    let result = [strings[0]];
    keys.forEach(function(key, i) {
      let value = isInteger(key) ? values[key] : dict[key];
      result.push(value, strings[i + 1]);
    });
    return result.join('');
  };
}
622699
function toArrayLike(buf) {
  if (buf instanceof Uint8Array) {
    return buf;
  } else if (buf instanceof ArrayBuffer) {
    return new Uint8Array(buf);
  } else if (Buffer.isBuffer(buf)) {
    return buf;
  } else {
    return buf; // type unknown, trust the user
  }
}
612137
function compile(tmpl, conf) {
  let str = tmpl || '';
  const c = Object.assign({}, settings, conf);
  const blocks = {};

  str = str
    // allow the use of ' in the body
    .replace(/'/g, '\\\'')

    // handle block def
    .replace(c.blockDef, (m, name, argStr, body) => {
      blocks[name] = {
        args: argStr.split(',').map(a => a.trim()),
        body,
      };
      return '';
    })

    // handle block call
    .replace(c.block, handleBlockCall(c, blocks))

    // convert models
    .replace(c.interpolate, (m, code) => `';out+=${jsValue(code)};out+='`)

    // raw js
    .replace(c.evaluate, (m, code) => `';${jsValue(code)}out+='`);

  // build the template function body
  str = `var out='${str}';return out;`
    // remove the newlines or '' will break
    .replace(/\r/g, '\\r')
    .replace(/\n/g, '\\n')
    .replace(/\t/g, '\\t')
    .replace(/(\s|;|\}|^|\{)out\+='';/g, '$1')
    .replace(/\+''/g, '');

  return new Function(c.varname, str); // eslint-disable-line
}
528038
function fillArray(low, high, step, def) {
            step = step || 1;
            var i = [], x;
            for (x = low; x <= high; x += step) {
                i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def);
            }
            return i;
        }
424943
function stringToArrayLike(str, array) {
    for (var i = 0; i < str.length; ++i) {
        array[i] = str.charCodeAt(i) & 0xFF;
    }
    return array;
}
983272
function _combineObject(params, arr) {
  const ret = {};
  _.each(arr, (arg, i) => {
    ret[params[i]] = arg;
  });
  return ret;
}
1276066
function _object2array(input) {

		var index,
			subindex = 0,
			result = [];

		if (typeof input !== 'object' || !input)

			return input;

		for (index in input) {

			if (subindex++ !== Number(index))

				return input;

			result.push(input[index]);

		}

		return result;

	}
719634
function buildValueArray(name, mod, map, fn) {
        var field = name, all = [], setMap;
        if (!loc[field]) {
          field += 's';
        }
        if (!map) {
          map = {};
          setMap = true;
        }
        forAllAlternates(field, function(alt, j, i) {
          var idx = j * mod + i, val;
          val = fn ? fn(i) : i;
          map[alt] = val;
          map[alt.toLowerCase()] = val;
          all[idx] = alt;
        });
        loc[field] = all;
        if (setMap) {
          loc[name + 'Map'] = map;
        }
      }
1061091
function (obj, f) {
      var r = [];
      each(obj, function(value, name) {
        r.push(f(value, name));
      });
      return r;
    }
431428
function arrayFunction(item, index) {
      return function(data, cb) {
        if (iterator.length === 2) {
          iterator(item, cb);
        } else if (iterator.length === 3) {
          iterator(item, index, cb);
        } else {
          iterator(item, index, data, cb);
        }
      };
    }
1348216
final public function makeArrayGetterCallable()
    {
        $getters = [];

        foreach ($this->parts as $part) {
            $getters[] = $part->createArrayGetterCallable();
        }

        return function (array $objects) use ($getters) {
            $results = $objects;

            foreach ($getters as $getter) {
                $results = $getter($results);
            }

            return $results;
        };
    }
636041
def array_wrap(object)
      if object.nil?
        []
      elsif object.respond_to?(:to_ary)
        object.to_ary || [object]
      else
        [object]
      end
    end
847270
function vectorize(fun) {
  return function(x) {
    if (!isArray(x)) {
      return fun(x);
    }
    return x.map(function(x) {
      return fun(x);
    });
  };
}
866249
static Node arrayFromIterable(AbstractCompiler compiler, Node iterable) {
    JSTypeRegistry registry = compiler.getTypeRegistry();
    JSType arrayType = registry.getNativeType(JSTypeNative.ARRAY_TYPE);

    Node call =
        callEs6RuntimeFunction(compiler, iterable, "arrayFromIterable").setJSType(arrayType);
    call.getFirstChild().setJSType(registry.createFunctionTypeWithVarArgs(arrayType));
    return call;
  }
567062
function arrayToList(array) {
  if(isArray(array)) {
    return List.fromArray(array)
  }
  else if(isFunction(array)) {
    return function(x) {
      const g = array(x)

      if(!isArray(g)) {
        throw new TypeError('arrayToList: Array returning function required')
      }

      return List.fromArray(g)
    }
  }

  throw new TypeError('arrayToList: Array or Array returning function required')
}
235730
function isThunkArray(value) {
  return Array.isArray(value) && value.every(function(fn) {return isThunk(fn);});
}