def from_array(x, chunks, name=None, lock=False):
    chunks = normalize_chunks(chunks, x.shape)
    if len(chunks) != len(x.shape):
        raise ValueError("Input array has %d dimensions but the supplied "
                "chunks has only %d dimensions" % (len(x.shape), len(chunks)))
    name = name or 'from-array-' + tokenize(x, chunks)
    dsk = getem(name, chunks)
    if lock is True:
        lock = Lock()
    if lock:
        dsk = dict((k, v + (lock,)) for k, v in dsk.items())
    return Array(merge({name: x}, dsk), name, chunks, dtype=x.dtype)
Trigger registration of this optionable's options.
dataset/ETHPy150Open dask/dask/dask/array/core.py/from_array--crossover with--dataset/ETHPy150Open pantsbuild/pants/src/python/pants/option/optionable.py/Optionable.register_options_on_scope