# Path: loompy/utils.py
# def timestamp() -> str:
# 	return datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%S.%fZ")


import scipy.sparse as sparse
import numpy as np
from typing import *
from loompy import timestamp
				w = self.ds._file[a][name]["w"]
				g = sparse.coo_matrix((w, (r, c)), shape=(self.ds.shape[self.axis], self.ds.shape[self.axis]))
				self.__dict__["storage"][name] = g
			return g
		except KeyError:
			raise AttributeError(f"'{type(self)}' object has no graph '{name}' on axis {self.axis}")

	def __setitem__(self, name: str, g: sparse.coo_matrix) -> None:
		return self.__setattr__(name, g)

	def __setattr__(self, name: str, g: sparse.coo_matrix) -> None:
		if name.startswith("!"):
			super(GraphManager, self).__setattr__(name[1:], g)
		elif "/" in name:
			raise KeyError("Graph name cannot contain slash (/)")
		else:
			g = sparse.coo_matrix(g)
			if self.ds is not None:
				a = ["row_graphs", "col_graphs"][self.axis]
				if g.shape[0] != self.ds.shape[self.axis] or g.shape[1] != self.ds.shape[self.axis]:
					raise ValueError(f"Adjacency matrix shape for axis {self.axis} must be ({self.ds.shape[self.axis]},{self.ds.shape[self.axis]}) but shape was {g.shape}")
				if name in self.ds._file[a]:
					del self.ds._file[a][name]["a"]
					del self.ds._file[a][name]["b"]
					del self.ds._file[a][name]["w"]
					del self.ds._file[a][name]
				self.ds._file[a].create_group(name)
				self.ds._file[a][name]["a"] = g.row
				self.ds._file[a][name]["b"] = g.col
				self.ds._file[a][name]["w"] = g.data

# Path: loompy/utils.py
# def timestamp() -> str:
# 	return datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%S.%fZ")


# Path: loompy/graph_manager.py
import scipy.sparse as sparse
import numpy as np
from typing import *
from loompy import timestamp

				w = self.ds._file[a][name]["w"]
				g = sparse.coo_matrix((w, (r, c)), shape=(self.ds.shape[self.axis], self.ds.shape[self.axis]))
				self.__dict__["storage"][name] = g
			return g
		except KeyError:
			raise AttributeError(f"'{type(self)}' object has no graph '{name}' on axis {self.axis}")

	def __setitem__(self, name: str, g: sparse.coo_matrix) -> None:
		return self.__setattr__(name, g)

	def __setattr__(self, name: str, g: sparse.coo_matrix) -> None:
		if name.startswith("!"):
			super(GraphManager, self).__setattr__(name[1:], g)
		elif "/" in name:
			raise KeyError("Graph name cannot contain slash (/)")
		else:
			g = sparse.coo_matrix(g)
			if self.ds is not None:
				a = ["row_graphs", "col_graphs"][self.axis]
				if g.shape[0] != self.ds.shape[self.axis] or g.shape[1] != self.ds.shape[self.axis]:
					raise ValueError(f"Adjacency matrix shape for axis {self.axis} must be ({self.ds.shape[self.axis]},{self.ds.shape[self.axis]}) but shape was {g.shape}")
				if name in self.ds._file[a]:
					del self.ds._file[a][name]["a"]
					del self.ds._file[a][name]["b"]
					del self.ds._file[a][name]["w"]
					del self.ds._file[a][name]
				self.ds._file[a].create_group(name)
				self.ds._file[a][name]["a"] = g.row
				self.ds._file[a][name]["b"] = g.col
				self.ds._file[a][name]["w"] = g.data

				self.ds._file[a][name].attrs["last_modified"] = timestamp()