def none_if_empty(fn):

  def wrapper(value):


    if value == '' or value is None or value == []:
      return None
    return fn(value)

  return wrapper
A decorator which returns None if its input is empty else fn(x).
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/bulkload/transform.py/none_if_empty