Get a contact method for this user.
965421
def get_contact_method(self, id, **kwargs):
        """"""
        endpoint = '{0}/{1}/contact_methods/{2}'.format(
            self.endpoint,
            self['id'],
            id,
        )
        result = self.request('GET', endpoint=endpoint, query_params=kwargs)
        return result['contact_method']
207644
def update_contact(self, um_from_user, um_to_user, message):
        
        contact, created = self.get_or_create(um_from_user,
                                              um_to_user,
                                              message)

        # If the contact already existed, update the message
        if not created:
            contact.latest_message = message
            contact.save()
        return contact
1237569
public function getContact($id)
    {
        //get contact from db
        foreach ($this->contacts as $contact) {
            if ($contact->id == $id) {
                return $contact;
            }
        }
        //might wanna throw an exception when it does not exists
        throw new Exception("Contact '$id' not found");
    }
99529
public String getContact() {
    if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_contact == null)
      jcasType.jcas.throwFeatMissing("contact", "de.julielab.jules.types.AuthorInfo");
    return jcasType.ll_cas.ll_getStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_contact);}
1046666
def delete_contact_method(self, id, **kwargs):
        """"""
        endpoint = '{0}/{1}/contact_methods/{2}'.format(
            self.endpoint,
            self['id'],
            id,
        )
        return self.request('DELETE', endpoint=endpoint, query_params=kwargs)
326713
def get_contacts_for(self, user):
        
        contacts = self.filter(Q(um_from_user=user) | Q(um_to_user=user))
        return contacts
410558
def contact_of
      @contact_of ||= Person.distinct
                            .joins(activity_object: { circles: :ties })
                            .merge(Tie.with_contact_id(contact_id: guid))
    end
197284
def get_contacts(self):
        
        all_contacts = self.wapi_functions.getAllContacts()
        return [Contact(contact, self) for contact in all_contacts]
53048
public function getContact()
    {
        if (empty($this->contact)) {
            throw new LogicException(
                sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'contact')
            );
        }
        return $this->contact;
    }
695872
public function getContact($contactId): Contact
    {
        @trigger_error(sprintf('The %s() method is deprecated since version 0.8. Use get() instead.', __METHOD__), E_USER_DEPRECATED);

        return $this->get($contactId);
    }
1268983
function(messageContent) {
                /**
                 * + ContactVO                        {object}
                 *    - id                            {long}
                 *    - blocked                       {boolean}
                 *    - userId                        {long}
                 *    - firstName                     {string}
                 *    - lastName                      {string}
                 *    - image                         {string}
                 *    - email                         {string}
                 *    - cellphoneNumber               {string}
                 *    - uniqueId                      {string}
                 *    - notSeenDuration               {long}
                 *    - hasUser                       {boolean}
                 *    - linkedUser                    {object : RelatedUserVO}
                 */

                var contact = {
                    id: messageContent.id,
                    blocked: (messageContent.blocked !== undefined)
                        ? messageContent.blocked
                        : false,
                    userId: messageContent.userId,
                    firstName: messageContent.firstName,
                    lastName: messageContent.lastName,
                    image: messageContent.profileImage,
                    email: messageContent.email,
                    cellphoneNumber: messageContent.cellphoneNumber,
                    uniqueId: messageContent.uniqueId,
                    notSeenDuration: messageContent.notSeenDuration,
                    hasUser: messageContent.hasUser,
                    linkedUser: undefined
                };

                if (messageContent.linkedUser !== undefined) {
                    contact.linkedUser = formatDataToMakeLinkedUser(messageContent.linkedUser);
                }

                return contact;
            }
491541
def get_contact(self, jid):
        
        try:
            return self.get_contacts()[jid.bare()]
        except KeyError:
            raise ContactNotFound
        except AttributeError:
            raise AttributeError("jid must be an aioxmpp.JID object")
22191
public function actionContact()
    {
        $model = new ContactForm();
        if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
            Yii::$app->session->setFlash('contactFormSubmitted');

            return $this->refresh();
        }

        return $this->render('contact', compact('model'));
    }
654618
def build_contact(request, slug=""):
    
    controller = get_object_or_404(ContactFormController, slug=slug)
    site = Site.objects.get_current()
    UserModel = get_user_model()
    user = request.user
    form = ContactForm(request.POST or None, request.FILES or None, controller=controller)

    # if we know, fill in the user name and email
    if user.is_authenticated:
        # first, resolve username for tango and non-tango sites
        try:
            name = user.display_name
        except AttributeError:
            name = user.username
        form.fields['sender_name'].widget.attrs['readonly'] = 'true'
        form.fields['sender_name'].initial = name
        form.fields['sender_email'].widget.attrs['readonly'] = 'true'
        form.fields['sender_email'].initial = user.email

    if form.is_valid():
        if controller.store_in_db:
            # To do: sanitize submission.
            new_msg = Contact(**form.cleaned_data)
            new_msg.controller = controller
            new_msg.site = site
            if controller.override_subject:  # we're overriding the subject
                new_msg.subject = controller.override_subject
            new_msg.save()

        if controller.send_emails:
            form_data = form.cleaned_data
            if controller.override_subject:
                subject = controller.override_subject
            elif 'subject' in form_data:
                subject = form_data['subject']
            else:
                subject = "{} message from {}".format(controller.name, form_data['sender_name'])

            body = "{} \n\n {}".format(form_data['body'], form_data['sender_name'])
            if controller.request_contact_info:
                body += "\nAddress: {} \nCity: {} \nState: {} \nPhone: {}".format(
                    form_data['contact_address'],
                    form_data['contact_city'],
                    form_data['contact_state'],
                    form_data['contact_phone']
                )

            if controller.email_options == '2':  # Create selectable list from recipients
                try:
                    to = [UserModel.objects.get(username=form.cleaned_data['to']).email]
                except Exception:
                    to = [form.cleaned_data['to']]

            if controller.email_options == '1':
                to = [r.email for r in controller.recipients.all()]
                for r in controller.other_recipients.all():
                    to.append(r.email)

            if 'send_a_copy' in form.cleaned_data:
                to.append(form.cleaned_data['sender_email'])

            mail = EmailMessage(
                subject=subject,
                body=body,
                from_email=form.cleaned_data['sender_email'],
                to=to
            )
            if 'photo' in request.FILES:
                photo = request.FILES['photo']
                mail.attach(photo.name, photo.read(), photo.content_type)
            mail.send()
        return render(request, 'success_url', {'controller': controller})

    return render(request, 'contact/form.html', {
        'form': form,
        'site': site,
        'controller': controller
    })
1269533
def _get_user(self) -> Dict:
        

        if 'callback_query' in self._update:
            return self._update['callback_query']['from']
        elif 'inline_query' in self._update:
            return self._update['inline_query']['from']
        elif 'message' in self._update:
            return self._update['message']['from']
10593
public ContactType getContactType(Person recPerson)
    {
        if (m_recContactType == null)
        {
            m_recContactType = (ContactType)Record.makeRecordFromClassName(ContactTypeModel.CONTACT_TYPE_FILE, this.getOwner().getRecord().findRecordOwner());
            if (((Record)m_recContactType).getRecordOwner() != null)
                ((Record)m_recContactType).getRecordOwner().removeRecord((Record)m_recContactType);
        }
        return m_recContactType.getContactType(recPerson);
    }
123686
def get_contacts(self, limit=100, offset=0, params={}):
        
        url = self.CONTACTS_URL + "?limit=%s&offset=%s" % (limit, offset)

        for key, value in params.items():
            if key is 'ids':
                value = ",".join(value)

            url += '&%s=%s' % (key, value)

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.get_request()