----------- turn the contacts into a comma separated list of names
430046
function listNames(theContacts) {
  var s = '';
  for (var contact in theContacts) {
    if (s != '') { s = s + ", " };
    s = s + contact;
  }
  return s;
}
327172
public Contact[] getSelectedContacts() {
		int[] selected = getTable().getSelectedRows();
		Contact[] contacts = new Contact[selected.length];
		for (int i = 0; i < selected.length; i++) {
			contacts[i] = (Contact) getTableModel().getElementAt(selected[i]);
		}
		return contacts;
	}
291603
def get_user_contact_list(self, id, contact_list_id, **data):
        
        
        return self.get("/users/{0}/contact_lists/{0}/".format(id,contact_list_id), data=data)
945127
def to_array(self):
        
        array = super(Contact, self).to_array()
        array['phone_number'] = u(self.phone_number)  # py2: type unicode, py3: type str

        array['first_name'] = u(self.first_name)  # py2: type unicode, py3: type str

        if self.last_name is not None:
            array['last_name'] = u(self.last_name)  # py2: type unicode, py3: type str

        if self.user_id is not None:
            array['user_id'] = int(self.user_id)  # type int
        if self.vcard is not None:
            array['vcard'] = u(self.vcard)  # py2: type unicode, py3: type str

        return array
595357
private static List<String> convert(List<Recipient> recipients) throws PhoneNumberException {
		List<String> tos = new ArrayList<>(recipients.size());
		// convert phone numbers to international format
		for (Recipient recipient : recipients) {
			tos.add(toInternational(recipient.getPhoneNumber()));
		}
		return tos;
	}
333425
def names(self):
        """"""
        ret = set()
        for arr in self:
            if isinstance(arr, InteractiveList):
                ret.update(arr.names)
            else:
                ret.add(arr.name)
        return ret
218763
def create_contact(self, email=None, first_name=None, last_name=None, phone_number=None):
        
        result = {}
        if email:
            result['email'] = email
        if first_name is not None:
            result['first_name'] = first_name
        if last_name is not None:
            result['last_name'] = last_name
        if phone_number is not None:
            result['phone_number'] = phone_number
        return result if len(result) > 0 else None
354056
def post_user_contact_lists_contacts(self, id, contact_list_id, **data):
        
        
        return self.post("/users/{0}/contact_lists/{0}/contacts/".format(id,contact_list_id), data=data)
124702
@Override
    public void appendNames(StringBuilder sb, String sep)
    {
        // Let's first get the alphabetized list of all names from main hash
        TreeSet<PrefixedName> ts = new TreeSet<PrefixedName>();
        for (int i = 0; i < mNames.length; ++i) {
            PrefixedName name = mNames[i];
            if (name != null) {
                ts.add(name);
            }
        }

        // then spill area
        if (mBuckets != null) {
            for (int i = 0; i < (mNames.length >> 2); ++i) {
                Bucket b = mBuckets[i];
                while (b != null) {
                    ts.add(b.getName());
                    b = b.getNext();
                }
            }
        }

        // And then append them:
        Iterator<PrefixedName> it = ts.iterator();
        boolean first = true;
        while (it.hasNext()) {
            if (first) {
                first = false;
            } else {
                sb.append(sep);
            }
            sb.append(it.next().toString());
        }
    }
135942
def _import_string(names):
    """"""
    _names = []
    for name, asname in names:
        if asname is not None:
            _names.append("%s as %s" % (name, asname))
        else:
            _names.append(name)
    return ", ".join(_names)
598316
function createContact() {
    $cnt = count( $this->contact );
    if( 0 >= $cnt )
      return;
    $output = null;
    foreach( $this->contact as $contact ) {
      $attributes = $this->_createParams( $contact['params'], array( 'ALTREP', 'LANGUAGE' ));
      $content    = $this->_strrep( $contact['value'] );
      $output    .= $this->_createElement( 'CONTACT', $attributes, $content );
    }
    return $output;
  }
513879
function makeContacts(char) {
    function addContacts(watched, ids, standing, labelID) {
        return char.agent.request('post_characters_character_id_contacts', {
            path: { character_id: char.id },
            query: { watched: watched, standing: standing, label_id: labelID },
            body: ids
        }, char.ssoToken);
    }
    const allContacts = page_loader_1.makePageBasedLoader(page => char.agent.request('get_characters_character_id_contacts', { path: { character_id: char.id }, query: { page: page } }, char.ssoToken));
    let contacts = function (id) {
        if (id === undefined) {
            return allContacts.getAll();
        }
        else {
            return new ContactImpl(char, id);
        }
    };
    contacts.labels = function () {
        return char.agent.request('get_characters_character_id_contacts_labels', { path: { character_id: char.id } }, char.ssoToken);
    };
    contacts.add = function (ids, standing, labelID) {
        return addContacts(false, ids, standing, labelID);
    };
    contacts.addWatched = function (ids, standing, labelID) {
        return addContacts(true, ids, standing, labelID);
    };
    return contacts;
}
254359
private static CSLName[] toAuthors(List<Map<String, Object>> authors) {
		CSLName[] result = new CSLName[authors.size()];
		int i = 0;
		for (Map<String, Object> a : authors) {
			CSLNameBuilder builder = new CSLNameBuilder();
			if (a.containsKey(FIELD_FIRSTNAME)) {
				builder.given(strOrNull(a.get(FIELD_FIRSTNAME)));
			}
			if (a.containsKey(FIELD_LASTNAME)) {
				builder.family(strOrNull(a.get(FIELD_LASTNAME)));
			}
			builder.parseNames(true);
			result[i] = builder.build();
			++i;
		}
		return result;
	}
826986
def get_user_contact_lists_contacts(self, id, contact_list_id, **data):
        
        
        return self.get("/users/{0}/contact_lists/{0}/contacts/".format(id,contact_list_id), data=data)
371339
def filter_contacts(pairings):
    """"""
    if not config.INTRA:
        return pairings
    filtered1_pairings = [p for p in pairings if (p.resnr, p.reschain) != (p.resnr_l, p.reschain_l)]
    already_considered = []
    filtered2_pairings = []
    for contact in filtered1_pairings:
        try:
            dist = 'D{}'.format(round(contact.distance, 2))
        except AttributeError:
            try:
                dist = 'D{}'.format(round(contact.distance_ah, 2))
            except AttributeError:
                dist = 'D{}'.format(round(contact.distance_aw, 2))
        res1, res2 = ''.join([str(contact.resnr), contact.reschain]), ''.join(
            [str(contact.resnr_l), contact.reschain_l])
        data = {res1, res2, dist}
        if data not in already_considered:
            filtered2_pairings.append(contact)
            already_considered.append(data)
    return filtered2_pairings
265569
def update_contacts!
      assert!
      callback = Callback.new
      @contacts = []
      @connection.communicate('contact_list') do |success, data|
        if success and data.class == Array
          callback.trigger(:success)
          data.each { |contact|
            contact = TelegramContact.pick_or_new(self, contact)
            @contacts << contact unless self.contacts.include?(contact)
          }
        else
          raise "Couldn't fetch the contact list."
        end
      end
      callback
    end
333640
private <T> void appendNameList(StringBuffer sb,
                                    java.util.Set<T> resolutions,
                                    String sep) {
        for (T oneRes : resolutions) {
            sb.append(sep).append(oneRes.toString());
            sep = ", ";
        }
    }