<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def grant_user_access(self, user, db_names, strict=True):
 """ Gives access to the databases listed in `db_names` to the user. You may pass in either a single db or a list of dbs. If any of the databases do not exist, a NoSuchDatabase exception will be raised, unless you specify `strict=False` in the call. """

        user = utils.get_name(user)
        uri = "/%s/%s/databases" % (self.uri_base, user)
        db_names = self._get_db_names(db_names, strict=strict)
        dbs = [{"name": db_name} for db_name in db_names]
        body = {"databases": dbs}
        try:
            resp, resp_body = self.api.method_put(uri, body=body)
        except exc.NotFound as e:
            raise exc.NoSuchDatabaseUser("User '%s' does not exist." % user)