Parse object either in `input` or in the file called `input`. The latter is
searched first.
489550
function parseObj (input) {
  try {
    return require(path.resolve(input));
  } catch (e) {
    var str;
    try {
      str = fs.readFileSync(program.obj, 'utf8');
    } catch (e) {
      str = program.obj;
    }
    try {
      return JSON.parse(str);
    } catch (e) {
      return eval('(' + str + ')');
    }
  }
}
114177
def load(self, f):
        
        with _open_file_obj(f) as f:
            parser = self.parse_file(f)
            self.deserialize(parser)
1277789
def parse_file(self, filename=None, buffer=None, fileobj=None):
        """"""
        if filename:
            self.file = GzipFile(filename, 'rb')
        elif buffer:
            if hasattr(buffer, 'name'):
                self.filename = buffer.name
            self.file = buffer
        elif fileobj:
            if hasattr(fileobj, 'name'):
                self.filename = fileobj.name
            self.file = GzipFile(fileobj=fileobj)
        if self.file:
            try:
                type = TAG_Byte(buffer=self.file)
                if type.value == self.id:
                    name = TAG_String(buffer=self.file).value
                    self._parse_buffer(self.file)
                    self.name = name
                    self.file.close()
                else:
                    raise MalformedFileError(
                        "First record is not a Compound Tag")
            except StructError as e:
                raise MalformedFileError(
                    "Partial File Parse: file possibly truncated.")
        else:
            raise ValueError(
                "NBTFile.parse_file(): Need to specify either a "
                "filename or a file object"
            )
1220231
def parse(cls, string):
		'''
			
		'''
		obj, i = cls.match(string, 0)
		if i != len(string):
			raise Exception("Could not parse '" + string + "' beyond index " + str(i))
		return obj
841771
def parse_file(self, name):
        
        with open(name, "rb") as fp:
            return self.parse(fp.read())
805070
def parse(cls, fileobj):
        

        try:
            length = cls._parse_desc_length_file(fileobj)
        except ValueError as e:
            raise DescriptorError(e)
        pos = fileobj.tell()
        instance = cls(fileobj, length)
        left = length - (fileobj.tell() - pos)
        if left < 0:
            raise DescriptorError("descriptor parsing read too much data")
        fileobj.seek(left, 1)
        return instance
569786
def parser(input_file_path='config.json'):
    '''
    
    '''

    # --- Read .json file
    try:
        with open(input_file_path, 'r') as config_file:
            config_new = json.load(config_file)
            config_file.close()
    except:
        raise Exception('Config file "'+input_file_path+'" not loaded properly. Please check it an try again.')

    import copy
    options = update_config(config_new, copy.deepcopy(default_config))

    return options
694981
def _text_or_file(input_):
    '''
    
    '''
    if _isfile(input_):
        with salt.utils.files.fopen(input_) as fp_:
            out = salt.utils.stringutils.to_str(fp_.read())
    else:
        out = salt.utils.stringutils.to_str(input_)

    return out
659171
function parse(line) {
  assert_str(line)

  return Either.either(pipe, noop, Right(line).chain(is_inlined).chain(is_native).chain(is_not_inlined))
}
148865
def from_file(cls, filename_or_file_object):
        
        object_ = from_file(filename_or_file_object)
        if not isinstance(object_, cls):
            raise ValueError('Expected to read {0!r} object, but got {1!r} instead'.format(cls, type(object_)))

        return object_
1133951
def find_value_in_object(attr, obj):
    

    # Carry on inspecting inside the list or tuple
    if isinstance(obj, (collections.Iterator, list)):
        for item in obj:
            yield from find_value_in_object(attr, item)

    # Final object (dict or entity) inspect inside
    elif isinstance(obj, collections.Mapping):

        # If result is found, inspect inside and return inner results
        if attr in obj:

            # If it is iterable, just return the inner elements (avoid nested
            # lists)
            if isinstance(obj[attr], (collections.Iterator, list)):
                for item in obj[attr]:
                    yield item

            # If not, return just the objects
            else:
                yield obj[attr]

        # Carry on inspecting inside the object
        for item in obj.values():
            if item:
                yield from find_value_in_object(attr, item)
1093962
def parse_file(self, inputstring, addhash=True):
        """"""
        if addhash:
            use_hash = self.genhash(False, inputstring)
        else:
            use_hash = None
        return self.parse(inputstring, self.file_parser, {"nl_at_eof_check": True}, {"header": "file", "use_hash": use_hash})
830147
def extract_objects_from_source(self, text, type_filter=None):
    '''
    '''
    objects = parse_verilog(text)

    if type_filter:
      objects = [o for o in objects if isinstance(o, type_filter)]

    return objects
416872
function parseObject(obj){
  obj = obj.vals;
  for (var key in obj) {
    var nodes = obj[key].nodes[0].nodes;
    if (nodes && nodes.length) {
      obj[key] = [];
      for (var i = 0, len = nodes.length; i < len; ++i) {
        obj[key].push(convert(nodes[i]));
      }
    } else {
      obj[key] = convert(obj[key].first);
    }
  }
  return obj;

  function convert(node){
    switch (node.nodeName) {
      case 'object':
        return parseObject(node);
      case 'boolean':
        return node.isTrue;
      case 'unit':
        return node.type ? node.toString() : +node.val;
      case 'string':
      case 'literal':
        return node.val;
      default:
        return node.toString();
    }
  }
}
565654
private Map<String, Object> parseObjectInternal() throws IOException {
		Map<String, Object> result = new HashMap<>();
		
		Type t;
		while (true) {
			t = lexer.readNextToken();
			if (t == Type.END_OBJECT) {
				break;
			}
			
			if (!result.isEmpty()) {
				//skip comma and read next token
				if (t != Type.COMMA) {
					throw new IOException("Unexpected token: " + t);
				}
				t = lexer.readNextToken();
			}
			
			//first token must be the name
			if (t != Type.STRING) {
				throw new IOException("Unexpected token: " + t);
			}
			String name = lexer.readString();
			
			//skip colon
			t = lexer.readNextToken();
			if (t != Type.COLON) {
				throw new IOException("Unexpected token: " + t);
			}
			
			//next token must be the value
			t = lexer.readNextToken();
			Object value = readValue(t);
			result.put(name, value);
		}
		
		return result;
	}
635276
def parse_object(lexer: Lexer, is_const: bool) -> ObjectValueNode:
    """"""
    start = lexer.token
    item = cast(Callable[[Lexer], Node], partial(parse_object_field, is_const=is_const))
    return ObjectValueNode(
        fields=any_nodes(lexer, TokenKind.BRACE_L, item, TokenKind.BRACE_R),
        loc=loc(lexer, start),
    )
579202
def parse(string, is_file=False, obj=False):
        
        try:
            if obj is False:
                if is_file:
                    return system_json.load(string)
                return system_json.loads(string, encoding='utf8')
            else:
                if is_file:
                    return system_json.load(
                        string,
                        object_hook=lambda d: namedtuple('j', d.keys())
                        (*d.values()), ensure_ascii=False, encoding='utf8')
                return system_json.loads(
                    string,
                    object_hook=lambda d: namedtuple('j', d.keys())
                    (*d.values()), encoding='utf8')
        except (Exception, BaseException) as error:
            try:
                if current_app.config['DEBUG']:
                    raise error
            except RuntimeError as flask_error:
                raise error
            return None