parameters: (json_orig, family, replacement="")
return_statement: return filtered
docstring: Apply a filter to the json, and only leave the 'family' of benchmarks.
docstring_summary: Apply a filter to the json, and only leave the 'family' of benchmarks.
docstring_tokens: Apply a filter to the json and only leave the family of benchmarks .
function: def filter_benchmark(json_orig, family, replacement=""):
      """
      Apply a filter to the json, and only leave the 'family' of benchmarks.
      """
      regex = re.compile(family)
      filtered = {}
      filtered['benchmarks'] = []
      for be in json_orig['benchmarks']:
          if not regex.search(be['name']):
              continue
          filteredbench = copy.deepcopy(be) # Do NOT modify the old name!
          filteredbench['name'] = regex.sub(replacement, filteredbench['name'])
          filtered['benchmarks'].append(filteredbench)
      return filtered
function_tokens: def filter_benchmark ( json_orig , family , replacement = "" ) : regex = re . compile ( family ) filtered = { } filtered [ 'benchmarks' ] = [ ] for be in json_orig [ 'benchmarks' ] : if not regex . search ( be [ 'name' ] ) : continue filteredbench = copy . deepcopy ( be ) # Do NOT modify the old name! filteredbench [ 'name' ] = regex . sub ( replacement , filteredbench [ 'name' ] ) filtered [ 'benchmarks' ] . append ( filteredbench ) return filtered