def create_contact(contact, party_type, party):
 contact = contact.strip().split(u' ')
 contact = frappe.get_doc({u'doctype': u'Contact', u'first_name': contact[0], u'last_name': (((len(contact) > 1) and contact[1]) or u'')})
 contact.append(u'links', dict(link_doctype=party_type, link_name=party))
 contact.insert()

def create_contact ( contact , party_type , party ) : contact = contact . strip ( ) . split ( u' ' ) contact = frappe . get_doc ( { u'doctype' : u'Contact' , u'first_name' : contact [ 0 ] , u'last_name' : ( ( ( len ( contact ) > 1 ) and contact [ 1 ] ) or u'' ) } ) contact . append ( u'links' , dict ( link_doctype = party_type , link_name = party ) ) contact . insert ( )
create contact based on given contact name .