Allocate memory for a new run and return a reference to that memory
        wrapped in an array of size ``(new_points_len, self.dim)``.

        :param new_points_len:

            Integer; the number of points to be stored in the target memory.
510583
def append(self, new_points_len):
        '''

        '''
        new_points_len = int(new_points_len)
        assert new_points_len >= 1, "Must at least append one point!"

        # find out start and stop index of the new memory
        try:
            new_points_start = self._slice_for_run_nr[-1][-1]
        except IndexError:
            new_points_start = 0
        new_points_stop  = new_points_start + new_points_len

        # store slice for new_points
        self._slice_for_run_nr.append( (new_points_start , new_points_stop) )

        if self.memleft < new_points_len: #need to allocate new memory
            self.memleft = 0
            #careful: do not use self._points because this may include unused memory
            self._points  = _np.vstack(  (self[:],_np.empty((new_points_len, self.dim)))  )
        else: #have enough memory
            self.memleft -= new_points_len

        # return reference to the new points
        return self._points[new_points_start:new_points_stop]
719580
def createRandomObjects(self,
                          numObjects,
                          numPoints,
                          numLocations=None,
                          numFeatures=None):
    
    if numObjects > 0:
      if numLocations is None:
        numLocations = numPoints
      if numFeatures is None:
        numFeatures = numPoints

      assert(numPoints <= numLocations), ("Number of points in object cannot be "
            "greater than number of locations")

      locationArray = numpy.array(range(numLocations))
      numpy.random.seed(self.seed)
      for _ in xrange(numObjects):
        # Permute the number of locations and select points from it
        locationArray = numpy.random.permutation(locationArray)
        self.addObject(
          [(locationArray[p],
            numpy.random.randint(0, numFeatures)) for p in xrange(numPoints)],
        )
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;
    }
633738
def _alloc(self):
        
        nzeros = [0] * self.n
        for var in self._states:
            self.__dict__[var] = nzeros[:]
        for var in self._algebs:
            self.__dict__[var] = nzeros[:]
647646
def points(self):
        ''''''
        if self._points is None:
            _points = self.soma.points.tolist()
            for n in self.neurites:
                _points.extend(n.points.tolist())
            self._points = np.array(_points)

        return self._points
193327
def points(self):
        ''''''
        # add all points in a section except the first one, which is a duplicate
        _pts = [v for s in self.root_node.ipreorder()
                for v in s.points[1:, COLS.XYZR]]
        # except for the very first point, which is not a duplicate
        _pts.insert(0, self.root_node.points[0][COLS.XYZR])
        return np.array(_pts)
1328361
private FileEntry allocate(int len) {
      synchronized (freeList) {
         // lookup a free entry of sufficient size
         SortedSet<FileEntry> candidates = freeList.tailSet(new FileEntry(0, len));
         for (Iterator<FileEntry> it = candidates.iterator(); it.hasNext(); ) {
            FileEntry free = it.next();
            // ignore entries that are still in use by concurrent readers
            if (free.isLocked())
               continue;

            // There's no race condition risk between locking the entry on
            // loading and checking whether it's locked (or store allocation),
            // because for the entry to be lockable, it needs to be in the
            // entries collection, in which case it's not in the free list.
            // The only way an entry can be found in the free list is if it's
            // been removed, and to remove it, lock on "entries" needs to be
            // acquired, which is also a pre-requisite for loading data.

            // found one, remove from freeList
            it.remove();
            return allocateExistingEntry(free, len);
         }

         // no appropriate free section available, append at end of file
         FileEntry fe = new FileEntry(filePos, len);
         filePos += len;
         if (trace) log.tracef("New entry allocated at %d:%d, %d free entries, file size is %d", fe.offset, fe.size, freeList.size(), filePos);
         return fe;
      }
   }
1289470
def get_data_point(self, n):
        
        # loop over the columns and pop the data
        point = []
        for k in self.ckeys: point.append(self[k][n])
        return point
218483
def add(self, datapoint):
        
        if not self.is_full:
            self.set_datapoint(self.cur_index, datapoint)
            self.cur_index += 1
25309
final void addPointer(int keyPos, int keySize, int valuePos, int valueSize) {
    assert keyPos + keySize == valuePos;
    int start = memoryBuffer.limit() - POINTER_SIZE_BYTES;
    memoryBuffer.putInt(start, keyPos);
    memoryBuffer.putInt(start + 4, valuePos);
    memoryBuffer.putInt(start + 8, valueSize);
    memoryBuffer.limit(start);
    valuesHeld++;
  }
816143
def add_point(self, point):
        
        assert isinstance(point, GeoPoint), \
            'point should be GeoPoint instance'
        point_hash = self.get_point_hash(point)
        points = self.data.setdefault(point_hash, [])
        points.append(point)
428826
def allocate(vertices_resources, nets, machine, constraints, placements):
    
    allocation = {}

    # Globally reserved resource ranges {resource, [slice, ...], ...}
    globally_reserved = defaultdict(list)
    # Locally reserved resource ranges {(x, y): {resource, [slice, ...], ...}}
    locally_reserved = defaultdict(lambda: defaultdict(list))

    # Alignment of each resource
    alignments = defaultdict(lambda: 1)

    # Collect constraints
    for constraint in constraints:
        if isinstance(constraint, ReserveResourceConstraint):
            if constraint.location is None:
                globally_reserved[constraint.resource].append(
                    constraint.reservation)
            else:
                locally_reserved[constraint.location][
                    constraint.resource].append(constraint.reservation)
        elif isinstance(constraint, AlignResourceConstraint):
            alignments[constraint.resource] = constraint.alignment

    # A dictionary {(x, y): [vertex, ...], ...}
    chip_contents = defaultdict(list)
    for vertex, xy in iteritems(placements):
        chip_contents[xy].append(vertex)

    for xy, chip_vertices in iteritems(chip_contents):
        # Index of the next free resource in the current chip
        resource_pointers = {resource: 0
                             for resource in machine.chip_resources}

        for vertex in chip_vertices:
            vertex_allocation = {}

            # Make allocations, advancing resource pointers
            for resource, requirement in iteritems(vertices_resources[vertex]):
                proposed_allocation = None
                proposal_overlaps = True
                while proposal_overlaps:
                    # Check that the proposed allocation doesn't overlap a
                    # reserved area.
                    start = align(resource_pointers[resource],
                                  alignments[resource])
                    proposed_allocation = slice(start, start + requirement)
                    proposal_overlaps = False
                    if proposed_allocation.stop > machine[xy][resource]:
                        raise InsufficientResourceError(
                            "{} over-allocated on chip {}".format(resource,
                                                                  xy))
                    for reservation in globally_reserved[resource]:
                        if slices_overlap(proposed_allocation, reservation):
                            resource_pointers[resource] = reservation.stop
                            proposal_overlaps = True
                    local_reservations \
                        = locally_reserved.get(xy, {}).get(resource, [])
                    for reservation in local_reservations:
                        if slices_overlap(proposed_allocation, reservation):
                            resource_pointers[resource] = reservation.stop
                            proposal_overlaps = True

                # Getting here means the proposed allocation is not blocked
                # by any reservations
                vertex_allocation[resource] = proposed_allocation
                resource_pointers[resource] = proposed_allocation.stop

            allocation[vertex] = vertex_allocation

    return allocation
863579
def send_point_data(events, additional):
    
    bodies = {}
    for (site, content_id), count in events.items():
        if not len(site) or not len(content_id):
            continue

        # influxdb will take an array of arrays of values, cutting down on the number of requests
        # needed to be sent to it wo write data
        bodies.setdefault(site, [])

        # get additional info
        event, path = additional.get((site, content_id), (None, None))

        # append the point
        bodies[site].append([content_id, event, path, count])

    for site, points in bodies.items():
        # send payload to influxdb
        try:
            data = [{
                "name": site,
                "columns": ["content_id", "event", "path", "value"],
                "points": points,
            }]
            INFLUXDB_CLIENT.write_points(data)
        except Exception as e:
            LOGGER.exception(e)
580148
def _iterPoints(self, **kwargs):
        
        points = self.points
        count = len(points)
        index = 0
        while count:
            yield points[index]
            count -= 1
            index += 1
1183976
def isel_points(self, dim='points', **indexers):
        
        ds = self._to_temp_dataset().isel_points(dim=dim, **indexers)
        return self._from_temp_dataset(ds)
595366
def point_lm(self, context):
        
        lm = np.empty(context.shape, context.dtype)

        # Print the array schema
        montblanc.log.info(context.array_schema.shape)
        # Print the space of iteration
        montblanc.log.info(context.iter_args)

        (ls, us) = context.dim_extents('npsrc')

        lm[:,0] = 0.0008
        lm[:,1] = 0.0036

        lm[:,:] = 0
        return lm
215422
def sel_points(self, dim='points', method=None, tolerance=None,
                   **indexers):
        
        ds = self._to_temp_dataset().sel_points(
            dim=dim, method=method, tolerance=tolerance, **indexers)
        return self._from_temp_dataset(ds)