def create(filename: str, layers: Union[np.ndarray, Dict[str, np.ndarray], loompy.LayerManager], row_attrs: Union[loompy.AttributeManager, Dict[str, np.ndarray]], col_attrs: Union[loompy.AttributeManager, Dict[str, np.ndarray]], *, file_attrs: Dict[str, str] = None) -> None:
if isinstance(row_attrs, loompy.AttributeManager):<EOL><INDENT>row_attrs = {k: v[:] for k, v in row_attrs.items()}<EOL><DEDENT>if isinstance(col_attrs, loompy.AttributeManager):<EOL><INDENT>col_attrs = {k: v[:] for k, v in col_attrs.items()}<EOL><DEDENT>if isinstance(layers, np.ndarray) or scipy.sparse.issparse(layers):<EOL><INDENT>layers = {"<STR_LIT>": layers}<EOL><DEDENT>elif isinstance(layers, loompy.LayerManager):<EOL><INDENT>layers = {k: v[:, :] for k, v in layers.items()}<EOL><DEDENT>if "<STR_LIT>" not in layers:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>shape = layers["<STR_LIT>"].shape  <EOL>if shape[<NUM_LIT:0>] == <NUM_LIT:0> or shape[<NUM_LIT:1>] == <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>for name, layer in layers.items():<EOL><INDENT>if layer.shape != shape:  <EOL><INDENT>raise ValueError(f"<STR_LIT>")<EOL><DEDENT><DEDENT>for name, ra in row_attrs.items():<EOL><INDENT>if ra.shape[<NUM_LIT:0>] != shape[<NUM_LIT:0>]:<EOL><INDENT>raise ValueError(f"<STR_LIT>")<EOL><DEDENT><DEDENT>for name, ca in col_attrs.items():<EOL><INDENT>if ca.shape[<NUM_LIT:0>] != shape[<NUM_LIT:1>]:<EOL><INDENT>raise ValueError(f"<STR_LIT>")<EOL><DEDENT><DEDENT>try:<EOL><INDENT>with new(filename, file_attrs=file_attrs) as ds:<EOL><INDENT>for key, vals in layers.items():<EOL><INDENT>ds.layer[key] = vals<EOL><DEDENT>for key, vals in row_attrs.items():<EOL><INDENT>ds.ra[key] = vals<EOL><DEDENT>for key, vals in col_attrs.items():<EOL><INDENT>ds.ca[key] = vals<EOL><DEDENT><DEDENT><DEDENT>except ValueError as ve:<EOL><INDENT>if os.path.exists(filename):<EOL><INDENT>os.remove(filename)<EOL><DEDENT>raise ve<EOL><DEDENT>
Create a new Loom file from the given data.

Args:
        filename (str):         The filename (typically using a ``.loom`` file extension)
        layers:					One of the following:

                                                        * Two-dimensional (N-by-M) numpy ndarray of float values
                                                        * Sparse matrix (e.g. :class:`scipy.sparse.csr_matrix`)
                                                        * Dictionary of named layers, each an N-by-M ndarray or sparse matrix
                                                        * A :class:`.LayerManager`, with each layer an N-by-M ndarray
        row_attrs (dict):       Row attributes, where keys are attribute names and values
                                                        are numpy arrays (float or string) of length N
        col_attrs (dict):       Column attributes, where keys are attribute names and
                                                        values are numpy arrays (float or string) of length M
        file_attrs (dict):      Global attributes, where keys are attribute names and
                                                        values are strings
Returns:
        Nothing

Remarks:
        If the file exists, it will be overwritten.