neulab/docprompting-conala huggingface dataset:
encoding  
The name of the encoding used to decode the stream’s bytes into strings, and to encode strings into bytes.
newlines  
A string, a tuple of strings, or None, indicating the newlines translated so far. Depending on the implementation and the initial constructor flags, this may not be available.
read(size=-1)  
Read and return at most size characters from the stream as a single str. If size is negative or None, reads until EOF.
readline(size=-1)  
Read until newline or EOF and return a single str. If the stream is already at EOF, an empty string is returned. If size is specified, at most size characters will be read.
seek(offset, whence=SEEK_SET)  
Change the stream position to the given offset. Behaviour depends on the whence parameter. The default value for whence is SEEK_SET.  
SEEK_SET or 0: seek from the start of the stream (the default); offset must either be a number returned by TextIOBase.tell(), or zero. Any other offset value produces undefined behaviour. 
SEEK_CUR or 1: “seek” to the current position; offset must be zero, which is a no-operation (all other values are unsupported). 
SEEK_END or 2: seek to the end of the stream; offset must be zero (all other values are unsupported).  Return the new absolute position as an opaque number.  New in version 3.1: The SEEK_* constants.
tell()  
Return the current stream position as an opaque number. The number does not usually represent a number of bytes in the underlying binary storage.
write(s)  
Write the string s to the stream and return the number of characters written.
reconfigure(*[, encoding][, errors][, newline][, line_buffering][, write_through])  
Reconfigure this text stream using new settings for encoding, errors, newline, line_buffering and write_through. Parameters not specified keep current settings, except errors='strict' is used when encoding is specified but errors is not specified. It is not possible to change the encoding or newline if some data has already been read from the stream. On the other hand, changing encoding after write is possible. This method does an implicit stream flush before setting the new parameters.  New in version 3.7.
write_through  
Whether writes are passed immediately to the underlying binary buffer.  New in version 3.7.
exception io.UnsupportedOperation  
An exception inheriting OSError and ValueError that is raised when an unsupported operation is called on a stream.
exception ipaddress.AddressValueError(ValueError)  
Any value error related to the address.
ipaddress.collapse_addresses(addresses)  
Return an iterator of the collapsed IPv4Network or IPv6Network objects. addresses is an iterator of IPv4Network or IPv6Network objects. A TypeError is raised if addresses contains mixed version objects. >>> [ipaddr for ipaddr in
... ipaddress.collapse_addresses([ipaddress.IPv4Network('192.0.2.0/25'),
... ipaddress.IPv4Network('192.0.2.128/25')])]
[IPv4Network('192.0.2.0/24')]
ipaddress.get_mixed_type_key(obj)  
Return a key suitable for sorting between networks and addresses. Address and Network objects are not sortable by default; they’re fundamentally different, so the expression: IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')
 doesn’t make sense. There are some times however, where you may wish to have ipaddress sort these anyway. If you need to do this, you can use this function as the key argument to sorted(). obj is either a network or address object.
class ipaddress.IPv4Address(address)  
Construct an IPv4 address. An AddressValueError is raised if address is not a valid IPv4 address. The following constitutes a valid IPv4 address:  A string in decimal-dot notation, consisting of four decimal integers in the inclusive range 0–255, separated by dots (e.g. 192.168.0.1). Each integer represents an octet (byte) in the address. Leading zeroes are tolerated only for values less than 8 (as there is no ambiguity between the decimal and octal interpretations of such strings). An integer that fits into 32 bits. An integer packed into a bytes object of length 4 (most significant octet first).  >>> ipaddress.IPv4Address('192.168.0.1')
IPv4Address('192.168.0.1')
>>> ipaddress.IPv4Address(3232235521)
IPv4Address('192.168.0.1')
>>> ipaddress.IPv4Address(b'\xC0\xA8\x00\x01')
IPv4Address('192.168.0.1')
  
version  
The appropriate version number: 4 for IPv4, 6 for IPv6. 
  
max_prefixlen  
The total number of bits in the address representation for this version: 32 for IPv4, 128 for IPv6. The prefix defines the number of leading bits in an address that are compared to determine whether or not an address is part of a network. 
  
compressed 
  
exploded  
The string representation in dotted decimal notation. Leading zeroes are never included in the representation. As IPv4 does not define a shorthand notation for addresses with octets set to zero, these two attributes are always the same as str(addr) for IPv4 addresses. Exposing these attributes makes it easier to write display code that can handle both IPv4 and IPv6 addresses. 
  
packed  
The binary representation of this address - a bytes object of the appropriate length (most significant octet first). This is 4 bytes for IPv4 and 16 bytes for IPv6. 
  
reverse_pointer  
The name of the reverse DNS PTR record for the IP address, e.g.: >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
'1.0.0.127.in-addr.arpa'
>>> ipaddress.ip_address("2001:db8::1").reverse_pointer
'1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'
 This is the name that could be used for performing a PTR lookup, not the resolved hostname itself.  New in version 3.5.  
  
is_multicast  
True if the address is reserved for multicast use. See RFC 3171 (for IPv4) or RFC 2373 (for IPv6). 
  
is_private  
True if the address is allocated for private networks. See iana-ipv4-special-registry (for IPv4) or iana-ipv6-special-registry (for IPv6). 
  
is_global  
True if the address is allocated for public networks. See iana-ipv4-special-registry (for IPv4) or iana-ipv6-special-registry (for IPv6).  New in version 3.4.  
  
is_unspecified  
True if the address is unspecified. See RFC 5735 (for IPv4) or RFC 2373 (for IPv6). 
  
is_reserved  
True if the address is otherwise IETF reserved. 
  
is_loopback  
True if this is a loopback address. See RFC 3330 (for IPv4) or RFC 2373 (for IPv6). 
  
is_link_local  
True if the address is reserved for link-local usage. See RFC 3927.
exploded  
The string representation in dotted decimal notation. Leading zeroes are never included in the representation. As IPv4 does not define a shorthand notation for addresses with octets set to zero, these two attributes are always the same as str(addr) for IPv4 addresses. Exposing these attributes makes it easier to write display code that can handle both IPv4 and IPv6 addresses.
is_global  
True if the address is allocated for public networks. See iana-ipv4-special-registry (for IPv4) or iana-ipv6-special-registry (for IPv6).  New in version 3.4.
is_link_local  
True if the address is reserved for link-local usage. See RFC 3927.
is_loopback  
True if this is a loopback address. See RFC 3330 (for IPv4) or RFC 2373 (for IPv6).
is_multicast  
True if the address is reserved for multicast use. See RFC 3171 (for IPv4) or RFC 2373 (for IPv6).
is_private  
True if the address is allocated for private networks. See iana-ipv4-special-registry (for IPv4) or iana-ipv6-special-registry (for IPv6).
is_unspecified  
True if the address is unspecified. See RFC 5735 (for IPv4) or RFC 2373 (for IPv6).
max_prefixlen  
The total number of bits in the address representation for this version: 32 for IPv4, 128 for IPv6. The prefix defines the number of leading bits in an address that are compared to determine whether or not an address is part of a network.
packed  
The binary representation of this address - a bytes object of the appropriate length (most significant octet first). This is 4 bytes for IPv4 and 16 bytes for IPv6.
reverse_pointer  
The name of the reverse DNS PTR record for the IP address, e.g.: >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
'1.0.0.127.in-addr.arpa'
>>> ipaddress.ip_address("2001:db8::1").reverse_pointer
'1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'
 This is the name that could be used for performing a PTR lookup, not the resolved hostname itself.  New in version 3.5.
version  
The appropriate version number: 4 for IPv4, 6 for IPv6.
IPv4Address.__format__(fmt)  
Returns a string representation of the IP address, controlled by an explicit format string. fmt can be one of the following: 's', the default option, equivalent to str(), 'b' for a zero-padded binary string, 'X' or 'x' for an uppercase or lowercase hexadecimal representation, or 'n', which is equivalent to 'b' for IPv4 addresses and 'x' for IPv6. For binary and hexadecimal representations, the form specifier '#' and the grouping option '_' are available. __format__ is used by format, str.format and f-strings. >>> format(ipaddress.IPv4Address('192.168.0.1'))
'192.168.0.1'
>>> '{:#b}'.format(ipaddress.IPv4Address('192.168.0.1'))
'0b11000000101010000000000000000001'
>>> f'{ipaddress.IPv6Address("2001:db8::1000"):s}'
'2001:db8::1000'
>>> format(ipaddress.IPv6Address('2001:db8::1000'), '_X')
'2001_0DB8_0000_0000_0000_0000_0000_1000'
>>> '{:#_n}'.format(ipaddress.IPv6Address('2001:db8::1000'))
'0x2001_0db8_0000_0000_0000_0000_0000_1000'
  New in version 3.9.
class ipaddress.IPv4Interface(address)  
Construct an IPv4 interface. The meaning of address is as in the constructor of IPv4Network, except that arbitrary host addresses are always accepted. IPv4Interface is a subclass of IPv4Address, so it inherits all the attributes from that class. In addition, the following attributes are available:  
ip  
The address (IPv4Address) without network information. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.ip
IPv4Address('192.0.2.5')
 
  
network  
The network (IPv4Network) this interface belongs to. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.network
IPv4Network('192.0.2.0/24')
 
  
with_prefixlen  
A string representation of the interface with the mask in prefix notation. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.with_prefixlen
'192.0.2.5/24'
 
  
with_netmask  
A string representation of the interface with the network as a net mask. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.with_netmask
'192.0.2.5/255.255.255.0'
 
  
with_hostmask  
A string representation of the interface with the network as a host mask. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.with_hostmask
'192.0.2.5/0.0.0.255'
ip  
The address (IPv4Address) without network information. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.ip
IPv4Address('192.0.2.5')
network  
The network (IPv4Network) this interface belongs to. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.network
IPv4Network('192.0.2.0/24')
with_hostmask  
A string representation of the interface with the network as a host mask. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.with_hostmask
'192.0.2.5/0.0.0.255'
with_netmask  
A string representation of the interface with the network as a net mask. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.with_netmask
'192.0.2.5/255.255.255.0'
with_prefixlen  
A string representation of the interface with the mask in prefix notation. >>> interface = IPv4Interface('192.0.2.5/24')
>>> interface.with_prefixlen
'192.0.2.5/24'
address_exclude(network)  
Computes the network definitions resulting from removing the given network from this one. Returns an iterator of network objects. Raises ValueError if network is not completely contained in this network. >>> n1 = ip_network('192.0.2.0/28')
>>> n2 = ip_network('192.0.2.1/32')
>>> list(n1.address_exclude(n2))  
[IPv4Network('192.0.2.8/29'), IPv4Network('192.0.2.4/30'),
 IPv4Network('192.0.2.2/31'), IPv4Network('192.0.2.0/32')]
broadcast_address  
The broadcast address for the network. Packets sent to the broadcast address should be received by every host on the network.
compare_networks(other)  
Compare this network to other. In this comparison only the network addresses are considered; host bits aren’t. Returns either -1, 0 or 1. >>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.2/32'))
-1
>>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.0/32'))
1
>>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.1/32'))
0
  Deprecated since version 3.7: It uses the same ordering and comparison algorithm as “<”, “==”, and “>”
exploded  
A string representation of the network, with the mask in prefix notation. with_prefixlen and compressed are always the same as str(network). exploded uses the exploded form the network address.
hosts()  
Returns an iterator over the usable hosts in the network. The usable hosts are all the IP addresses that belong to the network, except the network address itself and the network broadcast address. For networks with a mask length of 31, the network address and network broadcast address are also included in the result. Networks with a mask of 32 will return a list containing the single host address. >>> list(ip_network('192.0.2.0/29').hosts())  
[IPv4Address('192.0.2.1'), IPv4Address('192.0.2.2'),
 IPv4Address('192.0.2.3'), IPv4Address('192.0.2.4'),
 IPv4Address('192.0.2.5'), IPv4Address('192.0.2.6')]
>>> list(ip_network('192.0.2.0/31').hosts())
[IPv4Address('192.0.2.0'), IPv4Address('192.0.2.1')]
>>> list(ip_network('192.0.2.1/32').hosts())
[IPv4Address('192.0.2.1')]
is_link_local  
These attributes are true for the network as a whole if they are true for both the network address and the broadcast address.
network_address  
The network address for the network. The network address and the prefix length together uniquely define a network.
overlaps(other)  
True if this network is partly or wholly contained in other or other is wholly contained in this network.
subnets(prefixlen_diff=1, new_prefix=None)  
The subnets that join to make the current network definition, depending on the argument values. prefixlen_diff is the amount our prefix length should be increased by. new_prefix is the desired new prefix of the subnets; it must be larger than our prefix. One and only one of prefixlen_diff and new_prefix must be set. Returns an iterator of network objects. >>> list(ip_network('192.0.2.0/24').subnets())
[IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/25')]
>>> list(ip_network('192.0.2.0/24').subnets(prefixlen_diff=2))  
[IPv4Network('192.0.2.0/26'), IPv4Network('192.0.2.64/26'),
 IPv4Network('192.0.2.128/26'), IPv4Network('192.0.2.192/26')]
>>> list(ip_network('192.0.2.0/24').subnets(new_prefix=26))  
[IPv4Network('192.0.2.0/26'), IPv4Network('192.0.2.64/26'),
 IPv4Network('192.0.2.128/26'), IPv4Network('192.0.2.192/26')]
>>> list(ip_network('192.0.2.0/24').subnets(new_prefix=23))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    raise ValueError('new prefix must be longer')
ValueError: new prefix must be longer
>>> list(ip_network('192.0.2.0/24').subnets(new_prefix=25))
[IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/25')]
subnet_of(other)  
Return True if this network is a subnet of other. >>> a = ip_network('192.168.1.0/24')
>>> b = ip_network('192.168.1.128/30')
>>> b.subnet_of(a)
True
  New in version 3.7.
supernet(prefixlen_diff=1, new_prefix=None)  
The supernet containing this network definition, depending on the argument values. prefixlen_diff is the amount our prefix length should be decreased by. new_prefix is the desired new prefix of the supernet; it must be smaller than our prefix. One and only one of prefixlen_diff and new_prefix must be set. Returns a single network object. >>> ip_network('192.0.2.0/24').supernet()
IPv4Network('192.0.2.0/23')
>>> ip_network('192.0.2.0/24').supernet(prefixlen_diff=2)
IPv4Network('192.0.0.0/22')
>>> ip_network('192.0.2.0/24').supernet(new_prefix=20)
IPv4Network('192.0.0.0/20')
supernet_of(other)  
Return True if this network is a supernet of other. >>> a = ip_network('192.168.1.0/24')
>>> b = ip_network('192.168.1.128/30')
>>> a.supernet_of(b)
True
  New in version 3.7.
with_hostmask  
A string representation of the network, with the mask in host mask notation.
with_netmask  
A string representation of the network, with the mask in net mask notation.
class ipaddress.IPv6Address(address)  
Construct an IPv6 address. An AddressValueError is raised if address is not a valid IPv6 address. The following constitutes a valid IPv6 address:  
A string consisting of eight groups of four hexadecimal digits, each group representing 16 bits. The groups are separated by colons. This describes an exploded (longhand) notation. The string can also be compressed (shorthand notation) by various means. See RFC 4291 for details. For example, "0000:0000:0000:0000:0000:0abc:0007:0def" can be compressed to "::abc:7:def". Optionally, the string may also have a scope zone ID, expressed with a suffix %scope_id. If present, the scope ID must be non-empty, and may not contain %. See RFC 4007 for details. For example, fe80::1234%1 might identify address fe80::1234 on the first link of the node.  An integer that fits into 128 bits. An integer packed into a bytes object of length 16, big-endian.  >>> ipaddress.IPv6Address('2001:db8::1000')
IPv6Address('2001:db8::1000')
>>> ipaddress.IPv6Address('ff02::5678%1')
IPv6Address('ff02::5678%1')
  
compressed 
 The short form of the address representation, with leading zeroes in groups omitted and the longest sequence of groups consisting entirely of zeroes collapsed to a single empty group. This is also the value returned by str(addr) for IPv6 addresses.  
exploded 
 The long form of the address representation, with all leading zeroes and groups consisting entirely of zeroes included. For the following attributes and methods, see the corresponding documentation of the IPv4Address class:  
packed 
  
reverse_pointer 
  
version 
  
max_prefixlen 
  
is_multicast 
  
is_private 
  
is_global 
  
is_unspecified 
  
is_reserved 
  
is_loopback 
  
is_link_local  
 New in version 3.4: is_global  
  
is_site_local  
True if the address is reserved for site-local usage. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193. 
  
ipv4_mapped  
For addresses that appear to be IPv4 mapped addresses (starting with ::FFFF/96), this property will report the embedded IPv4 address. For any other address, this property will be None. 
  
scope_id  
For scoped addresses as defined by RFC 4007, this property identifies the particular zone of the address’s scope that the address belongs to, as a string. When no scope zone is specified, this property will be None. 
  
sixtofour  
For addresses that appear to be 6to4 addresses (starting with 2002::/16) as defined by RFC 3056, this property will report the embedded IPv4 address. For any other address, this property will be None. 
  
teredo  
For addresses that appear to be Teredo addresses (starting with 2001::/32) as defined by RFC 4380, this property will report the embedded (server, client) IP address pair. For any other address, this property will be None.
ipv4_mapped  
For addresses that appear to be IPv4 mapped addresses (starting with ::FFFF/96), this property will report the embedded IPv4 address. For any other address, this property will be None.
is_site_local  
True if the address is reserved for site-local usage. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193.
scope_id  
For scoped addresses as defined by RFC 4007, this property identifies the particular zone of the address’s scope that the address belongs to, as a string. When no scope zone is specified, this property will be None.
sixtofour  
For addresses that appear to be 6to4 addresses (starting with 2002::/16) as defined by RFC 3056, this property will report the embedded IPv4 address. For any other address, this property will be None.
teredo  
For addresses that appear to be Teredo addresses (starting with 2001::/32) as defined by RFC 4380, this property will report the embedded (server, client) IP address pair. For any other address, this property will be None.
IPv6Address.__format__(fmt)  
Refer to the corresponding method documentation in IPv4Address.  New in version 3.9.
class ipaddress.IPv6Interface(address)  
Construct an IPv6 interface. The meaning of address is as in the constructor of IPv6Network, except that arbitrary host addresses are always accepted. IPv6Interface is a subclass of IPv6Address, so it inherits all the attributes from that class. In addition, the following attributes are available:  
ip 
  
network 
  
with_prefixlen 
  
with_netmask 
  
with_hostmask  
Refer to the corresponding attribute documentation in IPv4Interface.
class ipaddress.IPv6Network(address, strict=True)  
Construct an IPv6 network definition. address can be one of the following:  
A string consisting of an IP address and an optional prefix length, separated by a slash (/). The IP address is the network address, and the prefix length must be a single number, the prefix. If no prefix length is provided, it’s considered to be /128. Note that currently expanded netmasks are not supported. That means 2001:db00::0/24 is a valid argument while 2001:db00::0/ffff:ff00:: not.  An integer that fits into 128 bits. This is equivalent to a single-address network, with the network address being address and the mask being /128. An integer packed into a bytes object of length 16, big-endian. The interpretation is similar to an integer address. A two-tuple of an address description and a netmask, where the address description is either a string, a 128-bits integer, a 16-bytes packed integer, or an existing IPv6Address object; and the netmask is an integer representing the prefix length.  An AddressValueError is raised if address is not a valid IPv6 address. A NetmaskValueError is raised if the mask is not valid for an IPv6 address. If strict is True and host bits are set in the supplied address, then ValueError is raised. Otherwise, the host bits are masked out to determine the appropriate network address.  Changed in version 3.5: Added the two-tuple form for the address constructor parameter.   
version 
  
max_prefixlen 
  
is_multicast 
  
is_private 
  
is_unspecified 
  
is_reserved 
  
is_loopback 
  
is_link_local 
  
network_address 
  
broadcast_address 
  
hostmask 
  
netmask 
  
with_prefixlen 
  
compressed 
  
exploded 
  
with_netmask 
  
with_hostmask 
  
num_addresses 
  
prefixlen 
  
hosts()  
Returns an iterator over the usable hosts in the network. The usable hosts are all the IP addresses that belong to the network, except the Subnet-Router anycast address. For networks with a mask length of 127, the Subnet-Router anycast address is also included in the result. Networks with a mask of 128 will return a list containing the single host address. 
  
overlaps(other) 
  
address_exclude(network) 
  
subnets(prefixlen_diff=1, new_prefix=None) 
  
supernet(prefixlen_diff=1, new_prefix=None) 
  
subnet_of(other) 
  
supernet_of(other) 
  
compare_networks(other)  
Refer to the corresponding attribute documentation in IPv4Network. 
  
is_site_local  
These attribute is true for the network as a whole if it is true for both the network address and the broadcast address.
hosts()  
Returns an iterator over the usable hosts in the network. The usable hosts are all the IP addresses that belong to the network, except the Subnet-Router anycast address. For networks with a mask length of 127, the Subnet-Router anycast address is also included in the result. Networks with a mask of 128 will return a list containing the single host address.
is_site_local  
These attribute is true for the network as a whole if it is true for both the network address and the broadcast address.