def METHOD_NAME(self, *args, **options):
    username = options['username']
    user = User.objects.get(username=username)
    app_name = options['name']
    update = options['update']
    redirect_uris = options['redirect_uris']
    client_type = Application.CLIENT_PUBLIC if options['public'] else Application.CLIENT_CONFIDENTIAL
    grant_type = options['grant_type']
    skip_authorization = options['skip_authorization']
    client_id = options['client_id']
    client_secret = options['client_secret']
    application_kwargs = dict(
        redirect_uris=redirect_uris,
        client_type=client_type,
        authorization_grant_type=grant_type,
        skip_authorization=skip_authorization
    )
    if client_id:
        application_kwargs['client_id'] = client_id
    if client_secret:
        application_kwargs['client_secret'] = client_secret
    application = Application.objects.filter(user=user, name=app_name).first()
    if application and update:
        self._update_application(application, application_kwargs)
    elif application:
        logger.info('Application with name {} and user {} already exists.'.format(
            app_name,
            username
        ))
    else:
        application = self._create_application(user, app_name, application_kwargs)
    scopes = options['scopes']
    if scopes:
        self._create_or_update_access(application, scopes, update)