Dynamically create a Point subclass.
500480
def point_type(name, fields, srid_map):
    

    def srid(self):
        try:
            return srid_map[len(self)]
        except KeyError:
            return None

    attributes = {"srid": property(srid)}

    for index, subclass_field in enumerate(fields):

        def accessor(self, i=index, f=subclass_field):
            try:
                return self[i]
            except IndexError:
                raise AttributeError(f)

        for field_alias in {subclass_field, "xyz"[index]}:
            attributes[field_alias] = property(accessor)

    cls = type(name, (Point,), attributes)

    with __srid_table_lock:
        for dim, srid in srid_map.items():
            __srid_table[srid] = (cls, dim)

    return cls
1251247
def append(self, point):
        
        point = Point(point)
        self._elements.append(point)
1197391
def preprocess_points(points, preprocessor):
  """"""
  try:
    points = preprocessor(points)
  except Exception as e:
    raise PreprocessorError(e)
  return points
686006
function(points, options) {
      if (!points) {
        points = [0, 0, 0, 0];
      }

      this.callSuper('initialize', options);

      this.set('x1', points[0]);
      this.set('y1', points[1]);
      this.set('x2', points[2]);
      this.set('y2', points[3]);

      this._setWidthHeight(options);
    }
440210
def create(cls, *operands, **kwargs):
        """"""
        converted_operands = []
        for op in operands:
            if not isinstance(op, Scalar):
                op = ScalarValue.create(op)
            converted_operands.append(op)
        return super().create(*converted_operands, **kwargs)
1285588
def pointm(self, x, y, m=None):
        """"""
        shapeType = POINTM
        pointShape = Shape(shapeType)
        pointShape.points.append([x, y, m])
        self.shape(pointShape)
1046572
function subEndpoints(prefix, suffixes) {
  return function () {
    Array.prototype.forEach.call(suffixes, function (suffix) {
      var path = prefix + suffix;
      createEndpointFromPath(path);
      console.log('  registered path %s', path);
    });
  }
}
713608
async def create_scene_member(self, shade_position, scene_id, shade_id):
        """"""

        data = {
            ATTR_SCENE_MEMBER: {
                ATTR_POSITION_DATA: shade_position,
                ATTR_SCENE_ID: scene_id,
                ATTR_SHADE_ID: shade_id,
            }
        }
        return await self.request.post(self._base_path, data=data)
596346
function Point(point) {
        crs(point);
        bbox(point);
        geometrySemantics(point);
        if (!requiredProperty(point, 'coordinates', 'array')) {
            position(point.coordinates);
        }
    }
1342620
def _convert_point(cls, feature):
        """"""
        lon, lat = feature['geometry']['coordinates']
        popup = feature['properties'].get('name', '')
        return cls(lat, lon)
1340378
def point_mutate(self,p_i,func_set,term_set):
        """"""
        # point mutation
        x = self.random_state.randint(len(p_i))
        arity = p_i[x].arity[p_i[x].in_type]
        # find eligible replacements based on arity and type
        reps = [n for n in func_set+term_set
                if n.arity[n.in_type]==arity and n.out_type==p_i[x].out_type
                and n.in_type==p_i[x].in_type]

        tmp = reps[self.random_state.randint(len(reps))]
        tmp_p = p_i[:]
        p_i[x] = tmp
        if not self.is_valid_program(p_i):
            print("old:",tmp_p)
            print("new:",p_i)
            raise ValueError('Mutation produced an invalid program.')
713092
def register(cls, subclass):
        """"""
        if not isinstance(cls, type):
            raise TypeError("Can only register classes")
        if issubclass(subclass, cls):
            return  # Already a subclass
        # Subtle: test for cycles *after* testing for "already a subclass";
        # this means we allow X.register(X) and interpret it as a no-op.
        if issubclass(cls, subclass):
            # This would create a cycle, which is bad for the algorithm below
            raise RuntimeError("Refusing to create an inheritance cycle")
        cls._abc_registry.add(subclass)
        ABCMeta._abc_invalidation_counter += 1
719363
function(sketch) {
        var canvas = this._getContext(sketch).canvas;
        return new $.Point(canvas.width, canvas.height);
    }
1129872
function create(type, constructor) {
  return function projection() {
    var p = constructor();

    p.type = type;

    p.path = geoPath().projection(p);

    p.copy = p.copy || function() {
      var c = projection();
      projectionProperties.forEach(function(prop) {
        if (p.hasOwnProperty(prop)) c[prop](p[prop]());
      });
      c.path.pointRadius(p.path.pointRadius());
      return c;
    };

    return p;
  };
}
360910
def DEFINE_point(name, default, help):  # pylint: disable=invalid-name,redefined-builtin
  """"""
  flags.DEFINE(PointParser(), name, default, help)
515340
public static final Point add(Point... points)
    {
        AbstractPoint res = new AbstractPoint();
        for (Point pp : points)
        {
            res.x += pp.getX();
            res.y += pp.getY();
        }
        return res;
    }
166409
def pointSize(self, s=None):
        """"""
        if s is not None:
            if isinstance(self, vtk.vtkAssembly):
                cl = vtk.vtkPropCollection()
                self.GetActors(cl)
                cl.InitTraversal()
                a = vtk.vtkActor.SafeDownCast(cl.GetNextProp())
                a.GetProperty().SetRepresentationToPoints()
                a.GetProperty().SetPointSize(s)
            else:
                self.GetProperty().SetRepresentationToPoints()
                self.GetProperty().SetPointSize(s)
        else:
            return self.GetProperty().GetPointSize()
        return self