def check_args():
    # ---------------------------------------------------------------------
    # Check arguments
    # ---------------------------------------------------------------------

    if len(sys.argv) < 5:
        
        print '\n' + script_name + ' <PortalURL> <AdminUser> <AdminUserPassword> <OutputFile> {FilePerUser: YES|NO}'

        print '\nWhere:'
        print '\n\t{:<20}: {}'.format('<PortalURL>', 'URL of Portal (i.e. https://fully_qualified_domain_name/arcgis).')
        print '\n\t{:<20}: {}'.format('<AdminUser>', 'Portal admin user.')
        print '\n\t{:<20}: {}'.format('<AdminUserPassword>', 'Password for portal admin user.')
        print '\n\t{:<20}: {}'.format('<OutputBatchFile>', 'Path and name of batch file to write call to CreateServiceList.py script.')
        print '\n\t{:<20}: {}'.format('{FilePerUser: YES|NO}', 'CreateServiceList.py script will create a file per user.\n')
        return None
    
    else:
        
        # Set variables from parameter values
        portal_url = sys.argv[1]
        user = sys.argv[2]
        password = sys.argv[3]
        output_file = sys.argv[4]
        output_per_user = 'YES'
        
        if len(sys.argv) <= 6:
            output_per_user = sys.argv[5]
        
        if len(sys.argv) > 6:
            print '\nError: too many parameters.\n'
            return None
        
        valid_file_per_user = ['YES', 'NO']
        if not output_per_user.upper() in valid_file_per_user:
            print '\nError: incorrect {{FilePerUser}} value "{}". Valid choices are: {}\n'.format(
                                output_per_user, ', '.join(valid_file_per_user))
            return None
        
        if output_per_user.upper() == 'YES':
            output_per_user = True
        else:
            output_per_user = False
        
    return portal_url, user, password, output_file, output_per_user
dataset/ETHPy150Open Esri/ops-server-config/Utilities/CreateBatchFileToRunCreateServiceList.py/check_args/operator `==` -> `<=`