code: def load_variables(defines, config_file):
      
  
      if config_file is not None:
          with open(config_file, "r") as conf_file:
              variables = yaml.load(conf_file)
      else:
          variables = {}
  
      for define in defines:
          name, equ, value = define.partition('=')
          if equ != '=':
              print("Invalid variable definition")
              print("- expected name=value")
              print("- found: '%s'" % define)
              sys.exit(1)
  
          variables[name] = value
  
      return variables
docs: Load all variables from cmdline args and/or a config file.
  
      Args:
          defines (list of str): A list of name=value pairs that
              define free variables.
          config_file (str): An optional path to a yaml config
              file that defines a single dict with name=value
              variable definitions.