You can get all the class Baseline dict names by using the globals() function in Python, which returns a dictionary representing the current global symbol table. Here is an example of how you can do it:
python
User
How can I reference directly to class Baseline instead of globals().items()?
Assistant
To directly reference the Baseline class instead of using globals().items(), you can use the vars() function, which returns the __dict__ attribute of an object as its dictionary. Here is an updated example:
python
class Baseline(object):
"""Present ENM interface for getting data for cells configured on ENM."""
ENodeBFunction_base = {
'csfbMeasFromIdleMode': 'true',
'forcedSiTunnelingActive': 'true',
'releaseInactiveUesInactTime': '1',
'releaseInactiveUesMpLoadLevel': 'VERY_HIGH_LOAD',
'rrcConnReestActive': 'true',
'x2SetupTwoWayRelations': 'true',
}
SectorCarrier_base = {
'radioTransmitPerfMode': 'CAPACITY', # radioTransmitPerfMode 0-COVERAGE, 1-CAPACITY, 2&3-GREEN
'ulForcedTimingAdvanceCommand': '0',
}
AnrFunction_base = {
'removeNcellTime': '1',
'removeNenbTime': '1',
'removeNrelTime': '1',
}
AnrFunction_AnrFunctionEUtran_base = {
'cellAddRsrpThresholdEutran': '-1050',
}
AutoCellCapEstFunction_base = {
'useEstimatedCellCap': 'true',
}
# Get all class Baseline dict names
baseline_dict_names = [name for name, obj in globals().items() if isinstance(obj, dict) and name.endswith('_base')]
print(baseline_dict_names)
In this updated code, we use vars(Baseline) to get the dictionary of attributes for the Baseline class, and then we iterate over the items of this dictionary and check if the value is a dictionary object (isinstance(obj, dict)) and if the name ends with _base (name.endswith('_base')).