reads in a node and returns as a tuple: (type, name, points[])
432387
def readObject(self, innode):
        ''''''
        #get name
        names=innode.getElementsByTagName('name')[0].childNodes[0].data.strip()
        
        #get type
        pointType = 'Unknown'
        if len(innode.getElementsByTagName('LineString')) == 0 and len(innode.getElementsByTagName('Point')) == 0:
            pointType = 'Polygon'
        elif len(innode.getElementsByTagName('Polygon')) == 0 and len(innode.getElementsByTagName('Point')) == 0:
            pointType = 'Polygon'
        elif len(innode.getElementsByTagName('LineString')) == 0 and len(innode.getElementsByTagName('Polygon')) == 0:
            pointType = 'Point'
            
        #get coords
        coords = innode.getElementsByTagName('coordinates')[0].childNodes[0].data.strip()
        coordsSplit = coords.split()
        ret_s = []
        for j in coordsSplit:
            jcoord = j.split(',')
            if len(jcoord) == 3 and jcoord[0] != '' and jcoord[1] != '':
                #print("Got lon " + jcoord[0] + " and lat " + jcoord[1])
                ret_s.append((float(jcoord[1]), float(jcoord[0])))
            
        #return tuple
        return (str(pointType), str(names), ret_s)
668478
def read_points(features):
    
    for feature in features:

        if isinstance(feature, (tuple, list)) and len(feature) == 2:
            yield feature

        elif hasattr(feature, '__geo_interface__'):
            # An object implementing the geo_interface
            try:
                # Could be a Feature...
                geom = feature.__geo_interface__['geometry']
                for pt in _geom_points(geom):
                    yield pt
            except KeyError:
                # ... or a geometry directly
                for pt in _geom_points(feature.__geo_interface__):
                    yield pt

        elif 'type' in feature and feature['type'] == 'Feature':
            # A GeoJSON-like mapping
            geom = feature['geometry']
            for pt in _geom_points(geom):
                yield pt

        elif 'coordinates' in feature:
            geom = feature
            for pt in _geom_points(geom):
                yield pt

        else:
            raise InvalidFeatureError(
                "Unknown object: Not a GeoJSON Point feature or "
                "an object with __geo_interface__:\n{0}".format(feature))
1256123
def function_nodes(self):
        

        return {k: v for k, v in self.nodes.items() if v['type'] == 'function'}
16636
def parse(node)
      @list = node.xpath('c:f')[0].text.split('!').first
      coordinates = Coordinates.parser_coordinates_range(node.xpath('c:f')[0].text) # .split('!')[1].gsub('$', ''))
      return self unless coordinates

      node.xpath('c:numCache/c:pt').each_with_index do |point_node, index|
        point = ChartPoint.new(coordinates[index])
        point.value = point_node.xpath('c:v').first.text.to_f unless point_node.xpath('c:v').first.nil?
        @points << point
      end
      self
    end
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
964844
void processSpecialNodeTypes(NodeWithType<?, Type> node, String name) {
        Type type = node.getType();
        if (node instanceof MethodDeclaration && ("newBufferAndOffset".equals(name) || "nextArrayOffset".equals(name))) {
            node.setType(PrimitiveType.intType());
        } else if (PrimitiveType.longType().equals(type)) {
            switch(name) {
            case "offset":
            case "offsetInNew":
            case "offsetInOld":
            case "lookAheadElementOffset":
                node.setType(PrimitiveType.intType());
            }
        } else if (isRefType(type, "LinkedQueueNode")) {
            node.setType(simpleParametricType("LinkedQueueAtomicNode", "E"));
        } else if (isRefArray(type, "E")) {
            node.setType(atomicRefArrayType((ArrayType) type));
        }
    }
846252
def _get_points(self):
        
        return tuple([self._getitem__points(i)
                     for i in range(self._len__points())])
1063343
def read_tuple_ticks(self, symbol, start, end):
        '''  '''
        if end is None:
            end=sys.maxint

        session=self.getReadSession()()
        try:
            rows=session.query(Tick).filter(and_(Tick.symbol == symbol,
                                                      Tick.time >= int(start),
                                                      Tick.time < int(end)))
        finally:
            self.getReadSession().remove()

        return [self.__sqlToTupleTick(row) for row in rows]
840690
def decode_list(self, node, cache, as_map_key):
        
        if node:
            if node[0] == MAP_AS_ARR:
                # key must be decoded before value for caching to work.
                returned_dict = {}
                for k, v in pairs(node[1:]):
                    key = self._decode(k, cache, True)
                    val = self._decode(v, cache, as_map_key)
                    returned_dict[key] = val
                return transit_types.frozendict(returned_dict)

            decoded = self._decode(node[0], cache, as_map_key)
            if isinstance(decoded, Tag):
                return self.decode_tag(decoded.tag,
                                       self._decode(node[1], cache, as_map_key))
        return tuple(self._decode(x, cache, as_map_key) for x in node)
1324753
def read(filename):
    
    import h5py

    f = h5py.File(filename, "r")
    dset = f["tstt"]

    points = dset["nodes"]["coordinates"][()]
    # read point data
    point_data = {}
    if "tags" in dset["nodes"]:
        for name, dataset in dset["nodes"]["tags"].items():
            point_data[name] = dataset[()]

    # # Assert that the GLOBAL_IDs are contiguous.
    # point_gids = dset['nodes']['tags']['GLOBAL_ID'][()]
    # point_start_gid = dset['nodes']['coordinates'].attrs['start_id']
    # point_end_gid = point_start_gid + len(point_gids) - 1
    # assert all(point_gids == range(point_start_gid, point_end_gid + 1))

    h5m_to_meshio_type = {"Edge2": "line", "Tri3": "triangle", "Tet4": "tetra"}
    cells = {}
    cell_data = {}
    for h5m_type, data in dset["elements"].items():
        meshio_type = h5m_to_meshio_type[h5m_type]
        conn = data["connectivity"]
        # Note that the indices are off by 1 in h5m.
        cells[meshio_type] = conn[()] - 1

        # TODO bring cell data back
        # if 'tags' in data:
        #     for name, dataset in data['tags'].items():
        #         cell_data[name] = dataset[()]

    # The `sets` in H5M are special in that they represent a segration of data
    # in the current file, particularly by a load balancer (Metis, Zoltan,
    # etc.). This segregation has no equivalent in other data types, but is
    # certainly worthwhile visualizing.
    # Hence, we will translate the sets into cell data with the prefix "set::"
    # here.
    field_data = {}
    # TODO deal with sets
    # if 'sets' in dset and 'contents' in dset['sets']:
    #     # read sets
    #     sets_contents = dset['sets']['contents'][()]
    #     sets_list = dset['sets']['list'][()]
    #     sets_tags = dset['sets']['tags']

    #     cell_start_gid = conn.attrs['start_id']
    #     cell_gids = cell_start_gid + elems['tags']['GLOBAL_ID'][()]
    #     cell_end_gid = cell_start_gid + len(cell_gids) - 1
    #     assert all(cell_gids == range(cell_start_gid, cell_end_gid + 1))

    #     # create the sets
    #     for key, value in sets_tags.items():
    #         mod_key = 'set::' + key
    #         cell_data[mod_key] = numpy.empty(len(cells), dtype=int)
    #         end = 0
    #         for k, row in enumerate(sets_list):
    #             bits = _int_to_bool_list(row[3])
    #             # is_owner = bits[0]
    #             # is_unique = bits[1]
    #             # is_ordered = bits[2]
    #             is_range_compressed = bits[3]
    #             if is_range_compressed:
    #                 start_gids = sets_contents[end:row[0]+1:2]
    #                 lengths = sets_contents[end+1:row[0]+1:2]
    #                 for start_gid, length in zip(start_gids, lengths):
    #                     end_gid = start_gid + length - 1
    #                     if start_gid >= cell_start_gid and \
    #                             end_gid <= cell_end_gid:
    #                         i0 = start_gid - cell_start_gid
    #                         i1 = end_gid - cell_start_gid + 1
    #                         cell_data[mod_key][i0:i1] = value[k]
    #                     else:
    #                         # TODO deal with point data
    #                         raise RuntimeError('')
    #             else:
    #                 gids = sets_contents[end:row[0]+1]
    #                 cell_data[mod_key][gids - cell_start_gid] = value[k]

    #             end = row[0] + 1

    return Mesh(
        points, cells, point_data=point_data, cell_data=cell_data, field_data=field_data
    )
1127804
def read_connections(file_name, point_names):
    """"""

    connections = []
    fid = open(file_name, 'r')
    line=fid.readline()
    while(line):
        connections.append(np.array(line.split(',')))
        connections[-1][0] = connections[-1][0].strip()
        connections[-1][1] = connections[-1][1].strip()
        line = fid.readline()
    connect = np.zeros((len(point_names), len(point_names)),dtype=bool)
    for i in range(len(point_names)):
        for j in range(len(point_names)):
            for k in range(len(connections)):
                if connections[k][0] == point_names[i] and connections[k][1] == point_names[j]:
                    
                    connect[i,j]=True
                    connect[j,i]=True
                    break
    
    return connect
350331
def get_nodes(self, request, *args, **kwargs):
        
        # ListSerializerMixin.list returns a serializer object
        return (self.list(request, *args, **kwargs)).data
493186
def scan_in_memory(node, env, path=()):
    
    try:
        entries = node.entries
    except AttributeError:
        # It's not a Node.FS.Dir (or doesn't look enough like one for
        # our purposes), which can happen if a target list containing
        # mixed Node types (Dirs and Files, for example) has a Dir as
        # the first entry.
        return []
    entry_list = sorted(filter(do_not_scan, list(entries.keys())))
    return [entries[n] for n in entry_list]
761037
def read_nodes(rows, source_id=1):
    

    ncbi_keys = ['tax_id', 'parent_id', 'rank', 'embl_code', 'division_id']
    extra_keys = ['source_id', 'is_valid']
    is_valid = True

    ncbi_cols = len(ncbi_keys)

    rank = ncbi_keys.index('rank')
    parent_id = ncbi_keys.index('parent_id')

    # assumes the first row is the root
    row = next(rows)
    row[rank] = 'root'
    # parent must be None for termination of recursive CTE for
    # calculating lineages
    row[parent_id] = None
    rows = itertools.chain([row], rows)

    yield ncbi_keys + extra_keys

    for row in rows:
        # replace whitespace in "rank" with underscore
        row[rank] = '_'.join(row[rank].split())
        # provide default values for source_id and is_valid
        yield row[:ncbi_cols] + [source_id, is_valid]
818990
def __get_values(self):
        
        array = self._get_target().getDataArray()
        return tuple(itertools.chain.from_iterable(array))
466433
def load(self, read_tuple_name):
        
        self.prefix_width = 0
        self.read_tuple_id_width = 0
        self.genome_id_width = 0
        self.chr_id_width = 0
        self.coor_width = 0

        parts = read_tuple_name.split("__")
        self.prefix_width = len(parts[0])
        self.read_tuple_id_width = len(parts[1])

        segments = parts[2][1:-1].split("),(")
        for segment in segments:
            int_widths = list(map(len, segment.split(",")))
            self.genome_id_width = max(self.genome_id_width, int_widths[0])
            self.chr_id_width = max(self.chr_id_width, int_widths[1])
            self.coor_width = max(self.coor_width, int_widths[2], int_widths[3])
197279
@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
	private E readPolyElement(int elementIndex, ShapeElementType type) throws IOException {
		final boolean hasZ = type.hasZ();
		final boolean hasM = type.hasM();

		// Ignore the bounds stored inside the file
		skipBytes(8 * 4);

		// Count of parts
		final int numParts;
		if (type == ShapeElementType.MULTIPOINT || type == ShapeElementType.MULTIPOINT_Z
				|| type == ShapeElementType.MULTIPOINT_M) {
			numParts = 0;
		} else {
			numParts = readLEInt();
		}

		// Count of points
		final int numPoints = readLEInt();

		// Read the parts' indexes
		final int[] parts = new int[numParts];
		for (int idxParts = 0; idxParts < numParts; ++idxParts) {
			parts[idxParts] = readLEInt();
		}

		// Read the points
		final ESRIPoint[] points = new ESRIPoint[numPoints];

		for (int idxPoints = 0; idxPoints < numPoints; ++idxPoints) {
			// Read coordinates
			final double x = fromESRI_x(readLEDouble());
			final double y = fromESRI_y(readLEDouble());

			// Create point
			if (!Double.isNaN(x) && !Double.isNaN(y)) {
				points[idxPoints] = new ESRIPoint(x, y);
			} else {
				throw new ShapeFileException("invalid (x,y) coordinates"); //$NON-NLS-1$
			}
		} // for i= 0 to numPoints

		if (hasZ) {
			// Zmin and Zmax: 2*Double - ignored
			skipBytes(2 * 8);
			// Z array: numpoints*Double
			double z;
			for (int i = 0; i < numPoints; ++i) {
				z = fromESRI_z(readLEDouble());
				if (!Double.isNaN(z)) {
					points[i].setZ(z);
				}
			}
		}

		if (hasM) {
			// Mmin and Mmax: 2*Double - ignored
			skipBytes(2 * 8);
			// M array: numpoints*Double
			double measure;
			for (int i = 0; i < numPoints; ++i) {
				measure = fromESRI_m(readLEDouble());
				if (!Double.isNaN(measure)) {
					points[i].setM(measure);
				}
			}
		}

		// Create the instance of the element
		E newElement = null;
		switch (type) {
		case POLYGON_Z:
		case POLYGON_M:
		case POLYGON:
			newElement = createPolygon(createAttributeCollection(elementIndex), elementIndex, parts, points, hasZ);
			break;
		case POLYLINE_Z:
		case POLYLINE_M:
		case POLYLINE:
			newElement = createPolyline(createAttributeCollection(elementIndex), elementIndex, parts, points, hasZ);
			break;
		case MULTIPOINT:
		case MULTIPOINT_M:
		case MULTIPOINT_Z:
			newElement = createMultiPoint(createAttributeCollection(elementIndex), elementIndex, points, hasZ);
			break;
			//$CASES-OMITTED$
		default:
		}

		return newElement;
	}