class_docstr: A DataStoreStorage defines the interface of communication between the
  higher-level datastores and the actual storage system.
  
  Both the ContentAddressedStore and the TaskDataStore use these methods to
  read/write/list from the actual storage system. These methods are meant to
  be low-level; they are in a class to provide better abstraction but this
  class itself is not meant to be initialized.
class_docstr_tok: ["A","DataStoreStorage","defines","the","interface","of","communication","between","the","higher-level","datastores","and","the","actual","storage","system",".","Both","the","ContentAddressedStore","and","the","TaskDataStore","use","these","methods","to","read\/write\/list","from","the","actual","storage","system",".","These","methods","are","meant","to","be","low-level",";","they","are","in","a","class","to","provide","better","abstraction","but","this","class","itself","is","not","meant","to","be","initialized","."]
docstr: Extracts the datastore_root location from a path using
  a content-addressed store.
  
  NOTE: This leaks some detail of the content-addressed store so not ideal
  
  This method will raise an exception if the flow_name is not as expected
  
  Parameters
  ----------
  path : str
      Location from which to extract the datastore root value
  flow_name : str
      Flow name (for verification purposes)
  
  Returns
  -------
  str
      The datastore_root value that can be used to initialize an instance
      of this datastore storage.
  
  Raises
  ------
  DataException
      Raised if the path is not a valid path from this datastore.
docstr_tok: ["Extracts","the","datastore_root","location","from","a","path","using","a","content-addressed","store",".","NOTE",":","This","leaks","some","detail","of","the","content-addressed","store","so","not","ideal","This","method","will","raise","an","exception","if","the","flow_name","is","not","as","expected","Parameters","--","--","--","--","--","path",":","str","Location","from","which","to","extract","the","datastore","root","value","flow_name",":","str","Flow","name","(","for","verification","purposes",")","Returns","--","--","--","-","str","The","datastore_root","value","that","can","be","used","to","initialize","an","instance","of","this","datastore","storage",".","Raises","--","--","--","DataException","Raised","if","the","path","is","not","a","valid","path","from","this","datastore","."]
code: def get_datastore_root_from_location(cls, path, flow_name):
      """Extracts the datastore_root location from a path using
      a content-addressed store.
  
      NOTE: This leaks some detail of the content-addressed store so not ideal
  
      This method will raise an exception if the flow_name is not as expected
  
      Parameters
      ----------
      path : str
          Location from which to extract the datastore root value
      flow_name : str
          Flow name (for verification purposes)
  
      Returns
      -------
      str
          The datastore_root value that can be used to initialize an instance
          of this datastore storage.
  
      Raises
      ------
      DataException
          Raised if the path is not a valid path from this datastore.
      """
      if cls.path_rexp is None:
          cls.path_rexp = re.compile(
              cls.path_join(
                  "(?P<root>.*)",
                  "(?P<flow_name>[_a-zA-Z][_a-zA-Z0-9]+)",
                  "data",
                  "(?P<init>[0-9a-f]{2})",
                  "(?:r_)?(?P=init)[0-9a-f]{38}",
              )
          )
      m = cls.path_rexp.match(path)
      if not m or m.group("flow_name") != flow_name:
          raise DataException(
              "Location '%s' does not correspond to a valid location for "
              "flow '%s'." % (path, flow_name)
          )
      return m.group("root")
  
imports: from collections import namedtuple
  import re
  from .exceptions import DataException
label_desc: Use image node_id 3 for calling the DataStoreStorage obj's underlying member method code with example usage: obj.get_datastore_root_from_location(cls, path, flow_name) and returns: m