neulab/docprompting-conala huggingface dataset:
werkzeug.http.dump_cookie(key, value='', max_age=None, expires=None, path='/', domain=None, secure=False, httponly=False, charset='utf-8', sync_expires=True, max_size=4093, samesite=None)  
Create a Set-Cookie header without the Set-Cookie prefix. The return value is usually restricted to ascii as the vast majority of values are properly escaped, but that is no guarantee. It’s tunneled through latin1 as required by PEP 3333. The return value is not ASCII safe if the key contains unicode characters. This is technically against the specification but happens in the wild. It’s strongly recommended to not use non-ASCII values for the keys.  Parameters 
 
max_age (Optional[Union[datetime.timedelta, int]]) – should be a number of seconds, or None (default) if the cookie should last only as long as the client’s browser session. Additionally timedelta objects are accepted, too. 
expires (Optional[Union[str, datetime.datetime, int, float]]) – should be a datetime object or unix timestamp. 
path (Optional[str]) – limits the cookie to a given path, per default it will span the whole domain. 
domain (Optional[str]) – Use this if you want to set a cross-domain cookie. For example, domain=".example.com" will set a cookie that is readable by the domain www.example.com, foo.example.com etc. Otherwise, a cookie will only be readable by the domain that set it. 
secure (bool) – The cookie will only be available via HTTPS 
httponly (bool) – disallow JavaScript to access the cookie. This is an extension to the cookie standard and probably not supported by all browsers. 
charset (str) – the encoding for string values. 
sync_expires (bool) – automatically set expires if max_age is defined but expires not. 
max_size (int) – Warn if the final header value exceeds this size. The default, 4093, should be safely supported by most browsers. Set to 0 to disable this check. 
samesite (Optional[str]) – Limits the scope of the cookie such that it will only be attached to requests if those requests are same-site. 
key (str) –  
value (Union[bytes, str]) –    Return type 
str    Changelog Changed in version 1.0.0: The string 'None' is accepted for samesite.
werkzeug.http.dump_header(iterable, allow_token=True)  
Dump an HTTP header again. This is the reversal of parse_list_header(), parse_set_header() and parse_dict_header(). This also quotes strings that include an equals sign unless you pass it as dict of key, value pairs. >>> dump_header({'foo': 'bar baz'})
'foo="bar baz"'
>>> dump_header(('foo', 'bar baz'))
'foo, "bar baz"'
  Parameters 
 
iterable (Union[Dict[str, Union[str, int]], Iterable[str]]) – the iterable or dict of values to quote. 
allow_token (bool) – if set to False tokens as values are disallowed. See quote_header_value() for more details.   Return type 
str
class werkzeug.routing.EndpointPrefix(prefix, rules)  
Prefixes all endpoints (which must be strings for this factory) with another string. This can be useful for sub applications: url_map = Map([
    Rule('/', endpoint='index'),
    EndpointPrefix('blog/', [Submount('/blog', [
        Rule('/', endpoint='index'),
        Rule('/entry/<entry_slug>', endpoint='show')
    ])])
])
  Parameters 
 
prefix (str) –  
rules (Iterable[Rule]) –    Return type 
None
close()  
Closes all files. If you put real file objects into the files dict you can call this method to automatically close them all in one go.  Return type 
None
classmethod from_environ(environ, **kwargs)  
Turn an environ dict back into a builder. Any extra kwargs override the args extracted from the environ.  Changed in version 2.0: Path and query values are passed through the WSGI decoding dance to avoid double encoding.   Changelog New in version 0.15.   Parameters 
 
environ (WSGIEnvironment) –  
kwargs (Any) –    Return type 
EnvironBuilder
get_environ()  
Return the built environ.  Changelog Changed in version 0.15: The content type and length headers are set based on input stream detection. Previously this only set the WSGI keys.   Return type 
WSGIEnvironment
get_request(cls=None)  
Returns a request with the data. If the request class is not specified request_class is used.  Parameters 
cls (Optional[Type[werkzeug.wrappers.request.Request]]) – The request wrapper to use.  Return type 
werkzeug.wrappers.request.Request
static json_dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)  
The serialization function used when json is passed.
server_protocol = 'HTTP/1.1'  
the server protocol to use. defaults to HTTP/1.1
wsgi_version = (1, 0)  
the wsgi version to use. defaults to (1, 0)
class werkzeug.datastructures.EnvironHeaders(environ)  
Read only version of the headers from a WSGI environment. This provides the same interface as Headers and is constructed from a WSGI environment. From Werkzeug 0.3 onwards, the KeyError raised by this class is also a subclass of the BadRequest HTTP exception and will render a page for a 400 BAD REQUEST if caught in a catch-all for HTTP exceptions.
class werkzeug.utils.environ_property(name, default=None, load_func=None, dump_func=None, read_only=None, doc=None)  
Maps request attributes to environment variables. This works not only for the Werkzeug request object, but also any other class with an environ attribute: >>> class Test(object):
...     environ = {'key': 'value'}
...     test = environ_property('key')
>>> var = Test()
>>> var.test
'value'
 If you pass it a second value it’s used as default if the key does not exist, the third one can be a converter that takes a value and converts it. If it raises ValueError or TypeError the default value is used. If no default value is provided None is used. Per default the property is read only. You have to explicitly enable it by passing read_only=False to the constructor.
werkzeug.utils.escape(s)  
Replace &, <, >, ", and ' with HTML-safe sequences. None is escaped to an empty string.  Deprecated since version 2.0: Will be removed in Werkzeug 2.1. Use MarkupSafe instead.   Parameters 
s (Any) –   Return type 
str
class werkzeug.datastructures.ETags(strong_etags=None, weak_etags=None, star_tag=False)  
A set that can be used to check if one etag is present in a collection of etags.  
as_set(include_weak=False)  
Convert the ETags object into a python set. Per default all the weak etags are not part of this set. 
  
contains(etag)  
Check if an etag is part of the set ignoring weak tags. It is also possible to use the in operator. 
  
contains_raw(etag)  
When passed a quoted tag it will check if this tag is part of the set. If the tag is weak it is checked against weak and strong tags, otherwise strong only. 
  
contains_weak(etag)  
Check if an etag is part of the set including weak and strong tags. 
  
is_strong(etag)  
Check if an etag is strong. 
  
is_weak(etag)  
Check if an etag is weak. 
  
to_header()  
Convert the etags set into a HTTP header string.
as_set(include_weak=False)  
Convert the ETags object into a python set. Per default all the weak etags are not part of this set.
contains(etag)  
Check if an etag is part of the set ignoring weak tags. It is also possible to use the in operator.
contains_raw(etag)  
When passed a quoted tag it will check if this tag is part of the set. If the tag is weak it is checked against weak and strong tags, otherwise strong only.
contains_weak(etag)  
Check if an etag is part of the set including weak and strong tags.
werkzeug.wsgi.extract_path_info(environ_or_baseurl, path_or_url, charset='utf-8', errors='werkzeug.url_quote', collapse_http_schemes=True)  
Extracts the path info from the given URL (or WSGI environment) and path. The path info returned is a string. The URLs might also be IRIs. If the path info could not be determined, None is returned. Some examples: >>> extract_path_info('http://example.com/app', '/app/hello')
'/hello'
>>> extract_path_info('http://example.com/app',
...                   'https://example.com/app/hello')
'/hello'
>>> extract_path_info('http://example.com/app',
...                   'https://example.com/app/hello',
...                   collapse_http_schemes=False) is None
True
 Instead of providing a base URL you can also pass a WSGI environment.  Parameters 
 
environ_or_baseurl (Union[str, WSGIEnvironment]) – a WSGI environment dict, a base URL or base IRI. This is the root of the application. 
path_or_url (Union[str, werkzeug.urls._URLTuple]) – an absolute path from the server root, a relative path (in which case it’s the path info) or a full URL. 
charset (str) – the charset for byte data in URLs 
errors (str) – the error handling on decode 
collapse_http_schemes (bool) – if set to False the algorithm does not assume that http and https on the same server point to the same resource.   Return type 
Optional[str]    Changelog Changed in version 0.15: The errors parameter defaults to leaving invalid bytes quoted instead of replacing them.   New in version 0.6.
class werkzeug.datastructures.FileMultiDict(mapping=None)  
A special MultiDict that has convenience methods to add files to it. This is used for EnvironBuilder and generally useful for unittesting.  Changelog New in version 0.5.   
add_file(name, file, filename=None, content_type=None)  
Adds a new file to the dict. file can be a file name or a file-like or a FileStorage object.  Parameters 
 
name – the name of the field. 
file – a filename or file-like object 
filename – an optional filename 
content_type – an optional content type
add_file(name, file, filename=None, content_type=None)  
Adds a new file to the dict. file can be a file name or a file-like or a FileStorage object.  Parameters 
 
name – the name of the field. 
file – a filename or file-like object 
filename – an optional filename 
content_type – an optional content type
class werkzeug.datastructures.FileStorage(stream=None, filename=None, name=None, content_type=None, content_length=None, headers=None)  
The FileStorage class is a thin wrapper over incoming files. It is used by the request object to represent uploaded files. All the attributes of the wrapper stream are proxied by the file storage so it’s possible to do storage.read() instead of the long form storage.stream.read().  
stream  
The input stream for the uploaded file. This usually points to an open temporary file. 
  
filename  
The filename of the file on the client. 
  
name  
The name of the form field. 
  
headers  
The multipart headers as Headers object. This usually contains irrelevant information but in combination with custom multipart requests the raw headers might be interesting.  Changelog New in version 0.6.  

  
close()  
Close the underlying file if possible. 
  
property content_length  
The content-length sent in the header. Usually not available 
  
property content_type  
The content-type sent in the header. Usually not available 
  
property mimetype  
Like content_type, but without parameters (eg, without charset, type etc.) and always lowercase. For example if the content type is text/HTML; charset=utf-8 the mimetype would be 'text/html'.  Changelog New in version 0.7.  

  
property mimetype_params  
The mimetype parameters as dict. For example if the content type is text/html; charset=utf-8 the params would be {'charset': 'utf-8'}.  Changelog New in version 0.7.  

  
save(dst, buffer_size=16384)  
Save the file to a destination path or file object. If the destination is a file object you have to close it yourself after the call. The buffer size is the number of bytes held in memory during the copy process. It defaults to 16KB. For secure file saving also have a look at secure_filename().  Parameters 
 
dst – a filename, os.PathLike, or open file object to write to. 
buffer_size – Passed as the length parameter of shutil.copyfileobj().     Changelog Changed in version 1.0: Supports pathlib.
headers  
The multipart headers as Headers object. This usually contains irrelevant information but in combination with custom multipart requests the raw headers might be interesting.  Changelog New in version 0.6.
save(dst, buffer_size=16384)  
Save the file to a destination path or file object. If the destination is a file object you have to close it yourself after the call. The buffer size is the number of bytes held in memory during the copy process. It defaults to 16KB. For secure file saving also have a look at secure_filename().  Parameters 
 
dst – a filename, os.PathLike, or open file object to write to. 
buffer_size – Passed as the length parameter of shutil.copyfileobj().     Changelog Changed in version 1.0: Supports pathlib.
class werkzeug.wsgi.FileWrapper(file, buffer_size=8192)  
This class can be used to convert a file-like object into an iterable. It yields buffer_size blocks until the file is fully read. You should not use this class directly but rather use the wrap_file() function that uses the WSGI server’s file wrapper support if it’s available.  Changelog New in version 0.5.  If you’re using this object together with a Response you have to use the direct_passthrough mode.  Parameters 
 
file (BinaryIO) – a file-like object with a read() method. 
buffer_size (int) – number of bytes for one iteration.   Return type 
None
werkzeug.utils.find_modules(import_path, include_packages=False, recursive=False)  
Finds all the modules below a package. This can be useful to automatically import all views / controllers so that their metaclasses / function decorators have a chance to register themselves on the application. Packages are not returned unless include_packages is True. This can also recursively list modules but in that case it will import all the packages to get the correct load path of that module.  Parameters 
 
import_path (str) – the dotted name for the package to find child modules. 
include_packages (bool) – set to True if packages should be returned, too. 
recursive (bool) – set to True if recursion should happen.   Returns 
generator  Return type 
Iterator[str]
class werkzeug.routing.FloatConverter(map, min=None, max=None, signed=False)  
This converter only accepts floating point values: Rule("/probability/<float:probability>")
 By default it only accepts unsigned, positive values. The signed parameter will enable signed, negative values. Rule("/offset/<float(signed=True):offset>")
  Parameters 
 
map (Map) – The Map. 
min (Optional[float]) – The minimal value. 
max (Optional[float]) – The maximal value. 
signed (bool) – Allow signed (negative) values.   Return type 
None    Changelog New in version 0.15: The signed parameter.
class werkzeug.formparser.FormDataParser(stream_factory=None, charset='utf-8', errors='replace', max_form_memory_size=None, max_content_length=None, cls=None, silent=True)  
This class implements parsing of form data for Werkzeug. By itself it can parse multipart and url encoded form data. It can be subclassed and extended but for most mimetypes it is a better idea to use the untouched stream and expose it as separate attributes on a request object.  Changelog New in version 0.8.   Parameters 
 
stream_factory (Optional[TStreamFactory]) – An optional callable that returns a new read and writeable file descriptor. This callable works the same as Response._get_file_stream(). 
charset (str) – The character set for URL and url encoded form data. 
errors (str) – The encoding error behavior. 
max_form_memory_size (Optional[int]) – the maximum number of bytes to be accepted for in-memory stored form data. If the data exceeds the value specified an RequestEntityTooLarge exception is raised. 
max_content_length (Optional[int]) – If this is provided and the transmitted data is longer than this value an RequestEntityTooLarge exception is raised. 
cls (Optional[Type[werkzeug.datastructures.MultiDict]]) – an optional dict class to use. If this is not specified or None the default MultiDict is used. 
silent (bool) – If set to False parsing errors will not be caught.   Return type 
None
werkzeug.http.generate_etag(data)  
Generate an etag for some data.  Changed in version 2.0: Use SHA-1. MD5 may not be available in some environments.   Parameters 
data (bytes) –   Return type 
str
werkzeug.security.generate_password_hash(password, method='pbkdf2:sha256', salt_length=16)  
Hash a password with the given method and salt with a string of the given length. The format of the string returned includes the method that was used so that check_password_hash() can check the hash. The format for the hashed string looks like this: method$salt$hash
 This method can not generate unsalted passwords but it is possible to set param method=’plain’ in order to enforce plaintext passwords. If a salt is used, hmac is used internally to salt the password. If PBKDF2 is wanted it can be enabled by setting the method to pbkdf2:method:iterations where iterations is optional: pbkdf2:sha256:80000$salt$hash
pbkdf2:sha256$salt$hash
  Parameters 
 
password (str) – the password to hash. 
method (str) – the hash method to use (one that hashlib supports). Can optionally be in the format pbkdf2:method:iterations to enable PBKDF2. 
salt_length (int) – the length of the salt in letters.   Return type 
str
werkzeug.wsgi.get_content_length(environ)  
Returns the content length from the WSGI environment as integer. If it’s not available or chunked transfer encoding is used, None is returned.  Changelog New in version 0.9.   Parameters 
environ (WSGIEnvironment) – the WSGI environ to fetch the content length from.  Return type 
Optional[int]
werkzeug.wsgi.get_current_url(environ, root_only=False, strip_querystring=False, host_only=False, trusted_hosts=None)  
Recreate the URL for a request from the parts in a WSGI environment. The URL is an IRI, not a URI, so it may contain Unicode characters. Use iri_to_uri() to convert it to ASCII.  Parameters 
 
environ (WSGIEnvironment) – The WSGI environment to get the URL parts from. 
root_only (bool) – Only build the root path, don’t include the remaining path or query string. 
strip_querystring (bool) – Don’t include the query string. 
host_only (bool) – Only build the scheme and host. 
trusted_hosts (Optional[Iterable[str]]) – A list of trusted host names to validate the host against.   Return type 
str
werkzeug.filesystem.get_filesystem_encoding()  
Returns the filesystem encoding that should be used. Note that this is different from the Python understanding of the filesystem encoding which might be deeply flawed. Do not use this value against Python’s string APIs because it might be different. See The Filesystem for the exact behavior. The concept of a filesystem encoding in generally is not something you should rely on. As such if you ever need to use this function except for writing wrapper code reconsider.  Return type 
str
werkzeug.wsgi.get_host(environ, trusted_hosts=None)  
Return the host for the given WSGI environment. The Host header is preferred, then SERVER_NAME if it’s not set. The returned host will only contain the port if it is different than the standard port for the protocol. Optionally, verify that the host is trusted using host_is_trusted() and raise a SecurityError if it is not.  Parameters 
 
environ (WSGIEnvironment) – A WSGI environment dict. 
trusted_hosts (Optional[Iterable[str]]) – A list of trusted host names.   Returns 
Host, with port if necessary.  Raises 
SecurityError – If the host is not trusted.  Return type 
str
werkzeug.wsgi.get_input_stream(environ, safe_fallback=True)  
Returns the input stream from the WSGI environment and wraps it in the most sensible way possible. The stream returned is not the raw WSGI stream in most cases but one that is safe to read from without taking into account the content length. If content length is not set, the stream will be empty for safety reasons. If the WSGI server supports chunked or infinite streams, it should set the wsgi.input_terminated value in the WSGI environ to indicate that.  Changelog New in version 0.9.   Parameters 
 
environ (WSGIEnvironment) – the WSGI environ to fetch the stream from. 
safe_fallback (bool) – use an empty stream as a safe fallback when the content length is not set. Disabling this allows infinite streams, which can be a denial-of-service risk.   Return type 
BinaryIO
werkzeug.wsgi.get_path_info(environ, charset='utf-8', errors='replace')  
Return the PATH_INFO from the WSGI environment and decode it unless charset is None.  Parameters 
 
environ (WSGIEnvironment) – WSGI environment to get the path from. 
charset (str) – The charset for the path info, or None if no decoding should be performed. 
errors (str) – The decoding error handling.   Return type 
str    Changelog New in version 0.9.
werkzeug.wsgi.get_query_string(environ)  
Returns the QUERY_STRING from the WSGI environment. This also takes care of the WSGI decoding dance. The string returned will be restricted to ASCII characters.  Parameters 
environ (WSGIEnvironment) – WSGI environment to get the query string from.  Return type 
str    Changelog New in version 0.9.
werkzeug.wsgi.get_script_name(environ, charset='utf-8', errors='replace')  
Return the SCRIPT_NAME from the WSGI environment and decode it unless charset is set to None.  Parameters 
 
environ (WSGIEnvironment) – WSGI environment to get the path from. 
charset (str) – The charset for the path, or None if no decoding should be performed. 
errors (str) – The decoding error handling.   Return type 
str    Changelog New in version 0.9.
add(_key, _value, **kw)  
Add a new header tuple to the list. Keyword arguments can specify additional parameters for the header value, with underscores converted to dashes: >>> d = Headers()
>>> d.add('Content-Type', 'text/plain')
>>> d.add('Content-Disposition', 'attachment', filename='foo.png')
 The keyword argument dumping uses dump_options_header() behind the scenes.  Changelog New in version 0.4.1: keyword arguments were added for wsgiref compatibility.
add_header(_key, _value, **_kw)  
Add a new header tuple to the list. An alias for add() for compatibility with the wsgiref add_header() method.
extend(*args, **kwargs)  
Extend headers in this object with items from another object containing header items as well as keyword arguments. To replace existing keys instead of extending, use update() instead. If provided, the first argument can be another Headers object, a MultiDict, dict, or iterable of pairs.  Changelog Changed in version 1.0: Support MultiDict. Allow passing kwargs.
get(key, default=None, type=None, as_bytes=False)  
Return the default value if the requested data doesn’t exist. If type is provided and is a callable it should convert the value, return it or raise a ValueError if that is not possible. In this case the function will return the default as if the value was not found: >>> d = Headers([('Content-Length', '42')])
>>> d.get('Content-Length', type=int)
42
  Changelog New in version 0.9: Added support for as_bytes.   Parameters 
 
key – The key to be looked up. 
default – The default value to be returned if the key can’t be looked up. If not further specified None is returned. 
type – A callable that is used to cast the value in the Headers. If a ValueError is raised by this callable the default value is returned. 
as_bytes – return bytes instead of strings.
getlist(key, type=None, as_bytes=False)  
Return the list of items for a given key. If that key is not in the Headers, the return value will be an empty list. Just like get(), getlist() accepts a type parameter. All items will be converted with the callable defined there.  Changelog New in version 0.9: Added support for as_bytes.   Parameters 
 
key – The key to be looked up. 
type – A callable that is used to cast the value in the Headers. If a ValueError is raised by this callable the value will be removed from the list. 
as_bytes – return bytes instead of strings.   Returns 
a list of all the values for the key.
get_all(name)  
Return a list of all the values for the named field. This method is compatible with the wsgiref get_all() method.
has_key(key)  
 Deprecated since version 2.0: Will be removed in Werkzeug 2.1. Use key in data instead.
pop(key=None, default=no value)  
Removes and returns a key or index.  Parameters 
key – The key to be popped. If this is an integer the item at that position is removed, if it’s a string the value for that key is. If the key is omitted or None the last item is removed.  Returns 
an item.