def _request_hash_map(hash_map, form):
    error_code = None
    old_name = hash_map['name']
    hash_map['name'] = form['name']
    hash_map['value'] = {}

    # Check that the name hash map has between 2 and 20 characters
    if not check.length(hash_map['name'], LENGTH_MIN_HASHMAP_NAME, LENGTH_MAX_HASHMAP_NAME):
        error_code = ('hash_table_msg', 'error_1')

    # Verify that the format of the name is correct
    elif not check.username(hash_map['name']):
        error_code = ('hash_table_msg', 'error_2')

    # Check that the name is new
    if error_code is None and old_name != hash_map['name']:
        hash_map_old = model.hash_table.find(name=hash_map['name'], only_one=True)
        if hash_map_old:
            error_code = ('hash_table_msg', 'error_5')

    # Get len label
    len_label = int(form["len"])

    # I look for fields that contain the keys,
    # then I browse to the field until the larger number.
    for i in range(len_label):
        label_key = 'label-name-{}'.format(i)
        key = form[label_key].strip()

        # Check that the key has between 2 and 30 characters
        if not check.length(key, LENGTH_MIN_KEY, LENGTH_MAX_KEY):
            error_code = ('hash_table_msg', 'error_3')

        # Verify that the format of the key is correct
        elif not check.username(key):
            error_code = ('hash_table_msg', 'error_4')

        # It doesn't take into dictionary the empty keys
        if check.length(key, LENGTH_MIN_KEY, LENGTH_MAX_KEY):
            # Initial language values
            hash_map['value'][key] = {}

            for code, name in languages_object.all_lang_by_tuple:
                label_value = 'label-{}-{}'.format(code, i)

                value = form.get(label_value, "")
                hash_map['value'][key][code] = value
    return hash_map, error_code
Get from request.form the hash map values and check it
dataset/ETHPy150Open Opentaste/bombolone/bombolone/core/hash_table.py/_request_hash_map