def get_for_type(input_type="text"):
        """Get a random string for the given html input type

        Args:
            input_type (str): The input type (e.g. email).

        Returns:
            str: The (cached) random value.

        """

        if input_type in RandomInputHelper.cache:
            return RandomInputHelper.cache[input_type]

        types = {
            "text": RandomInputHelper.get_random_value,
            "hidden": RandomInputHelper.get_random_value,
            "search": RandomInputHelper.get_random_value,
            "color": RandomInputHelper.get_random_color,
            "week": {"function": RandomInputHelper.get_random_value, "params": [2, ["1234"]]},
            "password": RandomInputHelper.get_random_password,
            "number": RandomInputHelper.get_random_number,
            "tel": RandomInputHelper.get_random_telephonenumber,
            "url": RandomInputHelper.get_random_url,
            "textarea": RandomInputHelper.get_random_text,
            "email": RandomInputHelper.get_random_email
        }

        if types.get(input_type) is None:
            return ""

        if type(types.get(input_type)) is dict:
            generator = types.get(input_type)
            value = generator.get("function")(*generator.get("params"))
        else:
            value = types.get(input_type)()

        RandomInputHelper.cache[input_type] = value

        return value
def get_for_type ( input_type = "text" ) : if input_type in RandomInputHelper . cache : return RandomInputHelper . cache [ input_type ] types = { "text" : RandomInputHelper . get_random_value , "hidden" : RandomInputHelper . get_random_value , "search" : RandomInputHelper . get_random_value , "color" : RandomInputHelper . get_random_color , "week" : { "function" : RandomInputHelper . get_random_value , "params" : [ 2 , [ "1234" ] ] } , "password" : RandomInputHelper . get_random_password , "number" : RandomInputHelper . get_random_number , "tel" : RandomInputHelper . get_random_telephonenumber , "url" : RandomInputHelper . get_random_url , "textarea" : RandomInputHelper . get_random_text , "email" : RandomInputHelper . get_random_email } if types . get ( input_type ) is None : return "" if type ( types . get ( input_type ) ) is dict : generator = types . get ( input_type ) value = generator . get ( "function" ) ( * generator . get ( "params" ) ) else : value = types . get ( input_type ) ( ) RandomInputHelper . cache [ input_type ] = value return value
Get a random string for the given html input type

        Args:
            input_type (str): The input type (e.g. email).

        Returns:
            str: The (cached) random value.