This file is indexed.

/usr/lib/python3/dist-packages/muranopkgcheck/checkers/yaql_checker.py is in python3-murano-pkg-check 0.3.0-0ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#    Copyright (c) 2016 Mirantis, Inc.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import yaql

ITERATORS_LIMIT = 100
EXPRESSION_MEMORY_QUOTA = 512 * 1024

ENGINE_10_OPTIONS = {
    'yaql.limitIterators': ITERATORS_LIMIT,
    'yaql.memoryQuota': EXPRESSION_MEMORY_QUOTA,
    'yaql.convertSetsToLists': True,
    'yaql.convertTuplesToLists': True,
    'yaql.iterableDicts': True
}

ENGINE_12_OPTIONS = {
    'yaql.limitIterators': ITERATORS_LIMIT,
    'yaql.memoryQuota': EXPRESSION_MEMORY_QUOTA,
    'yaql.convertSetsToLists': True,
    'yaql.convertTuplesToLists': True
}


def _add_operators(engine_factory):
    engine_factory.insert_operator(
        '>', True, 'is',
        yaql.factory.OperatorType.BINARY_LEFT_ASSOCIATIVE, False)
    engine_factory.insert_operator(
        None, True, ':',
        yaql.factory.OperatorType.BINARY_LEFT_ASSOCIATIVE, True)
    engine_factory.insert_operator(
        ':', True, ':',
        yaql.factory.OperatorType.PREFIX_UNARY, False)
    engine_factory.operators.insert(0, ())


def _create_engine():
    engine_factory = yaql.factory.YaqlFactory()
    _add_operators(engine_factory=engine_factory)
    options = ENGINE_12_OPTIONS
    return engine_factory.create(options=options)


class YaqlChecker(object):
    def __init__(self):
        self._engine = _create_engine()

    def __call__(self, data):
        try:
            self._engine(data)
        except yaql.utils.exceptions.YaqlParsingException:
            return False
        except TypeError:
            return False
        return True