def mapper(oid, opts, jobid=False): logger.debug("mapper()") src = api.source(oid) if api.documentation(src)["set"]: return None if api.exists(name, oid, opts): return oid out_histo = build_ngrams(api.retrieve(src, oid, opts)["data"], opts["n"]) api.store(name, oid, out_histo, opts) return oid
def mapper(oid, opts, jobid=False): logger.debug("mapper()") src = api.source(oid) if api.documentation(src)["set"]: return None if api.exists(name, oid, opts): return oid opcodes = api.get_field("opcodes", oid, "opcodes") if not opcodes: return None out_histo = build_ngrams(opcodes, opts["n"]) api.store(name, oid, out_histo, opts) return oid