code: def try_friends(self, others):
          ''' Look for random agents around me and try to befriend them'''
          befriended = False
          k = int(10*self['openness'])
          shuffle(others)
          for friend in islice(others, k):  # random.choice >= 3.7
              if friend == self:
                  continue
              if friend.befriend(self):
                  self.befriend(friend, force=True)
                  self.debug('Hooray! new friend: {}'.format(friend.id))
                  befriended = True
              else:
                  self.debug('{} does not want to be friends'.format(friend.id))
          return befriendef try_friends(self, others):
          ''' Look for random agents around me and try to befriend them'''
          befriended = False
          k = int(10*self['openness'])
          shuffle(others)
          for friend in islice(others, k):  # random.choice >= 3.7
              if friend == self:
                  continue
              if friend.befriend(self):
                  self.befriend(friend, force=True)
                  self.debug('Hooray! new friend: {}'.format(friend.id))
                  befriended = True
              else:
                  self.debug('{} does not want to be friends'.format(friend.id))
          return befriended
docs: Look for random agents around me and try to befriend them