Load an instance of this class from YAML.
12983
def loads(cls, s):
        
        with closing(StringIO(s)) as fileobj:
            return cls.load(fileobj)
158618
def from_yaml(self, path):
        """"""
        bundles = YAMLLoader(path).load_bundles()
        for name in bundles:
            self.register(name, bundles[name])
980892
def _load_yaml_config(cls, config_data, filename="(unknown)"):
        """"""

        try:
            config = yaml.safe_load(config_data)
        except yaml.YAMLError as err:
            if hasattr(err, 'problem_mark'):
                mark = err.problem_mark
                errmsg = ("Invalid YAML syntax in Configuration file "
                          "%(file)s at line: %(line)s, column: %(column)s."
                          % dict(file=filename,
                                 line=mark.line + 1,
                                 column=mark.column + 1))
            else:
                errmsg = ("YAML error reading Configuration file "
                          "%(file)s"
                          % dict(file=filename))
            logger.error(errmsg)
            raise

        logger.info("Configuration: %s", config)
        return config
695799
def initialize():
    
    global is_initialized
    # Add the custom multi-constructor
    yaml.add_multi_constructor('!obj:', multi_constructor)
    yaml.add_multi_constructor('!pkl:', multi_constructor_pkl)
    yaml.add_multi_constructor('!import:', multi_constructor_import)
    yaml.add_multi_constructor('!include:', multi_constructor_include)

    def import_constructor(loader, node):
        value = loader.construct_scalar(node)
        return try_to_import(value)

    yaml.add_constructor('!import', import_constructor)
    yaml.add_implicit_resolver(
        '!import',
        re.compile(r'(?:[a-zA-Z_][\w_]+\.)+[a-zA-Z_][\w_]+')
    )
    is_initialized = True
1175536
def load_yaml(filename):
    """"""
    with open(filename) as myfile:
        content = myfile.read()
        if "win" in sys.platform:
            content = content.replace("\\", "/")
        return yaml.safe_load(content)
216471
def load_yaml(file):
    """"""
    if hasattr(yaml, "full_load"):
        return yaml.full_load(file)
    else:
        return yaml.load(file)
94923
def load(self, _override=True, _allow_undeclared=False, **kwargs):
    """"""
    self.load_from_dict(
        kwargs, _override=_override, _allow_undeclared=_allow_undeclared)
864755
def load(self, content):
        """"""
        # Try parsing the YAML with global tags
        try:
            config = yaml.load(content, Loader=self._loader(self._global_tags))
        except yaml.YAMLError:
            raise InvalidConfigError(_("Config is not valid yaml."))

        # Try extracting just the tool portion
        try:
            config = config[self.tool]
        except (TypeError, KeyError):
            return None

        # If no scopes, just apply global default
        if not isinstance(config, dict):
            config = self._apply_default(config, self._global_default)
        else:
            # Figure out what scopes exist
            scoped_keys = set(key for key in self._scopes)

            # For every scope
            for key in config:
                # If scope has custom tags, apply
                if key in scoped_keys:
                    # local tags, and local default
                    tags, default = self._scopes[key]

                    # Inherit global default if no local default
                    if not default:
                        default = self._global_default

                    config[key] = self._apply_default(config[key], default)
                    self._apply_scope(config[key], tags)
                # Otherwise just apply global default
                else:
                    config[key] = self._apply_default(config[key], self._global_default)

        self._validate(config)

        return config
1119457
def yml_load(stream, container, **options):
    
    ret = yml_fnc("load", stream, **options)
    if ret is None:
        return container()

    return ret
13172
def load(file)
      if File.exist? file
        symbolize_keys(YAML.load_file(File.expand_path('.', file)))
      else
        {}
      end
    end
599319
public static Object loadGenInstance(String classname) throws ParserException
    {
        try
        {
            Class<?> parserClass;
            try
            {
                parserClass = Class.forName(classname);
            }
            catch (ClassNotFoundException ex)
            {
                return null;
            }
            return parserClass.newInstance();
        }
        catch (InstantiationException | IllegalAccessException ex)
        {
            throw new ParserException(ex);
        }
    }
1268572
def load_yaml_config(self, conf):
        """"""
        with open(conf) as fd:
            self.config = recursive_dict_update(self.config, yaml.load(fd, Loader=UnsafeLoader))
1318244
def load_from(dir)
      Dir.foreach(dir) do |name|
        next if name =~ /^\./

        # convert from external to internal form, and
        # extract the instance/class flag

        if name =~ /^(.*?)-(c|i).yaml$/
          external_name = $1
          is_class_method = $2 == "c"
          internal_name = RiWriter.external_to_internal(external_name)
          list = is_class_method ? @class_methods : @instance_methods
          path = File.join(dir, name)
          list << MethodEntry.new(path, internal_name, is_class_method, self)
        else
          full_name = File.join(dir, name)
          if File.directory?(full_name)
            inf_class = @inferior_classes.find {|c| c.name == name }
            if inf_class
              inf_class.add_path(full_name)
            else
              inf_class = ClassEntry.new(full_name, name, self)
              @inferior_classes << inf_class
            end
            inf_class.load_from(full_name)
          end
        end
      end
    end
423470
def load_dict_from_yaml(path):
    
    f = file(path, 'r')
    dictionary = yaml.load(f)
    f.close()
    return dictionary
820109
def load(self):
    """"""
    try:
      with open(self._ef_site_config, 'r') as yml_file:
        return yaml.safe_load(yml_file)
    except (IOError, yaml.parser.ParserError) as error:
      print("Error: {}".format(error), file=sys.stderr)
      sys.exit(1)
1043773
def from_file(cls, filename):
        
        yaml = YAML(typ="safe")
        with open(filename, "r") as f:
            d = yaml.load(f)
        return cls.from_dict(d)
903817
def yml_load(stream, container, yml_fnc=yml_fnc, **options):
    
    if options.get("ac_safe", False):
        options = {}  # yaml.safe_load does not process Loader opts.
    elif not options.get("Loader"):
        maybe_container = options.get("ac_dict", False)
        if maybe_container and callable(maybe_container):
            container = maybe_container

        options["Loader"] = _customized_loader(container)

    ret = yml_fnc("load", stream,
                  **common.filter_from_options("ac_dict", options))
    if ret is None:
        return container()

    return ret