Debian Codegraph @

ml_collections/config_flags/tests/mini_config.py

raw symbols SCIP
1 # Copyright 2024 The ML Collections Authors.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 """Placeholder Config file."""
16
17
18 class MiniConfig(object):
19 """Just a placeholder config."""
20
21 def __init__(self):
22 self.dict = {}
23 self.field = False
24
25 def __getitem__(self, key):
26 return self.dict[key]
27
28 def __contains__(self, key):
29 return key in self.dict
30
31 def __setitem__(self, key, value):
32 self.dict[key] = value
33
34
35 def get_config():
36 cfg = MiniConfig()
37 cfg['entry_with_collision'] = False
38 cfg.entry_with_collision = True
39 return cfg