parameters: (values, mojom_name, scope, kind)
return_statement: return values.get(mojom_name)
docstring: Like LookupKind, but for constant values.
docstring_summary: Like LookupKind, but for constant values.
docstring_tokens: Like LookupKind but for constant values .
function: def _LookupValue(values, mojom_name, scope, kind):
    """Like LookupKind, but for constant values."""
    # If the type is an enum, the value can be specified as a qualified name, in
    # which case the form EnumName.ENUM_VALUE must be used. We use the presence
    # of a '.' in the requested name to identify this. Otherwise, we prepend the
    # enum name.
    if isinstance(kind, mojom.Enum) and '.' not in mojom_name:
      mojom_name = '%s.%s' % (kind.spec.split(':', 1)[1], mojom_name)
    for i in reversed(range(len(scope) + 1)):
      test_spec = '.'.join(scope[:i])
      if test_spec:
        test_spec += '.'
      test_spec += mojom_name
      value = values.get(test_spec)
      if value:
        return value
  
    return values.get(mojom_name)
function_tokens: def _LookupValue ( values , mojom_name , scope , kind ) : # If the type is an enum, the value can be specified as a qualified name, in # which case the form EnumName.ENUM_VALUE must be used. We use the presence # of a '.' in the requested name to identify this. Otherwise, we prepend the # enum name. if isinstance ( kind , mojom . Enum ) and '.' not in mojom_name : mojom_name = '%s.%s' % ( kind . spec . split ( ':' , 1 ) [ 1 ] , mojom_name ) for i in reversed ( range ( len ( scope ) + 1 ) ) : test_spec = '.' . join ( scope [ : i ] ) if test_spec : test_spec += '.' test_spec += mojom_name value = values . get ( test_spec ) if value : return value return values . get ( mojom_name )