<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def access(self, app_subdomain):

        ''' a method to validate user can access app '''

        title = '%s.access' % self.__class__.__name__
    
    # validate input
        input_fields = {
            'app_subdomain': app_subdomain
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
        
    # verbosity
        self.printer('Checking access to "%s" subdomain ... ' % app_subdomain, flush=True)

    # confirm existence of subdomain
        for app in self.apps:
            if app['name'] == app_subdomain:
                self.subdomain = app_subdomain
                break
    
    # refresh app list and search again
        if not self.subdomain:
            import json
            response = self._handle_command('heroku apps --json', handle_error=True)
            self.apps = json.loads(response)

            for app in self.apps:
                if app['name'] == app_subdomain:
                    self.subdomain = app_subdomain
                    break
    
    # check reason for failure
        if not self.subdomain:
            sys_command = 'heroku ps -a %s' % app_subdomain
            heroku_response = self._handle_command(sys_command, handle_error=True)
            if heroku_response.find('find that app') > -1:
                self.printer('ERROR')
                raise Exception('%s does not exist. Try: heroku create -a %s' % (app_subdomain, app_subdomain))
            elif heroku_response.find('have access to the app') > -1:
                self.printer('ERROR')
                raise Exception('%s belongs to another account.' % app_subdomain)
            else:
                self.printer('ERROR')
                raise Exception('Some unknown issue prevents you from accessing %s' % app_subdomain)

        self.printer('done.')
        
        return self