def validate_grant_type(self, client_id, grant_type, client, request,
                            *args, **kwargs):
        if self._usergetter is None and grant_type == 'password':
            log.debug('Password credential authorization is disabled.')
            return False

        default_grant_types = (
            'authorization_code', 'password',
            'client_credentials', 'refresh_token',
        )

        # Grant type is allowed if it is part of the 'allowed_grant_types'
        # of the selected client or if it is one of the default grant types
        if hasattr(client, 'allowed_grant_types'):
            if grant_type not in client.allowed_grant_types:
                return False
        else:
            if grant_type not in default_grant_types:
                return False

        if grant_type == 'client_credentials':
            if not hasattr(client, 'user'):
                log.debug('Client should have a user property')
                return False
            request.user = client.user

        return True
Return the name of the lock if any.
dataset/ETHPy150Open codalab/codalab-cli/codalab/server/oauth2_provider.py/OAuth2RequestValidator.validate_grant_type--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/lock/demo.py/DemoLock.name