Build an element in the correct format for UserChain.
Format:<APP>:<ID>:<protocol>[:AS][,<APP>:<ID>:<protocol>]*
@see UserChain
7409
public static StringBuilder build(StringBuilder sb, String app, String id, UserChain.Protocol proto, boolean as) {
		boolean mayAs;
		if(!(mayAs=sb.length()==0)) {
			sb.append(',');
		}
		sb.append(app);
		sb.append(':');
		sb.append(id);
		sb.append(':');
		sb.append(proto.name());
		if(as && mayAs) {
			sb.append(":AS");
		}
		return sb;
	}
471159
public String build()
    {
        this.message_string  = "{";

            if( this.recipient_id != null ){
                this.message_string += "\"recipient\": {\"id\": \"" + this.recipient_id + "\"},";
            }

            this.message_string += "\"message\": {";

                this.message_string += "\"attachment\":{";

                    this.message_string += "\"type\":\"template\",";
                    this.message_string += "\"payload\":{";

                        this.message_string += "\"template_type\":\"receipt\",";

                        if( this.recipient_name != null ){
                            this.message_string += "\"recipient_name\":\"" + this.recipient_name + "\",";
                        }
                        if( this.order_number != null ){
                            this.message_string += "\"order_number\":\"" + this.order_number + "\",";
                        }
                        if( this.currency != null ){
                            this.message_string += "\"currency\":\"" + this.currency + "\",";
                        }
                        if( this.payment_method != null ){
                            this.message_string += "\"payment_method\":\"" + this.payment_method + "\",";
                        }
                        if( this.order_url != null ){
                            this.message_string += "\"order_url\":\"" + this.order_url + "\",";
                        }
                        if( this.timestamp != null ){
                            this.message_string += "\"timestamp\":\"" + this.timestamp + "\",";
                        }

                        if( !this.elements.isEmpty() ){
                            this.message_string += "\"elements\":[";
                            for ( int j = 0 ; j < this.elements.size(); j++ ) {
                                HashMap<String, String> element = this.elements.get(j);

                                this.message_string += "{";
                                    if( !element.get("title").equals("") ){
                                        this.message_string += "\"title\":\"" + element.get("title") + "\",";
                                    }
                                    if( !element.get("subtitle").equals("") ){
                                        this.message_string += "\"subtitle\":\"" + element.get("subtitle") + "\",";
                                    }
                                    if( !element.get("quantity").equals("") ){
                                        this.message_string += "\"quantity\":" + element.get("quantity") + ",";
                                    }
                                    if( !element.get("price").equals("") ){
                                        this.message_string += "\"price\":" + element.get("price") + ",";
                                    }
                                    if( !element.get("currency").equals("") ){
                                        this.message_string += "\"currency\":\"" + element.get("currency") + "\",";
                                    }
                                    if( !element.get("image_url").equals("") ){
                                        this.message_string += "\"image_url\":\"" + element.get("image_url") + "\",";
                                    }

                                    this.message_string = this.message_string.replaceAll(",$", "");
                                this.message_string += "},";

                            }
                            this.message_string = this.message_string.replaceAll(",$", "");
                            this.message_string += "],";
                        }

                        if( !this.address.isEmpty() ){
                            this.message_string += "\"address\":{";

                                if( !this.address.get("street_1").equals("") ){
                                    this.message_string += "\"street_1\":\"" + this.address.get("street_1") + "\",";
                                }
                                if( !this.address.get("street_2").equals("") ){
                                    this.message_string += "\"street_2\":\"" + this.address.get("street_2") + "\",";
                                }
                                if( !this.address.get("city").equals("") ){
                                    this.message_string += "\"city\":\"" + this.address.get("city") + "\",";
                                }
                                if( !this.address.get("postal_code").equals("") ){
                                    this.message_string += "\"postal_code\":\"" + this.address.get("postal_code") + "\",";
                                }
                                if( !this.address.get("state").equals("") ){
                                    this.message_string += "\"state\":\"" + this.address.get("state") + "\",";
                                }
                                if( !this.address.get("country").equals("") ){
                                    this.message_string += "\"country\":\"" + this.address.get("country") + "\",";
                                }

                                this.message_string = this.message_string.replaceAll(",$", "");

                            this.message_string += "},";
                        }

                        if( !this.summary.isEmpty() ){
                            this.message_string += "\"summary\":{";

                                if( !this.summary.get("subtotal").equals("") ){
                                    this.message_string += "\"subtotal\":" + this.summary.get("subtotal") + ",";
                                }
                                if( !this.summary.get("shipping_cost").equals("") ){
                                    this.message_string += "\"shipping_cost\":" + this.summary.get("shipping_cost") + ",";
                                }
                                if( !this.summary.get("total_tax").equals("") ){
                                    this.message_string += "\"total_tax\":" + this.summary.get("total_tax") + ",";
                                }
                                if( !this.summary.get("total_cost").equals("") ){
                                    this.message_string += "\"total_cost\":" + this.summary.get("total_cost") + ",";
                                }

                                this.message_string = this.message_string.replaceAll(",$", "");

                            this.message_string += "},";
                        }
                        if( !this.adjustments.isEmpty() ){
                            this.message_string += "\"adjustments\":[";
                            for ( int j = 0 ; j < this.adjustments.size(); j++ ) {
                                HashMap<String, String> adjustment = this.adjustments.get(j);

                                this.message_string += "{";
                                    if( !adjustment.get("name").equals("") ){
                                        this.message_string += "\"name\":\"" + adjustment.get("name") + "\",";
                                    }
                                    if( !adjustment.get("amount").equals("") ){
                                        this.message_string += "\"amount\":" + adjustment.get("amount") + ",";
                                    }
                                    this.message_string = this.message_string.replaceAll(",$", "");
                                this.message_string += "},";

                            }
                            this.message_string = this.message_string.replaceAll(",$", "");
                            this.message_string += "],";
                        }

                        this.message_string = this.message_string.replaceAll(",$", "");

                    this.message_string += "}";

                this.message_string += "}";

            this.message_string += "}";

        this.message_string += "}";

        return this.message_string;
    }
131164
def build_id
      section = section_by_name('.note.gnu.build-id')
      return nil if section.nil?

      note = section.notes.first
      return nil if note.nil?

      note.desc.unpack('H*').first
    end
432648
def build(self, builder):
        

        params = {}
        if self.signature_id is not None:
            # If a Signature element is contained within a Signatures element, the ID attribute is required.
            params['ID'] = self.signature_id

        builder.start("Signature", params)

        if self.user_ref is None:
            raise ValueError("User Reference not set.")
        self.user_ref.build(builder)

        if self.location_ref is None:
            raise ValueError("Location Reference not set.")
        self.location_ref.build(builder)

        if self.signature_ref is None:
            raise ValueError("Signature Reference not set.")
        self.signature_ref.build(builder)

        if self.date_time_stamp is None:
            raise ValueError("DateTime not set.")
        self.date_time_stamp.build(builder)

        builder.end("Signature")
651513
def add_format(self, parser, default=Encoding.PEM, help_text=None, opts=None):
        """"""

        if opts is None:
            opts = ['-f', '--format']
        if help_text is None:
            help_text = 'The format to use ("ASN1" is an alias for "DER", default: %(default)s).'
        help_text = help_text % {'default': default.name}
        parser.add_argument(*opts, metavar='{PEM,ASN1,DER}', default=default,
                            action=FormatAction, help=help_text)
933799
public String build()
    {
        this.message_string  = "{";

        if( this.recipient_id != null ){
            this.message_string += "\"recipient\": {\"id\": \"" + this.recipient_id + "\"},";
        }

        if( !this.elements.isEmpty() ){

            this.message_string += "\"message\": {";

                this.message_string += "\"attachment\": {";

                    this.message_string += "\"type\": \"template\",";

                    this.message_string += "\"payload\": {";

                        if( this.element_style.equals("compact") ){
                            this.message_string += "\"top_element_style\":\"" + this.element_style + "\",";
                        }

                        if( !this.elements.isEmpty() ){

                            this.message_string += "\"elements\":[";
                            for ( int j = 0 ; j < this.elements.size(); j++ ) {
                                HashMap<String, Object> element = this.elements.get(j);

                                this.message_string += "{";
                                if( !element.get("title").equals("") ){
                                    this.message_string += "\"title\":\"" + element.get("title") + "\",";
                                }
                                if( !element.get("image_url").equals("") ){
                                    this.message_string += "\"image_url\":\"" + element.get("image_url") + "\",";
                                }
                                if( !element.get("subtitle").equals("") ){
                                    this.message_string += "\"subtitle\":\"" + element.get("subtitle") + "\",";
                                }

                                if( !element.get("default_action_type").equals("") || !element.get("default_action_url").equals("") || !element.get("default_action_messenger_extensions").equals("") || !element.get("default_action_webview_height_ratio").equals("") || !element.get("default_action_fallback_url").equals("") ){
                                    this.message_string += "\"default_action\":{";
                                        if( !element.get("default_action_type").equals("") ){
                                            this.message_string += "\"type\":\"" + element.get("default_action_type") + "\",";
                                        }
                                        if( !element.get("default_action_url").equals("") ){
                                            this.message_string += "\"url\":\"" + element.get("default_action_url") + "\",";
                                        }
                                        if( !element.get("default_action_messenger_extensions").equals("") ){
                                            this.message_string += "\"messenger_extensions\":\"" + element.get("default_action_messenger_extensions") + "\",";
                                        }
                                        if( !element.get("default_action_webview_height_ratio").equals("") ){
                                            this.message_string += "\"webview_height_ratio\":\"" + element.get("default_action_webview_height_ratio") + "\",";
                                        }
                                        if( !element.get("default_action_fallback_url").equals("") ){
                                            this.message_string += "\"fallback_url\":\"" + element.get("default_action_fallback_url") + "\",";
                                        }
                                        this.message_string = this.message_string.replaceAll(",$", "");
                                    this.message_string += "},";
                                }


                                if( element.containsKey("buttons") ){
                                    ArrayList<HashMap<String, String>> buttons = (ArrayList<HashMap<String, String>>) element.get("buttons");
                                    if( !buttons.isEmpty() ){

                                        this.message_string += "\"buttons\": [";

                                            for ( int k = 0 ; k < buttons.size(); k++ ) {
                                                HashMap<String, String> button = buttons.get(k);
                                                this.message_string += "{";
                                                    if( !button.get("title").equals("") ){
                                                        this.message_string += "\"title\":\"" + button.get("title") + "\",";
                                                    }
                                                    if( !button.get("type").equals("") ){
                                                        this.message_string += "\"type\":\"" + button.get("type") + "\",";
                                                    }
                                                    if( !button.get("url").equals("") ){
                                                        this.message_string += "\"url\":\"" + button.get("url") + "\",";
                                                    }
                                                    if( !button.get("messenger_extensions").equals("") ){
                                                        this.message_string += "\"messenger_extensions\":\"" + button.get("messenger_extensions") + "\",";
                                                    }
                                                    if( !button.get("webview_height_ratio").equals("") ){
                                                        this.message_string += "\"webview_height_ratio\":\"" + button.get("webview_height_ratio") + "\",";
                                                    }
                                                    if( !button.get("fallback_url").equals("") ){
                                                        this.message_string += "\"fallback_url\":\"" + button.get("fallback_url") + "\",";
                                                    }
                                                this.message_string = this.message_string.replaceAll(",$", "");
                                                this.message_string += "},";
                                            }

                                            this.message_string = this.message_string.replaceAll(",$", "");
                                        this.message_string += "]";
                                    }
                                }

                                this.message_string = this.message_string.replaceAll(",$", "");
                                this.message_string += "},";
                            }

                            this.message_string = this.message_string.replaceAll(",$", "");
                            this.message_string += "],";
                        }

                        this.message_string += "\"buttons\":[";
                        for ( int j = 0 ; j < this.buttons.size(); j++ ) {
                            HashMap<String, String> button = this.buttons.get(j);

                            this.message_string += "{";
                            if( !button.get("type").equals("") ){
                                this.message_string += "\"type\":\"" + button.get("type") + "\",";
                            }
                            if( !button.get("title").equals("") ){
                                this.message_string += "\"title\":\"" + button.get("title") + "\",";
                            }
                            if( !button.get("url").equals("") ){
                                this.message_string += "\"url\":\"" + button.get("url") + "\",";
                            }
                            if( !button.get("payload").equals("") ){
                                this.message_string += "\"payload\":\"" + button.get("payload") + "\",";
                            }
                            this.message_string = this.message_string.replaceAll(",$", "");
                            this.message_string += "},";
                        }

                        this.message_string = this.message_string.replaceAll(",$", "");
                        this.message_string += "]";

                    this.message_string += "}";

                this.message_string += "}";

            this.message_string += "}";

        }

        this.message_string = this.message_string.replaceAll(",$", "");
        this.message_string += "}";

        return this.message_string;
    }
1096737
def build(self, schema: Schema) -> Mapping[str, Any]:
        
        fields = list(self.iter_fields(schema))

        properties = {
            field.name: self.build_parameter(field)
            for name, field in fields
        }

        result = dict(
            type="object",
            properties=properties,
        )

        required_fields = [
            name
            for name, field in fields
            if field.required and not field.allow_none
        ]

        if required_fields:
            result["required"] = required_fields

        return result
222488
def build_channel(namespace, name, user_ids):
    
    ids = ','.join(map(str, user_ids))
    return "{0}:{1}#{2}".format(namespace, name, ids)
268014
def format
      raise FormatError.new(self) unless formattable?

      REXML::Element.new(type).tap do |attribute|
        attribute.attributes["key"] = @key
        attribute.attributes["value"] = format_value
        meta.each {|m| attribute.elements << m.format if m.formattable?}
      end
    end
966661
private String buildString(String format, Object[] params) {
        String stringFormat = format;
        for(int i = 0; i < params.length; i++) {
            stringFormat = stringFormat.replaceFirst("\\{}", "%s");
        }
        return String.format(stringFormat, params);
    }
269586
def build_url                 
      parts = []
      uri   = ""
      parts << "/#{@version}"         if @version
      parts << "/#{@domain}"          if @domain
      parts << "/#{@service}"         if @service
      uri   =  parts.join("")
      parts << "?"
      parts << "format=#{@format}"
      parts << "&#{authentication_params(uri)}"
      parts << "#{format_parameters}" if @parameters
      @url = parts.join("")
    end
858587
def packet2chain(packet):
    """"""
    chain = [type(packet).__name__]
    payload = packet.data
    while not isinstance(payload, bytes):
        chain.append(type(payload).__name__)
        payload = payload.data
    return ':'.join(chain)
79473
def to_element(self):
        
        if not self.protocol_info:
            raise DIDLMetadataError('Could not create Element for this'
                                    'resource:'
                                    'protocolInfo not set (required).')
        root = XML.Element('res')

        # Required
        root.attrib['protocolInfo'] = self.protocol_info
        # Optional
        if self.import_uri is not None:
            root.attrib['importUri'] = self.import_uri
        if self.size is not None:
            root.attrib['size'] = str(self.size)
        if self.duration is not None:
            root.attrib['duration'] = self.duration
        if self.bitrate is not None:
            root.attrib['bitrate'] = str(self.bitrate)
        if self.sample_frequency is not None:
            root.attrib['sampleFrequency'] = str(self.sample_frequency)
        if self.bits_per_sample is not None:
            root.attrib['bitsPerSample'] = str(self.bits_per_sample)
        if self.nr_audio_channels is not None:
            root.attrib['nrAudioChannels'] = str(self.nr_audio_channels)
        if self.resolution is not None:
            root.attrib['resolution'] = self.resolution
        if self.color_depth is not None:
            root.attrib['colorDepth'] = str(self.color_depth)
        if self.protection is not None:
            root.attrib['protection'] = self.protection

        root.text = self.uri
        return root
849440
function (format) {
		var res = _.range(1, deckSize + 1);
		var buffer = crypto.randomBytes(deckSize << 2);
		for (var pos = res.length - 1; pos > 0; pos--) {
			var rand = buffer.readUInt32LE(pos << 2) % (pos + 1);
			var temp = res[pos];
			res[pos] = res[rand];
			res[rand] = temp;
		};
		return format ? _.map(res, format) : res;
	}
382710
function Bitid(params) {
  params = params || {};
  var self = this;

  this._nonce = params.nonce;
  this.callback = url.parse(params.callback, true);
  this.signature = params.signature;
  this.address = params.address;
  this.unsecure = params.unsecure;
  this._uri = !params.uri ? buildURI() : url.parse(params.uri, true);

  function buildURI() {
    var uri = self.callback;
    uri.protocol = SCHEME;
    var params = {};
    params[PARAM_NONCE] = self._nonce;
    if(self.unsecure) params[PARAM_UNSECURE] = 1;
    uri.query = params;
    uri.href = url.format(uri);

    return uri;
  }
}
714487
def format(value, name = nil, style = nil)
      name  ||= self.name
      style ||= self.style

      value = fixed if fixed
      value ||= default if default

      unless value
        if required?
          raise ArgumentError, %Q{No value provided for required param "#{name}"!}
        else
          return '' # No value provided and none required.
        end
      end

      if value.respond_to?(:each) && !value.respond_to?(:to_str)
        if repeating?
          values = value
        else
          raise ArgumentError, %Q{Multiple values provided for single-value param "#{name}"}
        end
      else
        values = [value]
      end

      # If the param lists acceptable values in option tags, make sure that
      # all values are found in those tags.
      if options && !options.empty?
        values.each { |_value|
          unless find_option(_value)
            acceptable = options.map { |o| o.value }.join('", "')
            raise ArgumentError, %Q{"#{_value}" is not among the acceptable parameter values ("#{acceptable}")}
          end
        }
      end

      if style == 'query' || parent.is_a?(RequestFormat) || (
        parent.respond_to?(:is_form_representation?) && parent.is_form_representation?
      )
        values.map { |v| "#{uri_escape(name)}=#{uri_escape(v.to_s)}" }.join('&')
      elsif style == 'matrix'
        if type == 'xsd:boolean'
          values.map { |v| ";#{name}" if v =~ BOOLEAN_RE }.compact.join
        else
          values.map { |v| ";#{uri_escape(name)}=#{uri_escape(v.to_s)}" if v }.compact.join
        end
      elsif style == 'header'
        values.join(',')
      else
        # All other cases: plain text representation.
        values.map { |v| uri_escape(v.to_s) }.join(',')
      end
    end
1156908
def build_schema(
    source: Union[str, Source],
    assume_valid=False,
    assume_valid_sdl=False,
    no_location=False,
    experimental_fragment_variables=False,
) -> GraphQLSchema:
    """"""
    return build_ast_schema(
        parse(
            source,
            no_location=no_location,
            experimental_fragment_variables=experimental_fragment_variables,
        ),
        assume_valid=assume_valid,
        assume_valid_sdl=assume_valid_sdl,
    )