import yaml

def load_config(keys=None):
    with open('config.yml', 'r') as yf:
        conf = yaml.load(yf)

    if keys is not None:
        return [conf[k] for k in keys]

    return conf
import yaml

def load_config(keys=None):
    with open('config.yml', 'r') as yf:
        conf = yaml.safe_load(yf)

    if keys is not None:
        return [conf[k] for k in keys]

    return conf

Use safe_load in place of load
Use safe_load in place of load
