Return a scope based on the supplied action and resource.

        :param action: the scope action eg. read, write or admin
        :param resource: the specific resource of the scope, if any eg. alerts,
            blackouts, heartbeats, users, perms, customers, keys, webhooks,
            oembed, management or userinfo or None
        :return: Scope

def from_str(action: str, resource: str=None):
        """Return a scope based on the supplied action and resource.

        :param action: the scope action eg. read, write or admin
        :param resource: the specific resource of the scope, if any eg. alerts,
            blackouts, heartbeats, users, perms, customers, keys, webhooks,
            oembed, management or userinfo or None
        :return: Scope
        """
        if resource:
            return Scope('{}:{}'.format(action, resource))
        else:
            return Scope(action)