Load YAML file into an ordered dictionary

    Args:
        path (str): Path to YAML file

    Returns:
        OrderedDict: Ordered dictionary containing loaded YAML file
968277
def load_yaml(path):
    # type: (str) -> OrderedDict
    
    with open(path, 'rt') as f:
        yamldict = yaml.load(f.read(), Loader=yamlloader.ordereddict.CSafeLoader)
    if not yamldict:
        raise (LoadError('YAML file: %s is empty!' % path))
    return yamldict
1201331
def load_json(path):
    # type: (str) -> OrderedDict
    
    with open(path, 'rt') as f:
        jsondict = json.loads(f.read(), object_pairs_hook=OrderedDict)
    if not jsondict:
        raise (LoadError('JSON file: %s is empty!' % path))
    return jsondict
1127839
def load_yaml(path)
      yml = YAML.load_file(path)
      raise ConfigurationError, "The YAML file at #{path} failed to load" unless yml

      apply_configuration(yml)
    end
676655
def load_yaml(filename):
    
    with open(filename) as f:
        ydoc = yaml.safe_load(f.read())
    return (ydoc, serialize_tojson(ydoc))
1299951
def from_file(cls, path=None):
        
        # None => use default
        if path is None:
            for path in cls.default_pathes():
                try:
                    return cls.from_file(path)
                except IOError as e:
                    logging.getLogger(__name__).debug(
                        _("Failed to read config file: {0}", exc_message(e)))
                except ImportError as e:
                    logging.getLogger(__name__).warn(
                        _("Failed to read {0!r}: {1}", path, exc_message(e)))
            return cls({})
        # False/'' => no config
        if not path:
            return cls({})
        if os.path.splitext(path)[1].lower() == '.json':
            from json import load
        else:
            from yaml import safe_load as load
        with open(path) as f:
            return cls(load(f))
133280
def load(config_path: str):
    
    # we bind the config to _ to keep it alive
    if os.path.splitext(config_path)[1] in ('.yaml', '.yml'):
        _ = load_yaml_configuration(config_path, translator=PipelineTranslator())
    elif os.path.splitext(config_path)[1] == '.py':
        _ = load_python_configuration(config_path)
    else:
        raise ValueError('Unknown configuration extension: %r' % os.path.splitext(config_path)[1])
    yield
835012
def ordered_load(self, stream, Loader=yaml.Loader, object_pairs_hook=OrderedDict):
        
        class OrderedLoader(Loader):
            pass

        def construct_mapping(loader, node):
            loader.flatten_mapping(node)
            return object_pairs_hook(loader.construct_pairs(node))
        OrderedLoader.add_constructor(
            yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
            construct_mapping)
        try:
            try:
                result = yaml.load(stream, OrderedLoader)
            except yaml.scanner.ScannerError:
                if type(stream) == str:
                    result = json.loads(stream, object_pairs_hook=object_pairs_hook)
                else:
                    stream.seek(0)
                    result = json.load(stream, object_pairs_hook=object_pairs_hook)
        except Exception as e:
            self.error(e)
            result = {}
        return result
838268
def _load_config(config_filepath: str) -> Dict[str, Any]:
        
        try:
            config: Dict[str, Any] = yaml.load(stream=open(config_filepath, "r"))
        except Exception as e:
            raise Exception(f"Invalid DAG Factory config file; err: {e}")
        return config
735358
def load(path):
    '''
    
    '''
    ret = {}
    fmadm = _check_fmadm()
    cmd = '{cmd} load {path}'.format(
        cmd=fmadm,
        path=path
    )
    res = __salt__['cmd.run_all'](cmd)
    retcode = res['retcode']
    result = {}
    if retcode != 0:
        result['Error'] = res['stderr']
    else:
        result = True

    return result
1091869
def load(self, path):
        
        with open(path) as f:
            code = f.read()
            exec(code, {}, self.__dict__)
832743
def load(path, **kw):
    
    _kw = {}
    if PY3:  # pragma: no cover
        _kw['encoding'] = 'utf-8'
    with open(str(path), **_kw) as fp:
        return json.load(fp, **kw)
1170447
def load_config(self, path):
        
        self.config_path = path
        self.config.read(self.config_path)
14994
def load_configuration(conf_path):
    
    with open(conf_path) as f:
        conf_dict = yaml.load(f)
    validate_config(conf_dict)
    return conf_dict
454239
def load_yaml_config_file(path):
    
    result = None
    with open(path, 'r') as steam:
        result = yaml.safe_load(steam)
    return result
83134
def get_json_or_yaml(file_path, content):
    
    if os.path.splitext(file_path)[1] == ".json":
        return json.dumps(content, sort_keys=False, indent=4, separators=(',', ': '))
    else:
        return inginious.common.custom_yaml.dump(content)
277086
def load_from_file(cls, file_path: str):
        
        with open(file_path, "r") as f:
            data = json.load(f)
            item = cls.decode(data=data)
        return item
657114
def build(cls, path):
        
        with zipfile.ZipFile(path) as zfile:
            items = (
                (
                    name.replace('/', os.sep),
                    zfile.getinfo(name),
                )
                for name in zfile.namelist()
            )
            return dict(items)