<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def available_backends(self, hub=None, group=None, project=None, access_token=None, user_id=None):
 """ Get the backends available to use in the QX Platform """

        if access_token:
            self.req.credential.set_token(access_token)
        if user_id:
            self.req.credential.set_user_id(user_id)
        if not self.check_credentials():
            raise CredentialsError('credentials invalid')
        else:

            url = get_backend_url(self.config, hub, group, project)

            ret = self.req.get(url)
            if (ret is not None) and (isinstance(ret, dict)):
                return []
            return [backend for backend in ret
                    if backend.get('status') == 'on']