<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_all_declarations( declarations, decl_type=None, name=None, parent=None, recursive=True, fullname=None):
 """ Returns a list of all declarations that match criteria, defined by developer. For more information about arguments see :class:`match_declaration_t` class. :rtype: [ matched declarations ] """


    if recursive:
        decls = make_flatten(declarations)
    else:
        decls = declarations

    return list(
        filter(
            algorithm.match_declaration_t(
                decl_type=decl_type,
                name=name,
                fullname=fullname,
                parent=parent),
            decls))