Draws an ErrEllipse with the spcified dimensions.  Only one ErrEllipse can be drawn and
        only once (not movable).
558867
def draw_uncertainty_ellipse(self, cutout):
        
        if not self.mark_prediction:
            return

        try:
            colour = cutout.reading.from_input_file and 'b' or 'g'
            colour = cutout.reading.null_observation and 'c' or colour
            dash = cutout.reading.null_observation and 1 or 0
            sky_coord = cutout.reading.sky_coord


            # RA/DEC value of observation / prediction goes to X/Y  using PV keywords
            predict_ra = sky_coord.ra.to(units.degree)
            predict_dec = sky_coord.dec.to(units.degree)
            x, y, extno = cutout.world2pix(predict_ra, predict_dec, usepv=True)

            # The X/Y pixel values are then converted to RA/DEC without PV for use with DS9.
            ra, dec = cutout.pix2world(x, y, extno, usepv=False)
            uncertainty_ellipse = cutout.reading.uncertainty_ellipse

            self.current_displayable.place_ellipse((ra, dec), uncertainty_ellipse, colour=colour, dash=dash)

            # Also mark on the image where source is localted, not just the ellipse.
            try:
                measured_ra = cutout.reading.mpc_observation.coordinate.ra.to(units.degree)
                measured_dec = cutout.reading.mpc_observation.coordinate.dec.to(units.degree)
                try:
                    print "{:5.2f} {:5.2f} || {:5.2f} {:5.2f} # {}".format((predict_ra - measured_ra).to('arcsec'),
                                                        (predict_dec - measured_dec).to('arcsec'),
                                                        cutout.reading.uncertainty_ellipse.a,
                                                        cutout.reading.uncertainty_ellipse.b,
                                                        cutout.reading.mpc_observation.to_string())
                except Exception as ex:
                    print "Failed trying to write out the prevoiusly recorded measurement: {}".format(ex)
                    pass
                # x, y, extno = cutout.world2pix(measured_ra, measured_dec, usepv=True)
                # ra, dec = cutout.pix2world(x, y, extno, usepv=False)

            except Exception as ex:
                # print "We had an error :{}".format(ex)
                logging.debug(str(ex))
                logging.debug("Failed to get x/y from previous observation, using prediction.")
                hdulist_index = cutout.get_hdulist_idx(cutout.reading.get_ccd_num())
                measured_ra, measured_dec = cutout.pix2world(cutout.pixel_x, cutout.pixel_y, hdulist_index, usepv=True)
                colour = 'm'

            self.current_displayable.place_marker(measured_ra, measured_dec, radius=8, colour=colour)
        except Exception as ex:
            print "EXCEPTION while drawing the uncertainty ellipse, skipping.: {}".format(ex)
            logger.debug(type(ex))
            logger.debug(str(ex))
541750
def random_draw(self, size=None):
        
        return scipy.asarray([p.rvs(size=size) for p in self.univariate_priors])
256549
function fillRect(x, y, width, height) {
         if (this.backBufferContext2D.globalAlpha < 1 / 255) {
           // Fast path: don't draw fully transparent
           return;
         }

         this.backBufferContext2D.fillRect(x, y, width, height);
       }
428168
function drawSteps(){
            let steps = svg.select('.chart-group').selectAll('.step').data(data);

            // Enter
            steps.enter()
              .append('rect')
                .classed('step', true)
                .attr('x', chartWidth) // Initially drawing the steps at the end of Y axis
                .attr('y', ({value}) => yScale(value))
                .attr('width', xScale.bandwidth())
                .attr('height', (d) => (chartHeight - yScale(d.value)))
                .on('mouseover', function(d) {
                    handleMouseOver(this, d, chartWidth, chartHeight);
                })
                .on('mousemove', function(d) {
                    handleMouseMove(this, d, chartWidth, chartHeight);
                })
                .on('mouseout', function(d) {
                    handleMouseOut(this, d, chartWidth, chartHeight);
                })
              .merge(steps)
                .transition()
                .ease(ease)
                .attr('x', ({key}) => xScale(key))
                .attr('y', function(d) {
                    return yScale(d.value);
                })
                .attr('width', xScale.bandwidth())
                .attr('height', function(d) {
                    return chartHeight - yScale(d.value);
                });

            // Exit
            steps.exit()
                .transition()
                .style('opacity', 0)
                .remove();
        }
1169075
def draw(self):
        

        if not self._header and not self._rows:
            return
        self._compute_cols_width()
        self._check_align()
        out = ""
        if self._has_border():
            out += self._hline()
        if self._header:
            out += self._draw_line(self._header, isheader=True)
            if self._has_header():
                out += self._hline_header()
        length = 0
        for row in self._rows:
            length += 1
            out += self._draw_line(row)
            if self._has_hlines() and length < len(self._rows):
                out += self._hline()
        if self._has_border():
            out += self._hline()
        return out[:-1]
273048
private void drawSlices(Canvas canvas) {
        final PieChartData data = dataProvider.getPieChartData();
        final float sliceScale = 360f / maxSum;
        float lastAngle = rotation;
        int sliceIndex = 0;
        for (SliceValue sliceValue : data.getValues()) {
            final float angle = Math.abs(sliceValue.getValue()) * sliceScale;
            if (isTouched() && selectedValue.getFirstIndex() == sliceIndex) {
                drawSlice(canvas, sliceValue, lastAngle, angle, MODE_HIGHLIGHT);
            } else {
                drawSlice(canvas, sliceValue, lastAngle, angle, MODE_DRAW);
            }
            lastAngle += angle;
            ++sliceIndex;
        }
    }
737545
def _draw(self, size=1, **kwargs):
        
        # draw masses
        try:
            mass1 = kwargs['mass1']
        except KeyError:
            mass1 = self.mass1_distr.rvs(size=size)['mass1']
        try:
            mass2 = kwargs['mass2']
        except KeyError:
            mass2 = self.mass2_distr.rvs(size=size)['mass2']
        # draw angles
        try:
            phi_a = kwargs['phi_a']
        except KeyError:
            phi_a = self.phia_distr.rvs(size=size)['phi_a']
        try:
            phi_s = kwargs['phi_s']
        except KeyError:
            phi_s = self.phis_distr.rvs(size=size)['phi_s']
        # draw chi_eff, chi_a
        try:
            chi_eff = kwargs['chi_eff']
        except KeyError:
            chi_eff = self.chieff_distr.rvs(size=size)['chi_eff']
        try:
            chi_a = kwargs['chi_a']
        except KeyError:
            chi_a = self.chia_distr.rvs(size=size)['chi_a']
        # draw xis
        try:
            xi1 = kwargs['xi1']
        except KeyError:
            xi1 = self.xi1_distr.rvs(size=size)['xi1']
        try:
            xi2 = kwargs['xi2']
        except KeyError:
            xi2 = self.xi2_distr.rvs(size=size)['xi2']
        dtype = [(p, float) for p in self.params]
        arr = numpy.zeros(size, dtype=dtype)
        arr['mass1'] = mass1
        arr['mass2'] = mass2
        arr['phi_a'] = phi_a
        arr['phi_s'] = phi_s
        arr['chi_eff'] = chi_eff
        arr['chi_a'] = chi_a
        arr['xi1'] = xi1
        arr['xi2'] = xi2
        return arr
199933
def draw
      r = @dist.rng.to_i
      raise "drawn number must be an integer" unless r.is_a? Integer
      # keep the value inside the allowed range
      r = 0 - r if r < 0
      if r >= @range.size
        diff = 1 + r - @range.size
        r = @range.size - diff
      end
      @range[r]
    end
1192132
function(point, series) {
            if(!point || !point.graphic) {
                return;
            }
            point.graphic.attr({'fill': this.fadedElementColor, 'stroke-width': 1, 'stroke': this.fadedElementBorderColor});
        }
1248547
def draw_oval(x, y, width, height)
      @context.drawOval(x, y, width, height)
    end
453274
private void drawEventsWithPlus(Canvas canvas, float xPosition, float yPosition, List<Event> eventsList) {
        // k = size() - 1, but since we don't want to draw more than 2 indicators, we just stop after 2 iterations so we can just hard k = -2 instead
        // we can use the below loop to draw arbitrary eventsByMonthAndYearMap based on the current screen size, for example, larger screens should be able to
        // display more than 2 evens before displaying plus indicator, but don't draw more than 3 indicators for now
        for (int j = 0, k = -2; j < 3; j++, k += 2) {
            Event event = eventsList.get(j);
            float xStartPosition = xPosition + (xIndicatorOffset * k);
            if (j == 2) {
                dayPaint.setColor(multiEventIndicatorColor);
                dayPaint.setStrokeWidth(multiDayIndicatorStrokeWidth);
                canvas.drawLine(xStartPosition - smallIndicatorRadius, yPosition, xStartPosition + smallIndicatorRadius, yPosition, dayPaint);
                canvas.drawLine(xStartPosition, yPosition - smallIndicatorRadius, xStartPosition, yPosition + smallIndicatorRadius, dayPaint);
                dayPaint.setStrokeWidth(0);
            } else {
                drawEventIndicatorCircle(canvas, xStartPosition, yPosition, event.getColor());
            }
        }
    }
539015
private Paint createGraphicInnerShadowGradient(Shape s) {
        Rectangle2D b    = s.getBounds2D();
        float       midX = (float) b.getCenterX();
        float       y1   = (float) b.getMinY();
        float       y2   = (float) b.getMaxY();

        return createGradient(midX, y1, midX, y2, new float[] { 0f, 0.43f, 0.57f, 1f },
                              new Color[] { graphicInnerShadow1, graphicInnerShadow2, graphicInnerShadow3, graphicInnerShadow4 });
    }
874217
function strokeRect(x, y, width, height) {
         if (this.backBufferContext2D.globalAlpha < 1 / 255) {
           // Fast path: don't draw fully transparent
           return;
         }

         this.backBufferContext2D.strokeRect(x, y, width, height);
       }
1137265
def drawBezier(page, p1, p2, p3, p4, color=None, fill=None,
               dashes=None, width=1, morph=None,
               closePath=False, roundCap=False, overlay=True):
    
    img = page.newShape()
    Q = img.drawBezier(Point(p1), Point(p2), Point(p3), Point(p4))
    img.finish(color=color, fill=fill, dashes=dashes, width=width,
               roundCap=roundCap, morph=morph, closePath=closePath)
    img.commit(overlay)
    
    return Q
978650
def drawBezier(self, p1, p2, p3, p4):
        
        p1 = Point(p1)
        p2 = Point(p2)
        p3 = Point(p3)
        p4 = Point(p4)
        if not (self.lastPoint == p1):
            self.draw_cont += "%g %g m\n" % JM_TUPLE(p1 * self.ipctm)
        self.draw_cont += "%g %g %g %g %g %g c\n" % JM_TUPLE(list(p2 * self.ipctm) + \
                                                          list(p3 * self.ipctm) + \
                                                          list(p4 * self.ipctm))
        self.updateRect(p1)
        self.updateRect(p2)
        self.updateRect(p3)
        self.updateRect(p4)
        self.lastPoint = p4
        return self.lastPoint
812719
def shrink(self, src, width=0, max_value=0, filter_method=None,
               path=None, flags=0):
        
        if filter_method:
            get_ = _madoka.Sketch_get__
            set_ = _madoka.Sketch_set__
            new_sketch = Sketch(width, max_value, path, flags, src.seed)
            for table_id in range(SKETCH_DEPTH):
                for offset in range(width, src.width, width):
                    for cell_id in range(width):
                        val = get_(src, table_id, offset + cell_id)
                        val = filter_method(val)
                        val = max_value if val > max_value else val
                        if val > get_(new_sketch, table_id, cell_id):
                            set_(new_sketch, table_id, cell_id, val)
            self.swap(new_sketch)
        else:
            _madoka.Sketch_shrink(self, src, width, max_value, None, path, flags)
1308361
private void drawShape(
            Canvas canvas,
            Paint paint,
            Path path,
            ShapeAppearanceModel shapeAppearanceModel,
            RectF bounds) {
        if (shapeAppearanceModel.isRoundRect()) {
            float cornerSize = shapeAppearanceModel.getTopRightCorner().getCornerSize();
            canvas.drawRoundRect(bounds, cornerSize, cornerSize, paint);
        } else {
            canvas.drawPath(path, paint);
        }
    }