How a collection of Sanskrit stories influenced One Thousand and One Nights and reflected the everyday concerns of Islamic society