neulab/docprompting-conala huggingface dataset:
GEOSGeometry.wkb  
Returns the WKB (Well-Known Binary) representation of this Geometry as a Python buffer. SRID value is not included, use the GEOSGeometry.ewkb property instead.
GEOSGeometry.wkt  
Returns the Well-Known Text of the geometry (an OGC standard).
class LinearRing(*args, **kwargs)  
LinearRing objects are constructed in the exact same way as LineString objects, however the coordinates must be closed, in other words, the first coordinates must be the same as the last coordinates. For example: >>> ls = LinearRing((0, 0), (0, 1), (1, 1), (0, 0))
 Notice that (0, 0) is the first and last coordinate – if they were not equal, an error would be raised.  
is_counterclockwise  
Returns whether this LinearRing is counterclockwise.
class LineString(*args, **kwargs)  
LineString objects are instantiated using arguments that are either a sequence of coordinates or Point objects. For example, the following are equivalent: >>> ls = LineString((0, 0), (1, 1))
>>> ls = LineString(Point(0, 0), Point(1, 1))
 In addition, LineString objects may also be created by passing in a single sequence of coordinate or Point objects: >>> ls = LineString( ((0, 0), (1, 1)) )
>>> ls = LineString( [Point(0, 0), Point(1, 1)] )
 Empty LineString objects may be instantiated by passing no arguments or an empty sequence. The following are equivalent: >>> ls = LineString()
>>> ls = LineString([])
  
closed  
Returns whether or not this LineString is closed.
class MultiLineString(*args, **kwargs)  
MultiLineString objects may be instantiated by passing in LineString objects as arguments, or a single sequence of LineString objects: >>> ls1 = LineString((0, 0), (1, 1))
>>> ls2 = LineString((2, 2), (3, 3))
>>> mls = MultiLineString(ls1, ls2)
>>> mls = MultiLineString([ls1, ls2])
  
merged  
Returns a LineString representing the line merge of all the components in this MultiLineString. 
  
closed  
Returns True if and only if all elements are closed.
merged  
Returns a LineString representing the line merge of all the components in this MultiLineString.
class MultiPoint(*args, **kwargs)  
MultiPoint objects may be instantiated by passing in Point objects as arguments, or a single sequence of Point objects: >>> mp = MultiPoint(Point(0, 0), Point(1, 1))
>>> mp = MultiPoint( (Point(0, 0), Point(1, 1)) )
class MultiPolygon(*args, **kwargs)  
MultiPolygon objects may be instantiated by passing Polygon objects as arguments, or a single sequence of Polygon objects: >>> p1 = Polygon( ((0, 0), (0, 1), (1, 1), (0, 0)) )
>>> p2 = Polygon( ((1, 1), (1, 2), (2, 2), (1, 1)) )
>>> mp = MultiPolygon(p1, p2)
>>> mp = MultiPolygon([p1, p2])
class Point(x=None, y=None, z=None, srid=None)  
Point objects are instantiated using arguments that represent the component coordinates of the point or with a single sequence coordinates. For example, the following are equivalent: >>> pnt = Point(5, 23)
>>> pnt = Point([5, 23])
 Empty Point objects may be instantiated by passing no arguments or an empty sequence. The following are equivalent: >>> pnt = Point()
>>> pnt = Point([])
class Polygon(*args, **kwargs)  
Polygon objects may be instantiated by passing in parameters that represent the rings of the polygon. The parameters must either be LinearRing instances, or a sequence that may be used to construct a LinearRing: >>> ext_coords = ((0, 0), (0, 1), (1, 1), (1, 0), (0, 0))
>>> int_coords = ((0.4, 0.4), (0.4, 0.6), (0.6, 0.6), (0.6, 0.4), (0.4, 0.4))
>>> poly = Polygon(ext_coords, int_coords)
>>> poly = Polygon(LinearRing(ext_coords), LinearRing(int_coords))
  
classmethod from_bbox(bbox)  
Returns a polygon object from the given bounding-box, a 4-tuple comprising (xmin, ymin, xmax, ymax). 
  
num_interior_rings  
Returns the number of interior rings in this geometry.
class PreparedGeometry  
All methods on PreparedGeometry take an other argument, which must be a GEOSGeometry instance.  
contains(other) 
  
contains_properly(other) 
  
covers(other) 
  
crosses(other) 
  
disjoint(other) 
  
intersects(other) 
  
overlaps(other) 
  
touches(other) 
  
within(other)
class WKBReader  
Example: >>> from django.contrib.gis.geos import WKBReader
>>> wkb_r = WKBReader()
>>> wkb_r.read('0101000000000000000000F03F000000000000F03F')
<Point object at 0x103a88910>
class WKBWriter(dim=2)  
WKBWriter provides the most control over its output. By default it returns OGC-compliant WKB when its write method is called. However, it has properties that allow for the creation of EWKB, a superset of the WKB standard that includes additional information. See the WKBWriter.outdim documentation for more details about the dim argument.  
write(geom) 
 Returns the WKB of the given geometry as a Python buffer object. Example: >>> from django.contrib.gis.geos import Point, WKBWriter
>>> pnt = Point(1, 1)
>>> wkb_w = WKBWriter()
>>> wkb_w.write(pnt)
<read-only buffer for 0x103a898f0, size -1, offset 0 at 0x103a89930>
  
write_hex(geom) 
 Returns WKB of the geometry in hexadecimal. Example: >>> from django.contrib.gis.geos import Point, WKBWriter
>>> pnt = Point(1, 1)
>>> wkb_w = WKBWriter()
>>> wkb_w.write_hex(pnt)
'0101000000000000000000F03F000000000000F03F'
  
byteorder 
 This property may be set to change the byte-order of the geometry representation.   
Byteorder Value Description   
0 Big Endian (e.g., compatible with RISC systems)  
1 Little Endian (e.g., compatible with x86 systems)   Example: >>> from django.contrib.gis.geos import Point, WKBWriter
>>> wkb_w = WKBWriter()
>>> pnt = Point(1, 1)
>>> wkb_w.write_hex(pnt)
'0101000000000000000000F03F000000000000F03F'
>>> wkb_w.byteorder = 0
'00000000013FF00000000000003FF0000000000000'
  
outdim 
 This property may be set to change the output dimension of the geometry representation. In other words, if you have a 3D geometry then set to 3 so that the Z value is included in the WKB.   
Outdim Value Description   
2 The default, output 2D WKB.  
3 Output 3D WKB.   Example: >>> from django.contrib.gis.geos import Point, WKBWriter
>>> wkb_w = WKBWriter()
>>> wkb_w.outdim
2
>>> pnt = Point(1, 1, 1)
>>> wkb_w.write_hex(pnt) # By default, no Z value included:
'0101000000000000000000F03F000000000000F03F'
>>> wkb_w.outdim = 3 # Tell writer to include Z values
>>> wkb_w.write_hex(pnt)
'0101000080000000000000F03F000000000000F03F000000000000F03F'
  
srid 
 Set this property with a boolean to indicate whether the SRID of the geometry should be included with the WKB representation. Example: >>> from django.contrib.gis.geos import Point, WKBWriter
>>> wkb_w = WKBWriter()
>>> pnt = Point(1, 1, srid=4326)
>>> wkb_w.write_hex(pnt) # By default, no SRID included:
'0101000000000000000000F03F000000000000F03F'
>>> wkb_w.srid = True # Tell writer to include SRID
>>> wkb_w.write_hex(pnt)
'0101000020E6100000000000000000F03F000000000000F03F'
class WKTReader  
Example: >>> from django.contrib.gis.geos import WKTReader
>>> wkt_r = WKTReader()
>>> wkt_r.read('POINT(1 1)')
<Point object at 0x103a88b50>
class WKTWriter(dim=2, trim=False, precision=None)  
This class allows outputting the WKT representation of a geometry. See the WKBWriter.outdim, trim, and precision attributes for details about the constructor arguments.  
write(geom) 
 Returns the WKT of the given geometry. Example: >>> from django.contrib.gis.geos import Point, WKTWriter
>>> pnt = Point(1, 1)
>>> wkt_w = WKTWriter()
>>> wkt_w.write(pnt)
'POINT (1.0000000000000000 1.0000000000000000)'
  
outdim  
See WKBWriter.outdim. 
  
trim 
 This property is used to enable or disable trimming of unnecessary decimals. >>> from django.contrib.gis.geos import Point, WKTWriter
>>> pnt = Point(1, 1)
>>> wkt_w = WKTWriter()
>>> wkt_w.trim
False
>>> wkt_w.write(pnt)
'POINT (1.0000000000000000 1.0000000000000000)'
>>> wkt_w.trim = True
>>> wkt_w.write(pnt)
'POINT (1 1)'
  
precision 
 This property controls the rounding precision of coordinates; if set to None rounding is disabled. >>> from django.contrib.gis.geos import Point, WKTWriter
>>> pnt = Point(1.44, 1.66)
>>> wkt_w = WKTWriter()
>>> print(wkt_w.precision)
None
>>> wkt_w.write(pnt)
'POINT (1.4399999999999999 1.6599999999999999)'
>>> wkt_w.precision = 0
>>> wkt_w.write(pnt)
'POINT (1 2)'
>>> wkt_w.precision = 1
>>> wkt_w.write(pnt)
'POINT (1.4 1.7)'
class Area(**kwargs) [source]
 
To initialize an area object, pass in a keyword corresponding to the desired unit attribute name set with desired value. For example, the following creates an area object representing 5 square miles: >>> a = Area(sq_mi=5)
  
__getattr__(unit_att) 
 Returns the area value in units corresponding to the given unit attribute. For example: >>> print(a.sq_km)
12.949940551680001
  
classmethod unit_attname(unit_name) 
 Returns the area unit attribute name for the given full unit name. For example: >>> Area.unit_attname('Kilometer')
'sq_km'
class Distance(**kwargs) [source]
 
To initialize a distance object, pass in a keyword corresponding to the desired unit attribute name set with desired value. For example, the following creates a distance object representing 5 miles: >>> dist = Distance(mi=5)
  
__getattr__(unit_att) 
 Returns the distance value in units corresponding to the given unit attribute. For example: >>> print(dist.km)
8.04672
  
classmethod unit_attname(unit_name) 
 Returns the distance unit attribute name for the given full unit name. For example: >>> Distance.unit_attname('Mile')
'mi'
class LayerMapping(model, data_source, mapping, layer=0, source_srs=None, encoding=None, transaction_mode='commit_on_success', transform=True, unique=True, using='default')
LayerMapping.save(verbose=False, fid_range=False, step=False, progress=False, silent=False, stream=sys.stdout, strict=False)
mapping(data_source, geom_name='geom', layer_key=0, multi_geom=False)
class FileResponse(open_file, as_attachment=False, filename='', **kwargs)  
FileResponse is a subclass of StreamingHttpResponse optimized for binary files. It uses wsgi.file_wrapper if provided by the wsgi server, otherwise it streams the file out in small chunks. If as_attachment=True, the Content-Disposition header is set to attachment, which asks the browser to offer the file to the user as a download. Otherwise, a Content-Disposition header with a value of inline (the browser default) will be set only if a filename is available. If open_file doesn’t have a name or if the name of open_file isn’t appropriate, provide a custom file name using the filename parameter. Note that if you pass a file-like object like io.BytesIO, it’s your task to seek() it before passing it to FileResponse. The Content-Length and Content-Type headers are automatically set when they can be guessed from contents of open_file.
FileResponse.set_headers(open_file)  
This method is automatically called during the response initialization and set various headers (Content-Length, Content-Type, and Content-Disposition) depending on open_file.
HttpRequest.__iter__()  
Methods implementing a file-like interface for reading from an HttpRequest instance. This makes it possible to consume an incoming request in a streaming fashion. A common use-case would be to process a big XML payload with an iterative parser without constructing a whole XML tree in memory. Given this standard interface, an HttpRequest instance can be passed directly to an XML parser such as ElementTree: import xml.etree.ElementTree as ET
for element in ET.iterparse(request):
    process(element)
HttpRequest.accepts(mime_type)  
Returns True if the request Accept header matches the mime_type argument: >>> request.accepts('text/html')
True
 Most browsers send Accept: */* by default, so this would return True for all content types. Setting an explicit Accept header in API requests can be useful for returning a different content type for those consumers only. See Content negotiation example of using accepts() to return different content to API consumers. If a response varies depending on the content of the Accept header and you are using some form of caching like Django’s cache middleware, you should decorate the view with vary_on_headers('Accept') so that the responses are properly cached.
HttpRequest.body  
The raw HTTP request body as a bytestring. This is useful for processing data in different ways than conventional HTML forms: binary images, XML payload etc. For processing conventional form data, use HttpRequest.POST. You can also read from an HttpRequest using a file-like interface with HttpRequest.read() or HttpRequest.readline(). Accessing the body attribute after reading the request with either of these I/O stream methods will produce a RawPostDataException.
HttpRequest.build_absolute_uri(location=None)  
Returns the absolute URI form of location. If no location is provided, the location will be set to request.get_full_path(). If the location is already an absolute URI, it will not be altered. Otherwise the absolute URI is built using the server variables available in this request. For example: >>> request.build_absolute_uri()
'https://example.com/music/bands/the_beatles/?print=true'
>>> request.build_absolute_uri('/bands/')
'https://example.com/bands/'
>>> request.build_absolute_uri('https://example2.com/bands/')
'https://example2.com/bands/'
  Note Mixing HTTP and HTTPS on the same site is discouraged, therefore build_absolute_uri() will always generate an absolute URI with the same scheme the current request has. If you need to redirect users to HTTPS, it’s best to let your web server redirect all HTTP traffic to HTTPS.
HttpRequest.content_params  
A dictionary of key/value parameters included in the CONTENT_TYPE header.
HttpRequest.content_type  
A string representing the MIME type of the request, parsed from the CONTENT_TYPE header.
HttpRequest.current_app  
The url template tag will use its value as the current_app argument to reverse().
HttpRequest.encoding  
A string representing the current encoding used to decode form submission data (or None, which means the DEFAULT_CHARSET setting is used). You can write to this attribute to change the encoding used when accessing the form data. Any subsequent attribute accesses (such as reading from GET or POST) will use the new encoding value. Useful if you know the form data is not in the DEFAULT_CHARSET encoding.
HttpRequest.exception_reporter_class  
This will be used instead of DEFAULT_EXCEPTION_REPORTER for the current request. See Custom error reports for details.
HttpRequest.exception_reporter_filter  
This will be used instead of DEFAULT_EXCEPTION_REPORTER_FILTER for the current request. See Custom error reports for details.
HttpRequest.FILES  
A dictionary-like object containing all uploaded files. Each key in FILES is the name from the <input type="file" name="">. Each value in FILES is an UploadedFile. See Managing files for more information. FILES will only contain data if the request method was POST and the <form> that posted to the request had enctype="multipart/form-data". Otherwise, FILES will be a blank dictionary-like object.
HttpRequest.GET  
A dictionary-like object containing all given HTTP GET parameters. See the QueryDict documentation below.
HttpRequest.get_full_path()  
Returns the path, plus an appended query string, if applicable. Example: "/music/bands/the_beatles/?print=true"
HttpRequest.get_full_path_info()  
Like get_full_path(), but uses path_info instead of path. Example: "/minfo/music/bands/the_beatles/?print=true"
HttpRequest.get_host()  
Returns the originating host of the request using information from the HTTP_X_FORWARDED_HOST (if USE_X_FORWARDED_HOST is enabled) and HTTP_HOST headers, in that order. If they don’t provide a value, the method uses a combination of SERVER_NAME and SERVER_PORT as detailed in PEP 3333. Example: "127.0.0.1:8000" Raises django.core.exceptions.DisallowedHost if the host is not in ALLOWED_HOSTS or the domain name is invalid according to RFC 1034/1035.  Note The get_host() method fails when the host is behind multiple proxies. One solution is to use middleware to rewrite the proxy headers, as in the following example: class MultipleProxyMiddleware:
    FORWARDED_FOR_FIELDS = [
        'HTTP_X_FORWARDED_FOR',
        'HTTP_X_FORWARDED_HOST',
        'HTTP_X_FORWARDED_SERVER',
    ]

    def __init__(self, get_response):
        self.get_response = get_response

    def __call__(self, request):
        """
        Rewrites the proxy headers so that only the most
        recent proxy is used.
        """
        for field in self.FORWARDED_FOR_FIELDS:
            if field in request.META:
                if ',' in request.META[field]:
                    parts = request.META[field].split(',')
                    request.META[field] = parts[-1].strip()
        return self.get_response(request)
 This middleware should be positioned before any other middleware that relies on the value of get_host() – for instance, CommonMiddleware or CsrfViewMiddleware.
HttpRequest.get_port()  
Returns the originating port of the request using information from the HTTP_X_FORWARDED_PORT (if USE_X_FORWARDED_PORT is enabled) and SERVER_PORT META variables, in that order.
HttpRequest.get_signed_cookie(key, default=RAISE_ERROR, salt='', max_age=None)  
Returns a cookie value for a signed cookie, or raises a django.core.signing.BadSignature exception if the signature is no longer valid. If you provide the default argument the exception will be suppressed and that default value will be returned instead. The optional salt argument can be used to provide extra protection against brute force attacks on your secret key. If supplied, the max_age argument will be checked against the signed timestamp attached to the cookie value to ensure the cookie is not older than max_age seconds. For example: >>> request.get_signed_cookie('name')
'Tony'
>>> request.get_signed_cookie('name', salt='name-salt')
'Tony' # assuming cookie was set using the same salt
>>> request.get_signed_cookie('nonexistent-cookie')
...
KeyError: 'nonexistent-cookie'
>>> request.get_signed_cookie('nonexistent-cookie', False)
False
>>> request.get_signed_cookie('cookie-that-was-tampered-with')
...
BadSignature: ...
>>> request.get_signed_cookie('name', max_age=60)
...
SignatureExpired: Signature age 1677.3839159 > 60 seconds
>>> request.get_signed_cookie('name', False, max_age=60)
False
 See cryptographic signing for more information.
HttpRequest.headers  
A case insensitive, dict-like object that provides access to all HTTP-prefixed headers (plus Content-Length and Content-Type) from the request. The name of each header is stylized with title-casing (e.g. User-Agent) when it’s displayed. You can access headers case-insensitively: >>> request.headers
{'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6', ...}

>>> 'User-Agent' in request.headers
True
>>> 'user-agent' in request.headers
True

>>> request.headers['User-Agent']
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6)
>>> request.headers['user-agent']
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6)

>>> request.headers.get('User-Agent')
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6)
>>> request.headers.get('user-agent')
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6)
 For use in, for example, Django templates, headers can also be looked up using underscores in place of hyphens: {{ request.headers.user_agent }}
HttpRequest.is_secure()  
Returns True if the request is secure; that is, if it was made with HTTPS.
HttpRequest.META  
A dictionary containing all available HTTP headers. Available headers depend on the client and server, but here are some examples:  
CONTENT_LENGTH – The length of the request body (as a string). 
CONTENT_TYPE – The MIME type of the request body. 
HTTP_ACCEPT – Acceptable content types for the response. 
HTTP_ACCEPT_ENCODING – Acceptable encodings for the response. 
HTTP_ACCEPT_LANGUAGE – Acceptable languages for the response. 
HTTP_HOST – The HTTP Host header sent by the client. 
HTTP_REFERER – The referring page, if any. 
HTTP_USER_AGENT – The client’s user-agent string. 
QUERY_STRING – The query string, as a single (unparsed) string. 
REMOTE_ADDR – The IP address of the client. 
REMOTE_HOST – The hostname of the client. 
REMOTE_USER – The user authenticated by the web server, if any. 
REQUEST_METHOD – A string such as "GET" or "POST". 
SERVER_NAME – The hostname of the server. 
SERVER_PORT – The port of the server (as a string).  With the exception of CONTENT_LENGTH and CONTENT_TYPE, as given above, any HTTP headers in the request are converted to META keys by converting all characters to uppercase, replacing any hyphens with underscores and adding an HTTP_ prefix to the name. So, for example, a header called X-Bender would be mapped to the META key HTTP_X_BENDER. Note that runserver strips all headers with underscores in the name, so you won’t see them in META. This prevents header-spoofing based on ambiguity between underscores and dashes both being normalizing to underscores in WSGI environment variables. It matches the behavior of web servers like Nginx and Apache 2.4+. HttpRequest.headers is a simpler way to access all HTTP-prefixed headers, plus CONTENT_LENGTH and CONTENT_TYPE.
HttpRequest.method  
A string representing the HTTP method used in the request. This is guaranteed to be uppercase. For example: if request.method == 'GET':
    do_something()
elif request.method == 'POST':
    do_something_else()
HttpRequest.path  
A string representing the full path to the requested page, not including the scheme, domain, or query string. Example: "/music/bands/the_beatles/"
HttpRequest.path_info  
Under some web server configurations, the portion of the URL after the host name is split up into a script prefix portion and a path info portion. The path_info attribute always contains the path info portion of the path, no matter what web server is being used. Using this instead of path can make your code easier to move between test and deployment servers. For example, if the WSGIScriptAlias for your application is set to "/minfo", then path might be "/minfo/music/bands/the_beatles/" and path_info would be "/music/bands/the_beatles/".
HttpRequest.POST  
A dictionary-like object containing all given HTTP POST parameters, providing that the request contains form data. See the QueryDict documentation below. If you need to access raw or non-form data posted in the request, access this through the HttpRequest.body attribute instead. It’s possible that a request can come in via POST with an empty POST dictionary – if, say, a form is requested via the POST HTTP method but does not include form data. Therefore, you shouldn’t use if request.POST to check for use of the POST method; instead, use if request.method ==
"POST" (see HttpRequest.method). POST does not include file-upload information. See FILES.
HttpRequest.resolver_match  
An instance of ResolverMatch representing the resolved URL. This attribute is only set after URL resolving took place, which means it’s available in all views but not in middleware which are executed before URL resolving takes place (you can use it in process_view() though).
HttpRequest.session  
From the SessionMiddleware: A readable and writable, dictionary-like object that represents the current session.
HttpRequest.site  
From the CurrentSiteMiddleware: An instance of Site or RequestSite as returned by get_current_site() representing the current site.
HttpRequest.urlconf  
This will be used as the root URLconf for the current request, overriding the ROOT_URLCONF setting. See How Django processes a request for details. urlconf can be set to None to revert any changes made by previous middleware and return to using the ROOT_URLCONF.
HttpRequest.user  
From the AuthenticationMiddleware: An instance of AUTH_USER_MODEL representing the currently logged-in user. If the user isn’t currently logged in, user will be set to an instance of AnonymousUser. You can tell them apart with is_authenticated, like so: if request.user.is_authenticated:
    ... # Do something for logged-in users.
else:
    ... # Do something for anonymous users.
HttpResponse.__delitem__(header)  
Deletes the header with the given name. Fails silently if the header doesn’t exist. Case-insensitive.
HttpResponse.__getitem__(header)  
Returns the value for the given header name. Case-insensitive.