<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _process_name_or_alias_filter_directive(filter_operation_info, location, context, parameters):
 """Return a Filter basic block that checks for a match against an Entity's name or alias. Args: filter_operation_info: FilterOperationInfo object, containing the directive and field info of the field where the filter is to be applied. location: Location where this filter is used. context: dict, various per-compilation data (e.g. declared tags, whether the current block is optional, etc.). May be mutated in-place in this function! parameters: list of 1 element, containing the value to check the name or alias against; if the parameter is optional and missing, the check will return True Returns: a Filter basic block that performs the check against the name or alias """

    filtered_field_type = filter_operation_info.field_type
    if isinstance(filtered_field_type, GraphQLUnionType):
        raise GraphQLCompilationError(u'Cannot apply "name_or_alias" to union type '
                                      u'{}'.format(filtered_field_type))

    current_type_fields = filtered_field_type.fields
    name_field = current_type_fields.get('name', None)
    alias_field = current_type_fields.get('alias', None)
    if not name_field or not alias_field:
        raise GraphQLCompilationError(u'Cannot apply "name_or_alias" to type {} because it lacks a '
                                      u'"name" or "alias" field.'.format(filtered_field_type))

    name_field_type = strip_non_null_from_type(name_field.type)
    alias_field_type = strip_non_null_from_type(alias_field.type)

    if not isinstance(name_field_type, GraphQLScalarType):
        raise GraphQLCompilationError(u'Cannot apply "name_or_alias" to type {} because its "name" '
                                      u'field is not a scalar.'.format(filtered_field_type))
    if not isinstance(alias_field_type, GraphQLList):
        raise GraphQLCompilationError(u'Cannot apply "name_or_alias" to type {} because its '
                                      u'"alias" field is not a list.'.format(filtered_field_type))

    alias_field_inner_type = strip_non_null_from_type(alias_field_type.of_type)
    if alias_field_inner_type != name_field_type:
        raise GraphQLCompilationError(u'Cannot apply "name_or_alias" to type {} because the '
                                      u'"name" field and the inner type of the "alias" field '
                                      u'do not match: {} vs {}'.format(filtered_field_type,
                                                                       name_field_type,
                                                                       alias_field_inner_type))

    argument_inferred_type = name_field_type
    argument_expression, non_existence_expression = _represent_argument(
        location, context, parameters[0], argument_inferred_type)

    check_against_name = expressions.BinaryComposition(
        u'=', expressions.LocalField('name'), argument_expression)
    check_against_alias = expressions.BinaryComposition(
        u'contains', expressions.LocalField('alias'), argument_expression)
    filter_predicate = expressions.BinaryComposition(
        u'||', check_against_name, check_against_alias)

    if non_existence_expression is not None:
        # The argument comes from an optional block and might not exist,
        # in which case the filter expression should evaluate to True.
        filter_predicate = expressions.BinaryComposition(
            u'||', non_existence_expression, filter_predicate)

    return blocks.Filter(filter_predicate)