
from infcommon.factory import Factory
from infcommon.yaml_reader.yaml_reader import YamlReader


def yaml_reader(path=None):
    return Factory.instance('yaml_reader', lambda: YamlReader(path))


import os

from infcommon.factory import Factory
from infcommon.yaml_reader.yaml_reader import YamlReader


DEFAULT_PATH_ENVIRONMENT_VARIABLE_NAME = 'CONF_FILE'


def yaml_reader(path=None):
    path = path or os.environ[DEFAULT_PATH_ENVIRONMENT_VARIABLE_NAME]
    return Factory.instance('yaml_reader',
                            lambda: YamlReader(path))

Use environment variable with deafult path when no path given
[FEATURE] Use environment variable with deafult path when no path given

+ 
+ import os
  
  from infcommon.factory import Factory
  from infcommon.yaml_reader.yaml_reader import YamlReader
  
  
+ DEFAULT_PATH_ENVIRONMENT_VARIABLE_NAME = 'CONF_FILE'
+ 
+ 
  def yaml_reader(path=None):
+     path = path or os.environ[DEFAULT_PATH_ENVIRONMENT_VARIABLE_NAME]
-     return Factory.instance('yaml_reader', lambda: YamlReader(path))
+     return Factory.instance('yaml_reader',
+                             lambda: YamlReader(path))
  
Use environment variable with deafult path when no path given
## Code Before:

from infcommon.factory import Factory
from infcommon.yaml_reader.yaml_reader import YamlReader


def yaml_reader(path=None):
    return Factory.instance('yaml_reader', lambda: YamlReader(path))

## Instruction:
Use environment variable with deafult path when no path given
## Code After:

import os

from infcommon.factory import Factory
from infcommon.yaml_reader.yaml_reader import YamlReader


DEFAULT_PATH_ENVIRONMENT_VARIABLE_NAME = 'CONF_FILE'


def yaml_reader(path=None):
    path = path or os.environ[DEFAULT_PATH_ENVIRONMENT_VARIABLE_NAME]
    return Factory.instance('yaml_reader',
                            lambda: YamlReader(path))
