import platform

if platform.node().startswith('garnet') or platform.node().startswith('copper'):
    from garnet import *
else:
    from default import *
import os

if 'HOSTNAME' in os.environ:
    if os.environ['HOSTNAME'].startswith('garnet') or os.environ['HOSTNAME'].startswith('copper'):
        from garnet import *
else:
    from default import *
Correct detection on Garnet/Copper compute nodes
Correct detection on Garnet/Copper compute nodes

- import platform
+ import os
  
- if platform.node().startswith('garnet') or platform.node().startswith('copper'):
+ if 'HOSTNAME' in os.environ:
+     if os.environ['HOSTNAME'].startswith('garnet') or os.environ['HOSTNAME'].startswith('copper'):
-     from garnet import *
+         from garnet import *
  else:
      from default import *
Correct detection on Garnet/Copper compute nodes
## Code Before:
import platform

if platform.node().startswith('garnet') or platform.node().startswith('copper'):
    from garnet import *
else:
    from default import *
## Instruction:
Correct detection on Garnet/Copper compute nodes
## Code After:
import os

if 'HOSTNAME' in os.environ:
    if os.environ['HOSTNAME'].startswith('garnet') or os.environ['HOSTNAME'].startswith('copper'):
        from garnet import *
else:
    from default import *