def validate_image_col_row(image , col , row):
    """Basic checks for columns and rows values"""
    SPLIT_LIMIT = 99

    try:
        col = int(col)
        row = int(row)
    except:
        raise ValueError('columns and rows values could not be cast to integer.')

    if col < 2:
        raise ValueError('Number of columns must be between 2 and {} (you \
                          asked for {}).'.format(SPLIT_LIMIT, col))
    if row < 2 :
        raise ValueError('Number of rows must be between 2 and {} (you \
                          asked for {}).'.format(SPLIT_LIMIT, row))
def validate_image_col_row ( image , col , row ) : SPLIT_LIMIT = 99 try : col = int ( col ) row = int ( row ) except : raise ValueError ( 'columns and rows values could not be cast to integer.' ) if col < 2 : raise ValueError ( 'Number of columns must be between 2 and {} (you \
                          asked for {}).' . format ( SPLIT_LIMIT , col ) ) if row < 2 : raise ValueError ( 'Number of rows must be between 2 and {} (you \
                          asked for {}).' . format ( SPLIT_LIMIT , row ) )
Basic checks for columns and rows values