Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
OGRGeometry._set_coord_dim | (self, dim) | Sets the coordinate dimension of this Geometry. | Sets the coordinate dimension of this Geometry. | def _set_coord_dim(self, dim):
"Sets the coordinate dimension of this Geometry."
if dim not in (2, 3):
raise ValueError('Geometry dimension must be either 2 or 3')
capi.set_coord_dim(self.ptr, dim) | [
"def",
"_set_coord_dim",
"(",
"self",
",",
"dim",
")",
":",
"if",
"dim",
"not",
"in",
"(",
"2",
",",
"3",
")",
":",
"raise",
"ValueError",
"(",
"'Geometry dimension must be either 2 or 3'",
")",
"capi",
".",
"set_coord_dim",
"(",
"self",
".",
"ptr",
",",
... | [
201,
4
] | [
205,
41
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.geom_count | (self) | The number of elements in this Geometry. | The number of elements in this Geometry. | def geom_count(self):
"The number of elements in this Geometry."
return capi.get_geom_count(self.ptr) | [
"def",
"geom_count",
"(",
"self",
")",
":",
"return",
"capi",
".",
"get_geom_count",
"(",
"self",
".",
"ptr",
")"
] | [
210,
4
] | [
212,
44
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.point_count | (self) | Returns the number of Points in this Geometry. | Returns the number of Points in this Geometry. | def point_count(self):
"Returns the number of Points in this Geometry."
return capi.get_point_count(self.ptr) | [
"def",
"point_count",
"(",
"self",
")",
":",
"return",
"capi",
".",
"get_point_count",
"(",
"self",
".",
"ptr",
")"
] | [
215,
4
] | [
217,
45
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.num_points | (self) | Alias for `point_count` (same name method in GEOS API.) | Alias for `point_count` (same name method in GEOS API.) | def num_points(self):
"Alias for `point_count` (same name method in GEOS API.)"
return self.point_count | [
"def",
"num_points",
"(",
"self",
")",
":",
"return",
"self",
".",
"point_count"
] | [
220,
4
] | [
222,
31
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.num_coords | (self) | Alais for `point_count`. | Alais for `point_count`. | def num_coords(self):
"Alais for `point_count`."
return self.point_count | [
"def",
"num_coords",
"(",
"self",
")",
":",
"return",
"self",
".",
"point_count"
] | [
225,
4
] | [
227,
31
] | python | en | ['fr', 'en', 'en'] | True |
OGRGeometry.geom_type | (self) | Returns the Type for this Geometry. | Returns the Type for this Geometry. | def geom_type(self):
"Returns the Type for this Geometry."
return OGRGeomType(capi.get_geom_type(self.ptr)) | [
"def",
"geom_type",
"(",
"self",
")",
":",
"return",
"OGRGeomType",
"(",
"capi",
".",
"get_geom_type",
"(",
"self",
".",
"ptr",
")",
")"
] | [
230,
4
] | [
232,
56
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.geom_name | (self) | Returns the Name of this Geometry. | Returns the Name of this Geometry. | def geom_name(self):
"Returns the Name of this Geometry."
return capi.get_geom_name(self.ptr) | [
"def",
"geom_name",
"(",
"self",
")",
":",
"return",
"capi",
".",
"get_geom_name",
"(",
"self",
".",
"ptr",
")"
] | [
235,
4
] | [
237,
43
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.area | (self) | Returns the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise. | Returns the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise. | def area(self):
"Returns the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise."
return capi.get_area(self.ptr) | [
"def",
"area",
"(",
"self",
")",
":",
"return",
"capi",
".",
"get_area",
"(",
"self",
".",
"ptr",
")"
] | [
240,
4
] | [
242,
38
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.envelope | (self) | Returns the envelope for this Geometry. | Returns the envelope for this Geometry. | def envelope(self):
"Returns the envelope for this Geometry."
# TODO: Fix Envelope() for Point geometries.
return Envelope(capi.get_envelope(self.ptr, byref(OGREnvelope()))) | [
"def",
"envelope",
"(",
"self",
")",
":",
"# TODO: Fix Envelope() for Point geometries.",
"return",
"Envelope",
"(",
"capi",
".",
"get_envelope",
"(",
"self",
".",
"ptr",
",",
"byref",
"(",
"OGREnvelope",
"(",
")",
")",
")",
")"
] | [
245,
4
] | [
248,
74
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.extent | (self) | Returns the envelope as a 4-tuple, instead of as an Envelope object. | Returns the envelope as a 4-tuple, instead of as an Envelope object. | def extent(self):
"Returns the envelope as a 4-tuple, instead of as an Envelope object."
return self.envelope.tuple | [
"def",
"extent",
"(",
"self",
")",
":",
"return",
"self",
".",
"envelope",
".",
"tuple"
] | [
255,
4
] | [
257,
34
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry._get_srs | (self) | Returns the Spatial Reference for this Geometry. | Returns the Spatial Reference for this Geometry. | def _get_srs(self):
"Returns the Spatial Reference for this Geometry."
try:
srs_ptr = capi.get_geom_srs(self.ptr)
return SpatialReference(srs_api.clone_srs(srs_ptr))
except SRSException:
return None | [
"def",
"_get_srs",
"(",
"self",
")",
":",
"try",
":",
"srs_ptr",
"=",
"capi",
".",
"get_geom_srs",
"(",
"self",
".",
"ptr",
")",
"return",
"SpatialReference",
"(",
"srs_api",
".",
"clone_srs",
"(",
"srs_ptr",
")",
")",
"except",
"SRSException",
":",
"ret... | [
262,
4
] | [
268,
23
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry._set_srs | (self, srs) | Sets the SpatialReference for this geometry. | Sets the SpatialReference for this geometry. | def _set_srs(self, srs):
"Sets the SpatialReference for this geometry."
# Do not have to clone the `SpatialReference` object pointer because
# when it is assigned to this `OGRGeometry` it's internal OGR
# reference count is incremented, and will likewise be released
# (decremente... | [
"def",
"_set_srs",
"(",
"self",
",",
"srs",
")",
":",
"# Do not have to clone the `SpatialReference` object pointer because",
"# when it is assigned to this `OGRGeometry` it's internal OGR",
"# reference count is incremented, and will likewise be released",
"# (decremented) when this geometry'... | [
270,
4
] | [
285,
42
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.geos | (self) | Returns a GEOSGeometry object from this OGRGeometry. | Returns a GEOSGeometry object from this OGRGeometry. | def geos(self):
"Returns a GEOSGeometry object from this OGRGeometry."
from django.contrib.gis.geos import GEOSGeometry
return GEOSGeometry(self._geos_ptr(), self.srid) | [
"def",
"geos",
"(",
"self",
")",
":",
"from",
"django",
".",
"contrib",
".",
"gis",
".",
"geos",
"import",
"GEOSGeometry",
"return",
"GEOSGeometry",
"(",
"self",
".",
"_geos_ptr",
"(",
")",
",",
"self",
".",
"srid",
")"
] | [
310,
4
] | [
313,
56
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.gml | (self) | Returns the GML representation of the Geometry. | Returns the GML representation of the Geometry. | def gml(self):
"Returns the GML representation of the Geometry."
return capi.to_gml(self.ptr) | [
"def",
"gml",
"(",
"self",
")",
":",
"return",
"capi",
".",
"to_gml",
"(",
"self",
".",
"ptr",
")"
] | [
316,
4
] | [
318,
36
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.hex | (self) | Returns the hexadecimal representation of the WKB (a string). | Returns the hexadecimal representation of the WKB (a string). | def hex(self):
"Returns the hexadecimal representation of the WKB (a string)."
return b2a_hex(self.wkb).upper() | [
"def",
"hex",
"(",
"self",
")",
":",
"return",
"b2a_hex",
"(",
"self",
".",
"wkb",
")",
".",
"upper",
"(",
")"
] | [
321,
4
] | [
323,
40
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.json | (self) |
Returns the GeoJSON representation of this Geometry.
|
Returns the GeoJSON representation of this Geometry.
| def json(self):
"""
Returns the GeoJSON representation of this Geometry.
"""
return capi.to_json(self.ptr) | [
"def",
"json",
"(",
"self",
")",
":",
"return",
"capi",
".",
"to_json",
"(",
"self",
".",
"ptr",
")"
] | [
326,
4
] | [
330,
37
] | python | en | ['en', 'error', 'th'] | False |
OGRGeometry.kml | (self) | Returns the KML representation of the Geometry. | Returns the KML representation of the Geometry. | def kml(self):
"Returns the KML representation of the Geometry."
return capi.to_kml(self.ptr, None) | [
"def",
"kml",
"(",
"self",
")",
":",
"return",
"capi",
".",
"to_kml",
"(",
"self",
".",
"ptr",
",",
"None",
")"
] | [
334,
4
] | [
336,
42
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.wkb_size | (self) | Returns the size of the WKB buffer. | Returns the size of the WKB buffer. | def wkb_size(self):
"Returns the size of the WKB buffer."
return capi.get_wkbsize(self.ptr) | [
"def",
"wkb_size",
"(",
"self",
")",
":",
"return",
"capi",
".",
"get_wkbsize",
"(",
"self",
".",
"ptr",
")"
] | [
339,
4
] | [
341,
41
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.wkb | (self) | Returns the WKB representation of the Geometry. | Returns the WKB representation of the Geometry. | def wkb(self):
"Returns the WKB representation of the Geometry."
if sys.byteorder == 'little':
byteorder = 1 # wkbNDR (from ogr_core.h)
else:
byteorder = 0 # wkbXDR
sz = self.wkb_size
# Creating the unsigned character buffer, and passing it in by referen... | [
"def",
"wkb",
"(",
"self",
")",
":",
"if",
"sys",
".",
"byteorder",
"==",
"'little'",
":",
"byteorder",
"=",
"1",
"# wkbNDR (from ogr_core.h)",
"else",
":",
"byteorder",
"=",
"0",
"# wkbXDR",
"sz",
"=",
"self",
".",
"wkb_size",
"# Creating the unsigned charact... | [
344,
4
] | [
355,
49
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.wkt | (self) | Returns the WKT representation of the Geometry. | Returns the WKT representation of the Geometry. | def wkt(self):
"Returns the WKT representation of the Geometry."
return capi.to_wkt(self.ptr, byref(c_char_p())) | [
"def",
"wkt",
"(",
"self",
")",
":",
"return",
"capi",
".",
"to_wkt",
"(",
"self",
".",
"ptr",
",",
"byref",
"(",
"c_char_p",
"(",
")",
")",
")"
] | [
358,
4
] | [
360,
55
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.ewkt | (self) | Returns the EWKT representation of the Geometry. | Returns the EWKT representation of the Geometry. | def ewkt(self):
"Returns the EWKT representation of the Geometry."
srs = self.srs
if srs and srs.srid:
return 'SRID=%s;%s' % (srs.srid, self.wkt)
else:
return self.wkt | [
"def",
"ewkt",
"(",
"self",
")",
":",
"srs",
"=",
"self",
".",
"srs",
"if",
"srs",
"and",
"srs",
".",
"srid",
":",
"return",
"'SRID=%s;%s'",
"%",
"(",
"srs",
".",
"srid",
",",
"self",
".",
"wkt",
")",
"else",
":",
"return",
"self",
".",
"wkt"
] | [
363,
4
] | [
369,
27
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.clone | (self) | Clones this OGR Geometry. | Clones this OGR Geometry. | def clone(self):
"Clones this OGR Geometry."
return OGRGeometry(capi.clone_geom(self.ptr), self.srs) | [
"def",
"clone",
"(",
"self",
")",
":",
"return",
"OGRGeometry",
"(",
"capi",
".",
"clone_geom",
"(",
"self",
".",
"ptr",
")",
",",
"self",
".",
"srs",
")"
] | [
372,
4
] | [
374,
63
] | python | en | ['en', 'id', 'en'] | True |
OGRGeometry.close_rings | (self) |
If there are any rings within this geometry that have not been
closed, this routine will do so by adding the starting point at the
end.
|
If there are any rings within this geometry that have not been
closed, this routine will do so by adding the starting point at the
end.
| def close_rings(self):
"""
If there are any rings within this geometry that have not been
closed, this routine will do so by adding the starting point at the
end.
"""
# Closing the open rings.
capi.geom_close_rings(self.ptr) | [
"def",
"close_rings",
"(",
"self",
")",
":",
"# Closing the open rings.",
"capi",
".",
"geom_close_rings",
"(",
"self",
".",
"ptr",
")"
] | [
376,
4
] | [
383,
39
] | python | en | ['en', 'error', 'th'] | False |
OGRGeometry.transform | (self, coord_trans, clone=False) |
Transforms this geometry to a different spatial reference system.
May take a CoordTransform object, a SpatialReference object, string
WKT or PROJ.4, and/or an integer SRID. By default nothing is returned
and the geometry is transformed in-place. However, if the `clone`
keyword... |
Transforms this geometry to a different spatial reference system.
May take a CoordTransform object, a SpatialReference object, string
WKT or PROJ.4, and/or an integer SRID. By default nothing is returned
and the geometry is transformed in-place. However, if the `clone`
keyword... | def transform(self, coord_trans, clone=False):
"""
Transforms this geometry to a different spatial reference system.
May take a CoordTransform object, a SpatialReference object, string
WKT or PROJ.4, and/or an integer SRID. By default nothing is returned
and the geometry is tran... | [
"def",
"transform",
"(",
"self",
",",
"coord_trans",
",",
"clone",
"=",
"False",
")",
":",
"if",
"clone",
":",
"klone",
"=",
"self",
".",
"clone",
"(",
")",
"klone",
".",
"transform",
"(",
"coord_trans",
")",
"return",
"klone",
"# Depending on the input ty... | [
385,
4
] | [
410,
77
] | python | en | ['en', 'error', 'th'] | False |
OGRGeometry._topology | (self, func, other) | A generalized function for topology operations, takes a GDAL function and
the other geometry to perform the operation on. | A generalized function for topology operations, takes a GDAL function and
the other geometry to perform the operation on. | def _topology(self, func, other):
"""A generalized function for topology operations, takes a GDAL function and
the other geometry to perform the operation on."""
if not isinstance(other, OGRGeometry):
raise TypeError('Must use another OGRGeometry object for topology operations!')
... | [
"def",
"_topology",
"(",
"self",
",",
"func",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"OGRGeometry",
")",
":",
"raise",
"TypeError",
"(",
"'Must use another OGRGeometry object for topology operations!'",
")",
"# Returning the output of th... | [
413,
4
] | [
421,
40
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.intersects | (self, other) | Returns True if this geometry intersects with the other. | Returns True if this geometry intersects with the other. | def intersects(self, other):
"Returns True if this geometry intersects with the other."
return self._topology(capi.ogr_intersects, other) | [
"def",
"intersects",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_topology",
"(",
"capi",
".",
"ogr_intersects",
",",
"other",
")"
] | [
423,
4
] | [
425,
57
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.equals | (self, other) | Returns True if this geometry is equivalent to the other. | Returns True if this geometry is equivalent to the other. | def equals(self, other):
"Returns True if this geometry is equivalent to the other."
return self._topology(capi.ogr_equals, other) | [
"def",
"equals",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_topology",
"(",
"capi",
".",
"ogr_equals",
",",
"other",
")"
] | [
427,
4
] | [
429,
53
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.disjoint | (self, other) | Returns True if this geometry and the other are spatially disjoint. | Returns True if this geometry and the other are spatially disjoint. | def disjoint(self, other):
"Returns True if this geometry and the other are spatially disjoint."
return self._topology(capi.ogr_disjoint, other) | [
"def",
"disjoint",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_topology",
"(",
"capi",
".",
"ogr_disjoint",
",",
"other",
")"
] | [
431,
4
] | [
433,
55
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.touches | (self, other) | Returns True if this geometry touches the other. | Returns True if this geometry touches the other. | def touches(self, other):
"Returns True if this geometry touches the other."
return self._topology(capi.ogr_touches, other) | [
"def",
"touches",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_topology",
"(",
"capi",
".",
"ogr_touches",
",",
"other",
")"
] | [
435,
4
] | [
437,
54
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.crosses | (self, other) | Returns True if this geometry crosses the other. | Returns True if this geometry crosses the other. | def crosses(self, other):
"Returns True if this geometry crosses the other."
return self._topology(capi.ogr_crosses, other) | [
"def",
"crosses",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_topology",
"(",
"capi",
".",
"ogr_crosses",
",",
"other",
")"
] | [
439,
4
] | [
441,
54
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.within | (self, other) | Returns True if this geometry is within the other. | Returns True if this geometry is within the other. | def within(self, other):
"Returns True if this geometry is within the other."
return self._topology(capi.ogr_within, other) | [
"def",
"within",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_topology",
"(",
"capi",
".",
"ogr_within",
",",
"other",
")"
] | [
443,
4
] | [
445,
53
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.contains | (self, other) | Returns True if this geometry contains the other. | Returns True if this geometry contains the other. | def contains(self, other):
"Returns True if this geometry contains the other."
return self._topology(capi.ogr_contains, other) | [
"def",
"contains",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_topology",
"(",
"capi",
".",
"ogr_contains",
",",
"other",
")"
] | [
447,
4
] | [
449,
55
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.overlaps | (self, other) | Returns True if this geometry overlaps the other. | Returns True if this geometry overlaps the other. | def overlaps(self, other):
"Returns True if this geometry overlaps the other."
return self._topology(capi.ogr_overlaps, other) | [
"def",
"overlaps",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_topology",
"(",
"capi",
".",
"ogr_overlaps",
",",
"other",
")"
] | [
451,
4
] | [
453,
55
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry._geomgen | (self, gen_func, other=None) | A helper routine for the OGR routines that generate geometries. | A helper routine for the OGR routines that generate geometries. | def _geomgen(self, gen_func, other=None):
"A helper routine for the OGR routines that generate geometries."
if isinstance(other, OGRGeometry):
return OGRGeometry(gen_func(self.ptr, other.ptr), self.srs)
else:
return OGRGeometry(gen_func(self.ptr), self.srs) | [
"def",
"_geomgen",
"(",
"self",
",",
"gen_func",
",",
"other",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"OGRGeometry",
")",
":",
"return",
"OGRGeometry",
"(",
"gen_func",
"(",
"self",
".",
"ptr",
",",
"other",
".",
"ptr",
")",
",... | [
456,
4
] | [
461,
60
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.boundary | (self) | Returns the boundary of this geometry. | Returns the boundary of this geometry. | def boundary(self):
"Returns the boundary of this geometry."
return self._geomgen(capi.get_boundary) | [
"def",
"boundary",
"(",
"self",
")",
":",
"return",
"self",
".",
"_geomgen",
"(",
"capi",
".",
"get_boundary",
")"
] | [
464,
4
] | [
466,
47
] | python | en | ['en', 'en', 'en'] | True |
OGRGeometry.convex_hull | (self) |
Returns the smallest convex Polygon that contains all the points in
this Geometry.
|
Returns the smallest convex Polygon that contains all the points in
this Geometry.
| def convex_hull(self):
"""
Returns the smallest convex Polygon that contains all the points in
this Geometry.
"""
return self._geomgen(capi.geom_convex_hull) | [
"def",
"convex_hull",
"(",
"self",
")",
":",
"return",
"self",
".",
"_geomgen",
"(",
"capi",
".",
"geom_convex_hull",
")"
] | [
469,
4
] | [
474,
51
] | python | en | ['en', 'error', 'th'] | False |
OGRGeometry.difference | (self, other) |
Returns a new geometry consisting of the region which is the difference
of this geometry and the other.
|
Returns a new geometry consisting of the region which is the difference
of this geometry and the other.
| def difference(self, other):
"""
Returns a new geometry consisting of the region which is the difference
of this geometry and the other.
"""
return self._geomgen(capi.geom_diff, other) | [
"def",
"difference",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_geomgen",
"(",
"capi",
".",
"geom_diff",
",",
"other",
")"
] | [
476,
4
] | [
481,
51
] | python | en | ['en', 'error', 'th'] | False |
OGRGeometry.intersection | (self, other) |
Returns a new geometry consisting of the region of intersection of this
geometry and the other.
|
Returns a new geometry consisting of the region of intersection of this
geometry and the other.
| def intersection(self, other):
"""
Returns a new geometry consisting of the region of intersection of this
geometry and the other.
"""
return self._geomgen(capi.geom_intersection, other) | [
"def",
"intersection",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_geomgen",
"(",
"capi",
".",
"geom_intersection",
",",
"other",
")"
] | [
483,
4
] | [
488,
59
] | python | en | ['en', 'error', 'th'] | False |
OGRGeometry.sym_difference | (self, other) |
Returns a new geometry which is the symmetric difference of this
geometry and the other.
|
Returns a new geometry which is the symmetric difference of this
geometry and the other.
| def sym_difference(self, other):
"""
Returns a new geometry which is the symmetric difference of this
geometry and the other.
"""
return self._geomgen(capi.geom_sym_diff, other) | [
"def",
"sym_difference",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_geomgen",
"(",
"capi",
".",
"geom_sym_diff",
",",
"other",
")"
] | [
490,
4
] | [
495,
55
] | python | en | ['en', 'error', 'th'] | False |
OGRGeometry.union | (self, other) |
Returns a new geometry consisting of the region which is the union of
this geometry and the other.
|
Returns a new geometry consisting of the region which is the union of
this geometry and the other.
| def union(self, other):
"""
Returns a new geometry consisting of the region which is the union of
this geometry and the other.
"""
return self._geomgen(capi.geom_union, other) | [
"def",
"union",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_geomgen",
"(",
"capi",
".",
"geom_union",
",",
"other",
")"
] | [
497,
4
] | [
502,
52
] | python | en | ['en', 'error', 'th'] | False |
Point.x | (self) | Returns the X coordinate for this Point. | Returns the X coordinate for this Point. | def x(self):
"Returns the X coordinate for this Point."
return capi.getx(self.ptr, 0) | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"capi",
".",
"getx",
"(",
"self",
".",
"ptr",
",",
"0",
")"
] | [
517,
4
] | [
519,
37
] | python | en | ['en', 'en', 'en'] | True |
Point.y | (self) | Returns the Y coordinate for this Point. | Returns the Y coordinate for this Point. | def y(self):
"Returns the Y coordinate for this Point."
return capi.gety(self.ptr, 0) | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"capi",
".",
"gety",
"(",
"self",
".",
"ptr",
",",
"0",
")"
] | [
522,
4
] | [
524,
37
] | python | en | ['en', 'en', 'en'] | True |
Point.z | (self) | Returns the Z coordinate for this Point. | Returns the Z coordinate for this Point. | def z(self):
"Returns the Z coordinate for this Point."
if self.coord_dim == 3:
return capi.getz(self.ptr, 0) | [
"def",
"z",
"(",
"self",
")",
":",
"if",
"self",
".",
"coord_dim",
"==",
"3",
":",
"return",
"capi",
".",
"getz",
"(",
"self",
".",
"ptr",
",",
"0",
")"
] | [
527,
4
] | [
530,
41
] | python | en | ['en', 'en', 'en'] | True |
Point.tuple | (self) | Returns the tuple of this point. | Returns the tuple of this point. | def tuple(self):
"Returns the tuple of this point."
if self.coord_dim == 2:
return (self.x, self.y)
elif self.coord_dim == 3:
return (self.x, self.y, self.z) | [
"def",
"tuple",
"(",
"self",
")",
":",
"if",
"self",
".",
"coord_dim",
"==",
"2",
":",
"return",
"(",
"self",
".",
"x",
",",
"self",
".",
"y",
")",
"elif",
"self",
".",
"coord_dim",
"==",
"3",
":",
"return",
"(",
"self",
".",
"x",
",",
"self",
... | [
533,
4
] | [
538,
43
] | python | en | ['en', 'en', 'en'] | True |
LineString.__getitem__ | (self, index) | Returns the Point at the given index. | Returns the Point at the given index. | def __getitem__(self, index):
"Returns the Point at the given index."
if index >= 0 and index < self.point_count:
x, y, z = c_double(), c_double(), c_double()
capi.get_point(self.ptr, index, byref(x), byref(y), byref(z))
dim = self.coord_dim
if dim == 1:
... | [
"def",
"__getitem__",
"(",
"self",
",",
"index",
")",
":",
"if",
"index",
">=",
"0",
"and",
"index",
"<",
"self",
".",
"point_count",
":",
"x",
",",
"y",
",",
"z",
"=",
"c_double",
"(",
")",
",",
"c_double",
"(",
")",
",",
"c_double",
"(",
")",
... | [
544,
4
] | [
557,
70
] | python | en | ['en', 'en', 'en'] | True |
LineString.__iter__ | (self) | Iterates over each point in the LineString. | Iterates over each point in the LineString. | def __iter__(self):
"Iterates over each point in the LineString."
for i in range(self.point_count):
yield self[i] | [
"def",
"__iter__",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"point_count",
")",
":",
"yield",
"self",
"[",
"i",
"]"
] | [
559,
4
] | [
562,
25
] | python | en | ['en', 'en', 'en'] | True |
LineString.__len__ | (self) | The length returns the number of points in the LineString. | The length returns the number of points in the LineString. | def __len__(self):
"The length returns the number of points in the LineString."
return self.point_count | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"self",
".",
"point_count"
] | [
564,
4
] | [
566,
31
] | python | en | ['en', 'en', 'en'] | True |
LineString.tuple | (self) | Returns the tuple representation of this LineString. | Returns the tuple representation of this LineString. | def tuple(self):
"Returns the tuple representation of this LineString."
return tuple(self[i] for i in range(len(self))) | [
"def",
"tuple",
"(",
"self",
")",
":",
"return",
"tuple",
"(",
"self",
"[",
"i",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
")",
")",
")"
] | [
569,
4
] | [
571,
55
] | python | en | ['en', 'en', 'en'] | True |
LineString._listarr | (self, func) |
Internal routine that returns a sequence (list) corresponding with
the given function.
|
Internal routine that returns a sequence (list) corresponding with
the given function.
| def _listarr(self, func):
"""
Internal routine that returns a sequence (list) corresponding with
the given function.
"""
return [func(self.ptr, i) for i in range(len(self))] | [
"def",
"_listarr",
"(",
"self",
",",
"func",
")",
":",
"return",
"[",
"func",
"(",
"self",
".",
"ptr",
",",
"i",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
")",
")",
"]"
] | [
574,
4
] | [
579,
60
] | python | en | ['en', 'error', 'th'] | False |
LineString.x | (self) | Returns the X coordinates in a list. | Returns the X coordinates in a list. | def x(self):
"Returns the X coordinates in a list."
return self._listarr(capi.getx) | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
".",
"_listarr",
"(",
"capi",
".",
"getx",
")"
] | [
582,
4
] | [
584,
39
] | python | en | ['en', 'en', 'en'] | True |
LineString.y | (self) | Returns the Y coordinates in a list. | Returns the Y coordinates in a list. | def y(self):
"Returns the Y coordinates in a list."
return self._listarr(capi.gety) | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
".",
"_listarr",
"(",
"capi",
".",
"gety",
")"
] | [
587,
4
] | [
589,
39
] | python | en | ['en', 'en', 'en'] | True |
LineString.z | (self) | Returns the Z coordinates in a list. | Returns the Z coordinates in a list. | def z(self):
"Returns the Z coordinates in a list."
if self.coord_dim == 3:
return self._listarr(capi.getz) | [
"def",
"z",
"(",
"self",
")",
":",
"if",
"self",
".",
"coord_dim",
"==",
"3",
":",
"return",
"self",
".",
"_listarr",
"(",
"capi",
".",
"getz",
")"
] | [
592,
4
] | [
595,
43
] | python | en | ['en', 'en', 'en'] | True |
Polygon.__len__ | (self) | The number of interior rings in this Polygon. | The number of interior rings in this Polygon. | def __len__(self):
"The number of interior rings in this Polygon."
return self.geom_count | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"self",
".",
"geom_count"
] | [
605,
4
] | [
607,
30
] | python | en | ['en', 'en', 'en'] | True |
Polygon.__iter__ | (self) | Iterates through each ring in the Polygon. | Iterates through each ring in the Polygon. | def __iter__(self):
"Iterates through each ring in the Polygon."
for i in range(self.geom_count):
yield self[i] | [
"def",
"__iter__",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"geom_count",
")",
":",
"yield",
"self",
"[",
"i",
"]"
] | [
609,
4
] | [
612,
25
] | python | en | ['en', 'en', 'en'] | True |
Polygon.__getitem__ | (self, index) | Gets the ring at the specified index. | Gets the ring at the specified index. | def __getitem__(self, index):
"Gets the ring at the specified index."
if index < 0 or index >= self.geom_count:
raise OGRIndexError('index out of range: %s' % index)
else:
return OGRGeometry(capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs) | [
"def",
"__getitem__",
"(",
"self",
",",
"index",
")",
":",
"if",
"index",
"<",
"0",
"or",
"index",
">=",
"self",
".",
"geom_count",
":",
"raise",
"OGRIndexError",
"(",
"'index out of range: %s'",
"%",
"index",
")",
"else",
":",
"return",
"OGRGeometry",
"("... | [
614,
4
] | [
619,
93
] | python | en | ['en', 'en', 'en'] | True |
Polygon.shell | (self) | Returns the shell of this Polygon. | Returns the shell of this Polygon. | def shell(self):
"Returns the shell of this Polygon."
return self[0] # First ring is the shell | [
"def",
"shell",
"(",
"self",
")",
":",
"return",
"self",
"[",
"0",
"]",
"# First ring is the shell"
] | [
623,
4
] | [
625,
49
] | python | en | ['en', 'en', 'en'] | True |
Polygon.tuple | (self) | Returns a tuple of LinearRing coordinate tuples. | Returns a tuple of LinearRing coordinate tuples. | def tuple(self):
"Returns a tuple of LinearRing coordinate tuples."
return tuple(self[i].tuple for i in range(self.geom_count)) | [
"def",
"tuple",
"(",
"self",
")",
":",
"return",
"tuple",
"(",
"self",
"[",
"i",
"]",
".",
"tuple",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"geom_count",
")",
")"
] | [
629,
4
] | [
631,
67
] | python | en | ['en', 'en', 'en'] | True |
Polygon.point_count | (self) | The number of Points in this Polygon. | The number of Points in this Polygon. | def point_count(self):
"The number of Points in this Polygon."
# Summing up the number of points in each ring of the Polygon.
return sum(self[i].point_count for i in range(self.geom_count)) | [
"def",
"point_count",
"(",
"self",
")",
":",
"# Summing up the number of points in each ring of the Polygon.",
"return",
"sum",
"(",
"self",
"[",
"i",
"]",
".",
"point_count",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"geom_count",
")",
")"
] | [
635,
4
] | [
638,
71
] | python | en | ['en', 'en', 'en'] | True |
Polygon.centroid | (self) | Returns the centroid (a Point) of this Polygon. | Returns the centroid (a Point) of this Polygon. | def centroid(self):
"Returns the centroid (a Point) of this Polygon."
# The centroid is a Point, create a geometry for this.
p = OGRGeometry(OGRGeomType('Point'))
capi.get_centroid(self.ptr, p.ptr)
return p | [
"def",
"centroid",
"(",
"self",
")",
":",
"# The centroid is a Point, create a geometry for this.",
"p",
"=",
"OGRGeometry",
"(",
"OGRGeomType",
"(",
"'Point'",
")",
")",
"capi",
".",
"get_centroid",
"(",
"self",
".",
"ptr",
",",
"p",
".",
"ptr",
")",
"return"... | [
641,
4
] | [
646,
16
] | python | en | ['en', 'en', 'en'] | True |
GeometryCollection.__getitem__ | (self, index) | Gets the Geometry at the specified index. | Gets the Geometry at the specified index. | def __getitem__(self, index):
"Gets the Geometry at the specified index."
if index < 0 or index >= self.geom_count:
raise OGRIndexError('index out of range: %s' % index)
else:
return OGRGeometry(capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs) | [
"def",
"__getitem__",
"(",
"self",
",",
"index",
")",
":",
"if",
"index",
"<",
"0",
"or",
"index",
">=",
"self",
".",
"geom_count",
":",
"raise",
"OGRIndexError",
"(",
"'index out of range: %s'",
"%",
"index",
")",
"else",
":",
"return",
"OGRGeometry",
"("... | [
653,
4
] | [
658,
93
] | python | en | ['en', 'en', 'en'] | True |
GeometryCollection.__iter__ | (self) | Iterates over each Geometry. | Iterates over each Geometry. | def __iter__(self):
"Iterates over each Geometry."
for i in range(self.geom_count):
yield self[i] | [
"def",
"__iter__",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"geom_count",
")",
":",
"yield",
"self",
"[",
"i",
"]"
] | [
660,
4
] | [
663,
25
] | python | en | ['en', 'en', 'en'] | True |
GeometryCollection.__len__ | (self) | The number of geometries in this Geometry Collection. | The number of geometries in this Geometry Collection. | def __len__(self):
"The number of geometries in this Geometry Collection."
return self.geom_count | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"self",
".",
"geom_count"
] | [
665,
4
] | [
667,
30
] | python | en | ['en', 'en', 'en'] | True |
GeometryCollection.add | (self, geom) | Add the geometry to this Geometry Collection. | Add the geometry to this Geometry Collection. | def add(self, geom):
"Add the geometry to this Geometry Collection."
if isinstance(geom, OGRGeometry):
if isinstance(geom, self.__class__):
for g in geom:
capi.add_geom(self.ptr, g.ptr)
else:
capi.add_geom(self.ptr, geom.ptr)
... | [
"def",
"add",
"(",
"self",
",",
"geom",
")",
":",
"if",
"isinstance",
"(",
"geom",
",",
"OGRGeometry",
")",
":",
"if",
"isinstance",
"(",
"geom",
",",
"self",
".",
"__class__",
")",
":",
"for",
"g",
"in",
"geom",
":",
"capi",
".",
"add_geom",
"(",
... | [
669,
4
] | [
681,
59
] | python | en | ['en', 'en', 'en'] | True |
GeometryCollection.point_count | (self) | The number of Points in this Geometry Collection. | The number of Points in this Geometry Collection. | def point_count(self):
"The number of Points in this Geometry Collection."
# Summing up the number of points in each geometry in this collection
return sum(self[i].point_count for i in range(self.geom_count)) | [
"def",
"point_count",
"(",
"self",
")",
":",
"# Summing up the number of points in each geometry in this collection",
"return",
"sum",
"(",
"self",
"[",
"i",
"]",
".",
"point_count",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"geom_count",
")",
")"
] | [
684,
4
] | [
687,
71
] | python | en | ['en', 'en', 'en'] | True |
GeometryCollection.tuple | (self) | Returns a tuple representation of this Geometry Collection. | Returns a tuple representation of this Geometry Collection. | def tuple(self):
"Returns a tuple representation of this Geometry Collection."
return tuple(self[i].tuple for i in range(self.geom_count)) | [
"def",
"tuple",
"(",
"self",
")",
":",
"return",
"tuple",
"(",
"self",
"[",
"i",
"]",
".",
"tuple",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"geom_count",
")",
")"
] | [
690,
4
] | [
692,
67
] | python | en | ['en', 'en', 'en'] | True |
FrameManager.__init__ | (self, client: CDPSession, frameTree: Dict, page: Any) | Make new frame manager. | Make new frame manager. | def __init__(self, client: CDPSession, frameTree: Dict, page: Any) -> None:
"""Make new frame manager."""
super().__init__()
self._client = client
self._page = page
self._frames: OrderedDict[str, Frame] = OrderedDict()
self._mainFrame: Optional[Frame] = None
self.... | [
"def",
"__init__",
"(",
"self",
",",
"client",
":",
"CDPSession",
",",
"frameTree",
":",
"Dict",
",",
"page",
":",
"Any",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_client",
"=",
"client",
"self",
".",
"_pa... | [
35,
4
] | [
71,
40
] | python | en | ['en', 'no', 'en'] | True |
FrameManager.mainFrame | (self) | Return main frame. | Return main frame. | def mainFrame(self) -> Optional['Frame']:
"""Return main frame."""
return self._mainFrame | [
"def",
"mainFrame",
"(",
"self",
")",
"->",
"Optional",
"[",
"'Frame'",
"]",
":",
"return",
"self",
".",
"_mainFrame"
] | [
101,
4
] | [
103,
30
] | python | en | ['en', 'hi-Latn', 'ur'] | False |
FrameManager.frames | (self) | Return all frames. | Return all frames. | def frames(self) -> List['Frame']:
"""Return all frames."""
return list(self._frames.values()) | [
"def",
"frames",
"(",
"self",
")",
"->",
"List",
"[",
"'Frame'",
"]",
":",
"return",
"list",
"(",
"self",
".",
"_frames",
".",
"values",
"(",
")",
")"
] | [
105,
4
] | [
107,
42
] | python | en | ['sv', 'no', 'en'] | False |
FrameManager.frame | (self, frameId: str) | Return :class:`Frame` of ``frameId``. | Return :class:`Frame` of ``frameId``. | def frame(self, frameId: str) -> Optional['Frame']:
"""Return :class:`Frame` of ``frameId``."""
return self._frames.get(frameId) | [
"def",
"frame",
"(",
"self",
",",
"frameId",
":",
"str",
")",
"->",
"Optional",
"[",
"'Frame'",
"]",
":",
"return",
"self",
".",
"_frames",
".",
"get",
"(",
"frameId",
")"
] | [
109,
4
] | [
111,
40
] | python | en | ['en', 'no', 'en'] | True |
FrameManager.executionContextById | (self, contextId: str) | Get stored ``ExecutionContext`` by ``id``. | Get stored ``ExecutionContext`` by ``id``. | def executionContextById(self, contextId: str) -> ExecutionContext:
"""Get stored ``ExecutionContext`` by ``id``."""
context = self._contextIdToContext.get(contextId)
if not context:
raise ElementHandleError(
f'INTERNAL ERROR: missing context with id = {contextId}'
... | [
"def",
"executionContextById",
"(",
"self",
",",
"contextId",
":",
"str",
")",
"->",
"ExecutionContext",
":",
"context",
"=",
"self",
".",
"_contextIdToContext",
".",
"get",
"(",
"contextId",
")",
"if",
"not",
"context",
":",
"raise",
"ElementHandleError",
"("... | [
207,
4
] | [
214,
22
] | python | en | ['en', 'en', 'en'] | True |
FrameManager.createJSHandle | (self, context: ExecutionContext,
remoteObject: Dict = None) | Create JS handle associated to the context id and remote object. | Create JS handle associated to the context id and remote object. | def createJSHandle(self, context: ExecutionContext,
remoteObject: Dict = None) -> JSHandle:
"""Create JS handle associated to the context id and remote object."""
if remoteObject is None:
remoteObject = dict()
if remoteObject.get('subtype') == 'node':
... | [
"def",
"createJSHandle",
"(",
"self",
",",
"context",
":",
"ExecutionContext",
",",
"remoteObject",
":",
"Dict",
"=",
"None",
")",
"->",
"JSHandle",
":",
"if",
"remoteObject",
"is",
"None",
":",
"remoteObject",
"=",
"dict",
"(",
")",
"if",
"remoteObject",
... | [
216,
4
] | [
224,
60
] | python | en | ['en', 'en', 'en'] | True |
Frame.executionContext | (self) | Return execution context of this frame.
Return :class:`~pyppeteer.execution_context.ExecutionContext`
associated to this frame.
| Return execution context of this frame. | async def executionContext(self) -> Optional[ExecutionContext]:
"""Return execution context of this frame.
Return :class:`~pyppeteer.execution_context.ExecutionContext`
associated to this frame.
"""
return await self._contextPromise | [
"async",
"def",
"executionContext",
"(",
"self",
")",
"->",
"Optional",
"[",
"ExecutionContext",
"]",
":",
"return",
"await",
"self",
".",
"_contextPromise"
] | [
280,
4
] | [
286,
41
] | python | en | ['en', 'en', 'en'] | True |
Frame.evaluateHandle | (self, pageFunction: str, *args: Any) | Execute function on this frame.
Details see :meth:`pyppeteer.page.Page.evaluateHandle`.
| Execute function on this frame. | async def evaluateHandle(self, pageFunction: str, *args: Any) -> JSHandle:
"""Execute function on this frame.
Details see :meth:`pyppeteer.page.Page.evaluateHandle`.
"""
context = await self.executionContext()
if context is None:
raise PageError('this frame has no co... | [
"async",
"def",
"evaluateHandle",
"(",
"self",
",",
"pageFunction",
":",
"str",
",",
"*",
"args",
":",
"Any",
")",
"->",
"JSHandle",
":",
"context",
"=",
"await",
"self",
".",
"executionContext",
"(",
")",
"if",
"context",
"is",
"None",
":",
"raise",
"... | [
288,
4
] | [
296,
64
] | python | en | ['en', 'en', 'en'] | True |
Frame.evaluate | (self, pageFunction: str, *args: Any,
force_expr: bool = False) | Evaluate pageFunction on this frame.
Details see :meth:`pyppeteer.page.Page.evaluate`.
| Evaluate pageFunction on this frame. | async def evaluate(self, pageFunction: str, *args: Any,
force_expr: bool = False) -> Any:
"""Evaluate pageFunction on this frame.
Details see :meth:`pyppeteer.page.Page.evaluate`.
"""
context = await self.executionContext()
if context is None:
... | [
"async",
"def",
"evaluate",
"(",
"self",
",",
"pageFunction",
":",
"str",
",",
"*",
"args",
":",
"Any",
",",
"force_expr",
":",
"bool",
"=",
"False",
")",
"->",
"Any",
":",
"context",
"=",
"await",
"self",
".",
"executionContext",
"(",
")",
"if",
"co... | [
298,
4
] | [
308,
55
] | python | en | ['en', 'en', 'en'] | True |
Frame.querySelector | (self, selector: str) | Get element which matches `selector` string.
Details see :meth:`pyppeteer.page.Page.querySelector`.
| Get element which matches `selector` string. | async def querySelector(self, selector: str) -> Optional[ElementHandle]:
"""Get element which matches `selector` string.
Details see :meth:`pyppeteer.page.Page.querySelector`.
"""
document = await self._document()
value = await document.querySelector(selector)
return val... | [
"async",
"def",
"querySelector",
"(",
"self",
",",
"selector",
":",
"str",
")",
"->",
"Optional",
"[",
"ElementHandle",
"]",
":",
"document",
"=",
"await",
"self",
".",
"_document",
"(",
")",
"value",
"=",
"await",
"document",
".",
"querySelector",
"(",
... | [
310,
4
] | [
317,
20
] | python | en | ['en', 'en', 'en'] | True |
Frame.xpath | (self, expression: str) | Evaluate the XPath expression.
If there are no such elements in this frame, return an empty list.
:arg str expression: XPath string to be evaluated.
| Evaluate the XPath expression. | async def xpath(self, expression: str) -> List[ElementHandle]:
"""Evaluate the XPath expression.
If there are no such elements in this frame, return an empty list.
:arg str expression: XPath string to be evaluated.
"""
document = await self._document()
value = await doc... | [
"async",
"def",
"xpath",
"(",
"self",
",",
"expression",
":",
"str",
")",
"->",
"List",
"[",
"ElementHandle",
"]",
":",
"document",
"=",
"await",
"self",
".",
"_document",
"(",
")",
"value",
"=",
"await",
"document",
".",
"xpath",
"(",
"expression",
")... | [
331,
4
] | [
340,
20
] | python | en | ['en', 'en', 'en'] | True |
Frame.querySelectorEval | (self, selector: str, pageFunction: str,
*args: Any) | Execute function on element which matches selector.
Details see :meth:`pyppeteer.page.Page.querySelectorEval`.
| Execute function on element which matches selector. | async def querySelectorEval(self, selector: str, pageFunction: str,
*args: Any) -> Any:
"""Execute function on element which matches selector.
Details see :meth:`pyppeteer.page.Page.querySelectorEval`.
"""
document = await self._document()
return ... | [
"async",
"def",
"querySelectorEval",
"(",
"self",
",",
"selector",
":",
"str",
",",
"pageFunction",
":",
"str",
",",
"*",
"args",
":",
"Any",
")",
"->",
"Any",
":",
"document",
"=",
"await",
"self",
".",
"_document",
"(",
")",
"return",
"await",
"docum... | [
342,
4
] | [
349,
78
] | python | en | ['en', 'en', 'en'] | True |
Frame.querySelectorAllEval | (self, selector: str, pageFunction: str,
*args: Any) | Execute function on all elements which matches selector.
Details see :meth:`pyppeteer.page.Page.querySelectorAllEval`.
| Execute function on all elements which matches selector. | async def querySelectorAllEval(self, selector: str, pageFunction: str,
*args: Any) -> Optional[Dict]:
"""Execute function on all elements which matches selector.
Details see :meth:`pyppeteer.page.Page.querySelectorAllEval`.
"""
document = await self._d... | [
"async",
"def",
"querySelectorAllEval",
"(",
"self",
",",
"selector",
":",
"str",
",",
"pageFunction",
":",
"str",
",",
"*",
"args",
":",
"Any",
")",
"->",
"Optional",
"[",
"Dict",
"]",
":",
"document",
"=",
"await",
"self",
".",
"_document",
"(",
")",... | [
351,
4
] | [
359,
20
] | python | en | ['en', 'en', 'en'] | True |
Frame.querySelectorAll | (self, selector: str) | Get all elements which matches `selector`.
Details see :meth:`pyppeteer.page.Page.querySelectorAll`.
| Get all elements which matches `selector`. | async def querySelectorAll(self, selector: str) -> List[ElementHandle]:
"""Get all elements which matches `selector`.
Details see :meth:`pyppeteer.page.Page.querySelectorAll`.
"""
document = await self._document()
value = await document.querySelectorAll(selector)
return ... | [
"async",
"def",
"querySelectorAll",
"(",
"self",
",",
"selector",
":",
"str",
")",
"->",
"List",
"[",
"ElementHandle",
"]",
":",
"document",
"=",
"await",
"self",
".",
"_document",
"(",
")",
"value",
"=",
"await",
"document",
".",
"querySelectorAll",
"(",
... | [
361,
4
] | [
368,
20
] | python | en | ['en', 'en', 'en'] | True |
Frame.content | (self) | Get the whole HTML contents of the page. | Get the whole HTML contents of the page. | async def content(self) -> str:
"""Get the whole HTML contents of the page."""
return await self.evaluate('''
() => {
let retVal = '';
if (document.doctype)
retVal = new XMLSerializer().serializeToString(document.doctype);
if (document.documentElement)
retVal += document.documentElement.ou... | [
"async",
"def",
"content",
"(",
"self",
")",
"->",
"str",
":",
"return",
"await",
"self",
".",
"evaluate",
"(",
"'''\n() => {\n let retVal = '';\n if (document.doctype)\n retVal = new XMLSerializer().serializeToString(document.doctype);\n if (document.documentElement)\n retVal... | [
381,
4
] | [
392,
20
] | python | en | ['en', 'en', 'en'] | True |
Frame.setContent | (self, html: str) | Set content to this page. | Set content to this page. | async def setContent(self, html: str) -> None:
"""Set content to this page."""
func = '''
function(html) {
document.open();
document.write(html);
document.close();
}
'''
await self.evaluate(func, html) | [
"async",
"def",
"setContent",
"(",
"self",
",",
"html",
":",
"str",
")",
"->",
"None",
":",
"func",
"=",
"'''\nfunction(html) {\n document.open();\n document.write(html);\n document.close();\n}\n'''",
"await",
"self",
".",
"evaluate",
"(",
"func",
",",
"html",
")"
... | [
394,
4
] | [
403,
39
] | python | en | ['en', 'en', 'en'] | True |
Frame.name | (self) | Get frame name. | Get frame name. | def name(self) -> str:
"""Get frame name."""
return self.__dict__.get('_name', '') | [
"def",
"name",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"__dict__",
".",
"get",
"(",
"'_name'",
",",
"''",
")"
] | [
406,
4
] | [
408,
45
] | python | da | ['da', 'da', 'en'] | True |
Frame.url | (self) | Get url of the frame. | Get url of the frame. | def url(self) -> str:
"""Get url of the frame."""
return self._url | [
"def",
"url",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_url"
] | [
411,
4
] | [
413,
24
] | python | en | ['en', 'en', 'en'] | True |
Frame.parentFrame | (self) | Get parent frame.
If this frame is main frame or detached frame, return ``None``.
| Get parent frame. | def parentFrame(self) -> Optional['Frame']:
"""Get parent frame.
If this frame is main frame or detached frame, return ``None``.
"""
return self._parentFrame | [
"def",
"parentFrame",
"(",
"self",
")",
"->",
"Optional",
"[",
"'Frame'",
"]",
":",
"return",
"self",
".",
"_parentFrame"
] | [
416,
4
] | [
421,
32
] | python | en | ['fr', 'pt', 'en'] | False |
Frame.childFrames | (self) | Get child frames. | Get child frames. | def childFrames(self) -> List['Frame']:
"""Get child frames."""
return list(self._childFrames) | [
"def",
"childFrames",
"(",
"self",
")",
"->",
"List",
"[",
"'Frame'",
"]",
":",
"return",
"list",
"(",
"self",
".",
"_childFrames",
")"
] | [
424,
4
] | [
426,
38
] | python | en | ['en', 'da', 'en'] | True |
Frame.isDetached | (self) | Return ``True`` if this frame is detached.
Otherwise return ``False``.
| Return ``True`` if this frame is detached. | def isDetached(self) -> bool:
"""Return ``True`` if this frame is detached.
Otherwise return ``False``.
"""
return self._detached | [
"def",
"isDetached",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"_detached"
] | [
428,
4
] | [
433,
29
] | python | en | ['en', 'en', 'en'] | True |
Frame.injectFile | (self, filePath: str) | [Deprecated] Inject file to the frame. | [Deprecated] Inject file to the frame. | async def injectFile(self, filePath: str) -> str:
"""[Deprecated] Inject file to the frame."""
logger.warning('`injectFile` method is deprecated.'
' Use `addScriptTag` method instead.')
with open(filePath) as f:
contents = f.read()
contents += '/* # sou... | [
"async",
"def",
"injectFile",
"(",
"self",
",",
"filePath",
":",
"str",
")",
"->",
"str",
":",
"logger",
".",
"warning",
"(",
"'`injectFile` method is deprecated.'",
"' Use `addScriptTag` method instead.'",
")",
"with",
"open",
"(",
"filePath",
")",
"as",
"f",
"... | [
435,
4
] | [
442,
44
] | python | en | ['en', 'en', 'en'] | True |
Frame.addScriptTag | (self, options: Dict) | Add script tag to this frame.
Details see :meth:`pyppeteer.page.Page.addScriptTag`.
| Add script tag to this frame. | async def addScriptTag(self, options: Dict) -> ElementHandle: # noqa: C901
"""Add script tag to this frame.
Details see :meth:`pyppeteer.page.Page.addScriptTag`.
"""
context = await self.executionContext()
if context is None:
raise ElementHandleError('ExecutionConte... | [
"async",
"def",
"addScriptTag",
"(",
"self",
",",
"options",
":",
"Dict",
")",
"->",
"ElementHandle",
":",
"# noqa: C901",
"context",
"=",
"await",
"self",
".",
"executionContext",
"(",
")",
"if",
"context",
"is",
"None",
":",
"raise",
"ElementHandleError",
... | [
444,
4
] | [
511,
75
] | python | en | ['en', 'en', 'en'] | True |
Frame.addStyleTag | (self, options: Dict) | Add style tag to this frame.
Details see :meth:`pyppeteer.page.Page.addStyleTag`.
| Add style tag to this frame. | async def addStyleTag(self, options: Dict) -> ElementHandle:
"""Add style tag to this frame.
Details see :meth:`pyppeteer.page.Page.addStyleTag`.
"""
context = await self.executionContext()
if context is None:
raise ElementHandleError('ExecutionContext is None.')
... | [
"async",
"def",
"addStyleTag",
"(",
"self",
",",
"options",
":",
"Dict",
")",
"->",
"ElementHandle",
":",
"context",
"=",
"await",
"self",
".",
"executionContext",
"(",
")",
"if",
"context",
"is",
"None",
":",
"raise",
"ElementHandleError",
"(",
"'ExecutionC... | [
513,
4
] | [
571,
75
] | python | en | ['en', 'en', 'en'] | True |
Frame.click | (self, selector: str, options: dict = None, **kwargs: Any
) | Click element which matches ``selector``.
Details see :meth:`pyppeteer.page.Page.click`.
| Click element which matches ``selector``. | async def click(self, selector: str, options: dict = None, **kwargs: Any
) -> None:
"""Click element which matches ``selector``.
Details see :meth:`pyppeteer.page.Page.click`.
"""
options = merge_dict(options, kwargs)
handle = await self.J(selector)
i... | [
"async",
"def",
"click",
"(",
"self",
",",
"selector",
":",
"str",
",",
"options",
":",
"dict",
"=",
"None",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"None",
":",
"options",
"=",
"merge_dict",
"(",
"options",
",",
"kwargs",
")",
"handle",
"=... | [
573,
4
] | [
584,
30
] | python | en | ['en', 'en', 'en'] | True |
Frame.focus | (self, selector: str) | Focus element which matches ``selector``.
Details see :meth:`pyppeteer.page.Page.focus`.
| Focus element which matches ``selector``. | async def focus(self, selector: str) -> None:
"""Focus element which matches ``selector``.
Details see :meth:`pyppeteer.page.Page.focus`.
"""
handle = await self.J(selector)
if not handle:
raise PageError('No node found for selector: ' + selector)
await self.... | [
"async",
"def",
"focus",
"(",
"self",
",",
"selector",
":",
"str",
")",
"->",
"None",
":",
"handle",
"=",
"await",
"self",
".",
"J",
"(",
"selector",
")",
"if",
"not",
"handle",
":",
"raise",
"PageError",
"(",
"'No node found for selector: '",
"+",
"sele... | [
586,
4
] | [
595,
30
] | python | en | ['en', 'en', 'en'] | True |
Frame.hover | (self, selector: str) | Mouse hover the element which matches ``selector``.
Details see :meth:`pyppeteer.page.Page.hover`.
| Mouse hover the element which matches ``selector``. | async def hover(self, selector: str) -> None:
"""Mouse hover the element which matches ``selector``.
Details see :meth:`pyppeteer.page.Page.hover`.
"""
handle = await self.J(selector)
if not handle:
raise PageError('No node found for selector: ' + selector)
a... | [
"async",
"def",
"hover",
"(",
"self",
",",
"selector",
":",
"str",
")",
"->",
"None",
":",
"handle",
"=",
"await",
"self",
".",
"J",
"(",
"selector",
")",
"if",
"not",
"handle",
":",
"raise",
"PageError",
"(",
"'No node found for selector: '",
"+",
"sele... | [
597,
4
] | [
606,
30
] | python | en | ['en', 'en', 'en'] | True |
Frame.select | (self, selector: str, *values: str) | Select options and return selected values.
Details see :meth:`pyppeteer.page.Page.select`.
| Select options and return selected values. | async def select(self, selector: str, *values: str) -> List[str]:
"""Select options and return selected values.
Details see :meth:`pyppeteer.page.Page.select`.
"""
for value in values:
if not isinstance(value, str):
raise TypeError(
'Value... | [
"async",
"def",
"select",
"(",
"self",
",",
"selector",
":",
"str",
",",
"*",
"values",
":",
"str",
")",
"->",
"List",
"[",
"str",
"]",
":",
"for",
"value",
"in",
"values",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"rais... | [
608,
4
] | [
637,
20
] | python | en | ['en', 'en', 'en'] | True |
Frame.tap | (self, selector: str) | Tap the element which matches the ``selector``.
Details see :meth:`pyppeteer.page.Page.tap`.
| Tap the element which matches the ``selector``. | async def tap(self, selector: str) -> None:
"""Tap the element which matches the ``selector``.
Details see :meth:`pyppeteer.page.Page.tap`.
"""
handle = await self.J(selector)
if not handle:
raise PageError('No node found for selector: ' + selector)
await han... | [
"async",
"def",
"tap",
"(",
"self",
",",
"selector",
":",
"str",
")",
"->",
"None",
":",
"handle",
"=",
"await",
"self",
".",
"J",
"(",
"selector",
")",
"if",
"not",
"handle",
":",
"raise",
"PageError",
"(",
"'No node found for selector: '",
"+",
"select... | [
639,
4
] | [
648,
30
] | python | en | ['en', 'en', 'en'] | True |
Frame.type | (self, selector: str, text: str, options: dict = None,
**kwargs: Any) | Type ``text`` on the element which matches ``selector``.
Details see :meth:`pyppeteer.page.Page.type`.
| Type ``text`` on the element which matches ``selector``. | async def type(self, selector: str, text: str, options: dict = None,
**kwargs: Any) -> None:
"""Type ``text`` on the element which matches ``selector``.
Details see :meth:`pyppeteer.page.Page.type`.
"""
options = merge_dict(options, kwargs)
handle = await self... | [
"async",
"def",
"type",
"(",
"self",
",",
"selector",
":",
"str",
",",
"text",
":",
"str",
",",
"options",
":",
"dict",
"=",
"None",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"None",
":",
"options",
"=",
"merge_dict",
"(",
"options",
",",
"... | [
650,
4
] | [
661,
30
] | python | en | ['en', 'en', 'en'] | True |
Frame.waitFor | (self, selectorOrFunctionOrTimeout: Union[str, int, float],
options: dict = None, *args: Any, **kwargs: Any
) | Wait until `selectorOrFunctionOrTimeout`.
Details see :meth:`pyppeteer.page.Page.waitFor`.
| Wait until `selectorOrFunctionOrTimeout`. | def waitFor(self, selectorOrFunctionOrTimeout: Union[str, int, float],
options: dict = None, *args: Any, **kwargs: Any
) -> Union[Awaitable, 'WaitTask']:
"""Wait until `selectorOrFunctionOrTimeout`.
Details see :meth:`pyppeteer.page.Page.waitFor`.
"""
opt... | [
"def",
"waitFor",
"(",
"self",
",",
"selectorOrFunctionOrTimeout",
":",
"Union",
"[",
"str",
",",
"int",
",",
"float",
"]",
",",
"options",
":",
"dict",
"=",
"None",
",",
"*",
"args",
":",
"Any",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"Uni... | [
663,
4
] | [
688,
73
] | python | en | ['id', 'jv', 'en'] | False |
Frame.waitForSelector | (self, selector: str, options: dict = None,
**kwargs: Any) | Wait until element which matches ``selector`` appears on page.
Details see :meth:`pyppeteer.page.Page.waitForSelector`.
| Wait until element which matches ``selector`` appears on page. | def waitForSelector(self, selector: str, options: dict = None,
**kwargs: Any) -> 'WaitTask':
"""Wait until element which matches ``selector`` appears on page.
Details see :meth:`pyppeteer.page.Page.waitForSelector`.
"""
options = merge_dict(options, kwargs)
... | [
"def",
"waitForSelector",
"(",
"self",
",",
"selector",
":",
"str",
",",
"options",
":",
"dict",
"=",
"None",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"'WaitTask'",
":",
"options",
"=",
"merge_dict",
"(",
"options",
",",
"kwargs",
")",
"return",... | [
690,
4
] | [
697,
69
] | python | en | ['en', 'en', 'en'] | True |
Frame.waitForXPath | (self, xpath: str, options: dict = None,
**kwargs: Any) | Wait until element which matches ``xpath`` appears on page.
Details see :meth:`pyppeteer.page.Page.waitForXPath`.
| Wait until element which matches ``xpath`` appears on page. | def waitForXPath(self, xpath: str, options: dict = None,
**kwargs: Any) -> 'WaitTask':
"""Wait until element which matches ``xpath`` appears on page.
Details see :meth:`pyppeteer.page.Page.waitForXPath`.
"""
options = merge_dict(options, kwargs)
return self.... | [
"def",
"waitForXPath",
"(",
"self",
",",
"xpath",
":",
"str",
",",
"options",
":",
"dict",
"=",
"None",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"'WaitTask'",
":",
"options",
"=",
"merge_dict",
"(",
"options",
",",
"kwargs",
")",
"return",
"se... | [
699,
4
] | [
706,
65
] | python | en | ['en', 'en', 'en'] | True |
Frame.waitForFunction | (self, pageFunction: str, options: dict = None,
*args: Any, **kwargs: Any) | Wait until the function completes.
Details see :meth:`pyppeteer.page.Page.waitForFunction`.
| Wait until the function completes. | def waitForFunction(self, pageFunction: str, options: dict = None,
*args: Any, **kwargs: Any) -> 'WaitTask':
"""Wait until the function completes.
Details see :meth:`pyppeteer.page.Page.waitForFunction`.
"""
options = merge_dict(options, kwargs)
timeout =... | [
"def",
"waitForFunction",
"(",
"self",
",",
"pageFunction",
":",
"str",
",",
"options",
":",
"dict",
"=",
"None",
",",
"*",
"args",
":",
"Any",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"'WaitTask'",
":",
"options",
"=",
"merge_dict",
"(",
"opt... | [
708,
4
] | [
718,
50
] | python | en | ['en', 'en', 'en'] | True |
Frame.title | (self) | Get title of the frame. | Get title of the frame. | async def title(self) -> str:
"""Get title of the frame."""
return await self.evaluate('() => document.title') | [
"async",
"def",
"title",
"(",
"self",
")",
"->",
"str",
":",
"return",
"await",
"self",
".",
"evaluate",
"(",
"'() => document.title'",
")"
] | [
770,
4
] | [
772,
58
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.