def dict_to_scalamap(jvm, d):
    """
    Convert python dictionary to scala type map

    :param jvm: sc._jvm
    :param d: python type dictionary
    """
    if d is None:
        return None
    sm = jvm.scala.Predef.Map().empty()
    for k, v in d.items():
        sm = sm.updated(k, v)
    return sm