Generate lilypond representation for a point
354337
def lilypond(point):
    
    #If lilypond already computed, leave as is
    if "lilypond" in point:
        return point

    #Defaults:
    pitch_string = ""
    octave_string = ""
    duration_string = ""
    preamble = ""
    dynamic_string = ""
    if "pitch" in point:
        octave = point["octave"]
        pitch = point["pitch"]
        if octave > 4:
            octave_string = "'" * (octave - 4)
        elif octave < 4:
            octave_string = "," * (4 - octave)
        else:
            octave_string = ""
        m = modifiers(pitch)
        if m > 0:
            modifier_string = "is" * m
        elif m < 0:
            modifier_string = "es" * -m
        else:
            modifier_string = ""
        pitch_string = letter(pitch).lower() + modifier_string

    if DURATION_64 in point:
        duration = point[DURATION_64]
        if duration > 0:
            if duration % 3 == 0:  # dotted note
                duration_string = str(192 // (2 * duration)) + "."
            else:
                duration_string = str(64 // duration)
        #TODO: for now, if we have a duration but no pitch, show a 'c' with an x note
        if duration_string:
            if not pitch_string:
                pitch_string = "c"
                octave_string = "'"
                preamble = r'\xNote '

    if "dynamic" in point:
        dynamic = point["dynamic"]
        if dynamic == "crescendo":
            dynamic_string = "\<"
        elif dynamic == "diminuendo":
            dynamic_string = "\>"
        else:
            dynamic_string = "\%s" % (dynamic,)

    point["lilypond"] = "%s%s%s%s%s" % (preamble, pitch_string, octave_string, duration_string, dynamic_string)

    return point
592399
function (points) {
                var iMap = new HashMap();
                var newPoints = [];
                var intersections = [];
                var polygons = [];
                var iMaps = [];
                var poleIndex = -1;

                var pole = this.findIntersectionAndPole(points, newPoints, intersections, iMap);

                if (intersections.length === 0) {
                    polygons.push(newPoints);
                    iMaps.push(iMap);
                    return this.formatContourOutput(polygons, pole, poleIndex, iMaps);
                }

                if (intersections.length > 2) {
                    intersections.sort(function (a, b) {
                        return b.latitude - a.latitude;
                    });
                }

                if (pole !== Location.poles.NONE) {
                    newPoints = this.handleOnePole(newPoints, intersections, iMap, pole);
                    iMap = this.reindexIntersections(intersections, iMap, this.poleIndexOffset);
                }
                if (intersections.length === 0) {
                    polygons.push(newPoints);
                    iMaps.push(iMap);
                    poleIndex = 0;
                    return this.formatContourOutput(polygons, pole, poleIndex, iMaps);
                }

                this.linkIntersections(intersections, iMap);

                poleIndex = this.makePolygons(newPoints, intersections, iMap, polygons, iMaps);

                return this.formatContourOutput(polygons, pole, poleIndex, iMaps);
            }
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)
411426
function convertPolyToP2TPoly(poly) {
  return poly.points.map(function(p) {
    return new poly2tri.Point(p.x, p.y);
  });
}
399604
function(latLngs, symbolFactory, directionPoints) {
        return directionPoints.map((directionPoint, i) =>
            symbolFactory.buildSymbol(directionPoint, latLngs, this._map, i, directionPoints.length)
        );
    }
918854
def get_4pt_bezier(steps, points):
    """"""
    for i in range(steps):
        t = i / float(steps)

        xloc = (math.pow(1 - t, 3) * points[0][0] +
                3 * t * math.pow(1 - t, 2) * points[1][0] +
                3 * (1 - t) * math.pow(t, 2) * points[2][0] +
                math.pow(t, 3) * points[3][0])
        yloc = (math.pow(1 - t, 3) * points[0][1] +
                3 * t * math.pow(1 - t, 2) * points[1][1] +
                3 * (1 - t) * math.pow(t, 2) * points[2][1] +
                math.pow(t, 3) * points[3][1])

        yield (xloc, yloc)
806654
function generateData(numDimensions, numPoints) {
  const data = tf.tidy(() => {
    return tf.linspace(0, 1, numPoints * numDimensions)
        .reshape([numPoints, numDimensions])
        .add(tf.randomUniform([numPoints, numDimensions]));
  });
  return data;
}
1041621
def create_point(self, xcen, ycen, size=10, color='red', fill=None):
        """"""

        if fill is None:
            fill = color

        (x, y) = self.p2c((xcen, ycen))
        x1 = x - size
        x2 = x + size
        y1 = y - size
        y2 = y + size
        self.create_rectangle(x1, y1, x2, y2, fill=fill, outline=color)
353073
function generateLineString() {
  var coordNumber = getRandomNumber(3, options.maxCoordCount);

  var feature = rawFeature();
  feature.geometry.type = 'LineString';

  addCoordinates(feature.geometry.coordinates, coordNumber);

  return feature;
}
702445
def transform(self, m):
        """"""
        if len(m) != 6:
            raise ValueError("bad sequ. length")
        self.x, self.y = TOOLS._transform_point(self, m)
        return self
720118
function Shape( points ) {

	Path.call( this, points );

	this.uuid = _Math.generateUUID();

	this.type = 'Shape';

	this.holes = [];

}
327471
function pointsWrapper(opt) {
        var shape = shapeWrapper(g.Polyline, opt);
        return function(value, refBBox, node) {
            var polyline = shape(value, refBBox, node);
            return {
                points: polyline.serialize()
            };
        };
    }
395446
static String encodeCoordinates(Point2d[] points) {
        StringBuilder sb = new StringBuilder();
        sb.append("|(");
        for (Point2d point : points) {
            if (sb.length() > 2) sb.append(";");
            sb.append(DECIMAL_FORMAT.format(point.x));
            sb.append(',');
            sb.append(DECIMAL_FORMAT.format(point.y));
            sb.append(',');
        }
        sb.append(")|");
        return sb.toString();
    }
1023373
function pointToTile(lon, lat, z) {
    var tile = pointToTileFraction(lon, lat, z);
    tile[0] = Math.floor(tile[0]);
    tile[1] = Math.floor(tile[1]);
    return tile;
}
548202
def point2upoint(point):
    """"""
    upoint = [set(), set()]
    for v, val in point.items():
        upoint[val].add(v.uniqid)
    upoint[0] = frozenset(upoint[0])
    upoint[1] = frozenset(upoint[1])
    return tuple(upoint)
542303
def point_to_t(self, point):
        """"""

        # Single-precision floats have only 7 significant figures of
        # resolution, so test that we're within 6 sig figs.
        if np.isclose(point, self.start, rtol=0, atol=1e-6):
            return 0.0
        elif np.isclose(point, self.end, rtol=0, atol=1e-6):
            return 1.0

        # Finding the point "by hand" here is much faster than calling
        # radialrange(), see the discussion on PR #40:
        # https://github.com/mathandy/svgpathtools/pull/40#issuecomment-358134261

        p = self.poly()
        # p(t) = (p_1 * t) + p_0 = point
        # t = (point - p_0) / p_1
        t = (point - p[0]) / p[1]
        if np.isclose(t.imag, 0) and (t.real >= 0.0) and (t.real <= 1.0):
            return t.real
        return None
267982
def generateCustomColorRamp(cls, colors=[], interpolatedPoints=10):
        
        if not (isinstance(colors, list)):
            print('COLOR RAMP GENERATOR WARNING: colors must be passed in as a list of RGB tuples.')
            raise

        numColors = len(colors)

        colorRamp = []

        # Iterate over colors
        for index in range (0, numColors - 1):
            bottomColor = colors[index]
            topColor = colors[index + 1]

            colorRamp.append(bottomColor)

            # Calculate slopes
            rSlope = (topColor[0] - bottomColor[0]) / float(interpolatedPoints)
            gSlope = (topColor[1] - bottomColor[1]) / float(interpolatedPoints)
            bSlope = (topColor[2] - bottomColor[2]) / float(interpolatedPoints)

            # Interpolate colors
            for point in range(1, interpolatedPoints):
                red = int(rSlope * point + bottomColor[0])
                green = int(gSlope * point + bottomColor[1])
                blue = int(bSlope * point + bottomColor[2])
                color = (red, green, blue)

                # Make sure the color ramp contains unique colors
                if not (color in colorRamp):
                    colorRamp.append(color)

        # Append the last color
        colorRamp.append(colors[-1])

        return colorRamp