set delivery address
set delivery module
962708
public function deliver()
    {
        $this->checkAuth();
        $this->checkCartNotEmpty();

        $message = false;

        $orderDelivery = $this->createForm(FrontForm::ORDER_DELIVER);

        try {
            $form = $this->validateForm($orderDelivery, "post");

            $deliveryAddressId = $form->get("delivery-address")->getData();
            $deliveryModuleId = $form->get("delivery-module")->getData();
            $deliveryAddress = AddressQuery::create()->findPk($deliveryAddressId);
            $deliveryModule = ModuleQuery::create()->findPk($deliveryModuleId);

            /* check that the delivery address belongs to the current customer */
            if ($deliveryAddress->getCustomerId() !== $this->getSecurityContext()->getCustomerUser()->getId()) {
                throw new \Exception(
                    $this->getTranslator()->trans(
                        "Delivery address does not belong to the current customer",
                        [],
                        Front::MESSAGE_DOMAIN
                    )
                );
            }

            /* check that the delivery module fetches the delivery address area */
            if (null === AreaDeliveryModuleQuery::create()->findByCountryAndModule(
                $deliveryAddress->getCountry(),
                $deliveryModule
            )) {
                throw new \Exception(
                    $this->getTranslator()->trans(
                        "Delivery module cannot be use with selected delivery address",
                        [],
                        Front::MESSAGE_DOMAIN
                    )
                );
            }

            /* get postage amount */
            $moduleInstance = $deliveryModule->getDeliveryModuleInstance($this->container);

            $cart = $this->getSession()->getSessionCart($this->getDispatcher());
            $deliveryPostageEvent = new DeliveryPostageEvent($moduleInstance, $cart, $deliveryAddress);

            $this->getDispatcher()->dispatch(
                TheliaEvents::MODULE_DELIVERY_GET_POSTAGE,
                $deliveryPostageEvent
            );

            if (!$deliveryPostageEvent->isValidModule() || null === $deliveryPostageEvent->getPostage()) {
                throw new DeliveryException(
                    $this->getTranslator()->trans('The delivery module is not valid.', [], Front::MESSAGE_DOMAIN)
                );
            }

            $postage = $deliveryPostageEvent->getPostage();

            $orderEvent = $this->getOrderEvent();
            $orderEvent->setDeliveryAddress($deliveryAddressId);
            $orderEvent->setDeliveryModule($deliveryModuleId);
            $orderEvent->setPostage($postage->getAmount());
            $orderEvent->setPostageTax($postage->getAmountTax());
            $orderEvent->setPostageTaxRuleTitle($postage->getTaxRuleTitle());

            $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_ADDRESS, $orderEvent);
            $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_MODULE, $orderEvent);
            $this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent);

            return $this->generateRedirectFromRoute("order.invoice");

        } catch (FormValidationException $e) {
            $message = $this->getTranslator()->trans(
                "Please check your input: %s",
                ['%s' => $e->getMessage()],
                Front::MESSAGE_DOMAIN
            );
        } catch (PropelException $e) {
            $this->getParserContext()->setGeneralError($e->getMessage());
        } catch (\Exception $e) {
            $message = $this->getTranslator()->trans(
                "Sorry, an error occured: %s",
                ['%s' => $e->getMessage()],
                Front::MESSAGE_DOMAIN
            );
        }

        if ($message !== false) {
            Tlog::getInstance()->error(
                sprintf("Error during order delivery process : %s. Exception was %s", $message, $e->getMessage())
            );

            $orderDelivery->setErrorMessage($message);

            $this->getParserContext()
                ->addForm($orderDelivery)
                ->setGeneralError($message)
            ;
        }
    }
432381
def update_location(self, ps):
        """"""

        loc = ps.get('location')
        if not loc:
            loc = os.path.join(self.project().get('location'), self.name())
            ps = ps.add_raw(["<location>" + loc])

        return ps
1183772
def set(self, name, valu):
        '''
        
        '''
        byts = s_msgpack.en(valu)
        lkey = self.pref + name.encode('utf8')
        self.slab.put(lkey, byts, db=self.db)
        self.info[name] = valu
1243595
def create_shipping_address(self, shipping_address):
        """"""
        url = urljoin(self._url, '/shipping_addresses')
        return shipping_address.post(url)
811870
private function setShippingAddress($quote, $transaction)
    {
        $address = @$transaction->order->cart->shipments[0]->shipping_address;
        if ($address) {
            $this->setAddress($quote->getShippingAddress(), $address);
        }
    }
511104
protected function setItemDeliveryAddress(
        $addressData,
        ApiItemInterface $item,
        ContactInterface $contact = null,
        AccountInterface $account = null
    ) {
        if ($item->getDeliveryAddress() === null) {
            // Create new delivery address.
            $deliveryAddress = new $this->orderAddressEntity();
            // Persist entities.
            $this->em->persist($deliveryAddress);
            // Assign to order.
            $item->setDeliveryAddress($deliveryAddress);
        }

        if (is_array($addressData)) {
            // Set order-address.
            $this->orderAddressManager->setOrderAddress(
                $item->getDeliveryAddress(),
                $addressData,
                $contact,
                $account
            );
        } elseif (is_int($addressData)) {
            $contactAddressId = $addressData;
            // Create order-address and assign contact-address data.
            $deliveryAddress = $item->getEntity()->getDeliveryAddress();

            $orderAddress = $this->orderAddressManager->getAndSetOrderAddressByContactAddressId(
                $contactAddressId,
                $contact,
                $account,
                $deliveryAddress
            );

            // Set delivery address.
            $item->setDeliveryAddress($orderAddress);

            // If new delivery address persist.
            if (!$deliveryAddress) {
                $this->em->persist($orderAddress);
            }
        }
    }
871108
def fulfill(order_id, shipping_address, line_items, options = {})
      commit :fulfillment, build_fulfillment_request(order_id, shipping_address, line_items, options)
    end
909434
private function setShippingInformation()
    {
        $shipping = $this->_order->getShippingAddress();
        if ($shipping) {
            if (count($shipping->getStreet()) === 4) {
                $this->_paymentRequest->setShipping()->setAddress()->withParameters(
                    $shipping->getStreetLine(1),
                    $shipping->getStreetLine(2),
                    $shipping->getStreetLine(4),
                    \UOL\PagSeguro\Helper\Data::fixPostalCode($shipping->getPostcode()),
                    $shipping->getCity(),
                    $this->getRegionAbbreviation($shipping),
                    $this->getCountryName($shipping['country_id']),
                    $shipping->getStreetLine(3)
                );
            } else {
                $address = \UOL\PagSeguro\Helper\Data::addressConfig($shipping['street']);
                $this->_paymentRequest->setShipping()->setAddress()->withParameters(
                    $this->getShippingAddress($address[0], $shipping),
                    $this->getShippingAddress($address[1]),
                    $this->getShippingAddress($address[3]),
                    \UOL\PagSeguro\Helper\Data::fixPostalCode($shipping->getPostcode()),
                    $shipping->getCity(),
                    $this->getRegionAbbreviation($shipping),
                    $this->getCountryName($shipping['country_id']),
                    $this->getShippingAddress($address[2])
                );
            }

            $this->_paymentRequest->setShipping()->setType()
                ->withParameters(\PagSeguro\Enum\Shipping\Type::NOT_SPECIFIED); //Shipping Type
            $this->_paymentRequest->setShipping()->setCost()
                ->withParameters(number_format($this->getShippingAmount(), 2, '.', '')); //Shipping Coast
        }
    }
594285
public function deliveryAddressStepAction()
    {
        $request = $this->getCurrentRequest();
        $customer = $this->get('sonata.customer.selector')->get();

        if (!$customer) {
            throw new NotFoundHttpException('customer not found');
        }

        $basket = $this->get('sonata.basket');
        $basket->setCustomer($customer);

        if (0 === $basket->countBasketElements()) {
            return new RedirectResponse($this->generateUrl('sonata_basket_index'));
        }

        $addresses = $customer->getAddressesByType(AddressInterface::TYPE_DELIVERY);

        $em = $this->container->get('sonata.address.manager')->getEntityManager();
        foreach ($addresses as $key => $address) {
            // Prevents usage of not persisted addresses in AddressType to avoid choice field error
            // This case occurs when customer is taken from a session
            if (!$em->contains($address)) {
                unset($addresses[$key]);
            }
        }

        // Show address creation / selection form
        $form = $this->createForm(AddressType::class, null, ['addresses' => $addresses]);
        $template = 'SonataBasketBundle:Basket:delivery_address_step.html.twig';

        if ('POST' === $request->getMethod()) {
            $form->handleRequest($request);

            if ($form->isValid()) {
                if ($form->has('useSelected') && $form->get('useSelected')->isClicked()) {
                    $address = $form->get('addresses')->getData();
                } else {
                    $address = $form->getData();
                    $address->setType(AddressInterface::TYPE_DELIVERY);

                    $customer->addAddress($address);

                    $this->get('sonata.customer.manager')->save($customer);

                    $this->get('session')->getFlashBag()->add('sonata_customer_success', 'address_add_success');
                }

                $basket->setCustomer($customer);
                $basket->setDeliveryAddress($address);
                // save the basket
                $this->get('sonata.basket.factory')->save($basket);

                return new RedirectResponse($this->generateUrl('sonata_basket_delivery'));
            }
        }

        // Set URL to be redirected to once edited address
        $this->get('session')->set('sonata_address_redirect', $this->generateUrl('sonata_basket_delivery_address'));

        $this->get('sonata.seo.page')->setTitle($this->get('translator')->trans('basket_delivery_title', [], 'SonataBasketBundle'));

        return $this->render($template, [
            'form' => $form->createView(),
            'addresses' => $addresses,
            'basket' => $basket,
        ]);
    }
598710
def set_address(addr):
    """"""
    # Send DNLOAD with first byte=0x21 and page address
    buf = struct.pack("<BI", 0x21, addr)
    __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 0, __DFU_INTERFACE, buf, __TIMEOUT)

    # Execute last command
    if get_status() != __DFU_STATE_DFU_DOWNLOAD_BUSY:
        raise Exception("DFU: set address failed")

    # Check command state
    if get_status() != __DFU_STATE_DFU_DOWNLOAD_IDLE:
        raise Exception("DFU: set address failed")
740093
public void setDeliveryChannels(java.util.Collection<DeliveryChannel> deliveryChannels) {
        if (deliveryChannels == null) {
            this.deliveryChannels = null;
            return;
        }

        this.deliveryChannels = new com.amazonaws.internal.SdkInternalList<DeliveryChannel>(deliveryChannels);
    }
1124406
def setInstallMode(self, remote, on=True, t=60, mode=1, address=None):
        """"""
        try:
            args = [on]
            if on and t:
                args.append(t)
                if address:
                    args.append(address)
                else:
                    args.append(mode)

            return self.proxies["%s-%s" % (self._interface_id, remote)].setInstallMode(*args)
        except Exception as err:
            LOG.debug("ServerThread.setInstallMode: Exception: %s" % str(err))
152360
private void recalcOutDeliveryMode() {
    // Changes are required.
    if (inDmOverride.equals(ApiJmsConstants.DELIVERY_MODE_PERSISTENT)) {
      outboundDeliveryMode = PersistenceType.PERSISTENT;
    }
    else if (inDmOverride.equals(ApiJmsConstants.DELIVERY_MODE_NONPERSISTENT)) {
      outboundDeliveryMode = PersistenceType.NON_PERSISTENT;
    }
    else {
      // Dest.deliveryMode is validated on set, so treating everything else
      // as app should be ok here.
      if (inDeliveryMode == DeliveryMode.PERSISTENT) {
        outboundDeliveryMode = PersistenceType.PERSISTENT;
      }
      else {
        outboundDeliveryMode = PersistenceType.NON_PERSISTENT;
      }
    }
  }
614171
public function setDeliveryChannel($s) {
        if (is_string($s)){
            $this->options['Destination.DeliveryChannel'] = $s;
            $this->options['Subscription.Destination.DeliveryChannel'] = $s;
        } else {
            return false;
        }
    }
980386
@Override
	public final void setDeliveryMode(int deliveryMode) throws JMSException
    {
        if (deliveryMode != DeliveryMode.PERSISTENT &&
            deliveryMode != DeliveryMode.NON_PERSISTENT)
            throw new FFMQException("Invalid delivery mode : "+deliveryMode,"INVALID_DELIVERY_MODE");
        
        this.defaultDeliveryMode = deliveryMode;
    }
107272
public function setDeliveryTax(\Core\Entity\DeliveryTax $delivery_tax = null) {
        $this->delivery_tax = $delivery_tax;

        return $this;
    }
1099313
def cmd_set_homepos(self, args):
        ''''''
        (lat, lon) = (self.click_position[0], self.click_position[1])
        print("Setting home to: ", lat, lon)
        self.master.mav.command_int_send(
            self.settings.target_system, self.settings.target_component,
            mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT_INT,
            mavutil.mavlink.MAV_CMD_DO_SET_HOME,
            1, # current
            0, # autocontinue
            0, # param1
            0, # param2
            0, # param3
            0, # param4
            int(lat*1e7), # lat
            int(lon*1e7), # lon
            0)