def insertmany_query(tablename, objects):
    """
    Function to process the query for insert many  process
    """
    if isinstance(tablename, str):
        pass
    else:
        raise ValueError('Tablename should be a String')
    """
        Sanity check of bulk insert
    """
    len_objects = []
    for val in map(len, objects):
        len_objects.append(val)
    if len(set(len_objects)) != 1:
        raise ValueError('Objects are off different length')
    columns = set(objects[0].keys())
    for val in objects:
        if columns != set(val.keys()):
            raise ValueError(
                'The number of columns that has to be updated must be same across all the objects'
                )
    cols = objects[0].keys()
    data = []
    for i in objects:
        data.append(tuple(i.values()))
    reg_string = ''
    for i in range(len(data[0])):
        reg_string += '%s, '
    reg_string = reg_string[:len(reg_string) - 2]
    query = 'INSERT INTO ' + tablename + ' (%s) VALUES(%s)' % (','.join(
        cols), reg_string)
    return query, data
