import yaml
import os, os.path
loc = os.path.dirname(os.path.abspath(__file__))

hosts = yaml.load(open(loc+'/hosts.yml'))
projects = yaml.load(open(loc+'/projects.yml'))
allocations = yaml.load(open(loc+'/allocations.yml'))
users = yaml.load(open(loc+'/users.yml'))

import yaml
import os
loc = os.path.dirname(os.path.abspath(__file__))

with open(os.path.join(loc, 'hosts.yml'), 'r') as fr:
    hosts = yaml.load(fr)

with open(os.path.join(loc, 'projects.yml'), 'r') as fr:
    projects = yaml.load(fr)

with open(os.path.join(loc, 'allocations.yml'), 'r') as fr:
    allocations = yaml.load(fr)

with open(os.path.join(loc, 'users.yml'), 'r') as fr:
    users = yaml.load(fr)

Use OS-agnostic path joining operations
Use OS-agnostic path joining operations

  import yaml
- import os, os.path
+ import os
  loc = os.path.dirname(os.path.abspath(__file__))
  
+ with open(os.path.join(loc, 'hosts.yml'), 'r') as fr:
+     hosts = yaml.load(fr)
- hosts = yaml.load(open(loc+'/hosts.yml'))
- projects = yaml.load(open(loc+'/projects.yml'))
- allocations = yaml.load(open(loc+'/allocations.yml'))
- users = yaml.load(open(loc+'/users.yml'))
  
+ with open(os.path.join(loc, 'projects.yml'), 'r') as fr:
+     projects = yaml.load(fr)
+ 
+ with open(os.path.join(loc, 'allocations.yml'), 'r') as fr:
+     allocations = yaml.load(fr)
+ 
+ with open(os.path.join(loc, 'users.yml'), 'r') as fr:
+     users = yaml.load(fr)
+ 
Use OS-agnostic path joining operations
## Code Before:
import yaml
import os, os.path
loc = os.path.dirname(os.path.abspath(__file__))

hosts = yaml.load(open(loc+'/hosts.yml'))
projects = yaml.load(open(loc+'/projects.yml'))
allocations = yaml.load(open(loc+'/allocations.yml'))
users = yaml.load(open(loc+'/users.yml'))

## Instruction:
Use OS-agnostic path joining operations
## Code After:
import yaml
import os
loc = os.path.dirname(os.path.abspath(__file__))

with open(os.path.join(loc, 'hosts.yml'), 'r') as fr:
    hosts = yaml.load(fr)

with open(os.path.join(loc, 'projects.yml'), 'r') as fr:
    projects = yaml.load(fr)

with open(os.path.join(loc, 'allocations.yml'), 'r') as fr:
    allocations = yaml.load(fr)

with open(os.path.join(loc, 'users.yml'), 'r') as fr:
    users = yaml.load(fr)
