uses the given regex to filter out any properties whose key doesn't match will return an empty object if the props input is not a map
179327
function(props, regex) {
            if(!(regex instanceof RegExp)) {
                return props;
            }
            var key,
                filtered = {};

            for(key in props) {
                if(props.hasOwnProperty(key) && regex.test(key)) {
                    filtered[key] = props[key];
                }
            }
            return filtered;
        }
329847
public static void removeEmptyProperties(Map<String, CmsClientProperty> props) {

        Iterator<Map.Entry<String, CmsClientProperty>> iter = props.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry<String, CmsClientProperty> entry = iter.next();
            CmsClientProperty value = entry.getValue();
            if (value.isEmpty()) {
                iter.remove();
            }
        }
    }
45950
protected Map<String, String> extract(String propertyPrefix, Map<String, String> properties, boolean removeProps) {

        if (null == properties || properties.isEmpty()) {
            return Collections.<String, String> emptyMap();
        }

        Map<String, String> extractProps = new HashMap<String, String>();

        Iterator<Map.Entry<String, String>> propIter = properties.entrySet().iterator();
        while (propIter.hasNext()) {
            Map.Entry<String, String> propEntry = propIter.next();
            if (null != propEntry.getKey() && propEntry.getKey().startsWith(propertyPrefix)) {
                String propKey = propEntry.getKey().substring(propertyPrefix.length());
                extractProps.put(propKey, propEntry.getValue());
                if (removeProps) {
                    propIter.remove();
                }
            }
        }
        return extractProps;
    }
159305
function cleanUndefinedProperties(obj) {
  var newObj;
  var isArray = false;
  if (typeof obj === 'object' && obj !== null) {
    if (Array.isArray(obj)) {
      newObj = [];
      isArray = true;
    } else {
      newObj = {};
    }
  } else {
    return obj;
  }
  var keys = Object.keys(obj);
  keys.forEach(function (key, i) {
    if (isArray || typeof obj[key] !== 'undefined') {
      newObj[key] = cleanUndefinedProperties(obj[key]);
    }
  });
  return newObj;
}
978240
def get_matching_property_names(self, regex):
        
        log = logging.getLogger(self.cls_logger + '.get_matching_property_names')
        prop_list_matched = []
        if not isinstance(regex, basestring):
            log.warn('regex arg is not a string, found type: {t}'.format(t=regex.__class__.__name__))
            return prop_list_matched
        log.debug('Finding properties matching regex: {r}'.format(r=regex))
        for prop_name in self.properties.keys():
            match = re.search(regex, prop_name)
            if match:
                prop_list_matched.append(prop_name)
        return prop_list_matched
720317
private Map<String, Object> extractOptions(Map<String, Object> props) {
        List<Map<String, Object>> optionsList = Nester.nest("options", props);
        if (!optionsList.isEmpty()) {
            Map<String, Object> options = new HashMap<String, Object>(optionsList.get(0).size());
            for (Map.Entry<String, Object> option : optionsList.get(0).entrySet()) {
                String key = option.getKey();
                if (key.startsWith(".")
                    || key.startsWith("config.")
                    || key.startsWith("service.")
                    || key.equals("id")) {
                    continue;
                }
                options.put(key, option.getValue());

            }
            return options;
        }
        return new HashMap<String, Object>(2);

    }
411250
private static boolean propMatchesPrefix(String prefix, String key) {
        return key.startsWith(prefix) && key.length() >= prefix.length();
    }
55502
function _splitProps (props) {
  var test = {}

  if (util.isString(props)) {
    props = props
      .split(',')
      .map(_segment(','))
      .filter(function (k) {
        return k
      })
  }
  if (util.isArray(props)) {
    props.forEach(function (key) {
      test[key] = 1
    })
    return test
  }
  return {}
}
402862
function _coerceNumericProps(props) {
	var propName, propType, propValue;
	// Loop through all properties in given property map
	for (propName in props) {
		if (Object.prototype.hasOwnProperty.call(props, propName)) {
			propValue = props[propName];
			propType = typeOf(propValue);
			// If property is non-empty string and value is numeric
			if (propType === 'string' && isNumeric(propValue) && propName !== 'text') {
				// Convert value to number
				props[propName] = parseFloat(propValue);
			}
		}
	}
	// Ensure value of text property is always a string
	if (props.text !== undefined) {
		props.text = String(props.text);
	}
}
181807
function emptyp(obj) { var key
        for (key in obj)
            if (hasp(obj, key)) return false

        return true
    }
251562
function() {
    if (this.props.search instanceof RegExp) {
      return this.props.search;
    }

    var flags = '';
    if (!this.props.caseSensitive) {
      flags +='i';
    }

    var search = this.props.search;
    if (typeof this.props.search === 'string') {
      search = escapeStringRegexp(search);
    }

    if (this.props.ignoreDiacritics) {
      search = removeDiacritics(search, this.props.diacriticsBlacklist);
    }

    return new RegExp(search, flags);
  }
615541
function matchIndex(prop) {
    if (!prop || !/\[\d+\]/.test(prop))
        return false;
    var prefix = prop.match(/[^\[]+/i);
    var idx;
    var indices = prop.match(/\d+/g);
    if (!indices)
        return false;
    return {
        name: prefix[0],
        index: indices[0],
        indices: indices.slice(1)
    };
}
395516
function exclude(obj, keys) {
        var result, key;
        result = {};
        keys = keys || [];
        for (key in obj) {
            if (obj.hasOwnProperty(key)) {
                if (keys.indexOf(key) === -1) {
                    if (typeof obj[key] !== 'function') {
                        result[key] = obj[key];
                    }
                }
            }
        }
        return result;
    }
300614
function replacer(key, value) {
        if (!value) {
            return value;
        }

        const type = typeof value;

        if (type === 'object') {
            if (isRegExp(value)) {
                return '@__R-' + UID + '-' + (regexps.push(value) - 1) + '__@';
            }

            return value;
        }

        if (type === 'function') {
            return '@__F-' + UID + '-' + (functions.push(value) - 1) + '__@';
        }

        return value;
    }
1248982
def matches(self, filter_props):
        """"""
        if filter_props is None:
            return False

        found_one = False
        for key, value in filter_props.items():
            if key in self.properties and value != self.properties[key]:
                return False
            elif key in self.properties and value == self.properties[key]:
                found_one = True

        return found_one
543913
private void parseAutoDecompression(Map<Object, Object> props) {
        // PK41619 - allow this to be turned off
        Object value = props.get(HttpConfigConstants.PROPNAME_AUTODECOMPRESSION);
        if (null != value) {
            this.bAutoDecompression = convertBoolean(value);
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Config: autodecompression is " + isAutoDecompressionEnabled());
            }
        }
    }
350189
def filterMapNames(regexText,  records=getIndex(), excludeRegex=False, closestMatch=True):
    """"""
    bestScr = 99999 # a big enough number to not be a valid file system path
    regex = re.compile(regexText, flags=re.IGNORECASE)
    ret = []
    if excludeRegex: # match only records that do NOT contain regex
        if regexText and closestMatch: # then maps with fewer characters are better matches
            for m in list(records):
                if re.search(regex, m.name): continue # map must NOT contain specified phrase
                score = len(m.name) # the map with the smallest map name means it has the largets matching character percentage
                if score == bestScr:
                    bestScr = score
                    ret.append(m)
                elif score <  bestScr: # new set of best maps
                    bestScr = score
                    ret = [m]
        else: # all maps that match regex are included
            for m in list(records):
                if re.search(regex, m.name): continue # map must NOT contain specified phrase
                ret.append(m) # any mapname containing regex matches
    else: # only match records that contain regex
        if regexText and closestMatch: # then maps with fewer characters are better matches
            for m in records:
                if not re.search(regex, m.name): continue # map must contain specified phrase if excludeRegex==True
                score = len(m.name) # the map with the smallest map name means it has the largets matching character percentage
                if score == bestScr:
                    bestScr = score
                    ret.append(m)
                elif score <  bestScr: # new group of best maps
                    bestScr = score
                    ret = [m]
        else: # all maps that match regex are included
            for m in records:
                if not re.search(regex, m.name): continue # map must contain specified phrase if excludeRegex==True
                ret.append(m) # any mapname containing regex matches
    return ret