synchronize self from Ariane server according its id (prioritary) or name
        :return:
345646
def sync(self):
        
        LOGGER.debug("Location.sync")
        params = None
        if self.id is not None:
            params = {'id': self.id}
        elif self.name is not None:
            params = {'name': self.name}

        if params is not None:
            args = {'http_operation': 'GET', 'operation_path': 'get', 'parameters': params}
            response = LocationService.requester.call(args)
            if response.rc == 0:
                json_obj = response.response_content
                self.id = json_obj['locationID']
                self.name = json_obj['locationName']
                self.description = json_obj['locationDescription']
                self.address = json_obj['locationAddress']
                self.zip_code = json_obj['locationZipCode']
                self.town = json_obj['locationTown']
                self.type = json_obj['locationType']
                self.country = json_obj['locationCountry']
                self.gpsLatitude = json_obj['locationGPSLat']
                self.gpsLongitude = json_obj['locationGPSLng']
                self.routing_area_ids = json_obj['locationRoutingAreasID']
                self.subnet_ids = json_obj['locationSubnetsID']
            else:
                LOGGER.warning('Location.sync - Problem while syncing location (name:' +
                               self.name + ', id: ' + str(self.id) + '). ' +
                               'Reason: ' + str(response.response_content) + '-' + str(response.error_message) +
                               " (" + str(response.rc) + ")")
384148
def sync(self):
        
        if self._sync is None:
            from twilio.rest.sync import Sync
            self._sync = Sync(self)
        return self._sync
315064
def _sync(self, timeout_ms=30000):
        
        response = self.api.sync(self.sync_token, timeout_ms)
        prev_sync_token = self.sync_token
        self.sync_token = response["next_batch"]

        if self._handle_thread is not None:
            # if previous _handle_thread is still running, wait for it and re-raise if needed
            self._handle_thread.get()

        is_first_sync = (prev_sync_token is None)
        self._handle_thread = gevent.Greenlet(self._handle_response, response, is_first_sync)
        self._handle_thread.name = (
            f'GMatrixClient._sync user_id:{self.user_id} sync_token:{prev_sync_token}'
        )
        self._handle_thread.link_exception(lambda g: self.sync_thread.kill(g.exception))
        self._handle_thread.start()

        if self._post_hook_func is not None:
            self._post_hook_func(self.sync_token)
906290
def sync():
    '''
    
    '''
    # Funtoo patches eix to use 'ego sync'
    if __grains__['os'] == 'Funtoo':
        cmd = 'eix-sync -q'
    else:
        cmd = 'eix-sync -q -C "--ask" -C "n"'
    if 'makeconf.features_contains' in __salt__ and __salt__['makeconf.features_contains']('webrsync-gpg'):
        # GPG sign verify is supported only for "webrsync"
        if salt.utils.path.which('emerge-delta-webrsync'):  # We prefer 'delta-webrsync' to 'webrsync'
            cmd += ' -W'
        else:
            cmd += ' -w'
        return __salt__['cmd.retcode'](cmd) == 0
    else:
        if __salt__['cmd.retcode'](cmd) == 0:
            return True
        # We fall back to "webrsync" if "rsync" fails for some reason
        if salt.utils.path.which('emerge-delta-webrsync'):  # We prefer 'delta-webrsync' to 'webrsync'
            cmd += ' -W'
        else:
            cmd += ' -w'
        return __salt__['cmd.retcode'](cmd) == 0
356757
def sync(self):
        
        phase = _get_phase(self._formula_instance)
        self.logger.info("%s %s..." % (phase.verb.capitalize(), self.feature_name))
        message = "...finished %s %s." % (phase.verb, self.feature_name)
        result = getattr(self, phase.name)()
        if result or phase in (PHASE.INSTALL, PHASE.REMOVE):
            self.logger.info(message)
        else:
            self.logger.debug(message)
        return result
690805
def sync(self, clear_cache=False):
        
        self.persistence.update(self)

        if clear_cache:
            self.cache.clear()
1325277
def sync(self):
        
        LOGGER.debug("RoutingArea.sync")
        params = None
        if self.id is not None:
            params = {'id': self.id}
        elif self.name is not None:
            params = {'name': self.name}

        if params is not None:
            args = {'http_operation': 'GET', 'operation_path': 'get', 'parameters': params}
            response = RoutingAreaService.requester.call(args)
            if response.rc == 0:
                json_obj = response.response_content
                self.id = json_obj['routingAreaID']
                self.name = json_obj['routingAreaName']
                self.description = json_obj['routingAreaDescription']
                self.type = json_obj['routingAreaType']
                self.multicast = json_obj['routingAreaMulticast']
                self.loc_ids = json_obj['routingAreaLocationsID']
                self.subnet_ids = json_obj['routingAreaSubnetsID']
            else:
                LOGGER.warning(
                    'RoutingArea.sync - Problem while syncing routing area (name:' + self.name + ', id:' +
                    str(self.id) + '). Reason: ' + str(response.response_content) + '-' + str(response.error_message) +
                    " (" + str(response.rc) + ")"
                )
628758
def set_synchronous_standby(self, name):
        """"""
        if name and name != '*':
            name = quote_ident(name)
        if name != self._synchronous_standby_names:
            if name is None:
                self._server_parameters.pop('synchronous_standby_names', None)
            else:
                self._server_parameters['synchronous_standby_names'] = name
            self._synchronous_standby_names = name
            if self.state == 'running':
                self._write_postgresql_conf()
                self.reload()
681493
def synchronize(self, graph_data=None):
        
        profile = graph_data or self.graph.get('me')

        self.facebook_username = profile.get('username')
        self.first_name = profile.get('first_name')
        self.middle_name = profile.get('middle_name')
        self.last_name = profile.get('last_name')
        self.birthday = datetime.strptime(profile['birthday'], '%m/%d/%Y') if profile.has_key('birthday') else None
        self.email = profile.get('email')
        self.locale = profile.get('locale')
        self.gender = profile.get('gender')
        self.extra_data = profile
        self.save()
221870
def sync(self):
        
        LOGGER.debug("NIC.sync")
        params = None
        if self.id is not None:
            params = {'id': self.id}
        elif self.name is not None:
            params = {'name': self.name}

        if params is not None:
            args = {'http_operation': 'GET', 'operation_path': 'get', 'parameters': params}
            response = NICService.requester.call(args)
            if response.rc != 0:
                LOGGER.warning(
                    'NIC.sync - Problem while syncing NIC (name:' + self.name + ', id:' + str(self.id) +
                    '). Reason: ' + str(response.response_content) + '-' + str(response.error_message) +
                    " (" + str(response.rc) + ")"
                )
            else:
                json_obj = response.response_content
                self.id = json_obj['nicID']
                self.name = json_obj['nicName']
                self.mac_address = json_obj['nicMacAddress']
                self.duplex = json_obj['nicDuplex']
                self.speed = json_obj['nicSpeed']
                self.mtu = json_obj['nicMtu']
                self.nic_ipa_id = json_obj['nicIPAddressID']
                self.nic_osi_id = json_obj['nicOSInstanceID']
1246725
def set_status(self, name, status):
        
        getattr(self.system, name).status = status
        return True
265663
def run(self):
        
        self.kwargs['cached'] = self.cached
        self.kwargs['sync'] = self.sync
        self.kwargs['broker'] = self.broker
        self.id = async_iter(self.func, self.args, **self.kwargs)
        self.started = True
        return self.id
249162
async def synchronize(self, pid, vendor_specific=None):
        """"""
        return await self._request_pyxb(
            "post",
            ["synchronize", pid],
            {},
            mmp_dict={"pid": pid},
            vendor_specific=vendor_specific,
        )
1075387
def zSyncWithUI(self):
        """"""
        if not OpticalSystem._dde_link:
            OpticalSystem._dde_link = _get_new_dde_link()
        if not self._sync_ui_file:
            self._sync_ui_file = _get_sync_ui_filename()
        self._sync_ui = True
71636
def sync_it_now
      puts "Attempt Sync"

      # Getting the last sync value.
      last_update_at = get_last_update_at

      # querying the page.
      page = @mechanize_agent.get("#{ChronuscopClient.configuration_object.chronuscop_server_address}/projects/#{ChronuscopClient.configuration_object.project_number}/translations.xml/?auth_token=#{ChronuscopClient.configuration_object.api_token}&last_update_at=#{last_update_at}")

      # converting the returned xml page into a hash.
      words_hash = XmlSimple.xml_in(page.body)

      # catching the case when no-translations are returned.
      if(!words_hash) then
        puts "Nothing new added."
        return
      end

      # collecting the translations array.
      all_translations = words_hash["translation"]

      # catching the case when no-translations are returned.
      if(!all_translations) then
        puts "Nothing new added."
        return
      end


      all_translations.each do |t|
        # Inserting into the redis store.
        @redis_agent.set "#{t["key"]}","#{t["value"]}"

        # Bad hack used here. Should fix this.
        str = t["updated-at"][0]["content"]
        key_updated_at = xml_time_to_integer(str)

        # Updating the value last_update_at
        if(key_updated_at > last_update_at) then
          last_update_at = key_updated_at
        end

      end

      # Writing the value of last_update_at to the file.
      write_last_update(last_update_at.to_i)
      puts "Finished synchronizing !!!"
    end
173443
def _initialize_system_sync(self):
        """"""
        connected_devices = self.bable.list_connected_devices()
        for device in connected_devices:
            context = {
                'connection_id': len(self.connections.get_connections()),
                'connection_handle': device.connection_handle,
                'connection_string': device.address
            }
            self.connections.add_connection(context['connection_id'], device.address, context)
            self.disconnect_sync(context['connection_id'])

        self.stop_scan()

        try:
            self.bable.set_advertising(enabled=False)
        except bable_interface.BaBLEException:
            # If advertising is already disabled
            pass
528418
def sync_nodes(self, clusters):
        
        logger.info("Syncing HAProxy backends.")

        current_nodes, enabled_nodes = self.get_current_nodes(clusters)

        for cluster_name, nodes in six.iteritems(current_nodes):
            for node in nodes:
                if node["svname"] in enabled_nodes[cluster_name]:
                    command = self.control.enable_node
                else:
                    command = self.control.disable_node

                try:
                    response = command(cluster_name, node["svname"])
                except Exception:
                    logger.exception("Error when enabling/disabling node")
                    self.restart_required = True
                else:
                    if response:
                        logger.error(
                            "Socket command for %s node %s failed: %s",
                            cluster_name, node["svname"], response
                        )
                        self.restart_required = True
                        return

        logger.info("HAProxy nodes/servers synced.")