parse name app and key item language

@param string
@param object
426458
static function engineName($name){
		$segments = explode('.',$name);
		$app = 'App';
		if(count($segments) == 2){
			$app = current($segments);
		}
		return (object)[
			'app' => $app,
			'key' => end($segments)
		];
	}
1240668
public function getObjectValue($object, $name)
    {
        if (is_object($object) && isset($object->$name) && !method_exists($object, $name)) {
            return $object->$name;
        }

        // If its a nested value like meta[user[phone]]
        if (strpos($name, '[') > 0) {
            $nested = explode('[', str_replace(']', '', $name));
            $final = $object;
            foreach ($nested as $property) {
                if (!empty($property) && isset($final->{$property})) {
                    $final = $final->{$property};
                } elseif (is_object($final) && is_null($final->{$property})) {
                    $final = '';
                }
            }

            return $final;
        }

        return '';
    }
556874
function parsePrimitives(info, name, value) {
  var index
  var length
  var result

  if (typeof value !== 'object' || !('length' in value)) {
    return parsePrimitive(info, name, value)
  }

  length = value.length
  index = -1
  result = []

  while (++index < length) {
    result[index] = parsePrimitive(info, name, value[index])
  }

  return result
}
920360
function getObjectWithKeyAsCjs(key, object) {
	const jsContents = Object.keys(object).reduce((jsLines, name) => {
		jsLines.push(`\t\t'${escapeForJS(name)}': '${escapeForJS(object[name])}'`);

		return jsLines;
	}, []).join(',\n');
	const cjs = `\n\t${key}: {\n${jsContents}\n\t}`;

	return cjs;
}
71797
function parseOrigin(str) {
	const match = str.match(/^([^!]+?)!([^@]+?)@(.+?)$/);
	if (match) {
		return new ClientOrigin(match[1], match[2], match[3]);
	} else {
		return new ServerOrigin(str);
	}
}
567023
public static function findPropertyNameStatic($name, $object)
    {
        $property = null;
        if (property_exists($object, $name)) {
            $property = $name;
        } else {
            // _name
            $underscore_name = '_'.$name;
            if (property_exists($object, $underscore_name)) {
                $property = $underscore_name;
            } else {
                // __name
                $doubleunderscore_name = '__'.$name;
                if (property_exists($object, $doubleunderscore_name)) {
                    $property = $doubleunderscore_name;
                }
            }
        }
        return $property;
    }
816948
function styleParse (str, obj) {
  var chunks;
  var i;
  var item;
  var pos;
  var key;
  var val;

  obj = obj || {};

  chunks = getKeyValueChunks(str);
  for (i = 0; i < chunks.length; i++) {
    item = chunks[i];
    if (!item) { continue; }
    // Split with `.indexOf` rather than `.split` because the value may also contain colons.
    pos = item.indexOf(':');
    key = item.substr(0, pos).trim();
    val = item.substr(pos + 1).trim();
    obj[key] = val;
  }
  return obj;
}
651642
function parseKey (inp) {
    var res = parseString(inp);
    if (res) return res;
  
    var match = inp.takeAPeek(JS_IDENT);
    if (match) return match[0]
  }
273405
function parse() {
        $name_without_parens = preg_replace('/[{}]/', '', $this->full_name);

        $parts = explode('::', $name_without_parens);
        $name_without_case_keys = trim($parts[0]);
        array_shift($parts);
        $this->case_keys = array_map('trim', $parts);

        $parts = explode(':', $name_without_case_keys);
        $this->short_name = trim($parts[0]);
        array_shift($parts);
        $this->context_keys = array_map('trim', $parts);
    }
338916
protected function parse($object)
    {
        if (! is_object($object)) {
            throw new ValidationException('Meta has to be an object, "' . gettype($object) . '" given.');
        }

        $object_vars = get_object_vars($object);

        if (count($object_vars) === 0) {
            return;
        }

        foreach ($object_vars as $name => $value) {
            $this->set($name, $value);
        }
    }
971891
protected function parse($object)
    {
        if (! is_object($object)) {
            throw new ValidationException(
                'DocumentLink has to be an object, "' . gettype($object) . '" given.'
            );
        }

        $links = get_object_vars($object);

        if (array_key_exists('self', $links)) {
            if (! is_string($links['self']) and ! is_object($links['self'])) {
                throw new ValidationException(
                    'property "self" has to be a string or object, "' .
                    gettype($links['self']) . '" given.'
                );
            }

            $this->setLink('self', $links['self']);

            unset($links['self']);
        }

        if (array_key_exists('related', $links)) {
            if (! is_string($links['related']) and ! is_object($links['related'])) {
                throw new ValidationException(
                    'property "related" has to be a string or object, "' .
                    gettype($links['related']) . '" given.'
                );
            }

            $this->setLink('related', $links['related']);

            unset($links['related']);
        }

        // Pagination links, if data in parent attributes exists
        if ($this->getParent()->has('data')) {
            if (array_key_exists('first', $links)) {
                $this->setPaginationLink('first', $links['first']);

                unset($links['first']);
            }

            if (array_key_exists('last', $links)) {
                $this->setPaginationLink('last', $links['last']);

                unset($links['last']);
            }

            if (array_key_exists('prev', $links)) {
                $this->setPaginationLink('prev', $links['prev']);

                unset($links['prev']);
            }

            if (array_key_exists('next', $links)) {
                $this->setPaginationLink('next', $links['next']);

                unset($links['next']);
            }
        }

        // custom links
        foreach ($links as $name => $value) {
            $this->setLink($name, $value);
        }
    }
1179653
@Override
    public String getDisplayName(Locale language) {

        String key;

        switch (this.getSymbol()) {
            case 'G':
                key = "L_era";
                break;
            case 'u':
            case 'y':
            case 'Y':
                key = "L_year";
                break;
            case 'Q':
                key = "L_quarter";
                break;
            case 'M':
                key = "L_month";
                break;
            case 'w':
            case 'W':
                key = "L_week";
                break;
            case 'd':
                key = "L_day";
                break;
            case 'E':
            case 'e':
                key = "L_weekday";
                break;
            case 'H':
            case 'h':
            case 'K':
            case 'k':
                key = "L_hour";
                break;
            case 'm':
                key = "L_minute";
                break;
            case 's':
                key = "L_second";
                break;
            default:
                String n = this.name();
                key = OTHER_DISPLAY_KEYS.get(n);
                if (key == null) {
                    return n;
                }
        }

        String lname = CalendarText.getIsoInstance(language).getTextForms().get(key);
        return ((lname == null) ? this.name() : lname);

    }
579514
function findname(error, response, body) {
		if (error){
                        return error
                }
              	if (body){
			try{
				var info = JSON.parse(body)
			}
			catch(err){
				console.log(body)
				return
			}			
			if (info.items){
		        	var ilen=info.items.length
		        	while(ilen--){
		                	var it=info.items[ilen]
		                	var thename=it['properties']['name']
		                	if (thename.match(srchfor)){
		         			console.log(it) // <---- print json for server(s) that match srchfor
		                	}
                                }
                        }
                }
}
874100
function parseQueryString(query) {
  if (!query) {
    return {};
  }
  return (/^[?#]/.test(query) ? query.slice(1) : query)
      .split('&')
      .reduce((params, param) => {
        const item = param.split('=');
        const key = decodeURIComponent(item[0] || '');
        const value = decodeURIComponent(item[1] || '');
        if (key) {
          params[key] = value;
        }
        return params;
      }, {});
}
467020
function _parseSmartColonLine(line, obj) {
        //some of the value contains colon, so this is why I don't split the string using colon.
        //Lie this:
        //    Local Time is:    Fri Jun 12 23:55:27 2015 CST
        var pos = line.indexOf(':');
        var key, val;
        if (pos < 0) {//If no colon, then put this into key 'Others'
            key = 'Others';
            val = line;
        }
        else {
            key = line.substring(0, pos);
            val = line.substring(pos + 1).trim();
        }

        //Some of identity occurs multi times
        //Example data:
        //SMART support is: Available - device has SMART capability.
        //SMART support is: Enabled
        if (obj.hasOwnProperty(key)) {
            if (_.isArray(obj[key])) {
                obj[key] = obj[key].push(val);
            }
            else {
                obj[key] = [obj[key], val];
            }
        }
        else {
            obj[key] = val;
        }
        return obj;
    }
191042
public function getPropertyNameToMap(SwatUIObject $object, $name)
    {
        if ($this === $object) {
            return $name;
        }

        $mangled_name = $name;
        $suffix = 0;

        if (property_exists($this, $name)) {
            $mangled_name = $name . $suffix;
            $suffix++;
        }

        while (array_key_exists($mangled_name, $this->mappings)) {
            $mangled_name = $name . $suffix;
            $suffix++;
        }

        $this->mappings[$mangled_name] = array(
            'object' => $object,
            'property' => $name
        );

        return $mangled_name;
    }
259313
protected function parse($object)
    {
        if (! is_object($object)) {
            throw new ValidationException(
                'Error has to be an object, "' . gettype($object) . '" given.'
            );
        }

        if (property_exists($object, 'id')) {
            if (! is_string($object->id)) {
                throw new ValidationException(
                    'property "id" has to be a string, "' .
                    gettype($object->id) . '" given.'
                );
            }

            $this->set('id', strval($object->id));
        }

        if (property_exists($object, 'links')) {
            $this->set('links', $this->create('ErrorLink', $object->links));
        }

        if (property_exists($object, 'status')) {
            if (! is_string($object->status)) {
                throw new ValidationException(
                    'property "status" has to be a string, "' .
                    gettype($object->status) . '" given.'
                );
            }

            $this->set('status', strval($object->status));
        }

        if (property_exists($object, 'code')) {
            if (! is_string($object->code)) {
                throw new ValidationException(
                    'property "code" has to be a string, "' .
                    gettype($object->code) . '" given.'
                );
            }

            $this->set('code', strval($object->code));
        }

        if (property_exists($object, 'title')) {
            if (! is_string($object->title)) {
                throw new ValidationException(
                    'property "title" has to be a string, "' .
                    gettype($object->title) . '" given.'
                );
            }

            $this->set('title', strval($object->title));
        }

        if (property_exists($object, 'detail')) {
            if (! is_string($object->detail)) {
                throw new ValidationException(
                    'property "detail" has to be a string, "' .
                    gettype($object->detail) . '" given.'
                );
            }

            $this->set('detail', strval($object->detail));
        }

        if (property_exists($object, 'source')) {
            $this->set('source', $this->create('ErrorSource', $object->source));
        }

        if (property_exists($object, 'meta')) {
            $this->set('meta', $this->create('Meta', $object->meta));
        }
    }