params
   blast_id, Fixnum | String
   name, String
   list, String
   schedule_time, String
   from_name, String
   from_email, String
   subject, String
   content_html, String
   content_text, String
   options, hash

 updates existing blast
965575
def update_blast(blast_id, name = nil, list = nil, schedule_time = nil, from_name = nil, from_email = nil, subject = nil, content_html = nil, content_text = nil, options = {})
      data = options ? options : {}
      data[:blast_id] = blast_id
      if name != nil
        data[:name] = name
      end
      if list !=  nil
        data[:list] = list
      end
      if schedule_time != nil
        data[:schedule_time] = schedule_time
      end
      if from_name != nil
        data[:from_name] = from_name
      end
      if from_email != nil
        data[:from_email] = from_email
      end
      if subject != nil
        data[:subject] = subject
      end
      if content_html != nil
        data[:content_html] = content_html
      end
      if content_text != nil
        data[:content_text] = content_text
      end
      api_post(:blast, data)
    end
938855
private String writeUpdateString(Map<String, String> param) {
        StringBuffer fieldStringBuffer = new StringBuffer();
        for(Entry<String, String> entry : param.entrySet()){
        	fieldStringBuffer.append("<field name=\"").append(entry.getKey()).append("\">")
        			.append(StringEscapeUtils.escapeXml(entry.getValue())).append("</field>");
        }
        fieldStringBuffer.insert(0,"<add><doc>").append("</doc></add>");
        
        return fieldStringBuffer.toString();
    }
992462
def write(chunk)
      body = ''
      chunk.msgpack_each {|(tag,time,record)|

        # define index and sourcetype dynamically
        begin
          index = expand_param(@index, tag, time, record)
          sourcetype = expand_param(@sourcetype, tag, time, record)
          event_host = expand_param(@event_host, tag, time, record)
          token = expand_param(@token, tag, time, record)
        rescue => e
          # handle dynamic parameters misconfigurations
          router.emit_error_event(tag, time, record, e)
          next
        end
        log.debug "routing event from #{event_host} to #{index} index"
        log.debug "expanded token #{token}"

        # Parse record to Splunk event format
        case record
        when Integer
          event = record.to_s
        when Hash
          if @send_event_as_json
            event = record.to_json
          else
            event = record.to_json.gsub("\"", %q(\\\"))
          end
        else
          event = record
        end

        sourcetype = @sourcetype == 'tag' ? tag : @sourcetype

        # Build body for the POST request
        if !@usejson
          event = record["time"]+ " " + record["message"].to_json.gsub(/^"|"$/,"")
          body << '{"time":"'+ DateTime.parse(record["time"]).strftime("%Q") +'", "event":"' + event + '", "sourcetype" :"' + sourcetype + '", "source" :"' + @source + '", "index" :"' + index + '", "host" : "' + event_host + '"}'
        elsif @send_event_as_json
          body << '{"time" :' + time.to_s + ', "event" :' + event + ', "sourcetype" :"' + sourcetype + '", "source" :"' + source + '", "index" :"' + index + '", "host" : "' + event_host + '"}'
        else
          body << '{"time" :' + time.to_s + ', "event" :"' + event + '", "sourcetype" :"' + sourcetype + '", "source" :"' + source + '", "index" :"' + index + '", "host" : "' + event_host + '"}'
        end

        if @send_batched_events
          body << "\n"
        else
          send_to_splunk(body, token)
          body = ''
        end
      }

      if @send_batched_events
        send_to_splunk(body, token)
      end
    end
447003
def stats_blast(blast_id = nil, start_date = nil, end_date = nil, options = {})
      data = options
      if blast_id != nil
        data[:blast_id] = blast_id
      end
      if start_date != nil
        data[:start_date] = start_date
      end
      if end_date != nil
        data[:end_date] = end_date
      end
      data[:stat] = 'blast'
      api_get(:stats, data)
    end
1012917
def update_time_entries_tags_fixed(time_entry_ids, params)
      time_entries = update_time_entries_tags(time_entry_ids, params)
      return time_entries if params['tag_action'] == 'add'

      time_entries_for_removing_all_tags_ids = []
      [].push(time_entries).flatten.map! do |time_entry|
        unless time_entry['tags'].nil?
          time_entry['tags'] = time_entry['tags'] - params['tags']
          time_entries_for_removing_all_tags_ids << time_entry['id'] if time_entry['tags'].empty?
        end
        time_entry
      end

      remove_params = {'tags' => []}
      put "time_entries/#{time_entries_for_removing_all_tags_ids.join(',')}", { 'time_entry' => remove_params } unless time_entries_for_removing_all_tags_ids.empty?

      time_entries
    end
952480
def expanded
            h = Hash.new
            [:id, :email, :api_key, :name, :phone, :password,:states, :approval, :suspend,
            :registration_ip_address, :dates, :some_msg].each do |setting|
                if grouped = self.send("#{setting}").is_a?(Hash)
                    self.send("#{setting}").each {|k,v|   h[k.to_sym] = v}
                else
                    h[setting] = self.send("#{setting}")
                end
            end
            h
        end
705746
def update_params(params, updates):
    ''''''
    params = params.copy() if isinstance(params, dict) else dict()
    params.update(updates)
    return params
780298
def update(self, name, html_url, zip_url):
        """"""
        body = {
            "Name": name,
            "HtmlPageURL": html_url,
            "ZipFileURL": zip_url}
        response = self._put("/templates/%s.json" %
                             self.template_id, json.dumps(body))
1000211
def blast(request, blast_form, template_init, template_result, blast_commandline, sample_fasta_path,
          extra_context=None):
    

    if request.method == 'POST':

        form = blast_form(request.POST)

        if form.is_valid():

            query_file_object_tmp = form.cleaned_data['sequence_in_form']
            evalue = float(form.cleaned_data['evalue_in_form'])
            word_size = int(form.cleaned_data['word_size_in_form'])
            database_path = str(form.cleaned_data['blast_db_in_form'])

            standard_opt_dic = {'query': query_file_object_tmp, 'evalue': evalue, 'outfmt': 5, 'db': database_path,
                                'word_size': word_size}
            annotated = utils.get_annotation(database_path, BLAST_DB_NUCL_LIST)

            # none standard options:
            try:
                matrix = str(form.cleaned_data['matrix_in_form'])
                standard_opt_dic["matrix"] = matrix
            except:
                pass

            sensitivity_opt_dic = ast.literal_eval(str(form.cleaned_data['search_sensitivity_in_form']))

            blast_records__file_xml = None
            try:

                # blast search, parse results from temp file, put them into template for rendering.
                blast_records__file_xml, blast_error = utils.run_blast_commands(blast_commandline,
                                                                                **dict(standard_opt_dic,
                                                                                       **sensitivity_opt_dic))

                if len(blast_error) > 0:
                    return render(request=request, template_name=template_result,
                                  context={"blast_record": '', blast_error: BLAST_CORRECT_PARAMS})

                else:

                    # converts blast results into objects and pack into list
                    blast_records_in_object_and_list = utils.blast_records_to_object(
                        list(NCBIXML.parse(blast_records__file_xml)))

                    # user defined function to modify blast results
                    # e.g. join blast results with external database in template
                    if extra_context is not None:
                        blast_records_in_object_and_list = extra_context(blast_records_in_object_and_list)

                    return render(request=request, template_name=template_result,
                                  context={'application': blast_records_in_object_and_list[0].application,
                                           'version': blast_records_in_object_and_list[0].version,
                                           'blast_records': blast_records_in_object_and_list,
                                           'annotated': annotated})

            finally:
                # remove result - temporary file
                if blast_records__file_xml is not None:
                    os.remove(blast_records__file_xml.name)

    else:
        form = blast_form(initial={'sequence_in_form': '', 'evalue_in_form': EVALUE_BLAST_DEFAULT})

    return render(request=request, template_name=template_init,
                  context={'form': form, 'sequence_sample_in_fasta': utils.get_sample_data(sample_fasta_path),
                           "blast_max_number_seq_in_input": BLAST_MAX_NUMBER_SEQ_IN_INPUT, })
1152960
def update_item(cls, hash_key, range_key=None, attributes_to_set=None, attributes_to_add=None):
        """"""
        primary_key = cls._encode_key(hash_key, range_key)

        value_names = {}
        encoded_values = {}
        dynamizer = Dynamizer()

        set_expression = ''
        if attributes_to_set:
            for i, key in enumerate(attributes_to_set.keys()):
                value_name = ':s{0}'.format(i)
                value_names[key] = value_name
                encoded_values[value_name] = dynamizer.encode(attributes_to_set[key])

            set_expression = 'SET {0}'.format(
                ', '.join(
                    '{key}={value_name}'.format(key=key, value_name=value_names[key]) for key in attributes_to_set
                )
            )

        add_expression = ''
        if attributes_to_add:
            for i, key in enumerate(attributes_to_add.keys()):
                value_name = ':a{0}'.format(i)
                value_names[key] = value_name
                encoded_values[value_name] = dynamizer.encode(attributes_to_add[key])
            add_expression = 'ADD {0}'.format(
                ', '.join(
                    '{key} {value_name}'.format(key=key, value_name=value_names[key]) for key in attributes_to_add
                )
            )

        update_expression = ' '.join([set_expression, add_expression])

        cls._get_connection().update_item(
            cls.get_table_name(),
            primary_key,
            update_expression=update_expression, expression_attribute_values=encoded_values)
104634
async def update_contents(self, **params):
		
		if params.get("message"):
			params = json.loads(params.get("message", "{}"))

		if not params:
			return {"error":400, "reason":"Missed required fields"}

		txid = params.get("txid")

		coinid = params.get("coinid").upper()

		try:
			coinid = coinid.replace("TEST", "")
		except:
			pass

		database = client[coinid]
		content_collection = database[settings.CONTENT]

		content = await content_collection.find_one({"txid":txid})

		if not content:
			return {"error":404, 
					"reason":"Update content. Content with txid %s not found" % txid}

		if content.get("hash"):
			self.account.blockchain.setendpoint(settings.bridges[coinid])
			cid = await self.account.blockchain.getcid(hash=content["hash"])

			await content_collection.find_one_and_update({"txid":txid}, {"$set":{"cid":int(cid)}})
			await content_collection.find_one_and_update({"txid":txid}, {"$set":{"hash":None}})


		updated = await content_collection.find_one({"txid":txid})

		return {i:updated[i] for i in updated if i != "_id"}
639417
def Update(self, data):
        
        m = len(data)
        self.params[:m] += data
190818
def update!(params)
      data = {
        engagement: params[:engagement]     || engagement,
        associations: params[:associations] || associations,
        attachments: params[:attachments]   || attachments,
        metadata: params[:metadata]         || metadata
      }

      Hubspot::Connection.put_json(ENGAGEMENT_PATH, params: { engagement_id: id }, body: data)
      self
    end
36996
def update_http_method_params(self):
        
        url_params = {}

        if self.start:
            url_params.update(
                {"start": int(calendar.timegm(self.start.timetuple()))}
            )

        if self.stop:
            url_params.update(
                {"stop": int(calendar.timegm(self.stop.timetuple()))}
            )

        if self.probe_ids:
            url_params.update({"probe_ids": self.probe_ids})

        self.http_method_args["params"].update(url_params)
714346
def update(every, timezone: nil)
            time = Scheduler.parse_in(every, :quiet) || Scheduler.parse_cron(every, :quiet, timezone: timezone)
            raise ArgumentError.new("couldn't parse \"#{o}\"") if time.nil?

            @every = time
            reschedule
        end
333089
def service_param_string(params):
    """"""
    p = []
    k = []
    for param in params:
        name = fix_param_name(param['name'])
        if 'required' in param and param['required'] is True:
            p.append(name)
        else:
            if 'default' in param:
                k.append('{name}={default}'.format(name=name, default=param['default']))
            else:
                k.append('{name}=None'.format(name=name))
    p.sort(lambda a, b: len(a) - len(b))
    k.sort()
    a = p + k
    return ', '.join(a)
1138273
def update(self, params, ignore_set=False, overwrite=False):
        
        log = logging.getLogger(__name__)
        valid = {i[0] for i in self}
        for key, value in params.items():
            if not hasattr(self, key):
                raise AttributeError("'{}' object has no attribute '{}'".format(self.__class__.__name__, key))
            if key not in valid:
                message = "'{}' object does not support item assignment on '{}'"
                raise AttributeError(message.format(self.__class__.__name__, key))
            if key in self._already_set:
                if ignore_set:
                    log.debug('%s already set in config, skipping.', key)
                    continue
                if not overwrite:
                    message = "'{}' object does not support item re-assignment on '{}'"
                    raise AttributeError(message.format(self.__class__.__name__, key))
            setattr(self, key, value)
            self._already_set.add(key)