def create_user(data):
    user = create("User", email=data['email'])
    salt = create("Salt", salt=str(uuid.uuid4()), algo="md5")
    data['passwd'] = hash_pwd(data['password'], salt['algo'], salt['salt'])

    del data['password']
    upsert(user, uid=uuid.uuid4().hex, **data)

    r = WithSalt(user, salt)

    push(r)

    return user
def create_document(data):
    node = create("Document", uid=uuid.uuid4().hex, **data)
    return node
def create_provider(data):
    node = create("Provider", uid=uuid.uuid4().hex, kind="provider", **data)
    return node
def create_client(data):
    node = create("Client", uid=uuid.uuid4().hex, kind="client", **data)
    return node