neulab/docprompting-conala huggingface dataset:
torch.zeros_like(input, *, dtype=None, layout=None, device=None, requires_grad=False, memory_format=torch.preserve_format) → Tensor  
Returns a tensor filled with the scalar value 0, with the same size as input. torch.zeros_like(input) is equivalent to torch.zeros(input.size(), dtype=input.dtype, layout=input.layout, device=input.device).  Warning As of 0.4, this function does not support an out keyword. As an alternative, the old torch.zeros_like(input, out=output) is equivalent to torch.zeros(input.size(), out=output).   Parameters 
input (Tensor) – the size of input will determine size of the output tensor.  Keyword Arguments 
 
dtype (torch.dtype, optional) – the desired data type of returned Tensor. Default: if None, defaults to the dtype of input. 
layout (torch.layout, optional) – the desired layout of returned tensor. Default: if None, defaults to the layout of input. 
device (torch.device, optional) – the desired device of returned tensor. Default: if None, defaults to the device of input. 
requires_grad (bool, optional) – If autograd should record operations on the returned tensor. Default: False. 
memory_format (torch.memory_format, optional) – the desired memory format of returned Tensor. Default: torch.preserve_format.    Example: >>> input = torch.empty(2, 3)
>>> torch.zeros_like(input)
tensor([[ 0.,  0.,  0.],
        [ 0.,  0.,  0.]])
torch._assert(condition, message) [source]
 
A wrapper around Python’s assert which is symbolically traceable.
werkzeug.exceptions.abort(status, *args, **kwargs)  
Raises an HTTPException for the given status code or WSGI application. If a status code is given, it will be looked up in the list of exceptions and will raise that exception. If passed a WSGI application, it will wrap it in a proxy WSGI exception and raise that: abort(404)  # 404 Not Found
abort(Response('Hello World'))
  Parameters 
 
status (Union[int, Response]) –  
args (Any) –  
kwargs (Any) –    Return type 
NoReturn
class werkzeug.exceptions.Aborter(mapping=None, extra=None)  
When passed a dict of code -> exception items it can be used as callable that raises exceptions. If the first argument to the callable is an integer it will be looked up in the mapping, if it’s a WSGI application it will be raised in a proxy exception. The rest of the arguments are forwarded to the exception constructor.  Parameters 
 
mapping (Optional[Dict[int, Type[werkzeug.exceptions.HTTPException]]]) –  
extra (Optional[Dict[int, Type[werkzeug.exceptions.HTTPException]]]) –    Return type 
None
class werkzeug.datastructures.Accept(values=())  
An Accept object is just a list subclass for lists of (value, quality) tuples. It is automatically sorted by specificity and quality. All Accept objects work similar to a list but provide extra functionality for working with the data. Containment checks are normalized to the rules of that header: >>> a = CharsetAccept([('ISO-8859-1', 1), ('utf-8', 0.7)])
>>> a.best
'ISO-8859-1'
>>> 'iso-8859-1' in a
True
>>> 'UTF8' in a
True
>>> 'utf7' in a
False
 To get the quality for an item you can use normal item lookup: >>> print a['utf-8']
0.7
>>> a['utf7']
0
  Changelog Changed in version 1.0.0: Accept internal values are no longer ordered alphabetically for equal quality tags. Instead the initial order is preserved.   Changed in version 0.5: Accept objects are forced immutable now.   
property best  
The best match as value. 
  
best_match(matches, default=None)  
Returns the best match from a list of possible matches based on the specificity and quality of the client. If two items have the same quality and specificity, the one is returned that comes first.  Parameters 
 
matches – a list of matches to check for 
default – the value that is returned if none match    
  
find(key)  
Get the position of an entry or return -1.  Parameters 
key – The key to be looked up.   
  
index(key)  
Get the position of an entry or raise ValueError.  Parameters 
key – The key to be looked up.    Changelog Changed in version 0.5: This used to raise IndexError, which was inconsistent with the list API.  

  
quality(key)  
Returns the quality of the key.  Changelog New in version 0.6: In previous versions you had to use the item-lookup syntax (eg: obj[key] instead of obj.quality(key))  

  
to_header()  
Convert the header set into an HTTP header string. 
  
values()  
Iterate over all values.
best_match(matches, default=None)  
Returns the best match from a list of possible matches based on the specificity and quality of the client. If two items have the same quality and specificity, the one is returned that comes first.  Parameters 
 
matches – a list of matches to check for 
default – the value that is returned if none match
find(key)  
Get the position of an entry or return -1.  Parameters 
key – The key to be looked up.
index(key)  
Get the position of an entry or raise ValueError.  Parameters 
key – The key to be looked up.    Changelog Changed in version 0.5: This used to raise IndexError, which was inconsistent with the list API.
quality(key)  
Returns the quality of the key.  Changelog New in version 0.6: In previous versions you had to use the item-lookup syntax (eg: obj[key] instead of obj.quality(key))
class werkzeug.routing.AnyConverter(map, *items)  
Matches one of the items provided. Items can either be Python identifiers or strings: Rule('/<any(about, help, imprint, class, "foo,bar"):page_name>')
  Parameters 
 
map (Map) – the Map. 
items (str) – this function accepts the possible items as positional arguments.   Return type 
None
werkzeug.utils.append_slash_redirect(environ, code=301)  
Redirects to the same URL but with a slash appended. The behavior of this function is undefined if the path ends with a slash already.  Parameters 
 
environ (WSGIEnvironment) – the WSGI environment for the request that triggers the redirect. 
code (int) – the status code for the redirect.   Return type 
Response
class werkzeug.datastructures.Authorization(auth_type, data=None)  
Represents an Authorization header sent by the client. This is returned by parse_authorization_header(). It can be useful to create the object manually to pass to the test Client.  Changelog Changed in version 0.5: This object became immutable.   
property cnonce  
If the server sent a qop-header in the WWW-Authenticate header, the client has to provide this value for HTTP digest auth. See the RFC for more details. 
  
property nc  
The nonce count value transmitted by clients if a qop-header is also transmitted. HTTP digest auth only. 
  
property nonce  
The nonce the server sent for digest auth, sent back by the client. A nonce should be unique for every 401 response for HTTP digest auth. 
  
property opaque  
The opaque header from the server returned unchanged by the client. It is recommended that this string be base64 or hexadecimal data. Digest auth only. 
  
property password  
When the authentication type is basic this is the password transmitted by the client, else None. 
  
property qop  
Indicates what “quality of protection” the client has applied to the message for HTTP digest auth. Note that this is a single token, not a quoted list of alternatives as in WWW-Authenticate. 
  
property realm  
This is the server realm sent back for HTTP digest auth. 
  
property response  
A string of 32 hex digits computed as defined in RFC 2617, which proves that the user knows a password. Digest auth only. 
  
to_header()  
Convert to a string value for an Authorization header.  New in version 2.0: Added to support passing authorization to the test client.  
  
property uri  
The URI from Request-URI of the Request-Line; duplicated because proxies are allowed to change the Request-Line in transit. HTTP digest auth only. 
  
property username  
The username transmitted. This is set for both basic and digest auth all the time.
to_header()  
Convert to a string value for an Authorization header.  New in version 2.0: Added to support passing authorization to the test client.
decode_netloc()  
Decodes the netloc part into a string.  Return type 
str
decode_query(*args, **kwargs)  
Decodes the query part of the URL. Ths is a shortcut for calling url_decode() on the query argument. The arguments and keyword arguments are forwarded to url_decode() unchanged.  Parameters 
 
args (Any) –  
kwargs (Any) –    Return type 
ds.MultiDict[str, str]
encode_netloc()  
Encodes the netloc part to an ASCII safe URL as bytes.  Return type 
str
get_file_location(pathformat=None)  
Returns a tuple with the location of the file in the form (server, location). If the netloc is empty in the URL or points to localhost, it’s represented as None. The pathformat by default is autodetection but needs to be set when working with URLs of a specific system. The supported values are 'windows' when working with Windows or DOS paths and 'posix' when working with posix paths. If the URL does not point to a local file, the server and location are both represented as None.  Parameters 
pathformat (Optional[str]) – The expected format of the path component. Currently 'windows' and 'posix' are supported. Defaults to None which is autodetect.  Return type 
Tuple[Optional[str], Optional[str]]
join(*args, **kwargs)  
Joins this URL with another one. This is just a convenience function for calling into url_join() and then parsing the return value again.  Parameters 
 
args (Any) –  
kwargs (Any) –    Return type 
werkzeug.urls.BaseURL
replace(**kwargs)  
Return an URL with the same values, except for those parameters given new values by whichever keyword arguments are specified.  Parameters 
kwargs (Any) –   Return type 
werkzeug.urls.BaseURL
to_iri_tuple()  
Returns a URL tuple that holds a IRI. This will try to decode as much information as possible in the URL without losing information similar to how a web browser does it for the URL bar. It’s usually more interesting to directly call uri_to_iri() which will return a string.  Return type 
werkzeug.urls.BaseURL
to_uri_tuple()  
Returns a BytesURL tuple that holds a URI. This will encode all the information in the URL properly to ASCII using the rules a web browser would follow. It’s usually more interesting to directly call iri_to_uri() which will return a string.  Return type 
werkzeug.urls.BaseURL
to_url()  
Returns a URL string or bytes depending on the type of the information stored. This is just a convenience function for calling url_unparse() for this URL.  Return type 
str
werkzeug.utils.bind_arguments(func, args, kwargs)  
Bind the arguments provided into a dict. When passed a function, a tuple of arguments and a dict of keyword arguments bind_arguments returns a dict of names as the function would see it. This can be useful to implement a cache decorator that uses the function arguments to build the cache key based on the values of the arguments.  Parameters 
 
func – the function the arguments should be bound for. 
args – tuple of positional arguments. 
kwargs – a dict of keyword arguments.   Returns 
a dict of bound keyword arguments.    Deprecated since version 2.0: Will be removed in Werkzeug 2.1. Use Signature.bind() instead.
class werkzeug.filesystem.BrokenFilesystemWarning  
The warning used by Werkzeug to signal a broken filesystem. Will only be used once per runtime.
class werkzeug.urls.BytesURL(scheme, netloc, path, query, fragment)  
Represents a parsed URL in bytes. Create new instance of _URLTuple(scheme, netloc, path, query, fragment)  Parameters 
 
scheme (str) –  
netloc (str) –  
path (str) –  
query (str) –  
fragment (str) –      
decode(charset='utf-8', errors='replace')  
Decodes the URL to a tuple made out of strings. The charset is only being used for the path, query and fragment.  Parameters 
 
charset (str) –  
errors (str) –    Return type 
werkzeug.urls.URL   
  
encode_netloc()  
Returns the netloc unchanged as bytes.  Return type 
bytes
decode(charset='utf-8', errors='replace')  
Decodes the URL to a tuple made out of strings. The charset is only being used for the path, query and fragment.  Parameters 
 
charset (str) –  
errors (str) –    Return type 
werkzeug.urls.URL
encode_netloc()  
Returns the netloc unchanged as bytes.  Return type 
bytes
class werkzeug.utils.cached_property(fget, name=None, doc=None)  
A property() that is only evaluated once. Subsequent access returns the cached value. Setting the property sets the cached value. Deleting the property clears the cached value, accessing it again will evaluate it again. class Example:
    @cached_property
    def value(self):
        # calculate something important here
        return 42

e = Example()
e.value  # evaluates
e.value  # uses cache
e.value = 16  # sets cache
del e.value  # clears cache
 The class must have a __dict__ for this to work.  Changed in version 2.0: del obj.name clears the cached value.   Parameters 
 
fget (Callable[[Any], Any]) –  
name (Optional[str]) –  
doc (Optional[str]) –    Return type 
None
CGI If all other deployment methods do not work, CGI will work for sure. CGI is supported by all major servers but usually has a less-than-optimal performance. This is also the way you can use a Werkzeug application on Google’s AppEngine, there however the execution does happen in a CGI-like environment. The application’s performance is unaffected because of that.  Creating a .cgi file First you need to create the CGI application file. Let’s call it yourapplication.cgi: #!/usr/bin/python
from wsgiref.handlers import CGIHandler
from yourapplication import make_app

application = make_app()
CGIHandler().run(application)
   Server Setup Usually there are two ways to configure the server. Either just copy the .cgi into a cgi-bin (and use mod_rewrite or something similar to rewrite the URL) or let the server point to the file directly. In Apache for example you can put something like this into the config: ScriptAlias /app /path/to/the/application.cgi
 For more information consult the documentation of your webserver.
class werkzeug.datastructures.CharsetAccept(values=())  
Like Accept but with normalization for charsets.
werkzeug.security.check_password_hash(pwhash, password)  
Check a password against a given salted and hashed password value. In order to support unsalted legacy passwords this method supports plain text passwords, md5 and sha1 hashes (both salted and unsalted). Returns True if the password matched, False otherwise.  Parameters 
 
pwhash (str) – a hashed string like returned by generate_password_hash(). 
password (str) – the plaintext password to compare against the hash.   Return type 
bool
delete(*args, **kw)  
Call open() with method set to DELETE.  Parameters 
 
args (Any) –  
kw (Any) –    Return type 
werkzeug.test.TestResponse
delete_cookie(server_name, key, path='/', domain=None, secure=False, httponly=False, samesite=None)  
Deletes a cookie in the test client.  Parameters 
 
server_name (str) –  
key (str) –  
path (str) –  
domain (Optional[str]) –  
secure (bool) –  
httponly (bool) –  
samesite (Optional[str]) –    Return type 
None
get(*args, **kw)  
Call open() with method set to GET.  Parameters 
 
args (Any) –  
kw (Any) –    Return type 
werkzeug.test.TestResponse
head(*args, **kw)  
Call open() with method set to HEAD.  Parameters 
 
args (Any) –  
kw (Any) –    Return type 
werkzeug.test.TestResponse
open(*args, as_tuple=False, buffered=False, follow_redirects=False, **kwargs)  
Generate an environ dict from the given arguments, make a request to the application using it, and return the response.  Parameters 
 
args (Any) – Passed to EnvironBuilder to create the environ for the request. If a single arg is passed, it can be an existing EnvironBuilder or an environ dict. 
buffered (bool) – Convert the iterator returned by the app into a list. If the iterator has a close() method, it is called automatically. 
follow_redirects (bool) – Make additional requests to follow HTTP redirects until a non-redirect status is returned. TestResponse.history lists the intermediate responses. 
as_tuple (bool) –  
kwargs (Any) –    Return type 
werkzeug.test.TestResponse    Changed in version 2.0: as_tuple is deprecated and will be removed in Werkzeug 2.1. Use TestResponse.request and request.environ instead.   Changed in version 2.0: The request input stream is closed when calling response.close(). Input streams for redirects are automatically closed.   Changelog Changed in version 0.5: If a dict is provided as file in the dict for the data parameter the content type has to be called content_type instead of mimetype. This change was made for consistency with werkzeug.FileWrapper.   Changed in version 0.5: Added the follow_redirects parameter.
options(*args, **kw)  
Call open() with method set to OPTIONS.  Parameters 
 
args (Any) –  
kw (Any) –    Return type 
werkzeug.test.TestResponse
patch(*args, **kw)  
Call open() with method set to PATCH.  Parameters 
 
args (Any) –  
kw (Any) –    Return type 
werkzeug.test.TestResponse
post(*args, **kw)  
Call open() with method set to POST.  Parameters 
 
args (Any) –  
kw (Any) –    Return type 
werkzeug.test.TestResponse
put(*args, **kw)  
Call open() with method set to PUT.  Parameters 
 
args (Any) –  
kw (Any) –    Return type 
werkzeug.test.TestResponse
set_cookie(server_name, key, value='', max_age=None, expires=None, path='/', domain=None, secure=False, httponly=False, samesite=None, charset='utf-8')  
Sets a cookie in the client’s cookie jar. The server name is required and has to match the one that is also passed to the open call.  Parameters 
 
server_name (str) –  
key (str) –  
value (str) –  
max_age (Optional[Union[datetime.timedelta, int]]) –  
expires (Optional[Union[str, datetime.datetime, int, float]]) –  
path (str) –  
domain (Optional[str]) –  
secure (bool) –  
httponly (bool) –  
samesite (Optional[str]) –  
charset (str) –    Return type 
None
trace(*args, **kw)  
Call open() with method set to TRACE.  Parameters 
 
args (Any) –  
kw (Any) –    Return type 
werkzeug.test.TestResponse
class werkzeug.wsgi.ClosingIterator(iterable, callbacks=None)  
The WSGI specification requires that all middlewares and gateways respect the close callback of the iterable returned by the application. Because it is useful to add another close action to a returned iterable and adding a custom iterable is a boring task this class can be used for that: return ClosingIterator(app(environ, start_response), [cleanup_session,
                                                      cleanup_locals])
 If there is just one close function it can be passed instead of the list. A closing iterator is not needed if the application uses response objects and finishes the processing if the response is started: try:
    return response(environ, start_response)
finally:
    cleanup_session()
    cleanup_locals()
  Parameters 
 
iterable (Iterable[bytes]) –  
callbacks (Optional[Union[Callable[[], None], Iterable[Callable[[], None]]]]) –    Return type 
None
class werkzeug.datastructures.CombinedMultiDict(dicts=None)  
A read only MultiDict that you can pass multiple MultiDict instances as sequence and it will combine the return values of all wrapped dicts: >>> from werkzeug.datastructures import CombinedMultiDict, MultiDict
>>> post = MultiDict([('foo', 'bar')])
>>> get = MultiDict([('blub', 'blah')])
>>> combined = CombinedMultiDict([get, post])
>>> combined['foo']
'bar'
>>> combined['blub']
'blah'
 This works for all read operations and will raise a TypeError for methods that usually change data which isn’t possible. 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.datastructures.ContentRange(units, start, stop, length=None, on_update=None)  
Represents the content range header.  Changelog New in version 0.7.   
property length  
The length of the range or None. 
  
set(start, stop, length=None, units='bytes')  
Simple method to update the ranges. 
  
property start  
The start point of the range or None. 
  
property stop  
The stop point of the range (non-inclusive) or None. Can only be None if also start is None. 
  
property units  
The units to use, usually “bytes” 
  
unset()  
Sets the units to None which indicates that the header should no longer be used.
set(start, stop, length=None, units='bytes')  
Simple method to update the ranges.
unset()  
Sets the units to None which indicates that the header should no longer be used.
werkzeug.http.cookie_date(expires=None)  
Format a datetime object or timestamp into an RFC 2822 date string for Set-Cookie expires.  Deprecated since version 2.0: Will be removed in Werkzeug 2.1. Use http_date() instead.   Parameters 
expires (Optional[Union[datetime.datetime, datetime.date, int, float, time.struct_time]]) –   Return type 
str
werkzeug.test.create_environ(*args, **kwargs)  
Create a new WSGI environ dict based on the values passed. The first parameter should be the path of the request which defaults to ‘/’. The second one can either be an absolute path (in that case the host is localhost:80) or a full path to the request with scheme, netloc port and the path to the script. This accepts the same arguments as the EnvironBuilder constructor.  Changelog Changed in version 0.5: This function is now a thin wrapper over EnvironBuilder which was added in 0.5. The headers, environ_base, environ_overrides and charset parameters were added.   Parameters 
 
args (Any) –  
kwargs (Any) –    Return type 
WSGIEnvironment
class werkzeug.debug.DebuggedApplication(app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, pin_security=True, pin_logging=True)  
Enables debugging support for a given application: from werkzeug.debug import DebuggedApplication
from myapp import app
app = DebuggedApplication(app, evalex=True)
 The evalex keyword argument allows evaluating expressions in a traceback’s frame context.  Parameters 
 
app (WSGIApplication) – the WSGI application to run debugged. 
evalex (bool) – enable exception evaluation feature (interactive debugging). This requires a non-forking server. 
request_key (str) – The key that points to the request object in ths environment. This parameter is ignored in current versions. 
console_path (str) – the URL for a general purpose console. 
console_init_func (Optional[Callable[[], Dict[str, Any]]]) – the function that is executed before starting the general purpose console. The return value is used as initial namespace. 
show_hidden_frames (bool) – by default hidden traceback frames are skipped. You can show them by setting this parameter to True. 
pin_security (bool) – can be used to disable the pin based security system. 
pin_logging (bool) – enables the logging of the pin system.   Return type 
None
class werkzeug.middleware.dispatcher.DispatcherMiddleware(app, mounts=None)  
Combine multiple applications as a single WSGI application. Requests are dispatched to an application based on the path it is mounted under.  Parameters 
 
app (WSGIApplication) – The WSGI application to dispatch to if the request doesn’t match a mounted path. 
mounts (Optional[Dict[str, WSGIApplication]]) – Maps path prefixes to applications for dispatching.   Return type 
None