def other_location() -> str:
+ """
+ Returns the location where this program is _NOT_ running.
+
+ >>> x = other_location()
+ >>> x in set(['HOUSE', 'CABIN'])
+ True
+
+ """
hostname = platform.node()
if '.house' in hostname:
location = 'CABIN'
def this_location() -> str:
+ """
+ Returns the location where this program _IS_ running.
+
+ >>> x = this_location()
+ >>> x in set(['HOUSE', 'CABIN'])
+ True
+
+ """
hostname = platform.node()
if '.house' in hostname:
location = 'HOUSE'
def effective_location(location_override: Optional[str] = None) -> str:
+ """Detects and returns a location taking into account two override
+ mechanisms.
+
+ >>> x = effective_location()
+ >>> x in set(['HOUSE', 'CABIN'])
+ True
+
+ >>> effective_location('HOUSE')
+ 'HOUSE'
+
+ """
if location_override is None:
try:
location_override = config.config['site_config_override_location']