def METHOD_NAME(testcase):
  """Adds relevant function from testcase crash state to global blacklist."""
  testcase_id = testcase.key.id()
  if not should_be_blacklisted(testcase):
    logs.log('Testcase %s is not a reproducible leak, skipping leak blacklist.'
             % testcase_id)
    return False
  function_name = get_leak_function_for_blacklist(testcase)
  if not function_name:
    logs.log_error(
        'Testcase %s has invalid crash state, skipping leak blacklist.' %
        testcase_id)
    return False
  existing_query = data_types.Blacklist.query(
      data_types.Blacklist.function_name == function_name)
  existing_query = existing_query.filter(
      data_types.Blacklist.testcase_id == testcase_id)
  existing_query = existing_query.filter(
      data_types.Blacklist.tool_name == LSAN_TOOL_NAME)
  if existing_query.get():
    logs.log_error('Item already in leak blacklist.')
    return False
  blacklist_item = data_types.Blacklist(
      function_name=function_name,
      testcase_id=testcase_id,
      tool_name=LSAN_TOOL_NAME)
  blacklist_item.put()
  logs.log('Added %s to leak blacklist.' % function_name)
  return blacklist_item