def func(command, description, link, params_string, returns="On success, the sent Message is returned.", return_type="Message"):
    """
    Live template for pycharm:

    y = func(command="$cmd$", description="$desc$", link="$lnk$", params_string="$first_param$", returns="$returns$", return_type="$returntype$")
    """
    variables_needed = []
    variables_optional = []
    imports = set()
    if params_string:  # WHITELISTED_FUNCS have no params
        for param in params_string.split("\n"):
            variable = parse_param_types(param)
            # any variable.types has always_is_value => lenght must be 1.
            assert (not any([type_.always_is_value is not None for type_ in variable.types]) or len(variable.types) == 1)
            if variable.optional:
                variables_optional.append(variable)
            else:
                variables_needed.append(variable)
            # end if
            imports.update(variable.all_imports)
        # end for
    # end if
    imports = list(imports)
    imports.sort()
    returns = Variable(types=as_types(return_type, variable_name="return type"), description=returns)
    func_object = Function(
        imports=imports, api_name=command, link=link, description=description, returns=returns,
        parameters=variables_needed, keywords=variables_optional
    )
    return func_object
Live template for pycharm:

    y = func(command="$cmd$", description="$desc$", link="$lnk$", params_string="$first_param$", returns="$returns$", return_type="$returntype$")