Load install.json schema file.
345233
def install_json_schema(self):
        """"""
        if self._install_json_schema is None and self.install_json_schema_file is not None:
            # remove old schema file
            if os.path.isfile('tcex_json_schema.json'):
                # this file is now part of tcex.
                os.remove('tcex_json_schema.json')

            if os.path.isfile(self.install_json_schema_file):
                with open(self.install_json_schema_file) as fh:
                    self._install_json_schema = json.load(fh)
        return self._install_json_schema
748235
def install_json(self):
        """"""
        if self._install_json is None:
            try:
                install_json_filename = os.path.join(os.getcwd(), 'install.json')
                with open(install_json_filename, 'r') as fh:
                    self._install_json = json.load(fh)
            except IOError:
                self.log.warning(u'Could not retrieve App Data.')
                self._install_json = {}
        return self._install_json
1065372
def load_schema(name):
    

    data = pkgutil.get_data('jsonschema', "schemas/{0}.json".format(name))
    return json.loads(data.decode("utf-8"))
1016849
function loadJSONConfigFile(filePath) {
    try {
        return JSON.parse(stripComments(readFile(filePath)));
    }
    catch (e) {
        e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
        throw e;
    }
}
920488
def load(filename):
  '''  '''
  global _DICTIONARY
  try:
    json_file = filename + '.json'
    with open(os.path.join(_DEFAULT_DIR, json_file), 'rb') as f:
      _DICTIONARY = json.load(f)
  except IOError:
    raise IOError('Language file not found. Make sure that your ',
                  'translation file is in the languages directory, ')
1308343
function load () {
  const str = fs.readFileSync(settingsFile, 'utf8')
  if (str) {
    const settings = JSON.parse(str)
    this.settings = settings.livereload
    this.paths = getPaths(settings)
      .map(p => path.normalize(this.root + '/' + p))
      .map(p => makeGlob(p))
  }
}
787367
def install(cls):
        """"""
        [os.makedirs('{}/{}'.format(cls.home, cls.dirs[d])) for d in cls.dirs]
27590
def check_layout_json(self):
        """"""
        # the install.json files can't be validates if the schema file is not present
        layout_json_file = 'layout.json'
        if self.layout_json_schema is None or not os.path.isfile(layout_json_file):
            return

        error = None
        status = True
        try:
            # loading explicitly here to keep all error catching in this file
            with open(layout_json_file) as fh:
                data = json.loads(fh.read())
            validate(data, self.layout_json_schema)
        except SchemaError as e:
            status = False
            error = e
        except ValidationError as e:
            status = False
            error = e.message
        except ValueError:
            # any JSON decode error will be caught during syntax validation
            return

        # update validation data for module
        self.validation_data['schema'].append({'filename': layout_json_file, 'status': status})

        if error:
            # update validation data errors
            self.validation_data['errors'].append(
                'Schema validation failed for {} ({}).'.format(layout_json_file, error)
            )
        else:
            self.check_layout_params()
814665
def layout_json_schema(self):
        """"""
        if self._layout_json_schema is None and self.layout_json_schema_file is not None:
            if os.path.isfile(self.layout_json_schema_file):
                with open(self.layout_json_schema_file) as fh:
                    self._layout_json_schema = json.load(fh)
        return self._layout_json_schema
425573
function loadSchemas(ajv) {
    var metaSchema = helper.require('/lib/task-data/schemas/rackhd-task-schema.json');
    ajv.addMetaSchema(metaSchema, 'rackhd-task-schema.json');
    var fileNames = glob.sync(helper.relativeToRoot('/lib/task-data/schemas/*.json'));
    _(fileNames).filter(function (filename) {
        return path.basename(filename) !== 'rackhd-task-schema.json';
    })
    .forEach(function (filename) {
        try {
            var data = fs.readFileSync(filename).toString();
            jsonlint.parse(data);
            ajv.addSchema(JSON.parse(data), path.basename(filename));
        }
        catch(err) {
            console.error('fail to add schema: ' + filename);
            throw err;
        }
    })
    .value();
    return ajv;
}
1123419
function load(schema) {
  var obj;
  if (typeof schema == 'string' && schema !== 'null') {
    try {
      obj = JSON.parse(schema);
    } catch (err) {
      // No file loading here.
    }
  }
  if (obj === undefined) {
    obj = schema;
  }
  return obj;
}
216543
def load_schema(name):
    

    schema = import_schema_to_json(name)

    #salesking specific swap
    #//set link relation as key name to make it easier to call these
    for item in schema['links']:
        #//set link relation as key name to make it easier to call these
        #            foreach($schema->links as $key => $link)
        #            {
        #                $schema->links[$link->rel] = $link;
        #                unset($schema->links[$key]);
        #            }
        # this here seems not to work as expected
        # something is wrong
        href_value = item['href']
        rel_value = item['rel']
        schema[rel_value] = href_value
        del item

    ## sk use nesting of schema
    ## dynamically loading
    for prop in schema['properties']:
        value = schema['properties'][prop]
        # arrays may contain the nesting
        is_type_array = (value['type'] == 'array')
        is_type_object = (value['type'] == 'object')
        if ((is_type_array or is_type_object)
            and (_value_properties_are_referenced(value))):
            schema = _load_referenced_schema_from_properties(value, schema, prop)

        if is_type_array and _value_is_default_any(value) and _value_has_items_key(value):
            schema = _load_referenced_schemes_from_list(value['items'], value, schema, prop)

        if _value_is_required(value):
            # remove required
            schema['properties'][prop]['required'] = False
        
        # hack to bypass text format valitation to string
        if _value_is_type_text(value):
            log.debug("patched text to string")
            schema['properties'][prop]['type'] = u"string"
        
        #ignore the readonly properties auto validation
        #if 'readonly' in value.keys() and value['readonly'] == True:
        #    log.debug("patched required validation to none required")
        #    schema['properties'][property]['readonly'] = False

    # sk works on title and not name
    schema['name'] = schema['title']
    ## go one level deeper as we now have some replacements

    # put it to storage when done
    # if not JsonSchemaStore.is_stored(name) and (schema is not None):
    #    JsonSchemaStore.copy_to_store(name, schema)
    return schema
672050
def _setup_py_run_from_dir(root_dir, py_interpreter):
    """"""
    data = {}
    with _enter_single_subdir(root_dir) as single_subdir:
        if not os.path.exists("setup.py"):
            raise Exception("'setup.py' does not exist in '%s'" % (
                single_subdir))
        # generate a temporary json file which contains the metadata
        output_json = tempfile.NamedTemporaryFile()
        cmd = "%s setup.py -q --command-packages metaextract " \
              "metaextract -o %s " % (py_interpreter, output_json.name)
        try:
            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
        except subprocess.CalledProcessError:
            # try again with a encoding in setup.py
            _set_file_encoding_utf8("setup.py")
            subprocess.check_output(cmd, shell=True)

        # read json file and return data
        with open(output_json.name, "r") as f:
            data = json.loads(f.read())

        # sort some of the keys if the dict values are lists
        for key in ['data_files', 'entry_points', 'extras_require',
                    'install_requires', 'setup_requires', 'scripts',
                    'tests_require', 'tests_suite']:
            if key in data['data'] and isinstance(data['data'][key], list):
                data['data'][key] = sorted(data['data'][key])
    return data
378335
function loadIntoLibrary(schemas) {
  assert(_.isObject(schemas));
  _.extend(library, schemas);
}
1048097
def load(self):
        """"""
        try:
            self._read()
            self._parse()
        except Exception as exc:
            self.failed = True

            params = {'path': self._path, 'exception': exc}
            if self.fail_silently:
                LOG.warning("Error processing message json file '%(path)s': "
                            "%(exception)s", params)
            else:
                raise exceptions.MessageFailure(
                    _("Error processing message json file '%(path)s': "
                      "%(exception)s") % params)
1322517
def load(self, updates):
        """"""
        # Go through in order and override the config (`.mbed_cloud_config.json` loader)
        for path in self.paths():
            if not path:
                continue
            abs_path = os.path.abspath(os.path.expanduser(path))
            if not os.path.isfile(abs_path):
                self._using_paths.append('missing: %s' % abs_path)
                continue
            self._using_paths.append(' exists: %s' % abs_path)
            with open(abs_path) as fh:
                self.update(json.load(fh))

        # New dotenv loader - requires explicit instructions to use current working directory
        load_dotenv(find_dotenv(usecwd=True))

        # Pluck config values out of the environment
        for env_var, key in {ENVVAR_API_HOST: 'host', ENVVAR_API_KEY: 'api_key'}.items():
            env_value = os.getenv(env_var)
            if env_value is not None:
                self[key] = env_value
        if updates:
            self.update(updates)
        self.validate()
1294835
def loads(cls, json_data):
        """"""
        try:
            return cls(**cls.MARSHMALLOW_SCHEMA.loads(json_data))
        except marshmallow.exceptions.ValidationError as exc:
            raise ValidationError("Failed to load message", extra=exc.args[0])