body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
@staticmethod
def verify_bitcoin(message, signature, address):
' Verifies a message signed using PrivateKey.sign_bitcoin()\n or any of the bitcoin utils (e.g. bitcoin-cli, bx, etc.)\n\n Args:\n message(bytes): The message that the signature corresponds to.\n signature (bytes or s... | 7,227,219,737,541,673,000 | Verifies a message signed using PrivateKey.sign_bitcoin()
or any of the bitcoin utils (e.g. bitcoin-cli, bx, etc.)
Args:
message(bytes): The message that the signature corresponds to.
signature (bytes or str): A Base64 encoded signature
address (str): Base58Check encoded address.
Returns:
bool: True i... | pywallet/utils/ethereum.py | verify_bitcoin | ukor/pywallet | python | @staticmethod
def verify_bitcoin(message, signature, address):
' Verifies a message signed using PrivateKey.sign_bitcoin()\n or any of the bitcoin utils (e.g. bitcoin-cli, bx, etc.)\n\n Args:\n message(bytes): The message that the signature corresponds to.\n signature (bytes or s... |
def hash160(self, compressed=True):
' Return the RIPEMD-160 hash of the SHA-256 hash of the\n public key.\n\n Args:\n compressed (bool): Whether or not the compressed key should\n be used.\n Returns:\n bytes: RIPEMD-160 byte string.\n '
return (sel... | 2,221,346,376,300,860,200 | Return the RIPEMD-160 hash of the SHA-256 hash of the
public key.
Args:
compressed (bool): Whether or not the compressed key should
be used.
Returns:
bytes: RIPEMD-160 byte string. | pywallet/utils/ethereum.py | hash160 | ukor/pywallet | python | def hash160(self, compressed=True):
' Return the RIPEMD-160 hash of the SHA-256 hash of the\n public key.\n\n Args:\n compressed (bool): Whether or not the compressed key should\n be used.\n Returns:\n bytes: RIPEMD-160 byte string.\n '
return (sel... |
def address(self, compressed=True, testnet=False):
' Address property that returns the Base58Check\n encoded version of the HASH160.\n\n Args:\n compressed (bool): Whether or not the compressed key should\n be used.\n testnet (bool): Whether or not the key is intend... | -7,028,471,823,252,193,000 | Address property that returns the Base58Check
encoded version of the HASH160.
Args:
compressed (bool): Whether or not the compressed key should
be used.
testnet (bool): Whether or not the key is intended for testnet
usage. False indicates mainnet usage.
Returns:
bytes: Base58Check encoded st... | pywallet/utils/ethereum.py | address | ukor/pywallet | python | def address(self, compressed=True, testnet=False):
' Address property that returns the Base58Check\n encoded version of the HASH160.\n\n Args:\n compressed (bool): Whether or not the compressed key should\n be used.\n testnet (bool): Whether or not the key is intend... |
def verify(self, message, signature, do_hash=True):
' Verifies that message was appropriately signed.\n\n Args:\n message (bytes): The message to be verified.\n signature (Signature): A signature object.\n do_hash (bool): True if the message should be hashed prior\n ... | 294,918,660,936,284,300 | Verifies that message was appropriately signed.
Args:
message (bytes): The message to be verified.
signature (Signature): A signature object.
do_hash (bool): True if the message should be hashed prior
to signing, False if not. This should always be left as
True except in special situations whic... | pywallet/utils/ethereum.py | verify | ukor/pywallet | python | def verify(self, message, signature, do_hash=True):
' Verifies that message was appropriately signed.\n\n Args:\n message (bytes): The message to be verified.\n signature (Signature): A signature object.\n do_hash (bool): True if the message should be hashed prior\n ... |
def to_base64(self):
' Hex representation of the serialized byte stream.\n\n Returns:\n b (str): A Base64-encoded string.\n '
return base64.b64encode(bytes(self)) | 3,128,094,007,399,917,000 | Hex representation of the serialized byte stream.
Returns:
b (str): A Base64-encoded string. | pywallet/utils/ethereum.py | to_base64 | ukor/pywallet | python | def to_base64(self):
' Hex representation of the serialized byte stream.\n\n Returns:\n b (str): A Base64-encoded string.\n '
return base64.b64encode(bytes(self)) |
@property
def compressed_bytes(self):
' Byte string corresponding to a compressed representation\n of this public key.\n\n Returns:\n b (bytes): A 33-byte long byte string.\n '
return self.point.compressed_bytes | -355,551,882,697,130,600 | Byte string corresponding to a compressed representation
of this public key.
Returns:
b (bytes): A 33-byte long byte string. | pywallet/utils/ethereum.py | compressed_bytes | ukor/pywallet | python | @property
def compressed_bytes(self):
' Byte string corresponding to a compressed representation\n of this public key.\n\n Returns:\n b (bytes): A 33-byte long byte string.\n '
return self.point.compressed_bytes |
@staticmethod
def from_der(der):
' Decodes a Signature that was DER-encoded.\n\n Args:\n der (bytes or str): The DER encoding to be decoded.\n\n Returns:\n Signature: The deserialized signature.\n '
d = get_bytes(der)
if (len(d) < 8):
raise ValueError('DER ... | 178,877,373,032,888,100 | Decodes a Signature that was DER-encoded.
Args:
der (bytes or str): The DER encoding to be decoded.
Returns:
Signature: The deserialized signature. | pywallet/utils/ethereum.py | from_der | ukor/pywallet | python | @staticmethod
def from_der(der):
' Decodes a Signature that was DER-encoded.\n\n Args:\n der (bytes or str): The DER encoding to be decoded.\n\n Returns:\n Signature: The deserialized signature.\n '
d = get_bytes(der)
if (len(d) < 8):
raise ValueError('DER ... |
@staticmethod
def from_base64(b64str):
' Generates a signature object from a Base64 encoded string.\n\n Args:\n b64str (str): A Base64-encoded string.\n\n Returns:\n Signature: A Signature object.\n '
return Signature.from_bytes(base64.b64decode(b64str)) | 7,248,638,769,553,480,000 | Generates a signature object from a Base64 encoded string.
Args:
b64str (str): A Base64-encoded string.
Returns:
Signature: A Signature object. | pywallet/utils/ethereum.py | from_base64 | ukor/pywallet | python | @staticmethod
def from_base64(b64str):
' Generates a signature object from a Base64 encoded string.\n\n Args:\n b64str (str): A Base64-encoded string.\n\n Returns:\n Signature: A Signature object.\n '
return Signature.from_bytes(base64.b64decode(b64str)) |
@staticmethod
def from_bytes(b):
' Extracts the r and s components from a byte string.\n\n Args:\n b (bytes): A 64-byte long string. The first 32 bytes are\n extracted as the r component and the second 32 bytes\n are extracted as the s component.\n\n Returns:\n ... | -7,242,112,644,742,968,000 | Extracts the r and s components from a byte string.
Args:
b (bytes): A 64-byte long string. The first 32 bytes are
extracted as the r component and the second 32 bytes
are extracted as the s component.
Returns:
Signature: A Signature object.
Raises:
ValueError: If signature is incorrect len... | pywallet/utils/ethereum.py | from_bytes | ukor/pywallet | python | @staticmethod
def from_bytes(b):
' Extracts the r and s components from a byte string.\n\n Args:\n b (bytes): A 64-byte long string. The first 32 bytes are\n extracted as the r component and the second 32 bytes\n are extracted as the s component.\n\n Returns:\n ... |
@staticmethod
def from_hex(h):
' Extracts the r and s components from a hex-encoded string.\n\n Args:\n h (str): A 64-byte (128 character) long string. The first\n 32 bytes are extracted as the r component and the\n second 32 bytes are extracted as the s component.\n\n ... | 5,435,641,828,722,916,000 | Extracts the r and s components from a hex-encoded string.
Args:
h (str): A 64-byte (128 character) long string. The first
32 bytes are extracted as the r component and the
second 32 bytes are extracted as the s component.
Returns:
Signature: A Signature object. | pywallet/utils/ethereum.py | from_hex | ukor/pywallet | python | @staticmethod
def from_hex(h):
' Extracts the r and s components from a hex-encoded string.\n\n Args:\n h (str): A 64-byte (128 character) long string. The first\n 32 bytes are extracted as the r component and the\n second 32 bytes are extracted as the s component.\n\n ... |
@property
def x(self):
' Convenience property for any method that requires\n this object to provide a Point interface.\n '
return self.r | -5,011,515,628,047,565,000 | Convenience property for any method that requires
this object to provide a Point interface. | pywallet/utils/ethereum.py | x | ukor/pywallet | python | @property
def x(self):
' Convenience property for any method that requires\n this object to provide a Point interface.\n '
return self.r |
@property
def y(self):
' Convenience property for any method that requires\n this object to provide a Point interface.\n '
return self.s | -9,056,976,346,146,439,000 | Convenience property for any method that requires
this object to provide a Point interface. | pywallet/utils/ethereum.py | y | ukor/pywallet | python | @property
def y(self):
' Convenience property for any method that requires\n this object to provide a Point interface.\n '
return self.s |
def to_der(self):
' Encodes this signature using DER\n\n Returns:\n bytes: The DER encoding of (self.r, self.s).\n '
(r, s) = self._canonicalize()
total_length = ((6 + len(r)) + len(s))
der = (((bytes([48, (total_length - 2), 2, len(r)]) + r) + bytes([2, len(s)])) + s)
retur... | 2,245,976,467,492,142,800 | Encodes this signature using DER
Returns:
bytes: The DER encoding of (self.r, self.s). | pywallet/utils/ethereum.py | to_der | ukor/pywallet | python | def to_der(self):
' Encodes this signature using DER\n\n Returns:\n bytes: The DER encoding of (self.r, self.s).\n '
(r, s) = self._canonicalize()
total_length = ((6 + len(r)) + len(s))
der = (((bytes([48, (total_length - 2), 2, len(r)]) + r) + bytes([2, len(s)])) + s)
retur... |
def to_hex(self):
' Hex representation of the serialized byte stream.\n\n Returns:\n str: A hex-encoded string.\n '
return codecs.encode(bytes(self), 'hex_codec').decode('ascii') | -5,866,200,977,990,551,000 | Hex representation of the serialized byte stream.
Returns:
str: A hex-encoded string. | pywallet/utils/ethereum.py | to_hex | ukor/pywallet | python | def to_hex(self):
' Hex representation of the serialized byte stream.\n\n Returns:\n str: A hex-encoded string.\n '
return codecs.encode(bytes(self), 'hex_codec').decode('ascii') |
def to_base64(self):
' Hex representation of the serialized byte stream.\n\n Returns:\n str: A Base64-encoded string.\n '
return base64.b64encode(bytes(self)) | -2,654,131,553,993,369,000 | Hex representation of the serialized byte stream.
Returns:
str: A Base64-encoded string. | pywallet/utils/ethereum.py | to_base64 | ukor/pywallet | python | def to_base64(self):
' Hex representation of the serialized byte stream.\n\n Returns:\n str: A Base64-encoded string.\n '
return base64.b64encode(bytes(self)) |
@staticmethod
def from_b58check(key):
' Decodes a Base58Check encoded key.\n\n The encoding must conform to the description in:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format\n\n Args:\n key (str): A Base58Check encoded key.\n\n Returns:\... | -8,928,533,890,202,212,000 | Decodes a Base58Check encoded key.
The encoding must conform to the description in:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format
Args:
key (str): A Base58Check encoded key.
Returns:
HDPrivateKey or HDPublicKey:
Either an HD private or
public key object, ... | pywallet/utils/ethereum.py | from_b58check | ukor/pywallet | python | @staticmethod
def from_b58check(key):
' Decodes a Base58Check encoded key.\n\n The encoding must conform to the description in:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format\n\n Args:\n key (str): A Base58Check encoded key.\n\n Returns:\... |
@staticmethod
def from_bytes(b):
' Generates either a HDPrivateKey or HDPublicKey from the underlying\n bytes.\n\n The serialization must conform to the description in:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format\n\n Args:\n b (bytes):... | 4,919,203,036,137,217,000 | Generates either a HDPrivateKey or HDPublicKey from the underlying
bytes.
The serialization must conform to the description in:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format
Args:
b (bytes): A byte stream conforming to the above.
Returns:
HDPrivateKey or HDPublicKey:
... | pywallet/utils/ethereum.py | from_bytes | ukor/pywallet | python | @staticmethod
def from_bytes(b):
' Generates either a HDPrivateKey or HDPublicKey from the underlying\n bytes.\n\n The serialization must conform to the description in:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format\n\n Args:\n b (bytes):... |
@staticmethod
def from_hex(h):
' Generates either a HDPrivateKey or HDPublicKey from the underlying\n hex-encoded string.\n\n The serialization must conform to the description in:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format\n\n Args:\n ... | -5,066,633,890,945,613,000 | Generates either a HDPrivateKey or HDPublicKey from the underlying
hex-encoded string.
The serialization must conform to the description in:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format
Args:
h (str): A hex-encoded string conforming to the above.
Returns:
HDPrivateKey o... | pywallet/utils/ethereum.py | from_hex | ukor/pywallet | python | @staticmethod
def from_hex(h):
' Generates either a HDPrivateKey or HDPublicKey from the underlying\n hex-encoded string.\n\n The serialization must conform to the description in:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format\n\n Args:\n ... |
@property
def master(self):
' Whether or not this is a master node.\n\n Returns:\n bool: True if this is a master node, False otherwise.\n '
return (self.depth == 0) | -6,666,981,387,012,515,000 | Whether or not this is a master node.
Returns:
bool: True if this is a master node, False otherwise. | pywallet/utils/ethereum.py | master | ukor/pywallet | python | @property
def master(self):
' Whether or not this is a master node.\n\n Returns:\n bool: True if this is a master node, False otherwise.\n '
return (self.depth == 0) |
@property
def hardened(self):
' Whether or not this is a hardened node.\n\n Hardened nodes are those with indices >= 0x80000000.\n\n Returns:\n bool: True if this is hardened, False otherwise.\n '
return (self.index & 2147483648) | -6,217,019,830,460,732,000 | Whether or not this is a hardened node.
Hardened nodes are those with indices >= 0x80000000.
Returns:
bool: True if this is hardened, False otherwise. | pywallet/utils/ethereum.py | hardened | ukor/pywallet | python | @property
def hardened(self):
' Whether or not this is a hardened node.\n\n Hardened nodes are those with indices >= 0x80000000.\n\n Returns:\n bool: True if this is hardened, False otherwise.\n '
return (self.index & 2147483648) |
@property
def identifier(self):
" Returns the identifier for the key.\n\n A key's identifier and fingerprint are defined as:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers\n\n Returns:\n bytes: A 20-byte RIPEMD-160 hash.\n "
raise NotImple... | 796,333,715,178,832,100 | Returns the identifier for the key.
A key's identifier and fingerprint are defined as:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers
Returns:
bytes: A 20-byte RIPEMD-160 hash. | pywallet/utils/ethereum.py | identifier | ukor/pywallet | python | @property
def identifier(self):
" Returns the identifier for the key.\n\n A key's identifier and fingerprint are defined as:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers\n\n Returns:\n bytes: A 20-byte RIPEMD-160 hash.\n "
raise NotImple... |
@property
def fingerprint(self):
" Returns the key's fingerprint, which is the first 4 bytes\n of its identifier.\n\n A key's identifier and fingerprint are defined as:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers\n\n Returns:\n bytes: The f... | 8,939,580,986,969,387,000 | Returns the key's fingerprint, which is the first 4 bytes
of its identifier.
A key's identifier and fingerprint are defined as:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers
Returns:
bytes: The first 4 bytes of the RIPEMD-160 hash. | pywallet/utils/ethereum.py | fingerprint | ukor/pywallet | python | @property
def fingerprint(self):
" Returns the key's fingerprint, which is the first 4 bytes\n of its identifier.\n\n A key's identifier and fingerprint are defined as:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers\n\n Returns:\n bytes: The f... |
def to_b58check(self, testnet=False):
' Generates a Base58Check encoding of this key.\n\n Args:\n testnet (bool): True if the key is to be used with\n testnet, False otherwise.\n Returns:\n str: A Base58Check encoded string representing the key.\n '
b = ... | -555,311,680,589,127,360 | Generates a Base58Check encoding of this key.
Args:
testnet (bool): True if the key is to be used with
testnet, False otherwise.
Returns:
str: A Base58Check encoded string representing the key. | pywallet/utils/ethereum.py | to_b58check | ukor/pywallet | python | def to_b58check(self, testnet=False):
' Generates a Base58Check encoding of this key.\n\n Args:\n testnet (bool): True if the key is to be used with\n testnet, False otherwise.\n Returns:\n str: A Base58Check encoded string representing the key.\n '
b = ... |
@property
def testnet_bytes(self):
' Serialization of the key for testnet.\n\n Returns:\n bytes:\n A 78-byte serialization of the key, specifically for\n testnet (i.e. the first 2 bytes will be 0x0435).\n '
return self._serialize(True) | -6,797,410,677,608,330,000 | Serialization of the key for testnet.
Returns:
bytes:
A 78-byte serialization of the key, specifically for
testnet (i.e. the first 2 bytes will be 0x0435). | pywallet/utils/ethereum.py | testnet_bytes | ukor/pywallet | python | @property
def testnet_bytes(self):
' Serialization of the key for testnet.\n\n Returns:\n bytes:\n A 78-byte serialization of the key, specifically for\n testnet (i.e. the first 2 bytes will be 0x0435).\n '
return self._serialize(True) |
@staticmethod
def master_key_from_mnemonic(mnemonic, passphrase=''):
' Generates a master key from a mnemonic.\n\n Args:\n mnemonic (str): The mnemonic sentence representing\n the seed from which to generate the master key.\n passphrase (str): Password if one was used.\n\n... | -5,843,158,790,375,251,000 | Generates a master key from a mnemonic.
Args:
mnemonic (str): The mnemonic sentence representing
the seed from which to generate the master key.
passphrase (str): Password if one was used.
Returns:
HDPrivateKey: the master private key. | pywallet/utils/ethereum.py | master_key_from_mnemonic | ukor/pywallet | python | @staticmethod
def master_key_from_mnemonic(mnemonic, passphrase=):
' Generates a master key from a mnemonic.\n\n Args:\n mnemonic (str): The mnemonic sentence representing\n the seed from which to generate the master key.\n passphrase (str): Password if one was used.\n\n ... |
@staticmethod
def master_key_from_entropy(passphrase='', strength=128):
' Generates a master key from system entropy.\n\n Args:\n strength (int): Amount of entropy desired. This should be\n a multiple of 32 between 128 and 256.\n passphrase (str): An optional passphrase fo... | -689,727,026,407,204,400 | Generates a master key from system entropy.
Args:
strength (int): Amount of entropy desired. This should be
a multiple of 32 between 128 and 256.
passphrase (str): An optional passphrase for the generated
mnemonic string.
Returns:
HDPrivateKey, str:
a tuple consisting of the master
... | pywallet/utils/ethereum.py | master_key_from_entropy | ukor/pywallet | python | @staticmethod
def master_key_from_entropy(passphrase=, strength=128):
' Generates a master key from system entropy.\n\n Args:\n strength (int): Amount of entropy desired. This should be\n a multiple of 32 between 128 and 256.\n passphrase (str): An optional passphrase for ... |
@staticmethod
def master_key_from_seed(seed):
' Generates a master key from a provided seed.\n\n Args:\n seed (bytes or str): a string of bytes or a hex string\n\n Returns:\n HDPrivateKey: the master private key.\n '
S = get_bytes(seed)
I = hmac.new(b'Bitcoin seed'... | 2,719,579,831,305,562,000 | Generates a master key from a provided seed.
Args:
seed (bytes or str): a string of bytes or a hex string
Returns:
HDPrivateKey: the master private key. | pywallet/utils/ethereum.py | master_key_from_seed | ukor/pywallet | python | @staticmethod
def master_key_from_seed(seed):
' Generates a master key from a provided seed.\n\n Args:\n seed (bytes or str): a string of bytes or a hex string\n\n Returns:\n HDPrivateKey: the master private key.\n '
S = get_bytes(seed)
I = hmac.new(b'Bitcoin seed'... |
@staticmethod
def from_parent(parent_key, i):
' Derives a child private key from a parent\n private key. It is not possible to derive a child\n private key from a public parent key.\n\n Args:\n parent_private_key (HDPrivateKey):\n '
if (not isinstance(parent_key, HDPrivate... | 3,602,754,436,133,424,600 | Derives a child private key from a parent
private key. It is not possible to derive a child
private key from a public parent key.
Args:
parent_private_key (HDPrivateKey): | pywallet/utils/ethereum.py | from_parent | ukor/pywallet | python | @staticmethod
def from_parent(parent_key, i):
' Derives a child private key from a parent\n private key. It is not possible to derive a child\n private key from a public parent key.\n\n Args:\n parent_private_key (HDPrivateKey):\n '
if (not isinstance(parent_key, HDPrivate... |
@property
def public_key(self):
' Returns the public key associated with this private key.\n\n Returns:\n HDPublicKey:\n The HDPublicKey object that corresponds to this\n private key.\n '
if (self._public_key is None):
self._public_key = HDPublicKey... | -3,351,380,143,480,722,400 | Returns the public key associated with this private key.
Returns:
HDPublicKey:
The HDPublicKey object that corresponds to this
private key. | pywallet/utils/ethereum.py | public_key | ukor/pywallet | python | @property
def public_key(self):
' Returns the public key associated with this private key.\n\n Returns:\n HDPublicKey:\n The HDPublicKey object that corresponds to this\n private key.\n '
if (self._public_key is None):
self._public_key = HDPublicKey... |
def raw_sign(self, message, do_hash=True):
" Signs message using the underlying non-extended private key.\n\n Args:\n message (bytes): The message to be signed. If a string is\n provided it is assumed the encoding is 'ascii' and\n converted to bytes. If this is not th... | -3,268,282,181,061,833,700 | Signs message using the underlying non-extended private key.
Args:
message (bytes): The message to be signed. If a string is
provided it is assumed the encoding is 'ascii' and
converted to bytes. If this is not the case, it is up
to the caller to convert the string to bytes
appropri... | pywallet/utils/ethereum.py | raw_sign | ukor/pywallet | python | def raw_sign(self, message, do_hash=True):
" Signs message using the underlying non-extended private key.\n\n Args:\n message (bytes): The message to be signed. If a string is\n provided it is assumed the encoding is 'ascii' and\n converted to bytes. If this is not th... |
def sign(self, message, do_hash=True):
" Signs message using the underlying non-extended private key.\n\n Note:\n This differs from `raw_sign()` since it returns a Signature object.\n\n Args:\n message (bytes or str): The message to be signed. If a\n string is prov... | 2,026,012,484,002,148,900 | Signs message using the underlying non-extended private key.
Note:
This differs from `raw_sign()` since it returns a Signature object.
Args:
message (bytes or str): The message to be signed. If a
string is provided it is assumed the encoding is
'ascii' and converted to bytes. If this is not th... | pywallet/utils/ethereum.py | sign | ukor/pywallet | python | def sign(self, message, do_hash=True):
" Signs message using the underlying non-extended private key.\n\n Note:\n This differs from `raw_sign()` since it returns a Signature object.\n\n Args:\n message (bytes or str): The message to be signed. If a\n string is prov... |
def sign_bitcoin(self, message, compressed=False):
' Signs a message using the underlying non-extended private\n key such that it is compatible with bitcoind, bx, and other\n Bitcoin clients/nodes/utilities.\n\n Note:\n 0x18 + b"Bitcoin Signed Message:" + newline + len(message) is\n ... | -615,899,387,025,259,000 | Signs a message using the underlying non-extended private
key such that it is compatible with bitcoind, bx, and other
Bitcoin clients/nodes/utilities.
Note:
0x18 + b"Bitcoin Signed Message:" + newline + len(message) is
prepended to the message before signing.
Args:
message (bytes or str): Message to be si... | pywallet/utils/ethereum.py | sign_bitcoin | ukor/pywallet | python | def sign_bitcoin(self, message, compressed=False):
' Signs a message using the underlying non-extended private\n key such that it is compatible with bitcoind, bx, and other\n Bitcoin clients/nodes/utilities.\n\n Note:\n 0x18 + b"Bitcoin Signed Message:" + newline + len(message) is\n ... |
@property
def identifier(self):
" Returns the identifier for the key.\n\n A key's identifier and fingerprint are defined as:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers\n\n In this case, it will return the RIPEMD-160 hash of the\n corresponding public... | 394,542,324,917,610,300 | Returns the identifier for the key.
A key's identifier and fingerprint are defined as:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers
In this case, it will return the RIPEMD-160 hash of the
corresponding public key.
Returns:
bytes: A 20-byte RIPEMD-160 hash. | pywallet/utils/ethereum.py | identifier | ukor/pywallet | python | @property
def identifier(self):
" Returns the identifier for the key.\n\n A key's identifier and fingerprint are defined as:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers\n\n In this case, it will return the RIPEMD-160 hash of the\n corresponding public... |
@property
def identifier(self):
" Returns the identifier for the key.\n\n A key's identifier and fingerprint are defined as:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers\n\n In this case, it will return the RIPEMD-160 hash of the\n non-extended public ... | 1,443,509,380,358,592,800 | Returns the identifier for the key.
A key's identifier and fingerprint are defined as:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers
In this case, it will return the RIPEMD-160 hash of the
non-extended public key.
Returns:
bytes: A 20-byte RIPEMD-160 hash. | pywallet/utils/ethereum.py | identifier | ukor/pywallet | python | @property
def identifier(self):
" Returns the identifier for the key.\n\n A key's identifier and fingerprint are defined as:\n https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers\n\n In this case, it will return the RIPEMD-160 hash of the\n non-extended public ... |
def hash160(self, compressed=True):
' Return the RIPEMD-160 hash of the SHA-256 hash of the\n non-extended public key.\n\n Note:\n This always returns the hash of the compressed version of\n the public key.\n\n Returns:\n bytes: RIPEMD-160 byte string.\n ... | -2,092,964,254,580,674,800 | Return the RIPEMD-160 hash of the SHA-256 hash of the
non-extended public key.
Note:
This always returns the hash of the compressed version of
the public key.
Returns:
bytes: RIPEMD-160 byte string. | pywallet/utils/ethereum.py | hash160 | ukor/pywallet | python | def hash160(self, compressed=True):
' Return the RIPEMD-160 hash of the SHA-256 hash of the\n non-extended public key.\n\n Note:\n This always returns the hash of the compressed version of\n the public key.\n\n Returns:\n bytes: RIPEMD-160 byte string.\n ... |
def address(self, compressed=True, testnet=False):
' Address property that returns the Base58Check\n encoded version of the HASH160.\n\n Args:\n compressed (bool): Whether or not the compressed key should\n be used.\n testnet (bool): Whether or not the key is intend... | -6,539,582,272,185,335,000 | Address property that returns the Base58Check
encoded version of the HASH160.
Args:
compressed (bool): Whether or not the compressed key should
be used.
testnet (bool): Whether or not the key is intended for testnet
usage. False indicates mainnet usage.
Returns:
bytes: Base58Check encoded st... | pywallet/utils/ethereum.py | address | ukor/pywallet | python | def address(self, compressed=True, testnet=False):
' Address property that returns the Base58Check\n encoded version of the HASH160.\n\n Args:\n compressed (bool): Whether or not the compressed key should\n be used.\n testnet (bool): Whether or not the key is intend... |
def verify(self, message, signature, do_hash=True):
' Verifies that message was appropriately signed.\n\n Args:\n message (bytes): The message to be verified.\n signature (Signature): A signature object.\n do_hash (bool): True if the message should be hashed prior\n ... | 6,523,901,315,159,231,000 | Verifies that message was appropriately signed.
Args:
message (bytes): The message to be verified.
signature (Signature): A signature object.
do_hash (bool): True if the message should be hashed prior
to signing, False if not. This should always be left as
True except in special situations ... | pywallet/utils/ethereum.py | verify | ukor/pywallet | python | def verify(self, message, signature, do_hash=True):
' Verifies that message was appropriately signed.\n\n Args:\n message (bytes): The message to be verified.\n signature (Signature): A signature object.\n do_hash (bool): True if the message should be hashed prior\n ... |
@property
def compressed_bytes(self):
' Byte string corresponding to a compressed representation\n of this public key.\n\n Returns:\n b (bytes): A 33-byte long byte string.\n '
return self._key.compressed_bytes | 4,253,535,832,634,557,400 | Byte string corresponding to a compressed representation
of this public key.
Returns:
b (bytes): A 33-byte long byte string. | pywallet/utils/ethereum.py | compressed_bytes | ukor/pywallet | python | @property
def compressed_bytes(self):
' Byte string corresponding to a compressed representation\n of this public key.\n\n Returns:\n b (bytes): A 33-byte long byte string.\n '
return self._key.compressed_bytes |
def __init__(self, master, codice, calcolatore, emulatore):
"\n Inizializza i frame per l'interfaccia dell'emulatore\n "
self.CD = calcolatore
self.codice = codice
self.delay = 100
self.master = Frame(master)
self.root = emulatore
self.ram = LabelFrame(self.master, text='Memori... | -8,868,046,694,783,535,000 | Inizializza i frame per l'interfaccia dell'emulatore | Emulatore.py | __init__ | MircoT/py-pdp8-tk | python | def __init__(self, master, codice, calcolatore, emulatore):
"\n \n "
self.CD = calcolatore
self.codice = codice
self.delay = 100
self.master = Frame(master)
self.root = emulatore
self.ram = LabelFrame(self.master, text='Memoria RAM', relief=RIDGE, borderwidth=5, labelanchor='n'... |
def create_widgets(self):
"\n Crea il layout del programma, finestra dell'emulatore\n "
self.Visualizza = Text(self.ram, width=80)
self.Visualizzascrollbar = Scrollbar(self.ram)
self.Visualizzascrollbar.config(command=self.Visualizza.yview)
self.Visualizza.config(yscrollcommand=self.Vi... | 2,399,548,688,207,588,400 | Crea il layout del programma, finestra dell'emulatore | Emulatore.py | create_widgets | MircoT/py-pdp8-tk | python | def create_widgets(self):
"\n \n "
self.Visualizza = Text(self.ram, width=80)
self.Visualizzascrollbar = Scrollbar(self.ram)
self.Visualizzascrollbar.config(command=self.Visualizza.yview)
self.Visualizza.config(yscrollcommand=self.Visualizzascrollbar.set)
self.Visualizzascrollbar.g... |
def continua(self):
"\n Continua l'esecuzione dopo un break\n "
self.CD.S = True
self.esegui() | -5,933,921,717,104,816,000 | Continua l'esecuzione dopo un break | Emulatore.py | continua | MircoT/py-pdp8-tk | python | def continua(self):
"\n \n "
self.CD.S = True
self.esegui() |
def micro_step(self):
'\n Esegue il metodo step del calcolatore didattico ed aggiorna\n '
if self.CD.S:
self.CD.step(self.root, self.codice)
if ((self.CD.tempo == 0) and (not self.CD.F) and (not self.CD.R)):
self.CD.previstr = self.CD.nextistr
self.aggiornaall() | -2,389,170,151,703,013,400 | Esegue il metodo step del calcolatore didattico ed aggiorna | Emulatore.py | micro_step | MircoT/py-pdp8-tk | python | def micro_step(self):
'\n \n '
if self.CD.S:
self.CD.step(self.root, self.codice)
if ((self.CD.tempo == 0) and (not self.CD.F) and (not self.CD.R)):
self.CD.previstr = self.CD.nextistr
self.aggiornaall() |
def step(self):
'\n Esegue il metodo step del calcolatore didattico ed aggiorna\n '
var = True
if (self.CD.S and (self.CD.nstep > 0)):
while (var and self.CD.S):
self.CD.step(self.root, self.codice)
if ((not self.CD.F) and (not self.CD.R) and (self.CD.tempo == 0... | 1,178,585,213,689,599,500 | Esegue il metodo step del calcolatore didattico ed aggiorna | Emulatore.py | step | MircoT/py-pdp8-tk | python | def step(self):
'\n \n '
var = True
if (self.CD.S and (self.CD.nstep > 0)):
while (var and self.CD.S):
self.CD.step(self.root, self.codice)
if ((not self.CD.F) and (not self.CD.R) and (self.CD.tempo == 0)):
self.CD.nstep -= 1
self... |
def esegui(self):
"\n Esegue il programma fino all'arresto della macchina tramite\n l'istruzione HLT\n "
while self.CD.S:
self.CD.step(self.root, self.codice)
if ((not self.CD.F) and (not self.CD.R) and (self.CD.tempo == 0)):
self.aggiornaall()
self.C... | 7,673,595,272,641,957,000 | Esegue il programma fino all'arresto della macchina tramite
l'istruzione HLT | Emulatore.py | esegui | MircoT/py-pdp8-tk | python | def esegui(self):
"\n Esegue il programma fino all'arresto della macchina tramite\n l'istruzione HLT\n "
while self.CD.S:
self.CD.step(self.root, self.codice)
if ((not self.CD.F) and (not self.CD.R) and (self.CD.tempo == 0)):
self.aggiornaall()
self.C... |
def mini_step(self):
'\n Esegue un singolo ciclo della macchina\n '
if self.CD.S:
for x in range(0, 4):
self.CD.step(self.root, self.codice)
self.CD.nstep = 1
self.aggiornaall()
if ((self.CD.F is False) and (self.CD.R is False)):
self... | -9,035,354,765,232,446,000 | Esegue un singolo ciclo della macchina | Emulatore.py | mini_step | MircoT/py-pdp8-tk | python | def mini_step(self):
'\n \n '
if self.CD.S:
for x in range(0, 4):
self.CD.step(self.root, self.codice)
self.CD.nstep = 1
self.aggiornaall()
if ((self.CD.F is False) and (self.CD.R is False)):
self.CD.previstr = self.CD.nextistr |
def cerca_istr_prev(self):
"\n Evidenzia di VERDE l'ultima istruzione eseguita\n "
if (self.CD.PC == '000000000000'):
return
try:
if ((self.CD.previstr == '') and (int(self.CD.PC, 2) == self.CD.START)):
return
else:
pospc = str((3.0 + self.CD.pre... | 6,070,608,328,843,375,000 | Evidenzia di VERDE l'ultima istruzione eseguita | Emulatore.py | cerca_istr_prev | MircoT/py-pdp8-tk | python | def cerca_istr_prev(self):
"\n \n "
if (self.CD.PC == '000000000000'):
return
try:
if ((self.CD.previstr == ) and (int(self.CD.PC, 2) == self.CD.START)):
return
else:
pospc = str((3.0 + self.CD.previstr))
self.Visualizza.tag_add('PIST... |
def cerca_MAR(self):
"\n Evidenzia di giallo l'indirizzo puntato dal MAR\n "
try:
pos = 3.0
stringa = self.Visualizza.get(str(pos), 'end')
while ((stringa[:12] != self.CD.MAR) and (int(pos) < (len(self.CD.RAM) + 3)) and (len(self.CD.RAM) > 0)):
pos += 1
... | 1,720,936,399,942,872,800 | Evidenzia di giallo l'indirizzo puntato dal MAR | Emulatore.py | cerca_MAR | MircoT/py-pdp8-tk | python | def cerca_MAR(self):
"\n \n "
try:
pos = 3.0
stringa = self.Visualizza.get(str(pos), 'end')
while ((stringa[:12] != self.CD.MAR) and (int(pos) < (len(self.CD.RAM) + 3)) and (len(self.CD.RAM) > 0)):
pos += 1
stringa = self.Visualizza.get(str(pos), 'en... |
def cerca_PC(self):
"\n Evidenzia di rosso l'indirizzo puntato da PC\n "
try:
pos = 3.0
stringa = self.Visualizza.get(str(pos), 'end')
while ((stringa[:12] != self.CD.PC) and (int(pos) < (len(self.CD.RAM) + 3)) and (len(self.CD.RAM) > 0)):
pos += 1
s... | -559,732,223,055,177,600 | Evidenzia di rosso l'indirizzo puntato da PC | Emulatore.py | cerca_PC | MircoT/py-pdp8-tk | python | def cerca_PC(self):
"\n \n "
try:
pos = 3.0
stringa = self.Visualizza.get(str(pos), 'end')
while ((stringa[:12] != self.CD.PC) and (int(pos) < (len(self.CD.RAM) + 3)) and (len(self.CD.RAM) > 0)):
pos += 1
stringa = self.Visualizza.get(str(pos), 'end'... |
def aggiornaout(self):
'\n Aggiorna micro e input/output\n '
self.aggiornamicro()
self.aggiornainout() | 6,511,139,235,739,962,000 | Aggiorna micro e input/output | Emulatore.py | aggiornaout | MircoT/py-pdp8-tk | python | def aggiornaout(self):
'\n \n '
self.aggiornamicro()
self.aggiornainout() |
def aggiornamicro(self):
'\n Aggiorna le microistruzioni eseguite\n '
self.Visualizzamicro.delete(1.0, END)
stringa = self.CD.microistruzioni
self.Visualizzamicro.insert(INSERT, stringa)
self.Visualizzamicro.see(END) | -7,334,009,341,202,917,000 | Aggiorna le microistruzioni eseguite | Emulatore.py | aggiornamicro | MircoT/py-pdp8-tk | python | def aggiornamicro(self):
'\n \n '
self.Visualizzamicro.delete(1.0, END)
stringa = self.CD.microistruzioni
self.Visualizzamicro.insert(INSERT, stringa)
self.Visualizzamicro.see(END) |
def aggiornainout(self):
'\n Aggiorna gli input ed output di sistema\n '
self.Visualizzainout.delete(1.0, END)
stringa = self.CD.inout
self.Visualizzainout.insert(INSERT, stringa)
self.Visualizzainout.see(END) | 5,196,792,618,315,077,000 | Aggiorna gli input ed output di sistema | Emulatore.py | aggiornainout | MircoT/py-pdp8-tk | python | def aggiornainout(self):
'\n \n '
self.Visualizzainout.delete(1.0, END)
stringa = self.CD.inout
self.Visualizzainout.insert(INSERT, stringa)
self.Visualizzainout.see(END) |
def aggiornaram(self):
'\n Aggiorna lo stato della RAM\n '
self.Visualizza.delete(1.0, END)
stringa = self.CD.statusRAM()
self.Visualizza.insert(INSERT, stringa)
self.cerca_MAR()
self.cerca_PC()
self.cerca_istr_prev() | -637,533,283,161,984,500 | Aggiorna lo stato della RAM | Emulatore.py | aggiornaram | MircoT/py-pdp8-tk | python | def aggiornaram(self):
'\n \n '
self.Visualizza.delete(1.0, END)
stringa = self.CD.statusRAM()
self.Visualizza.insert(INSERT, stringa)
self.cerca_MAR()
self.cerca_PC()
self.cerca_istr_prev() |
def aggiornareg(self):
'\n Aggiorna lo stato dei Registri\n '
self.labelprogramc.config(text=self.CD.PC)
self.labelmar.config(text=self.CD.MAR)
self.labelmbr.config(text=self.CD.MBR)
self.labelac.config(text=self.CD.AC)
self.labelacint.config(text=str(self.CD.range(int(self.CD.AC, ... | 6,939,395,657,199,489,000 | Aggiorna lo stato dei Registri | Emulatore.py | aggiornareg | MircoT/py-pdp8-tk | python | def aggiornareg(self):
'\n \n '
self.labelprogramc.config(text=self.CD.PC)
self.labelmar.config(text=self.CD.MAR)
self.labelmbr.config(text=self.CD.MBR)
self.labelac.config(text=self.CD.AC)
self.labelacint.config(text=str(self.CD.range(int(self.CD.AC, 2))))
self.labelachex.conf... |
def aggiornauc(self):
"\n Aggiorna lo stato dell'unita' di controllo\n "
if (self.CD.S and (not self.CD.breaks)):
self.labelucs.config(text=self.CD.S, bg='green')
self.unitas.config(bg='green')
elif ((not self.CD.S) and self.CD.breaks):
self.labelucs.config(text=self.CD... | -5,809,643,282,104,300,000 | Aggiorna lo stato dell'unita' di controllo | Emulatore.py | aggiornauc | MircoT/py-pdp8-tk | python | def aggiornauc(self):
"\n \n "
if (self.CD.S and (not self.CD.breaks)):
self.labelucs.config(text=self.CD.S, bg='green')
self.unitas.config(bg='green')
elif ((not self.CD.S) and self.CD.breaks):
self.labelucs.config(text=self.CD.S, bg='Magenta2')
self.unitas.con... |
def aggiornaall(self):
'\n Aggiorna tutto\n '
self.aggiornaram()
self.aggiornareg()
self.aggiornauc()
self.aggiornamicro()
self.aggiornaout()
self.labelnstep.config(text=self.CD.nstep) | -8,646,146,253,776,637,000 | Aggiorna tutto | Emulatore.py | aggiornaall | MircoT/py-pdp8-tk | python | def aggiornaall(self):
'\n \n '
self.aggiornaram()
self.aggiornareg()
self.aggiornauc()
self.aggiornamicro()
self.aggiornaout()
self.labelnstep.config(text=self.CD.nstep) |
def loading(self):
'\n Carica il contenuto del codice assembly decodificandolo in binario\n nella RAM\n '
contenuto = self.codice.Inserisci.get(1.0, END)
if (len(contenuto) > 1):
self.resetCD()
if (self.CD.carica(contenuto, self) is not None):
self.CD.S = 0
... | -4,438,673,585,903,791,600 | Carica il contenuto del codice assembly decodificandolo in binario
nella RAM | Emulatore.py | loading | MircoT/py-pdp8-tk | python | def loading(self):
'\n Carica il contenuto del codice assembly decodificandolo in binario\n nella RAM\n '
contenuto = self.codice.Inserisci.get(1.0, END)
if (len(contenuto) > 1):
self.resetCD()
if (self.CD.carica(contenuto, self) is not None):
self.CD.S = 0
... |
def resetCD(self):
'\n Resetta il calcolatore didattico\n '
self.CD = pdp8()
self.aggiornaall() | 110,645,149,466,588,060 | Resetta il calcolatore didattico | Emulatore.py | resetCD | MircoT/py-pdp8-tk | python | def resetCD(self):
'\n \n '
self.CD = pdp8()
self.aggiornaall() |
def start(self):
"\n Mette la variabile Start (S) ad 1, cioe' True\n "
self.CD.S = True
if (self.CD.breaks == True):
self.CD.breaks = False
self.aggiornauc() | 6,829,089,600,509,237,000 | Mette la variabile Start (S) ad 1, cioe' True | Emulatore.py | start | MircoT/py-pdp8-tk | python | def start(self):
"\n \n "
self.CD.S = True
if (self.CD.breaks == True):
self.CD.breaks = False
self.aggiornauc() |
def stop(self):
"\n Mette la variabile Start (S) ad 0, cioe' False\n "
self.CD.S = False
self.aggiornauc() | -8,117,244,839,212,324,000 | Mette la variabile Start (S) ad 0, cioe' False | Emulatore.py | stop | MircoT/py-pdp8-tk | python | def stop(self):
"\n \n "
self.CD.S = False
self.aggiornauc() |
def setnstep(self):
'\n Setta, in base al valore passato, il numero di cicli da eseguire\n '
temp = askinteger('Num Step', 'Numero di step da eseguire', initialvalue=1, minvalue=1, parent=self.root)
if (temp is None):
self.CD.setnstep(1)
else:
self.CD.setnstep(temp)
... | 2,629,730,336,373,217,000 | Setta, in base al valore passato, il numero di cicli da eseguire | Emulatore.py | setnstep | MircoT/py-pdp8-tk | python | def setnstep(self):
'\n \n '
temp = askinteger('Num Step', 'Numero di step da eseguire', initialvalue=1, minvalue=1, parent=self.root)
if (temp is None):
self.CD.setnstep(1)
else:
self.CD.setnstep(temp)
self.labelnstep.config(text=self.CD.nstep) |
def setdelay(self):
'\n Setta, in base al valore passato, il ritardo di esecuzione.\n Il valore è espresso in millisecondi, di default = 1000\n '
temp = askinteger('Set Delay', 'Ritardo in millisecondi', initialvalue=100, minvalue=1, parent=self.root)
if (temp is not None):
self... | -2,701,462,037,646,407,700 | Setta, in base al valore passato, il ritardo di esecuzione.
Il valore è espresso in millisecondi, di default = 1000 | Emulatore.py | setdelay | MircoT/py-pdp8-tk | python | def setdelay(self):
'\n Setta, in base al valore passato, il ritardo di esecuzione.\n Il valore è espresso in millisecondi, di default = 1000\n '
temp = askinteger('Set Delay', 'Ritardo in millisecondi', initialvalue=100, minvalue=1, parent=self.root)
if (temp is not None):
self... |
def breakpoint(self):
'\n Setta o elimina i breakpoint dal programma caricato in memoria\n '
temp = askstring('Cella di memoria', 'Indirizzo esadecimale', parent=self.root)
if (temp is not None):
temp = self.CD.binario(int(temp, 16)).zfill(12)
self.CD.breakpoint(temp)
s... | -7,659,988,798,097,755,000 | Setta o elimina i breakpoint dal programma caricato in memoria | Emulatore.py | breakpoint | MircoT/py-pdp8-tk | python | def breakpoint(self):
'\n \n '
temp = askstring('Cella di memoria', 'Indirizzo esadecimale', parent=self.root)
if (temp is not None):
temp = self.CD.binario(int(temp, 16)).zfill(12)
self.CD.breakpoint(temp)
self.aggiornaram() |
def exit(self):
'\n Esce dal programma\n '
if (askquestion('Exit', 'Sicuro di voler uscire?', parent=self.master) == YES):
self.codice.master.quit()
self.codice.master.destroy()
else:
showinfo('Suggerimento', "Forse e' meglio fare una pausa!", icon=WARNING, parent=self.... | -8,835,884,903,772,825,000 | Esce dal programma | Emulatore.py | exit | MircoT/py-pdp8-tk | python | def exit(self):
'\n \n '
if (askquestion('Exit', 'Sicuro di voler uscire?', parent=self.master) == YES):
self.codice.master.quit()
self.codice.master.destroy()
else:
showinfo('Suggerimento', "Forse e' meglio fare una pausa!", icon=WARNING, parent=self.master) |
def _wraps_with_cleaned_sig(wrapped, num_args_to_remove):
'Simplify the function signature by removing arguments from it.\n\n Removes the first N arguments from function signature (where N is\n num_args_to_remove). This is useful since function signatures are visible\n in our user-facing docs, and many met... | -498,736,037,893,288,960 | Simplify the function signature by removing arguments from it.
Removes the first N arguments from function signature (where N is
num_args_to_remove). This is useful since function signatures are visible
in our user-facing docs, and many methods in DeltaGenerator have arguments
that users have no access to.
Note that ... | lib/streamlit/DeltaGenerator.py | _wraps_with_cleaned_sig | OakNorthAI/streamlit-base | python | def _wraps_with_cleaned_sig(wrapped, num_args_to_remove):
'Simplify the function signature by removing arguments from it.\n\n Removes the first N arguments from function signature (where N is\n num_args_to_remove). This is useful since function signatures are visible\n in our user-facing docs, and many met... |
def _with_element(method):
'Wrap function and pass a NewElement proto to be filled.\n\n This is a function decorator.\n\n Converts a method of the with arguments (self, element, ...) into a method\n with arguments (self, ...). Thus, the instantiation of the element proto\n object and creation of the ele... | 1,382,497,044,708,321,300 | Wrap function and pass a NewElement proto to be filled.
This is a function decorator.
Converts a method of the with arguments (self, element, ...) into a method
with arguments (self, ...). Thus, the instantiation of the element proto
object and creation of the element are handled automatically.
Parameters
----------... | lib/streamlit/DeltaGenerator.py | _with_element | OakNorthAI/streamlit-base | python | def _with_element(method):
'Wrap function and pass a NewElement proto to be filled.\n\n This is a function decorator.\n\n Converts a method of the with arguments (self, element, ...) into a method\n with arguments (self, ...). Thus, the instantiation of the element proto\n object and creation of the ele... |
def _set_widget_id(widget_type, element, user_key=None):
"Set the widget id.\n\n Parameters\n ----------\n widget_type : str\n The type of the widget as stored in proto.\n element : proto\n The proto of the element\n user_key : str\n Optional user-specified key to use for the wid... | -2,941,223,114,238,296,000 | Set the widget id.
Parameters
----------
widget_type : str
The type of the widget as stored in proto.
element : proto
The proto of the element
user_key : str
Optional user-specified key to use for the widget ID.
If this is None, we'll generate an ID by hashing the element. | lib/streamlit/DeltaGenerator.py | _set_widget_id | OakNorthAI/streamlit-base | python | def _set_widget_id(widget_type, element, user_key=None):
"Set the widget id.\n\n Parameters\n ----------\n widget_type : str\n The type of the widget as stored in proto.\n element : proto\n The proto of the element\n user_key : str\n Optional user-specified key to use for the wid... |
def _get_widget_ui_value(widget_type, element, user_key=None):
"Get the widget ui_value from the report context.\n NOTE: This function should be called after the proto has been filled.\n\n Parameters\n ----------\n widget_type : str\n The type of the widget as stored in proto.\n element : prot... | 3,817,472,688,542,238,700 | Get the widget ui_value from the report context.
NOTE: This function should be called after the proto has been filled.
Parameters
----------
widget_type : str
The type of the widget as stored in proto.
element : proto
The proto of the element
user_key : str
Optional user-specified string to use as the widg... | lib/streamlit/DeltaGenerator.py | _get_widget_ui_value | OakNorthAI/streamlit-base | python | def _get_widget_ui_value(widget_type, element, user_key=None):
"Get the widget ui_value from the report context.\n NOTE: This function should be called after the proto has been filled.\n\n Parameters\n ----------\n widget_type : str\n The type of the widget as stored in proto.\n element : prot... |
def _value_or_dg(value, dg):
'Return either value, or None, or dg.\n\n This is needed because Widgets have meaningful return values. This is\n unlike other elements, which always return None. Then we internally replace\n that None with a DeltaGenerator instance.\n\n However, sometimes a widget may want ... | 2,538,830,385,503,340,500 | Return either value, or None, or dg.
This is needed because Widgets have meaningful return values. This is
unlike other elements, which always return None. Then we internally replace
that None with a DeltaGenerator instance.
However, sometimes a widget may want to return None, and in this case it
should not be replac... | lib/streamlit/DeltaGenerator.py | _value_or_dg | OakNorthAI/streamlit-base | python | def _value_or_dg(value, dg):
'Return either value, or None, or dg.\n\n This is needed because Widgets have meaningful return values. This is\n unlike other elements, which always return None. Then we internally replace\n that None with a DeltaGenerator instance.\n\n However, sometimes a widget may want ... |
def _enqueue_message(msg):
'Enqueues a ForwardMsg proto to send to the app.'
ctx = get_report_ctx()
if (ctx is None):
raise NoSessionContext()
ctx.enqueue(msg) | -3,615,354,086,389,056,500 | Enqueues a ForwardMsg proto to send to the app. | lib/streamlit/DeltaGenerator.py | _enqueue_message | OakNorthAI/streamlit-base | python | def _enqueue_message(msg):
ctx = get_report_ctx()
if (ctx is None):
raise NoSessionContext()
ctx.enqueue(msg) |
def __init__(self, container=BlockPath_pb2.BlockPath.MAIN, cursor=None):
'Inserts or updates elements in Streamlit apps.\n\n As a user, you should never initialize this object by hand. Instead,\n DeltaGenerator objects are initialized for you in two places:\n\n 1) When you call `dg = st.foo()` ... | -6,126,102,335,790,701,000 | Inserts or updates elements in Streamlit apps.
As a user, you should never initialize this object by hand. Instead,
DeltaGenerator objects are initialized for you in two places:
1) When you call `dg = st.foo()` for some method "foo", sometimes `dg`
is a DeltaGenerator object. You can call methods on the `dg` object t... | lib/streamlit/DeltaGenerator.py | __init__ | OakNorthAI/streamlit-base | python | def __init__(self, container=BlockPath_pb2.BlockPath.MAIN, cursor=None):
'Inserts or updates elements in Streamlit apps.\n\n As a user, you should never initialize this object by hand. Instead,\n DeltaGenerator objects are initialized for you in two places:\n\n 1) When you call `dg = st.foo()` ... |
def _get_coordinates(self):
'Returns the element\'s 4-component location as string like "M.(1,2).3".\n\n This function uniquely identifies the element\'s position in the front-end,\n which allows (among other potential uses) the MediaFileManager to maintain\n session-specific maps of MediaFile ... | 6,901,358,751,241,483,000 | Returns the element's 4-component location as string like "M.(1,2).3".
This function uniquely identifies the element's position in the front-end,
which allows (among other potential uses) the MediaFileManager to maintain
session-specific maps of MediaFile objects placed with their "coordinates".
This way, users can (... | lib/streamlit/DeltaGenerator.py | _get_coordinates | OakNorthAI/streamlit-base | python | def _get_coordinates(self):
'Returns the element\'s 4-component location as string like "M.(1,2).3".\n\n This function uniquely identifies the element\'s position in the front-end,\n which allows (among other potential uses) the MediaFileManager to maintain\n session-specific maps of MediaFile ... |
def _enqueue_new_element_delta(self, marshall_element, delta_type, last_index=None, element_width=None, element_height=None):
'Create NewElement delta, fill it, and enqueue it.\n\n Parameters\n ----------\n marshall_element : callable\n Function which sets the fields for a NewElement... | 3,325,375,162,167,999,500 | Create NewElement delta, fill it, and enqueue it.
Parameters
----------
marshall_element : callable
Function which sets the fields for a NewElement protobuf.
element_width : int or None
Desired width for the element
element_height : int or None
Desired height for the element
Returns
-------
DeltaGenerator... | lib/streamlit/DeltaGenerator.py | _enqueue_new_element_delta | OakNorthAI/streamlit-base | python | def _enqueue_new_element_delta(self, marshall_element, delta_type, last_index=None, element_width=None, element_height=None):
'Create NewElement delta, fill it, and enqueue it.\n\n Parameters\n ----------\n marshall_element : callable\n Function which sets the fields for a NewElement... |
@_with_element
def balloons(self, element):
'Draw celebratory balloons.\n\n Example\n -------\n >>> st.balloons()\n\n ...then watch your app and get ready for a celebration!\n\n '
element.balloons.type = Balloons_pb2.Balloons.DEFAULT
element.balloons.execution_id = random.... | -8,763,906,819,590,347,000 | Draw celebratory balloons.
Example
-------
>>> st.balloons()
...then watch your app and get ready for a celebration! | lib/streamlit/DeltaGenerator.py | balloons | OakNorthAI/streamlit-base | python | @_with_element
def balloons(self, element):
'Draw celebratory balloons.\n\n Example\n -------\n >>> st.balloons()\n\n ...then watch your app and get ready for a celebration!\n\n '
element.balloons.type = Balloons_pb2.Balloons.DEFAULT
element.balloons.execution_id = random.... |
@_with_element
def text(self, element, body):
"Write fixed-width and preformatted text.\n\n Parameters\n ----------\n body : str\n The string to display.\n\n Example\n -------\n >>> st.text('This is some text.')\n\n .. output::\n https://share.st... | -8,381,293,017,526,778,000 | Write fixed-width and preformatted text.
Parameters
----------
body : str
The string to display.
Example
-------
>>> st.text('This is some text.')
.. output::
https://share.streamlit.io/0.25.0-2JkNY/index.html?id=PYxU1kee5ubuhGR11NsnT1
height: 50px | lib/streamlit/DeltaGenerator.py | text | OakNorthAI/streamlit-base | python | @_with_element
def text(self, element, body):
"Write fixed-width and preformatted text.\n\n Parameters\n ----------\n body : str\n The string to display.\n\n Example\n -------\n >>> st.text('This is some text.')\n\n .. output::\n https://share.st... |
@_with_element
def markdown(self, element, body, unsafe_allow_html=False):
'Display string formatted as Markdown.\n\n Parameters\n ----------\n body : str\n The string to display as Github-flavored Markdown. Syntax\n information can be found at: https://github.github.com/g... | 4,004,008,554,206,298,000 | Display string formatted as Markdown.
Parameters
----------
body : str
The string to display as Github-flavored Markdown. Syntax
information can be found at: https://github.github.com/gfm.
This also supports:
* Emoji shortcodes, such as `:+1:` and `:sunglasses:`.
For a list of all supported co... | lib/streamlit/DeltaGenerator.py | markdown | OakNorthAI/streamlit-base | python | @_with_element
def markdown(self, element, body, unsafe_allow_html=False):
'Display string formatted as Markdown.\n\n Parameters\n ----------\n body : str\n The string to display as Github-flavored Markdown. Syntax\n information can be found at: https://github.github.com/g... |
@_with_element
def latex(self, element, body):
"Display mathematical expressions formatted as LaTeX.\n\n Supported LaTeX functions are listed at\n https://katex.org/docs/supported.html.\n\n Parameters\n ----------\n body : str or SymPy expression\n The string or SymPy e... | 2,476,711,617,061,567,000 | Display mathematical expressions formatted as LaTeX.
Supported LaTeX functions are listed at
https://katex.org/docs/supported.html.
Parameters
----------
body : str or SymPy expression
The string or SymPy expression to display as LaTeX. If str, it's
a good idea to use raw Python strings since LaTeX uses backs... | lib/streamlit/DeltaGenerator.py | latex | OakNorthAI/streamlit-base | python | @_with_element
def latex(self, element, body):
"Display mathematical expressions formatted as LaTeX.\n\n Supported LaTeX functions are listed at\n https://katex.org/docs/supported.html.\n\n Parameters\n ----------\n body : str or SymPy expression\n The string or SymPy e... |
@_with_element
def code(self, element, body, language='python'):
'Display a code block with optional syntax highlighting.\n\n (This is a convenience wrapper around `st.markdown()`)\n\n Parameters\n ----------\n body : str\n The string to display as code.\n\n language : ... | -6,307,285,162,227,188,000 | Display a code block with optional syntax highlighting.
(This is a convenience wrapper around `st.markdown()`)
Parameters
----------
body : str
The string to display as code.
language : str
The language that the code is written in, for syntax highlighting.
If omitted, the code will be unstyled.
Example
... | lib/streamlit/DeltaGenerator.py | code | OakNorthAI/streamlit-base | python | @_with_element
def code(self, element, body, language='python'):
'Display a code block with optional syntax highlighting.\n\n (This is a convenience wrapper around `st.markdown()`)\n\n Parameters\n ----------\n body : str\n The string to display as code.\n\n language : ... |
@_with_element
def json(self, element, body):
"Display object or string as a pretty-printed JSON string.\n\n Parameters\n ----------\n body : Object or str\n The object to print as JSON. All referenced objects should be\n serializable to JSON as well. If object is a string... | -4,540,416,328,640,454,000 | Display object or string as a pretty-printed JSON string.
Parameters
----------
body : Object or str
The object to print as JSON. All referenced objects should be
serializable to JSON as well. If object is a string, we assume it
contains serialized JSON.
Example
-------
>>> st.json({
... 'foo': 'bar',... | lib/streamlit/DeltaGenerator.py | json | OakNorthAI/streamlit-base | python | @_with_element
def json(self, element, body):
"Display object or string as a pretty-printed JSON string.\n\n Parameters\n ----------\n body : Object or str\n The object to print as JSON. All referenced objects should be\n serializable to JSON as well. If object is a string... |
@_with_element
def title(self, element, body):
"Display text in title formatting.\n\n Each document should have a single `st.title()`, although this is not\n enforced.\n\n Parameters\n ----------\n body : str\n The text to display.\n\n Example\n -------\n ... | -6,305,926,949,152,020,000 | Display text in title formatting.
Each document should have a single `st.title()`, although this is not
enforced.
Parameters
----------
body : str
The text to display.
Example
-------
>>> st.title('This is a title')
.. output::
https://share.streamlit.io/0.25.0-2JkNY/index.html?id=SFcBGANWd8kWXF28XnaEZj
h... | lib/streamlit/DeltaGenerator.py | title | OakNorthAI/streamlit-base | python | @_with_element
def title(self, element, body):
"Display text in title formatting.\n\n Each document should have a single `st.title()`, although this is not\n enforced.\n\n Parameters\n ----------\n body : str\n The text to display.\n\n Example\n -------\n ... |
@_with_element
def header(self, element, body):
"Display text in header formatting.\n\n Parameters\n ----------\n body : str\n The text to display.\n\n Example\n -------\n >>> st.header('This is a header')\n\n .. output::\n https://share.streamli... | 5,263,767,285,842,401,000 | Display text in header formatting.
Parameters
----------
body : str
The text to display.
Example
-------
>>> st.header('This is a header')
.. output::
https://share.streamlit.io/0.25.0-2JkNY/index.html?id=AnfQVFgSCQtGv6yMUMUYjj
height: 100px | lib/streamlit/DeltaGenerator.py | header | OakNorthAI/streamlit-base | python | @_with_element
def header(self, element, body):
"Display text in header formatting.\n\n Parameters\n ----------\n body : str\n The text to display.\n\n Example\n -------\n >>> st.header('This is a header')\n\n .. output::\n https://share.streamli... |
@_with_element
def subheader(self, element, body):
"Display text in subheader formatting.\n\n Parameters\n ----------\n body : str\n The text to display.\n\n Example\n -------\n >>> st.subheader('This is a subheader')\n\n .. output::\n https://sh... | 5,586,132,893,850,543,000 | Display text in subheader formatting.
Parameters
----------
body : str
The text to display.
Example
-------
>>> st.subheader('This is a subheader')
.. output::
https://share.streamlit.io/0.25.0-2JkNY/index.html?id=LBKJTfFUwudrbWENSHV6cJ
height: 100px | lib/streamlit/DeltaGenerator.py | subheader | OakNorthAI/streamlit-base | python | @_with_element
def subheader(self, element, body):
"Display text in subheader formatting.\n\n Parameters\n ----------\n body : str\n The text to display.\n\n Example\n -------\n >>> st.subheader('This is a subheader')\n\n .. output::\n https://sh... |
@_with_element
def error(self, element, body):
"Display error message.\n\n Parameters\n ----------\n body : str\n The error text to display.\n\n Example\n -------\n >>> st.error('This is an error')\n\n "
element.alert.body = _clean_text(body)
eleme... | 1,972,284,234,575,259,400 | Display error message.
Parameters
----------
body : str
The error text to display.
Example
-------
>>> st.error('This is an error') | lib/streamlit/DeltaGenerator.py | error | OakNorthAI/streamlit-base | python | @_with_element
def error(self, element, body):
"Display error message.\n\n Parameters\n ----------\n body : str\n The error text to display.\n\n Example\n -------\n >>> st.error('This is an error')\n\n "
element.alert.body = _clean_text(body)
eleme... |
@_with_element
def warning(self, element, body):
"Display warning message.\n\n Parameters\n ----------\n body : str\n The warning text to display.\n\n Example\n -------\n >>> st.warning('This is a warning')\n\n "
element.alert.body = _clean_text(body)
... | 1,412,789,457,126,936,000 | Display warning message.
Parameters
----------
body : str
The warning text to display.
Example
-------
>>> st.warning('This is a warning') | lib/streamlit/DeltaGenerator.py | warning | OakNorthAI/streamlit-base | python | @_with_element
def warning(self, element, body):
"Display warning message.\n\n Parameters\n ----------\n body : str\n The warning text to display.\n\n Example\n -------\n >>> st.warning('This is a warning')\n\n "
element.alert.body = _clean_text(body)
... |
@_with_element
def info(self, element, body):
"Display an informational message.\n\n Parameters\n ----------\n body : str\n The info text to display.\n\n Example\n -------\n >>> st.info('This is a purely informational message')\n\n "
element.alert.body... | -542,370,585,494,341,060 | Display an informational message.
Parameters
----------
body : str
The info text to display.
Example
-------
>>> st.info('This is a purely informational message') | lib/streamlit/DeltaGenerator.py | info | OakNorthAI/streamlit-base | python | @_with_element
def info(self, element, body):
"Display an informational message.\n\n Parameters\n ----------\n body : str\n The info text to display.\n\n Example\n -------\n >>> st.info('This is a purely informational message')\n\n "
element.alert.body... |
@_with_element
def success(self, element, body):
"Display a success message.\n\n Parameters\n ----------\n body : str\n The success text to display.\n\n Example\n -------\n >>> st.success('This is a success message!')\n\n "
element.alert.body = _clean_... | -3,019,921,363,302,528,500 | Display a success message.
Parameters
----------
body : str
The success text to display.
Example
-------
>>> st.success('This is a success message!') | lib/streamlit/DeltaGenerator.py | success | OakNorthAI/streamlit-base | python | @_with_element
def success(self, element, body):
"Display a success message.\n\n Parameters\n ----------\n body : str\n The success text to display.\n\n Example\n -------\n >>> st.success('This is a success message!')\n\n "
element.alert.body = _clean_... |
@_with_element
def help(self, element, obj):
"Display object's doc string, nicely formatted.\n\n Displays the doc string for this object.\n\n Parameters\n ----------\n obj : Object\n The object whose docstring should be displayed.\n\n Example\n -------\n\n ... | -3,615,020,235,629,871,000 | Display object's doc string, nicely formatted.
Displays the doc string for this object.
Parameters
----------
obj : Object
The object whose docstring should be displayed.
Example
-------
Don't remember how to initialize a dataframe? Try this:
>>> st.help(pandas.DataFrame)
Want to quickly check what datatype i... | lib/streamlit/DeltaGenerator.py | help | OakNorthAI/streamlit-base | python | @_with_element
def help(self, element, obj):
"Display object's doc string, nicely formatted.\n\n Displays the doc string for this object.\n\n Parameters\n ----------\n obj : Object\n The object whose docstring should be displayed.\n\n Example\n -------\n\n ... |
@_with_element
def exception(self, element, exception):
"Display an exception.\n\n Parameters\n ----------\n exception : Exception\n The exception to display.\n\n Example\n -------\n >>> e = RuntimeError('This is an exception of type RuntimeError')\n >>> s... | -1,978,820,827,651,106,000 | Display an exception.
Parameters
----------
exception : Exception
The exception to display.
Example
-------
>>> e = RuntimeError('This is an exception of type RuntimeError')
>>> st.exception(e) | lib/streamlit/DeltaGenerator.py | exception | OakNorthAI/streamlit-base | python | @_with_element
def exception(self, element, exception):
"Display an exception.\n\n Parameters\n ----------\n exception : Exception\n The exception to display.\n\n Example\n -------\n >>> e = RuntimeError('This is an exception of type RuntimeError')\n >>> s... |
def dataframe(self, data=None, width=None, height=None):
"Display a dataframe as an interactive table.\n\n Parameters\n ----------\n data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,\n or None\n The data to display.\n\n If 'data' is a pandas... | 3,596,530,301,364,283,000 | Display a dataframe as an interactive table.
Parameters
----------
data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,
or None
The data to display.
If 'data' is a pandas.Styler, it will be used to style its
underyling DataFrame. Streamlit supports custom cell
values and colors. ... | lib/streamlit/DeltaGenerator.py | dataframe | OakNorthAI/streamlit-base | python | def dataframe(self, data=None, width=None, height=None):
"Display a dataframe as an interactive table.\n\n Parameters\n ----------\n data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,\n or None\n The data to display.\n\n If 'data' is a pandas... |
@_with_element
def line_chart(self, element, data=None, width=0, height=0, use_container_width=True):
'Display a line chart.\n\n This is just syntax-sugar around st.altair_chart. The main difference\n is this command uses the data\'s own column and indices to figure out\n the chart\'s spec. As ... | 3,271,366,809,158,010,000 | Display a line chart.
This is just syntax-sugar around st.altair_chart. The main difference
is this command uses the data's own column and indices to figure out
the chart's spec. As a result this is easier to use for many "just plot
this" scenarios, while being less customizable.
Parameters
----------
data : pandas.D... | lib/streamlit/DeltaGenerator.py | line_chart | OakNorthAI/streamlit-base | python | @_with_element
def line_chart(self, element, data=None, width=0, height=0, use_container_width=True):
'Display a line chart.\n\n This is just syntax-sugar around st.altair_chart. The main difference\n is this command uses the data\'s own column and indices to figure out\n the chart\'s spec. As ... |
@_with_element
def area_chart(self, element, data=None, width=0, height=0, use_container_width=True):
'Display a area chart.\n\n This is just syntax-sugar around st.altair_chart. The main difference\n is this command uses the data\'s own column and indices to figure out\n the chart\'s spec. As ... | 8,608,271,067,037,099,000 | Display a area chart.
This is just syntax-sugar around st.altair_chart. The main difference
is this command uses the data's own column and indices to figure out
the chart's spec. As a result this is easier to use for many "just plot
this" scenarios, while being less customizable.
Parameters
----------
data : pandas.D... | lib/streamlit/DeltaGenerator.py | area_chart | OakNorthAI/streamlit-base | python | @_with_element
def area_chart(self, element, data=None, width=0, height=0, use_container_width=True):
'Display a area chart.\n\n This is just syntax-sugar around st.altair_chart. The main difference\n is this command uses the data\'s own column and indices to figure out\n the chart\'s spec. As ... |
@_with_element
def bar_chart(self, element, data=None, width=0, height=0, use_container_width=True):
'Display a bar chart.\n\n This is just syntax-sugar around st.altair_chart. The main difference\n is this command uses the data\'s own column and indices to figure out\n the chart\'s spec. As a ... | 1,886,139,325,102,552,600 | Display a bar chart.
This is just syntax-sugar around st.altair_chart. The main difference
is this command uses the data's own column and indices to figure out
the chart's spec. As a result this is easier to use for many "just plot
this" scenarios, while being less customizable.
Parameters
----------
data : pandas.Da... | lib/streamlit/DeltaGenerator.py | bar_chart | OakNorthAI/streamlit-base | python | @_with_element
def bar_chart(self, element, data=None, width=0, height=0, use_container_width=True):
'Display a bar chart.\n\n This is just syntax-sugar around st.altair_chart. The main difference\n is this command uses the data\'s own column and indices to figure out\n the chart\'s spec. As a ... |
@_with_element
def vega_lite_chart(self, element, data=None, spec=None, width=0, use_container_width=False, **kwargs):
"Display a chart using the Vega-Lite library.\n\n Parameters\n ----------\n data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,\n or None\n ... | -3,457,005,380,634,783,000 | Display a chart using the Vega-Lite library.
Parameters
----------
data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,
or None
Either the data to be plotted or a Vega-Lite spec containing the
data (which more closely follows the Vega-Lite API).
spec : dict or None
The Vega-Lite spec... | lib/streamlit/DeltaGenerator.py | vega_lite_chart | OakNorthAI/streamlit-base | python | @_with_element
def vega_lite_chart(self, element, data=None, spec=None, width=0, use_container_width=False, **kwargs):
"Display a chart using the Vega-Lite library.\n\n Parameters\n ----------\n data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict,\n or None\n ... |
@_with_element
def altair_chart(self, element, altair_chart, width=0, use_container_width=False):
"Display a chart using the Altair library.\n\n Parameters\n ----------\n altair_chart : altair.vegalite.v2.api.Chart\n The Altair chart object to display.\n\n width : number\n ... | -2,914,322,783,231,960,600 | Display a chart using the Altair library.
Parameters
----------
altair_chart : altair.vegalite.v2.api.Chart
The Altair chart object to display.
width : number
Deprecated. If != 0 (default), will show an alert.
From now on you should set the width directly in the Altair
spec. Please refer to the Altair... | lib/streamlit/DeltaGenerator.py | altair_chart | OakNorthAI/streamlit-base | python | @_with_element
def altair_chart(self, element, altair_chart, width=0, use_container_width=False):
"Display a chart using the Altair library.\n\n Parameters\n ----------\n altair_chart : altair.vegalite.v2.api.Chart\n The Altair chart object to display.\n\n width : number\n ... |
@_with_element
def graphviz_chart(self, element, figure_or_dot, width=0, height=0, use_container_width=False):
"Display a graph using the dagre-d3 library.\n\n Parameters\n ----------\n figure_or_dot : graphviz.dot.Graph, graphviz.dot.Digraph, str\n The Graphlib graph object or dot s... | -580,667,264,566,975,000 | Display a graph using the dagre-d3 library.
Parameters
----------
figure_or_dot : graphviz.dot.Graph, graphviz.dot.Digraph, str
The Graphlib graph object or dot string to display
width : number
Deprecated. If != 0 (default), will show an alert.
From now on you should set the width directly in the Graphviz... | lib/streamlit/DeltaGenerator.py | graphviz_chart | OakNorthAI/streamlit-base | python | @_with_element
def graphviz_chart(self, element, figure_or_dot, width=0, height=0, use_container_width=False):
"Display a graph using the dagre-d3 library.\n\n Parameters\n ----------\n figure_or_dot : graphviz.dot.Graph, graphviz.dot.Digraph, str\n The Graphlib graph object or dot s... |
@_with_element
def plotly_chart(self, element, figure_or_data, width=0, height=0, use_container_width=False, sharing='streamlit', **kwargs):
"Display an interactive Plotly chart.\n\n Plotly is a charting library for Python. The arguments to this function\n closely follow the ones for Plotly's `plot()`... | 1,226,472,571,385,272,000 | Display an interactive Plotly chart.
Plotly is a charting library for Python. The arguments to this function
closely follow the ones for Plotly's `plot()` function. You can find
more about Plotly at https://plot.ly/python.
Parameters
----------
figure_or_data : plotly.graph_objs.Figure, plotly.graph_objs.Data,
di... | lib/streamlit/DeltaGenerator.py | plotly_chart | OakNorthAI/streamlit-base | python | @_with_element
def plotly_chart(self, element, figure_or_data, width=0, height=0, use_container_width=False, sharing='streamlit', **kwargs):
"Display an interactive Plotly chart.\n\n Plotly is a charting library for Python. The arguments to this function\n closely follow the ones for Plotly's `plot()`... |
@_with_element
def pyplot(self, element, fig=None, clear_figure=None, **kwargs):
'Display a matplotlib.pyplot figure.\n\n Parameters\n ----------\n fig : Matplotlib Figure\n The figure to plot. When this argument isn\'t specified, which is\n the usual case, this function w... | -147,165,660,458,301,900 | Display a matplotlib.pyplot figure.
Parameters
----------
fig : Matplotlib Figure
The figure to plot. When this argument isn't specified, which is
the usual case, this function will render the global plot.
clear_figure : bool
If True, the figure will be cleared after being rendered.
If False, the figu... | lib/streamlit/DeltaGenerator.py | pyplot | OakNorthAI/streamlit-base | python | @_with_element
def pyplot(self, element, fig=None, clear_figure=None, **kwargs):
'Display a matplotlib.pyplot figure.\n\n Parameters\n ----------\n fig : Matplotlib Figure\n The figure to plot. When this argument isn\'t specified, which is\n the usual case, this function w... |
@_with_element
def bokeh_chart(self, element, figure, use_container_width=False):
"Display an interactive Bokeh chart.\n\n Bokeh is a charting library for Python. The arguments to this function\n closely follow the ones for Bokeh's `show` function. You can find\n more about Bokeh at https://bok... | -6,488,593,160,728,467,000 | Display an interactive Bokeh chart.
Bokeh is a charting library for Python. The arguments to this function
closely follow the ones for Bokeh's `show` function. You can find
more about Bokeh at https://bokeh.pydata.org.
Parameters
----------
figure : bokeh.plotting.figure.Figure
A Bokeh figure to plot.
use_contai... | lib/streamlit/DeltaGenerator.py | bokeh_chart | OakNorthAI/streamlit-base | python | @_with_element
def bokeh_chart(self, element, figure, use_container_width=False):
"Display an interactive Bokeh chart.\n\n Bokeh is a charting library for Python. The arguments to this function\n closely follow the ones for Bokeh's `show` function. You can find\n more about Bokeh at https://bok... |
@_with_element
def image(self, element, image, caption=None, width=None, use_column_width=False, clamp=False, channels='RGB', format='JPEG'):
"Display an image or list of images.\n\n Parameters\n ----------\n image : numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]\n Monochrome... | -6,240,400,164,668,515,000 | Display an image or list of images.
Parameters
----------
image : numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]
Monochrome image of shape (w,h) or (w,h,1)
OR a color image of shape (w,h,3)
OR an RGBA image of shape (w,h,4)
OR a URL to fetch the image from
OR a list of one of the above, to ... | lib/streamlit/DeltaGenerator.py | image | OakNorthAI/streamlit-base | python | @_with_element
def image(self, element, image, caption=None, width=None, use_column_width=False, clamp=False, channels='RGB', format='JPEG'):
"Display an image or list of images.\n\n Parameters\n ----------\n image : numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]\n Monochrome... |
@_with_element
def audio(self, element, data, format='audio/wav', start_time=0):
"Display an audio player.\n\n Parameters\n ----------\n data : str, bytes, BytesIO, numpy.ndarray, or file opened with\n io.open().\n Raw audio data, filename, or a URL pointing to the fil... | -4,706,573,096,117,969,000 | Display an audio player.
Parameters
----------
data : str, bytes, BytesIO, numpy.ndarray, or file opened with
io.open().
Raw audio data, filename, or a URL pointing to the file to load.
Numpy arrays and raw data formats must include all necessary file
headers to match specified file format.
start_t... | lib/streamlit/DeltaGenerator.py | audio | OakNorthAI/streamlit-base | python | @_with_element
def audio(self, element, data, format='audio/wav', start_time=0):
"Display an audio player.\n\n Parameters\n ----------\n data : str, bytes, BytesIO, numpy.ndarray, or file opened with\n io.open().\n Raw audio data, filename, or a URL pointing to the fil... |
@_with_element
def video(self, element, data, format='video/mp4', start_time=0):
"Display a video player.\n\n Parameters\n ----------\n data : str, bytes, BytesIO, numpy.ndarray, or file opened with\n io.open().\n Raw video data, filename, or URL pointing to a video to... | 6,395,827,962,340,364,000 | Display a video player.
Parameters
----------
data : str, bytes, BytesIO, numpy.ndarray, or file opened with
io.open().
Raw video data, filename, or URL pointing to a video to load.
Includes support for YouTube URLs.
Numpy arrays and raw data formats must include all necessary file
headers to m... | lib/streamlit/DeltaGenerator.py | video | OakNorthAI/streamlit-base | python | @_with_element
def video(self, element, data, format='video/mp4', start_time=0):
"Display a video player.\n\n Parameters\n ----------\n data : str, bytes, BytesIO, numpy.ndarray, or file opened with\n io.open().\n Raw video data, filename, or URL pointing to a video to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.