 
import yaml

def read_config():
    yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')
    config_file = yaml.load( yml_file )
    return config_file


 
import yaml
import os.path

_config_file_base_name = 'mediawords.yml'
_config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml'))

def read_config():
    yml_file = open(_config_file_name, 'rb')
    config_file = yaml.load( yml_file )
    return config_file


Use relative path location for mediawords.yml.
Use relative path location for mediawords.yml.

   
  import yaml
+ import os.path
+ 
+ _config_file_base_name = 'mediawords.yml'
+ _config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml'))
  
  def read_config():
-     yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')
+     yml_file = open(_config_file_name, 'rb')
      config_file = yaml.load( yml_file )
      return config_file
  
  
Use relative path location for mediawords.yml.
## Code Before:
 
import yaml

def read_config():
    yml_file = open('/home/dlarochelle/git_dev/mediacloud/mediawords.yml', 'rb')
    config_file = yaml.load( yml_file )
    return config_file


## Instruction:
Use relative path location for mediawords.yml.
## Code After:
 
import yaml
import os.path

_config_file_base_name = 'mediawords.yml'
_config_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mediawords.yml'))

def read_config():
    yml_file = open(_config_file_name, 'rb')
    config_file = yaml.load( yml_file )
    return config_file

