code: def find_db_instance(self, name, running=True):
          
          found = None
          for i in self.provider.reddwarf_client.instances.list():
              if i.name == name:
                  if not running:  # don't care if it's running or not
                      found = i
                  if i.status == 'running':
                      found = i
          if found:
              log.info("Found existing db, %s (%s)" % (found.name, found.id))
              return db_to_dict(found)
docs: Searches for a db instance named :attr:`name`.
  
          :param str name:  The name of the target db instance
  
          :param bool running:  A flag to only look for instances that are
              actually *running*.
  
          :rtype:  :class:`dict`