Creates a string where the coordinates of this contour are packed to a
 string in the format used in the Contour Data DICOM Element (3006,0050).

 @return [String] an encoded coordinate string (or an empty string if no coordinates are associated)
351804
def contour_data
      x, y, z = coords
      return [x, y, z].transpose.flatten.join("\\")
    end
1338621
def to_string(self):
        
        from pandas import Series

        frame = self.frame

        if len(frame.columns) == 0 or len(frame.index) == 0:
            info_line = ('Empty {name}\nColumns: {col}\nIndex: {idx}'
                         .format(name=type(self.frame).__name__,
                                 col=pprint_thing(frame.columns),
                                 idx=pprint_thing(frame.index)))
            text = info_line
        else:

            strcols = self._to_str_columns()
            if self.line_width is None:  # no need to wrap around just print
                # the whole frame
                text = self.adj.adjoin(1, *strcols)
            elif (not isinstance(self.max_cols, int) or
                    self.max_cols > 0):  # need to wrap around
                text = self._join_multiline(*strcols)
            else:  # max_cols == 0. Try to fit frame to terminal
                text = self.adj.adjoin(1, *strcols).split('\n')
                max_len = Series(text).str.len().max()
                # plus truncate dot col
                dif = max_len - self.w
                # '+ 1' to avoid too wide repr (GH PR #17023)
                adj_dif = dif + 1
                col_lens = Series([Series(ele).apply(len).max()
                                   for ele in strcols])
                n_cols = len(col_lens)
                counter = 0
                while adj_dif > 0 and n_cols > 1:
                    counter += 1
                    mid = int(round(n_cols / 2.))
                    mid_ix = col_lens.index[mid]
                    col_len = col_lens[mid_ix]
                    # adjoin adds one
                    adj_dif -= (col_len + 1)
                    col_lens = col_lens.drop(mid_ix)
                    n_cols = len(col_lens)
                # subtract index column
                max_cols_adj = n_cols - self.index
                # GH-21180. Ensure that we print at least two.
                max_cols_adj = max(max_cols_adj, 2)
                self.max_cols_adj = max_cols_adj

                # Call again _chk_truncate to cut frame appropriately
                # and then generate string representation
                self._chk_truncate()
                strcols = self._to_str_columns()
                text = self.adj.adjoin(1, *strcols)
        self.buf.writelines(text)

        if self.should_show_dimensions:
            self.buf.write("\n\n[{nrows} rows x {ncols} columns]"
                           .format(nrows=len(frame), ncols=len(frame.columns)))
175208
def toString(self):
        
        slist = self.toList()
        sign = '' if slist[0] == '+' else '-'
        string = '/'.join(['%02d' % v for v in slist[1:]])
        return sign + string
749101
def encode(self,
               data: mx.sym.Symbol,
               data_length: Optional[mx.sym.Symbol],
               seq_len: int) -> Tuple[mx.sym.Symbol, mx.sym.Symbol, int]:
        
        positions = mx.sym.arange(0, seq_len)
        embedding = self.encode_positions(positions, data)
        return embedding, data_length, seq_len
1129975
def boundary_map(self):
        
        # compute contours
        contours = self.find_contours()

        # fill in nonzero pixels
        new_data = np.zeros(self.data.shape)
        for contour in contours:
            new_data[contour.boundary_pixels[:, 0].astype(np.uint8),
                     contour.boundary_pixels[:, 1].astype(np.uint8)] = np.iinfo(np.uint8).max
        return BinaryImage(new_data.astype(np.uint8), frame=self.frame)
533757
def string_from_point(m, x, y)
      m = to_nibble(m)
      x = to_nibble(x)
      byte = [(m << 4) + x].pack("C")
      byte + be_from_int(y)
    end
1008716
def to_item
      item = DICOM::Item.new
      item.add(DICOM::Element.new(COLL_TYPE, @type))
      item.add(DICOM::Element.new(COLL_POS, positions_string))
      return item
    end
999691
def toxml(self):
        

        return '<Constant' +\
          (' name = "{0}"'.format(self.name) if self.name else '') +\
          (' symbol = "{0}"'.format(self.symbol) if self.symbol else '') +\
          (' value = "{0}"'.format(self.value) if self.value else '') +\
          (' dimension = "{0}"'.format(self.dimension) if self.dimension else '') +\
          (' description = "{0}"'.format(self.description) if self.description else '') +\
          '/>'
151985
def _format_coordinate(self, ax, m):
        '''  '''
        lon_m, lon_M, lat_m, lat_M = self.window
        xlocs = np.linspace(lon_m, lon_M, 5)
        ylocs = np.linspace(lat_m, lat_M, 5)
        xlocs = map(lambda x: float('%1.2f' % (x)), xlocs)
        ylocs = map(lambda x: float('%1.2f' % (x)), ylocs)
        m.drawparallels(ylocs, labels=[1, 0, 0, 1], ax=ax, fontsize=18)
        m.drawmeridians(xlocs, labels=[1, 0, 0, 1], ax=ax, fontsize=18)
775148
def toString(self):
        
        slist = self.toList()
        string = angle.slistStr(slist)
        return string if slist[0] == '-' else string[1:]
18176
def _dump_multilinestring(obj, big_endian, meta):
    
    coords = obj['coordinates']
    vertex = coords[0][0]
    num_dims = len(vertex)

    wkb_string, byte_fmt, byte_order = _header_bytefmt_byteorder(
        'MultiLineString', num_dims, big_endian, meta
    )

    ls_type = _WKB[_INT_TO_DIM_LABEL.get(num_dims)]['LineString']
    if big_endian:
        ls_type = BIG_ENDIAN + ls_type
    else:
        ls_type = LITTLE_ENDIAN + ls_type[::-1]

    # append the number of linestrings
    wkb_string += struct.pack('%sl' % byte_order, len(coords))

    for linestring in coords:
        wkb_string += ls_type
        # append the number of vertices in each linestring
        wkb_string += struct.pack('%sl' % byte_order, len(linestring))
        for vertex in linestring:
            wkb_string += struct.pack(byte_fmt, *vertex)

    return wkb_string
1065875
def coords
      x, y, z = Array.new, Array.new, Array.new
      @coordinates.each do |coord|
        x << coord.x
        y << coord.y
        z << coord.z
      end
      return x, y, z
    end
938528
def to_string(self):
        
        builder = ""

        index = 0
        while index < self.__len__():
            if index > 0:
                builder = builder + ','
            builder = builder + super(ProjectionParams, self).__getitem__(index)
            index = index + 1

        return builder
584054
def to_xml_string(str = '')
      super(str) do
        str << '<c:bar3DChart>'
        str << ('<c:barDir val="' << bar_dir.to_s << '"/>')
        str << ('<c:grouping val="' << grouping.to_s << '"/>')
        str << ('<c:varyColors val="' << vary_colors.to_s << '"/>')
        @series.each { |ser| ser.to_xml_string(str) }
        @d_lbls.to_xml_string(str) if @d_lbls
        str << ('<c:gapWidth val="' << @gap_width.to_s << '"/>') unless @gap_width.nil?
        str << ('<c:gapDepth val="' << @gap_depth.to_s << '"/>') unless @gap_depth.nil?
        str << ('<c:shape val="' << @shape.to_s << '"/>') unless @shape.nil?
        axes.to_xml_string(str, :ids => true)
        str << '</c:bar3DChart>'
        axes.to_xml_string(str)
      end
    end
1315758
def stringify(self):
        
        hexcode = "#"
        for x in self.value:
            part = hex(x)[2:]
            if len(part) < 2: part = "0" + part
            hexcode += part
        return hexcode
6907
def to_s
      str = ''
      if @width > 0
        fmt = @width.truncate == @width ? '%d' : '%.2f'
        str << format(fmt, @width)
        str << '%' if @flag == PercentGeometry
      end

      str << 'x' if (@width > 0 && @flag != PercentGeometry) || (@height > 0)

      if @height > 0
        fmt = @height.truncate == @height ? '%d' : '%.2f'
        str << format(fmt, @height)
        str << '%' if @flag == PercentGeometry
      end
      str << format('%+d%+d', @x, @y) if @x != 0 || @y != 0
      str << FLAGS[@flag.to_i] if @flag != PercentGeometry
      str
    end
87584
def dumps(self):
        

        string = Command('addplot', options=self.options).dumps()

        if self.coordinates is not None:
            string += ' coordinates {%\n'

            if self.error_bar is None:
                for x, y in self.coordinates:
                    # ie: "(x,y)"
                    string += '(' + str(x) + ',' + str(y) + ')%\n'

            else:
                for (x, y), (e_x, e_y) in zip(self.coordinates,
                                              self.error_bar):
                    # ie: "(x,y) +- (e_x,e_y)"
                    string += '(' + str(x) + ',' + str(y) + \
                        ') +- (' + str(e_x) + ',' + str(e_y) + ')%\n'

            string += '};%\n%\n'

        elif self.func is not None:
            string += '{' + self.func + '};%\n%\n'

        if self.name is not None:
            string += Command('addlegendentry', self.name).dumps()

        super().dumps()

        return string