partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
KMIPProxy.derive_key
Derive a new key or secret data from an existing managed object. Args: object_type (ObjectType): An ObjectType enumeration specifying what type of object to create. Required. unique_identifiers (list): A list of strings specifying the unique IDs of the ex...
kmip/services/kmip_client.py
def derive_key(self, object_type, unique_identifiers, derivation_method, derivation_parameters, template_attribute, credential=None): """ Derive a new key or secret data from an existing man...
def derive_key(self, object_type, unique_identifiers, derivation_method, derivation_parameters, template_attribute, credential=None): """ Derive a new key or secret data from an existing man...
[ "Derive", "a", "new", "key", "or", "secret", "data", "from", "an", "existing", "managed", "object", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L423-L503
[ "def", "derive_key", "(", "self", ",", "object_type", ",", "unique_identifiers", ",", "derivation_method", ",", "derivation_parameters", ",", "template_attribute", ",", "credential", "=", "None", ")", ":", "operation", "=", "Operation", "(", "OperationEnum", ".", ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
KMIPProxy.check
Check object usage according to specific constraints. Args: uuid (string): The unique identifier of a managed cryptographic object that should be checked. Optional, defaults to None. usage_limits_count (int): An integer specifying the number of items that...
kmip/services/kmip_client.py
def check(self, uuid=None, usage_limits_count=None, cryptographic_usage_mask=None, lease_time=None, credential=None): """ Check object usage according to specific constraints. Args: uuid (string): The unique ident...
def check(self, uuid=None, usage_limits_count=None, cryptographic_usage_mask=None, lease_time=None, credential=None): """ Check object usage according to specific constraints. Args: uuid (string): The unique ident...
[ "Check", "object", "usage", "according", "to", "specific", "constraints", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L505-L604
[ "def", "check", "(", "self", ",", "uuid", "=", "None", ",", "usage_limits_count", "=", "None", ",", "cryptographic_usage_mask", "=", "None", ",", "lease_time", "=", "None", ",", "credential", "=", "None", ")", ":", "# TODO (peter-hamilton) Push this into the Check...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
KMIPProxy.get_attributes
Send a GetAttributes request to the server. Args: uuid (string): The ID of the managed object with which the retrieved attributes should be associated. Optional, defaults to None. attribute_names (list): A list of AttributeName values indicating ...
kmip/services/kmip_client.py
def get_attributes(self, uuid=None, attribute_names=None): """ Send a GetAttributes request to the server. Args: uuid (string): The ID of the managed object with which the retrieved attributes should be associated. Optional, defaults to None. ...
def get_attributes(self, uuid=None, attribute_names=None): """ Send a GetAttributes request to the server. Args: uuid (string): The ID of the managed object with which the retrieved attributes should be associated. Optional, defaults to None. ...
[ "Send", "a", "GetAttributes", "request", "to", "the", "server", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L615-L639
[ "def", "get_attributes", "(", "self", ",", "uuid", "=", "None", ",", "attribute_names", "=", "None", ")", ":", "batch_item", "=", "self", ".", "_build_get_attributes_batch_item", "(", "uuid", ",", "attribute_names", ")", "request", "=", "self", ".", "_build_re...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
KMIPProxy.get_attribute_list
Send a GetAttributeList request to the server. Args: uid (string): The ID of the managed object with which the retrieved attribute names should be associated. Returns: result (GetAttributeListResult): A structure containing the results of the ope...
kmip/services/kmip_client.py
def get_attribute_list(self, uid=None): """ Send a GetAttributeList request to the server. Args: uid (string): The ID of the managed object with which the retrieved attribute names should be associated. Returns: result (GetAttributeListResult): A...
def get_attribute_list(self, uid=None): """ Send a GetAttributeList request to the server. Args: uid (string): The ID of the managed object with which the retrieved attribute names should be associated. Returns: result (GetAttributeListResult): A...
[ "Send", "a", "GetAttributeList", "request", "to", "the", "server", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L641-L658
[ "def", "get_attribute_list", "(", "self", ",", "uid", "=", "None", ")", ":", "batch_item", "=", "self", ".", "_build_get_attribute_list_batch_item", "(", "uid", ")", "request", "=", "self", ".", "_build_request_message", "(", "None", ",", "[", "batch_item", "]...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
KMIPProxy.query
Send a Query request to the server. Args: batch (boolean): A flag indicating if the operation should be sent with a batch of additional operations. Defaults to False. query_functions (list): A list of QueryFunction enumerations indicating what information...
kmip/services/kmip_client.py
def query(self, batch=False, query_functions=None, credential=None): """ Send a Query request to the server. Args: batch (boolean): A flag indicating if the operation should be sent with a batch of additional operations. Defaults to False. query_functions...
def query(self, batch=False, query_functions=None, credential=None): """ Send a Query request to the server. Args: batch (boolean): A flag indicating if the operation should be sent with a batch of additional operations. Defaults to False. query_functions...
[ "Send", "a", "Query", "request", "to", "the", "server", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L703-L726
[ "def", "query", "(", "self", ",", "batch", "=", "False", ",", "query_functions", "=", "None", ",", "credential", "=", "None", ")", ":", "batch_item", "=", "self", ".", "_build_query_batch_item", "(", "query_functions", ")", "# TODO (peter-hamilton): Replace this w...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
KMIPProxy.encrypt
Encrypt data using the specified encryption key and parameters. Args: data (bytes): The bytes to encrypt. Required. unique_identifier (string): The unique ID of the encryption key to use. Optional, defaults to None. cryptographic_parameters (CryptographicPara...
kmip/services/kmip_client.py
def encrypt(self, data, unique_identifier=None, cryptographic_parameters=None, iv_counter_nonce=None, credential=None): """ Encrypt data using the specified encryption key and parameters. Args: data (byt...
def encrypt(self, data, unique_identifier=None, cryptographic_parameters=None, iv_counter_nonce=None, credential=None): """ Encrypt data using the specified encryption key and parameters. Args: data (byt...
[ "Encrypt", "data", "using", "the", "specified", "encryption", "key", "and", "parameters", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L741-L817
[ "def", "encrypt", "(", "self", ",", "data", ",", "unique_identifier", "=", "None", ",", "cryptographic_parameters", "=", "None", ",", "iv_counter_nonce", "=", "None", ",", "credential", "=", "None", ")", ":", "operation", "=", "Operation", "(", "OperationEnum"...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
KMIPProxy.signature_verify
Verify a message signature using the specified signing key. Args: message (bytes): The bytes of the signed message. Required. signature (bytes): The bytes of the message signature. Required. unique_identifier (string): The unique ID of the signing key to use....
kmip/services/kmip_client.py
def signature_verify(self, message, signature, unique_identifier=None, cryptographic_parameters=None, credential=None): """ Verify a message signature using the specified signing ...
def signature_verify(self, message, signature, unique_identifier=None, cryptographic_parameters=None, credential=None): """ Verify a message signature using the specified signing ...
[ "Verify", "a", "message", "signature", "using", "the", "specified", "signing", "key", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L894-L967
[ "def", "signature_verify", "(", "self", ",", "message", ",", "signature", ",", "unique_identifier", "=", "None", ",", "cryptographic_parameters", "=", "None", ",", "credential", "=", "None", ")", ":", "operation", "=", "Operation", "(", "OperationEnum", ".", "...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
KMIPProxy.sign
Sign specified data using a specified signing key. Args: data (bytes): Data to be signed. Required. unique_identifier (string): The unique ID of the signing key to be used. Optional, defaults to None. cryptographic_parameters (CryptographicParameters): A stru...
kmip/services/kmip_client.py
def sign(self, data, unique_identifier=None, cryptographic_parameters=None, credential=None): """ Sign specified data using a specified signing key. Args: data (bytes): Data to be signed. Required. unique_identifier (string): The unique ID of the signing ...
def sign(self, data, unique_identifier=None, cryptographic_parameters=None, credential=None): """ Sign specified data using a specified signing key. Args: data (bytes): Data to be signed. Required. unique_identifier (string): The unique ID of the signing ...
[ "Sign", "specified", "data", "using", "a", "specified", "signing", "key", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L969-L1033
[ "def", "sign", "(", "self", ",", "data", ",", "unique_identifier", "=", "None", ",", "cryptographic_parameters", "=", "None", ",", "credential", "=", "None", ")", ":", "operation", "=", "Operation", "(", "OperationEnum", ".", "SIGN", ")", "request_payload", ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
KMIPProxy._build_host_list
This internal function takes the host string from the config file and turns it into a list :return: LIST host list
kmip/services/kmip_client.py
def _build_host_list(self, host_list_str): ''' This internal function takes the host string from the config file and turns it into a list :return: LIST host list ''' host_list = [] if isinstance(host_list_str, str): host_list = host_list_str.replace('...
def _build_host_list(self, host_list_str): ''' This internal function takes the host string from the config file and turns it into a list :return: LIST host list ''' host_list = [] if isinstance(host_list_str, str): host_list = host_list_str.replace('...
[ "This", "internal", "function", "takes", "the", "host", "string", "from", "the", "config", "file", "and", "turns", "it", "into", "a", "list", ":", "return", ":", "LIST", "host", "list" ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/kmip_client.py#L1676-L1690
[ "def", "_build_host_list", "(", "self", ",", "host_list_str", ")", ":", "host_list", "=", "[", "]", "if", "isinstance", "(", "host_list_str", ",", "str", ")", ":", "host_list", "=", "host_list_str", ".", "replace", "(", "' '", ",", "''", ")", ".", "split...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.kmip_version
Set the KMIP version for the client. Args: value (KMIPVersion): A KMIPVersion enumeration Return: None Raises: ValueError: if value is not a KMIPVersion enumeration Example: >>> client.kmip_version = enums.KMIPVersion.KMIP_1_1 ...
kmip/pie/client.py
def kmip_version(self, value): """ Set the KMIP version for the client. Args: value (KMIPVersion): A KMIPVersion enumeration Return: None Raises: ValueError: if value is not a KMIPVersion enumeration Example: >>> client....
def kmip_version(self, value): """ Set the KMIP version for the client. Args: value (KMIPVersion): A KMIPVersion enumeration Return: None Raises: ValueError: if value is not a KMIPVersion enumeration Example: >>> client....
[ "Set", "the", "KMIP", "version", "for", "the", "client", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L135-L155
[ "def", "kmip_version", "(", "self", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "enums", ".", "KMIPVersion", ")", ":", "self", ".", "proxy", ".", "kmip_version", "=", "value", "else", ":", "raise", "ValueError", "(", "\"KMIP version must...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.open
Open the client connection. Raises: ClientConnectionFailure: if the client connection is already open Exception: if an error occurs while trying to open the connection
kmip/pie/client.py
def open(self): """ Open the client connection. Raises: ClientConnectionFailure: if the client connection is already open Exception: if an error occurs while trying to open the connection """ if self._is_open: raise exceptions.ClientConnection...
def open(self): """ Open the client connection. Raises: ClientConnectionFailure: if the client connection is already open Exception: if an error occurs while trying to open the connection """ if self._is_open: raise exceptions.ClientConnection...
[ "Open", "the", "client", "connection", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L157-L174
[ "def", "open", "(", "self", ")", ":", "if", "self", ".", "_is_open", ":", "raise", "exceptions", ".", "ClientConnectionFailure", "(", "\"client connection already open\"", ")", "else", ":", "try", ":", "self", ".", "proxy", ".", "open", "(", ")", "self", "...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.close
Close the client connection. Raises: Exception: if an error occurs while trying to close the connection
kmip/pie/client.py
def close(self): """ Close the client connection. Raises: Exception: if an error occurs while trying to close the connection """ if not self._is_open: return else: try: self.proxy.close() self._is_open =...
def close(self): """ Close the client connection. Raises: Exception: if an error occurs while trying to close the connection """ if not self._is_open: return else: try: self.proxy.close() self._is_open =...
[ "Close", "the", "client", "connection", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L176-L191
[ "def", "close", "(", "self", ")", ":", "if", "not", "self", ".", "_is_open", ":", "return", "else", ":", "try", ":", "self", ".", "proxy", ".", "close", "(", ")", "self", ".", "_is_open", "=", "False", "except", "Exception", "as", "e", ":", "self",...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.create
Create a symmetric key on a KMIP appliance. Args: algorithm (CryptographicAlgorithm): An enumeration defining the algorithm to use to generate the symmetric key. length (int): The length in bits for the symmetric key. operation_policy_name (string): The name ...
kmip/pie/client.py
def create(self, algorithm, length, operation_policy_name=None, name=None, cryptographic_usage_mask=None): """ Create a symmetric key on a KMIP appliance. Args: algorithm (CryptographicAlgorithm): An enumeration defining the algorithm to use to generat...
def create(self, algorithm, length, operation_policy_name=None, name=None, cryptographic_usage_mask=None): """ Create a symmetric key on a KMIP appliance. Args: algorithm (CryptographicAlgorithm): An enumeration defining the algorithm to use to generat...
[ "Create", "a", "symmetric", "key", "on", "a", "KMIP", "appliance", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L194-L254
[ "def", "create", "(", "self", ",", "algorithm", ",", "length", ",", "operation_policy_name", "=", "None", ",", "name", "=", "None", ",", "cryptographic_usage_mask", "=", "None", ")", ":", "# Check inputs", "if", "not", "isinstance", "(", "algorithm", ",", "e...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.create_key_pair
Create an asymmetric key pair on a KMIP appliance. Args: algorithm (CryptographicAlgorithm): An enumeration defining the algorithm to use to generate the key pair. length (int): The length in bits for the key pair. operation_policy_name (string): The name of ...
kmip/pie/client.py
def create_key_pair(self, algorithm, length, operation_policy_name=None, public_name=None, public_usage_mask=None, private_name=None, private_usage_mask...
def create_key_pair(self, algorithm, length, operation_policy_name=None, public_name=None, public_usage_mask=None, private_name=None, private_usage_mask...
[ "Create", "an", "asymmetric", "key", "pair", "on", "a", "KMIP", "appliance", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L257-L374
[ "def", "create_key_pair", "(", "self", ",", "algorithm", ",", "length", ",", "operation_policy_name", "=", "None", ",", "public_name", "=", "None", ",", "public_usage_mask", "=", "None", ",", "private_name", "=", "None", ",", "private_usage_mask", "=", "None", ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.register
Register a managed object with a KMIP appliance. Args: managed_object (ManagedObject): A managed object to register. An instantiatable subclass of ManagedObject from the Pie API. Returns: string: The uid of the newly registered managed object. Raises: ...
kmip/pie/client.py
def register(self, managed_object): """ Register a managed object with a KMIP appliance. Args: managed_object (ManagedObject): A managed object to register. An instantiatable subclass of ManagedObject from the Pie API. Returns: string: The uid of...
def register(self, managed_object): """ Register a managed object with a KMIP appliance. Args: managed_object (ManagedObject): A managed object to register. An instantiatable subclass of ManagedObject from the Pie API. Returns: string: The uid of...
[ "Register", "a", "managed", "object", "with", "a", "KMIP", "appliance", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L377-L436
[ "def", "register", "(", "self", ",", "managed_object", ")", ":", "# Check input", "if", "not", "isinstance", "(", "managed_object", ",", "pobjects", ".", "ManagedObject", ")", ":", "raise", "TypeError", "(", "\"managed object must be a Pie ManagedObject\"", ")", "# ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.rekey
Rekey an existing key. Args: uid (string): The unique ID of the symmetric key to rekey. Optional, defaults to None. offset (int): The time delta, in seconds, between the new key's initialization date and activation date. Optional, defaults ...
kmip/pie/client.py
def rekey(self, uid=None, offset=None, **kwargs): """ Rekey an existing key. Args: uid (string): The unique ID of the symmetric key to rekey. Optional, defaults to None. offset (int): The time delta, in seconds, b...
def rekey(self, uid=None, offset=None, **kwargs): """ Rekey an existing key. Args: uid (string): The unique ID of the symmetric key to rekey. Optional, defaults to None. offset (int): The time delta, in seconds, b...
[ "Rekey", "an", "existing", "key", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L439-L524
[ "def", "rekey", "(", "self", ",", "uid", "=", "None", ",", "offset", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "uid", "is", "not", "None", ":", "if", "not", "isinstance", "(", "uid", ",", "six", ".", "string_types", ")", ":", "raise",...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.derive_key
Derive a new key or secret data from existing managed objects. Args: object_type (ObjectType): An ObjectType enumeration specifying what type of object to derive. Only SymmetricKeys and SecretData can be specified. Required. unique_identifiers (list): A l...
kmip/pie/client.py
def derive_key(self, object_type, unique_identifiers, derivation_method, derivation_parameters, **kwargs): """ Derive a new key or secret data from existing managed objects. Args: object_t...
def derive_key(self, object_type, unique_identifiers, derivation_method, derivation_parameters, **kwargs): """ Derive a new key or secret data from existing managed objects. Args: object_t...
[ "Derive", "a", "new", "key", "or", "secret", "data", "from", "existing", "managed", "objects", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L527-L660
[ "def", "derive_key", "(", "self", ",", "object_type", ",", "unique_identifiers", ",", "derivation_method", ",", "derivation_parameters", ",", "*", "*", "kwargs", ")", ":", "# Check input", "if", "not", "isinstance", "(", "object_type", ",", "enums", ".", "Object...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.locate
Search for managed objects, depending on the attributes specified in the request. Args: maximum_items (integer): Maximum number of object identifiers the server MAY return. storage_status_mask (integer): A bit mask that indicates whether on-line o...
kmip/pie/client.py
def locate(self, maximum_items=None, storage_status_mask=None, object_group_member=None, attributes=None): """ Search for managed objects, depending on the attributes specified in the request. Args: maximum_items (integer): Maximum number of object identifiers...
def locate(self, maximum_items=None, storage_status_mask=None, object_group_member=None, attributes=None): """ Search for managed objects, depending on the attributes specified in the request. Args: maximum_items (integer): Maximum number of object identifiers...
[ "Search", "for", "managed", "objects", "depending", "on", "the", "attributes", "specified", "in", "the", "request", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L663-L717
[ "def", "locate", "(", "self", ",", "maximum_items", "=", "None", ",", "storage_status_mask", "=", "None", ",", "object_group_member", "=", "None", ",", "attributes", "=", "None", ")", ":", "# Check inputs", "if", "maximum_items", "is", "not", "None", ":", "i...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.check
Check the constraints for a managed object. Args: uid (string): The unique ID of the managed object to check. Optional, defaults to None. usage_limits_count (int): The number of items that can be secured with the specified managed object. Optional, defaul...
kmip/pie/client.py
def check(self, uid=None, usage_limits_count=None, cryptographic_usage_mask=None, lease_time=None): """ Check the constraints for a managed object. Args: uid (string): The unique ID of the managed object to check. ...
def check(self, uid=None, usage_limits_count=None, cryptographic_usage_mask=None, lease_time=None): """ Check the constraints for a managed object. Args: uid (string): The unique ID of the managed object to check. ...
[ "Check", "the", "constraints", "for", "a", "managed", "object", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L720-L774
[ "def", "check", "(", "self", ",", "uid", "=", "None", ",", "usage_limits_count", "=", "None", ",", "cryptographic_usage_mask", "=", "None", ",", "lease_time", "=", "None", ")", ":", "if", "uid", "is", "not", "None", ":", "if", "not", "isinstance", "(", ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.get
Get a managed object from a KMIP appliance. Args: uid (string): The unique ID of the managed object to retrieve. key_wrapping_specification (dict): A dictionary containing various settings to be used when wrapping the key during retrieval. See Note below....
kmip/pie/client.py
def get(self, uid=None, key_wrapping_specification=None): """ Get a managed object from a KMIP appliance. Args: uid (string): The unique ID of the managed object to retrieve. key_wrapping_specification (dict): A dictionary containing various settings to b...
def get(self, uid=None, key_wrapping_specification=None): """ Get a managed object from a KMIP appliance. Args: uid (string): The unique ID of the managed object to retrieve. key_wrapping_specification (dict): A dictionary containing various settings to b...
[ "Get", "a", "managed", "object", "from", "a", "KMIP", "appliance", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L777-L844
[ "def", "get", "(", "self", ",", "uid", "=", "None", ",", "key_wrapping_specification", "=", "None", ")", ":", "# Check input", "if", "uid", "is", "not", "None", ":", "if", "not", "isinstance", "(", "uid", ",", "six", ".", "string_types", ")", ":", "rai...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.get_attributes
Get the attributes associated with a managed object. If the uid is not specified, the appliance will use the ID placeholder by default. If the attribute_names list is not specified, the appliance will return all viable attributes for the managed object. Args: uid (...
kmip/pie/client.py
def get_attributes(self, uid=None, attribute_names=None): """ Get the attributes associated with a managed object. If the uid is not specified, the appliance will use the ID placeholder by default. If the attribute_names list is not specified, the appliance will return ...
def get_attributes(self, uid=None, attribute_names=None): """ Get the attributes associated with a managed object. If the uid is not specified, the appliance will use the ID placeholder by default. If the attribute_names list is not specified, the appliance will return ...
[ "Get", "the", "attributes", "associated", "with", "a", "managed", "object", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L847-L888
[ "def", "get_attributes", "(", "self", ",", "uid", "=", "None", ",", "attribute_names", "=", "None", ")", ":", "# Check input", "if", "uid", "is", "not", "None", ":", "if", "not", "isinstance", "(", "uid", ",", "six", ".", "string_types", ")", ":", "rai...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.activate
Activate a managed object stored by a KMIP appliance. Args: uid (string): The unique ID of the managed object to activate. Optional, defaults to None. Returns: None Raises: ClientConnectionNotOpen: if the client connection is unusable ...
kmip/pie/client.py
def activate(self, uid=None): """ Activate a managed object stored by a KMIP appliance. Args: uid (string): The unique ID of the managed object to activate. Optional, defaults to None. Returns: None Raises: ClientConnectionNo...
def activate(self, uid=None): """ Activate a managed object stored by a KMIP appliance. Args: uid (string): The unique ID of the managed object to activate. Optional, defaults to None. Returns: None Raises: ClientConnectionNo...
[ "Activate", "a", "managed", "object", "stored", "by", "a", "KMIP", "appliance", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L921-L951
[ "def", "activate", "(", "self", ",", "uid", "=", "None", ")", ":", "# Check input", "if", "uid", "is", "not", "None", ":", "if", "not", "isinstance", "(", "uid", ",", "six", ".", "string_types", ")", ":", "raise", "TypeError", "(", "\"uid must be a strin...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.revoke
Revoke a managed object stored by a KMIP appliance. Args: revocation_reason (RevocationReasonCode): An enumeration indicating the revocation reason. uid (string): The unique ID of the managed object to revoke. Optional, defaults to None. revoc...
kmip/pie/client.py
def revoke(self, revocation_reason, uid=None, revocation_message=None, compromise_occurrence_date=None): """ Revoke a managed object stored by a KMIP appliance. Args: revocation_reason (RevocationReasonCode): An enumeration indicating the revocation re...
def revoke(self, revocation_reason, uid=None, revocation_message=None, compromise_occurrence_date=None): """ Revoke a managed object stored by a KMIP appliance. Args: revocation_reason (RevocationReasonCode): An enumeration indicating the revocation re...
[ "Revoke", "a", "managed", "object", "stored", "by", "a", "KMIP", "appliance", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L954-L1007
[ "def", "revoke", "(", "self", ",", "revocation_reason", ",", "uid", "=", "None", ",", "revocation_message", "=", "None", ",", "compromise_occurrence_date", "=", "None", ")", ":", "# Check input", "if", "not", "isinstance", "(", "revocation_reason", ",", "enums",...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.encrypt
Encrypt data using the specified encryption key and parameters. Args: data (bytes): The bytes to encrypt. Required. uid (string): The unique ID of the encryption key to use. Optional, defaults to None. cryptographic_parameters (dict): A dictionary containing ...
kmip/pie/client.py
def encrypt(self, data, uid=None, cryptographic_parameters=None, iv_counter_nonce=None): """ Encrypt data using the specified encryption key and parameters. Args: data (bytes): The bytes to encrypt. Required. uid (string): The unique ID of the encryption ...
def encrypt(self, data, uid=None, cryptographic_parameters=None, iv_counter_nonce=None): """ Encrypt data using the specified encryption key and parameters. Args: data (bytes): The bytes to encrypt. Required. uid (string): The unique ID of the encryption ...
[ "Encrypt", "data", "using", "the", "specified", "encryption", "key", "and", "parameters", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1042-L1146
[ "def", "encrypt", "(", "self", ",", "data", ",", "uid", "=", "None", ",", "cryptographic_parameters", "=", "None", ",", "iv_counter_nonce", "=", "None", ")", ":", "# Check input", "if", "not", "isinstance", "(", "data", ",", "six", ".", "binary_type", ")",...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.signature_verify
Verify a message signature using the specified signing key. Args: message (bytes): The bytes of the signed message. Required. signature (bytes): The bytes of the message signature. Required. uid (string): The unique ID of the signing key to use. Optional, def...
kmip/pie/client.py
def signature_verify(self, message, signature, uid=None, cryptographic_parameters=None): """ Verify a message signature using the specified signing key. Args: message (bytes): The bytes of the signed message. Required. signature (bytes): The byte...
def signature_verify(self, message, signature, uid=None, cryptographic_parameters=None): """ Verify a message signature using the specified signing key. Args: message (bytes): The bytes of the signed message. Required. signature (bytes): The byte...
[ "Verify", "a", "message", "signature", "using", "the", "specified", "signing", "key", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1254-L1317
[ "def", "signature_verify", "(", "self", ",", "message", ",", "signature", ",", "uid", "=", "None", ",", "cryptographic_parameters", "=", "None", ")", ":", "# Check input", "if", "not", "isinstance", "(", "message", ",", "six", ".", "binary_type", ")", ":", ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient.mac
Get the message authentication code for data. Args: data (string): The data to be MACed. uid (string): The unique ID of the managed object that is the key to use for the MAC operation. algorithm (CryptographicAlgorithm): An enumeration defining the ...
kmip/pie/client.py
def mac(self, data, uid=None, algorithm=None): """ Get the message authentication code for data. Args: data (string): The data to be MACed. uid (string): The unique ID of the managed object that is the key to use for the MAC operation. algorit...
def mac(self, data, uid=None, algorithm=None): """ Get the message authentication code for data. Args: data (string): The data to be MACed. uid (string): The unique ID of the managed object that is the key to use for the MAC operation. algorit...
[ "Get", "the", "message", "authentication", "code", "for", "data", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1375-L1422
[ "def", "mac", "(", "self", ",", "data", ",", "uid", "=", "None", ",", "algorithm", "=", "None", ")", ":", "# Check inputs", "if", "not", "isinstance", "(", "data", ",", "six", ".", "binary_type", ")", ":", "raise", "TypeError", "(", "\"data must be bytes...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient._build_cryptographic_parameters
Build a CryptographicParameters struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a CryptographicParameters struct. Returns: None: if value is None CryptographicParameters: a CryptographicParameters struct ...
kmip/pie/client.py
def _build_cryptographic_parameters(self, value): """ Build a CryptographicParameters struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a CryptographicParameters struct. Returns: None: if value is None ...
def _build_cryptographic_parameters(self, value): """ Build a CryptographicParameters struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a CryptographicParameters struct. Returns: None: if value is None ...
[ "Build", "a", "CryptographicParameters", "struct", "from", "a", "dictionary", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1445-L1482
[ "def", "_build_cryptographic_parameters", "(", "self", ",", "value", ")", ":", "if", "value", "is", "None", ":", "return", "None", "elif", "not", "isinstance", "(", "value", ",", "dict", ")", ":", "raise", "TypeError", "(", "\"Cryptographic parameters must be a ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient._build_encryption_key_information
Build an EncryptionKeyInformation struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a EncryptionKeyInformation struct. Returns: EncryptionKeyInformation: an EncryptionKeyInformation struct Raises: ...
kmip/pie/client.py
def _build_encryption_key_information(self, value): """ Build an EncryptionKeyInformation struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a EncryptionKeyInformation struct. Returns: EncryptionKeyInfor...
def _build_encryption_key_information(self, value): """ Build an EncryptionKeyInformation struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a EncryptionKeyInformation struct. Returns: EncryptionKeyInfor...
[ "Build", "an", "EncryptionKeyInformation", "struct", "from", "a", "dictionary", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1484-L1512
[ "def", "_build_encryption_key_information", "(", "self", ",", "value", ")", ":", "if", "value", "is", "None", ":", "return", "None", "if", "not", "isinstance", "(", "value", ",", "dict", ")", ":", "raise", "TypeError", "(", "\"Encryption key information must be ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient._build_mac_signature_key_information
Build an MACSignatureKeyInformation struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a MACSignatureKeyInformation struct. Returns: MACSignatureInformation: a MACSignatureKeyInformation struct Raises: ...
kmip/pie/client.py
def _build_mac_signature_key_information(self, value): """ Build an MACSignatureKeyInformation struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a MACSignatureKeyInformation struct. Returns: MACSignatur...
def _build_mac_signature_key_information(self, value): """ Build an MACSignatureKeyInformation struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a MACSignatureKeyInformation struct. Returns: MACSignatur...
[ "Build", "an", "MACSignatureKeyInformation", "struct", "from", "a", "dictionary", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1514-L1544
[ "def", "_build_mac_signature_key_information", "(", "self", ",", "value", ")", ":", "if", "value", "is", "None", ":", "return", "None", "if", "not", "isinstance", "(", "value", ",", "dict", ")", ":", "raise", "TypeError", "(", "\"MAC/signature key information mu...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient._build_key_wrapping_specification
Build a KeyWrappingSpecification struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a KeyWrappingSpecification struct. Returns: KeyWrappingSpecification: a KeyWrappingSpecification struct Raises: Ty...
kmip/pie/client.py
def _build_key_wrapping_specification(self, value): """ Build a KeyWrappingSpecification struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a KeyWrappingSpecification struct. Returns: KeyWrappingSpecific...
def _build_key_wrapping_specification(self, value): """ Build a KeyWrappingSpecification struct from a dictionary. Args: value (dict): A dictionary containing the key/value pairs for a KeyWrappingSpecification struct. Returns: KeyWrappingSpecific...
[ "Build", "a", "KeyWrappingSpecification", "struct", "from", "a", "dictionary", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1546-L1579
[ "def", "_build_key_wrapping_specification", "(", "self", ",", "value", ")", ":", "if", "value", "is", "None", ":", "return", "None", "if", "not", "isinstance", "(", "value", ",", "dict", ")", ":", "raise", "TypeError", "(", "\"Key wrapping specification must be ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient._build_common_attributes
Build a list of common attributes that are shared across symmetric as well as asymmetric objects
kmip/pie/client.py
def _build_common_attributes(self, operation_policy_name=None): ''' Build a list of common attributes that are shared across symmetric as well as asymmetric objects ''' common_attributes = [] if operation_policy_name: common_attributes.append( ...
def _build_common_attributes(self, operation_policy_name=None): ''' Build a list of common attributes that are shared across symmetric as well as asymmetric objects ''' common_attributes = [] if operation_policy_name: common_attributes.append( ...
[ "Build", "a", "list", "of", "common", "attributes", "that", "are", "shared", "across", "symmetric", "as", "well", "as", "asymmetric", "objects" ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1581-L1596
[ "def", "_build_common_attributes", "(", "self", ",", "operation_policy_name", "=", "None", ")", ":", "common_attributes", "=", "[", "]", "if", "operation_policy_name", ":", "common_attributes", ".", "append", "(", "self", ".", "attribute_factory", ".", "create_attri...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
ProxyKmipClient._build_name_attribute
Build a name attribute, returned in a list for ease of use in the caller
kmip/pie/client.py
def _build_name_attribute(self, name=None): ''' Build a name attribute, returned in a list for ease of use in the caller ''' name_list = [] if name: name_list.append(self.attribute_factory.create_attribute( enums.AttributeType.NAME, ...
def _build_name_attribute(self, name=None): ''' Build a name attribute, returned in a list for ease of use in the caller ''' name_list = [] if name: name_list.append(self.attribute_factory.create_attribute( enums.AttributeType.NAME, ...
[ "Build", "a", "name", "attribute", "returned", "in", "a", "list", "for", "ease", "of", "use", "in", "the", "caller" ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/client.py#L1598-L1609
[ "def", "_build_name_attribute", "(", "self", ",", "name", "=", "None", ")", ":", "name_list", "=", "[", "]", "if", "name", ":", "name_list", ".", "append", "(", "self", ".", "attribute_factory", ".", "create_attribute", "(", "enums", ".", "AttributeType", ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
QueryRequestPayload.read
Read the data encoding the QueryRequestPayload object and decode it into its constituent parts. Args: input_buffer (Stream): A data stream containing encoded object data, supporting a read method; usually a BytearrayStream object. kmip_version (KM...
kmip/core/messages/payloads/query.py
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the QueryRequestPayload object and decode it into its constituent parts. Args: input_buffer (Stream): A data stream containing encoded object data, supporting a ...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the QueryRequestPayload object and decode it into its constituent parts. Args: input_buffer (Stream): A data stream containing encoded object data, supporting a ...
[ "Read", "the", "data", "encoding", "the", "QueryRequestPayload", "object", "and", "decode", "it", "into", "its", "constituent", "parts", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/query.py#L83-L123
[ "def", "read", "(", "self", ",", "input_buffer", ",", "kmip_version", "=", "enums", ".", "KMIPVersion", ".", "KMIP_1_0", ")", ":", "super", "(", "QueryRequestPayload", ",", "self", ")", ".", "read", "(", "input_buffer", ",", "kmip_version", "=", "kmip_versio...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
QueryRequestPayload.write
Write the data encoding the QueryRequestPayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream object. kmip_version (KMIPVersion): An enumeration definin...
kmip/core/messages/payloads/query.py
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the QueryRequestPayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a Bytearray...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the QueryRequestPayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a Bytearray...
[ "Write", "the", "data", "encoding", "the", "QueryRequestPayload", "object", "to", "a", "stream", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/query.py#L125-L156
[ "def", "write", "(", "self", ",", "output_buffer", ",", "kmip_version", "=", "enums", ".", "KMIPVersion", ".", "KMIP_1_0", ")", ":", "local_buffer", "=", "utils", ".", "BytearrayStream", "(", ")", "if", "self", ".", "_query_functions", ":", "for", "query_fun...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
QueryResponsePayload.read
Read the data encoding the QueryResponsePayload object and decode it into its constituent parts. Args: input_buffer (Stream): A data stream containing encoded object data, supporting a read method; usually a BytearrayStream object. kmip_version (K...
kmip/core/messages/payloads/query.py
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the QueryResponsePayload object and decode it into its constituent parts. Args: input_buffer (Stream): A data stream containing encoded object data, supporting a...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the QueryResponsePayload object and decode it into its constituent parts. Args: input_buffer (Stream): A data stream containing encoded object data, supporting a...
[ "Read", "the", "data", "encoding", "the", "QueryResponsePayload", "object", "and", "decode", "it", "into", "its", "constituent", "parts", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/query.py#L694-L882
[ "def", "read", "(", "self", ",", "input_buffer", ",", "kmip_version", "=", "enums", ".", "KMIPVersion", ".", "KMIP_1_0", ")", ":", "super", "(", "QueryResponsePayload", ",", "self", ")", ".", "read", "(", "input_buffer", ",", "kmip_version", "=", "kmip_versi...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
QueryResponsePayload.write
Write the data encoding the QueryResponsePayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream object. kmip_version (KMIPVersion): An enumeration defini...
kmip/core/messages/payloads/query.py
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the QueryResponsePayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a Bytearra...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the QueryResponsePayload object to a stream. Args: output_buffer (Stream): A data stream in which to encode object data, supporting a write method; usually a Bytearra...
[ "Write", "the", "data", "encoding", "the", "QueryResponsePayload", "object", "to", "a", "stream", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/query.py#L884-L991
[ "def", "write", "(", "self", ",", "output_buffer", ",", "kmip_version", "=", "enums", ".", "KMIPVersion", ".", "KMIP_1_0", ")", ":", "local_buffer", "=", "utils", ".", "BytearrayStream", "(", ")", "if", "self", ".", "_operations", ":", "for", "operation", ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
GetAttributesResponsePayload.read
Read the data encoding the GetAttributes response payload and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supporting a read method; usually a BytearrayStream object. kmip_version...
kmip/core/messages/payloads/get_attributes.py
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the GetAttributes response payload and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supportin...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the GetAttributes response payload and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supportin...
[ "Read", "the", "data", "encoding", "the", "GetAttributes", "response", "payload", "and", "decode", "it", "into", "its", "constituent", "parts", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get_attributes.py#L348-L400
[ "def", "read", "(", "self", ",", "input_buffer", ",", "kmip_version", "=", "enums", ".", "KMIPVersion", ".", "KMIP_1_0", ")", ":", "super", "(", "GetAttributesResponsePayload", ",", "self", ")", ".", "read", "(", "input_buffer", ",", "kmip_version", "=", "km...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
GetAttributesResponsePayload.write
Write the data encoding the GetAttributes response payload to a stream. Args: output_buffer (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream object. kmip_version (KMIPVersion): An enumera...
kmip/core/messages/payloads/get_attributes.py
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the GetAttributes response payload to a stream. Args: output_buffer (stream): A data stream in which to encode object data, supporting a write method; usually...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the GetAttributes response payload to a stream. Args: output_buffer (stream): A data stream in which to encode object data, supporting a write method; usually...
[ "Write", "the", "data", "encoding", "the", "GetAttributes", "response", "payload", "to", "a", "stream", "." ]
OpenKMIP/PyKMIP
python
https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get_attributes.py#L402-L452
[ "def", "write", "(", "self", ",", "output_buffer", ",", "kmip_version", "=", "enums", ".", "KMIPVersion", ".", "KMIP_1_0", ")", ":", "local_buffer", "=", "utils", ".", "BytearrayStream", "(", ")", "if", "self", ".", "_unique_identifier", ":", "self", ".", ...
b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e
test
get_single
Find a single entry point. Returns an :class:`EntryPoint` object, or raises :exc:`NoSuchEntryPoint` if no match is found.
entrypoints.py
def get_single(group, name, path=None): """Find a single entry point. Returns an :class:`EntryPoint` object, or raises :exc:`NoSuchEntryPoint` if no match is found. """ for config, distro in iter_files_distros(path=path): if (group in config) and (name in config[group]): epstr =...
def get_single(group, name, path=None): """Find a single entry point. Returns an :class:`EntryPoint` object, or raises :exc:`NoSuchEntryPoint` if no match is found. """ for config, distro in iter_files_distros(path=path): if (group in config) and (name in config[group]): epstr =...
[ "Find", "a", "single", "entry", "point", "." ]
takluyver/entrypoints
python
https://github.com/takluyver/entrypoints/blob/d7db29fd6136f86498d8c374f531d4c198d66bf6/entrypoints.py#L205-L217
[ "def", "get_single", "(", "group", ",", "name", ",", "path", "=", "None", ")", ":", "for", "config", ",", "distro", "in", "iter_files_distros", "(", "path", "=", "path", ")", ":", "if", "(", "group", "in", "config", ")", "and", "(", "name", "in", "...
d7db29fd6136f86498d8c374f531d4c198d66bf6
test
get_group_named
Find a group of entry points with unique names. Returns a dictionary of names to :class:`EntryPoint` objects.
entrypoints.py
def get_group_named(group, path=None): """Find a group of entry points with unique names. Returns a dictionary of names to :class:`EntryPoint` objects. """ result = {} for ep in get_group_all(group, path=path): if ep.name not in result: result[ep.name] = ep return result
def get_group_named(group, path=None): """Find a group of entry points with unique names. Returns a dictionary of names to :class:`EntryPoint` objects. """ result = {} for ep in get_group_all(group, path=path): if ep.name not in result: result[ep.name] = ep return result
[ "Find", "a", "group", "of", "entry", "points", "with", "unique", "names", "." ]
takluyver/entrypoints
python
https://github.com/takluyver/entrypoints/blob/d7db29fd6136f86498d8c374f531d4c198d66bf6/entrypoints.py#L219-L228
[ "def", "get_group_named", "(", "group", ",", "path", "=", "None", ")", ":", "result", "=", "{", "}", "for", "ep", "in", "get_group_all", "(", "group", ",", "path", "=", "path", ")", ":", "if", "ep", ".", "name", "not", "in", "result", ":", "result"...
d7db29fd6136f86498d8c374f531d4c198d66bf6
test
get_group_all
Find all entry points in a group. Returns a list of :class:`EntryPoint` objects.
entrypoints.py
def get_group_all(group, path=None): """Find all entry points in a group. Returns a list of :class:`EntryPoint` objects. """ result = [] for config, distro in iter_files_distros(path=path): if group in config: for name, epstr in config[group].items(): with BadEnt...
def get_group_all(group, path=None): """Find all entry points in a group. Returns a list of :class:`EntryPoint` objects. """ result = [] for config, distro in iter_files_distros(path=path): if group in config: for name, epstr in config[group].items(): with BadEnt...
[ "Find", "all", "entry", "points", "in", "a", "group", "." ]
takluyver/entrypoints
python
https://github.com/takluyver/entrypoints/blob/d7db29fd6136f86498d8c374f531d4c198d66bf6/entrypoints.py#L230-L242
[ "def", "get_group_all", "(", "group", ",", "path", "=", "None", ")", ":", "result", "=", "[", "]", "for", "config", ",", "distro", "in", "iter_files_distros", "(", "path", "=", "path", ")", ":", "if", "group", "in", "config", ":", "for", "name", ",",...
d7db29fd6136f86498d8c374f531d4c198d66bf6
test
EntryPoint.load
Load the object to which this entry point refers.
entrypoints.py
def load(self): """Load the object to which this entry point refers. """ mod = import_module(self.module_name) obj = mod if self.object_name: for attr in self.object_name.split('.'): obj = getattr(obj, attr) return obj
def load(self): """Load the object to which this entry point refers. """ mod = import_module(self.module_name) obj = mod if self.object_name: for attr in self.object_name.split('.'): obj = getattr(obj, attr) return obj
[ "Load", "the", "object", "to", "which", "this", "entry", "point", "refers", "." ]
takluyver/entrypoints
python
https://github.com/takluyver/entrypoints/blob/d7db29fd6136f86498d8c374f531d4c198d66bf6/entrypoints.py#L79-L87
[ "def", "load", "(", "self", ")", ":", "mod", "=", "import_module", "(", "self", ".", "module_name", ")", "obj", "=", "mod", "if", "self", ".", "object_name", ":", "for", "attr", "in", "self", ".", "object_name", ".", "split", "(", "'.'", ")", ":", ...
d7db29fd6136f86498d8c374f531d4c198d66bf6
test
EntryPoint.from_string
Parse an entry point from the syntax in entry_points.txt :param str epstr: The entry point string (not including 'name =') :param str name: The name of this entry point :param Distribution distro: The distribution in which the entry point was found :rtype: EntryPoint :raises Bad...
entrypoints.py
def from_string(cls, epstr, name, distro=None): """Parse an entry point from the syntax in entry_points.txt :param str epstr: The entry point string (not including 'name =') :param str name: The name of this entry point :param Distribution distro: The distribution in which the entry poi...
def from_string(cls, epstr, name, distro=None): """Parse an entry point from the syntax in entry_points.txt :param str epstr: The entry point string (not including 'name =') :param str name: The name of this entry point :param Distribution distro: The distribution in which the entry poi...
[ "Parse", "an", "entry", "point", "from", "the", "syntax", "in", "entry_points", ".", "txt" ]
takluyver/entrypoints
python
https://github.com/takluyver/entrypoints/blob/d7db29fd6136f86498d8c374f531d4c198d66bf6/entrypoints.py#L90-L106
[ "def", "from_string", "(", "cls", ",", "epstr", ",", "name", ",", "distro", "=", "None", ")", ":", "m", "=", "entry_point_pattern", ".", "match", "(", "epstr", ")", "if", "m", ":", "mod", ",", "obj", ",", "extras", "=", "m", ".", "group", "(", "'...
d7db29fd6136f86498d8c374f531d4c198d66bf6
test
live
Run livereload server
flask_boost/project/manage.py
def live(): """Run livereload server""" from livereload import Server server = Server(app) map(server.watch, glob2.glob("application/pages/**/*.*")) # pages map(server.watch, glob2.glob("application/macros/**/*.html")) # macros map(server.watch, glob2.glob("application/static/**/*.*")) # pu...
def live(): """Run livereload server""" from livereload import Server server = Server(app) map(server.watch, glob2.glob("application/pages/**/*.*")) # pages map(server.watch, glob2.glob("application/macros/**/*.html")) # macros map(server.watch, glob2.glob("application/static/**/*.*")) # pu...
[ "Run", "livereload", "server" ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/manage.py#L27-L37
[ "def", "live", "(", ")", ":", "from", "livereload", "import", "Server", "server", "=", "Server", "(", "app", ")", "map", "(", "server", ".", "watch", ",", "glob2", ".", "glob", "(", "\"application/pages/**/*.*\"", ")", ")", "# pages", "map", "(", "server...
d0308408ebb248dd752b77123b845f8ec637fab2
test
generate_project
New project.
flask_boost/cli.py
def generate_project(args): """New project.""" # Project templates path src = os.path.join(dirname(abspath(__file__)), 'project') project_name = args.get('<project>') if not project_name: logger.warning('Project name cannot be empty.') return # Destination project path dst...
def generate_project(args): """New project.""" # Project templates path src = os.path.join(dirname(abspath(__file__)), 'project') project_name = args.get('<project>') if not project_name: logger.warning('Project name cannot be empty.') return # Destination project path dst...
[ "New", "project", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/cli.py#L49-L98
[ "def", "generate_project", "(", "args", ")", ":", "# Project templates path", "src", "=", "os", ".", "path", ".", "join", "(", "dirname", "(", "abspath", "(", "__file__", ")", ")", ",", "'project'", ")", "project_name", "=", "args", ".", "get", "(", "'<p...
d0308408ebb248dd752b77123b845f8ec637fab2
test
generate_controller
Generate controller, include the controller file, template & css & js directories.
flask_boost/cli.py
def generate_controller(args): """Generate controller, include the controller file, template & css & js directories.""" controller_template = os.path.join(dirname(abspath(__file__)), 'templates/controller.py') test_template = os.path.join(dirname(abspath(__file__)), 'templates/unittest.py') controller_n...
def generate_controller(args): """Generate controller, include the controller file, template & css & js directories.""" controller_template = os.path.join(dirname(abspath(__file__)), 'templates/controller.py') test_template = os.path.join(dirname(abspath(__file__)), 'templates/unittest.py') controller_n...
[ "Generate", "controller", "include", "the", "controller", "file", "template", "&", "css", "&", "js", "directories", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/cli.py#L101-L142
[ "def", "generate_controller", "(", "args", ")", ":", "controller_template", "=", "os", ".", "path", ".", "join", "(", "dirname", "(", "abspath", "(", "__file__", ")", ")", ",", "'templates/controller.py'", ")", "test_template", "=", "os", ".", "path", ".", ...
d0308408ebb248dd752b77123b845f8ec637fab2
test
generate_action
Generate action.
flask_boost/cli.py
def generate_action(args): """Generate action.""" controller = args.get('<controller>') action = args.get('<action>') with_template = args.get('-t') current_path = os.getcwd() logger.info('Start generating action.') controller_file_path = os.path.join(current_path, 'application/controllers...
def generate_action(args): """Generate action.""" controller = args.get('<controller>') action = args.get('<action>') with_template = args.get('-t') current_path = os.getcwd() logger.info('Start generating action.') controller_file_path = os.path.join(current_path, 'application/controllers...
[ "Generate", "action", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/cli.py#L145-L202
[ "def", "generate_action", "(", "args", ")", ":", "controller", "=", "args", ".", "get", "(", "'<controller>'", ")", "action", "=", "args", ".", "get", "(", "'<action>'", ")", "with_template", "=", "args", ".", "get", "(", "'-t'", ")", "current_path", "="...
d0308408ebb248dd752b77123b845f8ec637fab2
test
generate_form
Generate form.
flask_boost/cli.py
def generate_form(args): """Generate form.""" form_name = args.get('<form>') logger.info('Start generating form.') _generate_form(form_name) logger.info('Finish generating form.')
def generate_form(args): """Generate form.""" form_name = args.get('<form>') logger.info('Start generating form.') _generate_form(form_name) logger.info('Finish generating form.')
[ "Generate", "form", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/cli.py#L205-L210
[ "def", "generate_form", "(", "args", ")", ":", "form_name", "=", "args", ".", "get", "(", "'<form>'", ")", "logger", ".", "info", "(", "'Start generating form.'", ")", "_generate_form", "(", "form_name", ")", "logger", ".", "info", "(", "'Finish generating for...
d0308408ebb248dd752b77123b845f8ec637fab2
test
generate_model
Generate model.
flask_boost/cli.py
def generate_model(args): """Generate model.""" model_name = args.get('<model>') if not model_name: logger.warning('Model name cannot be empty.') return logger.info('Start generating model.') model_template = os.path.join(dirname(abspath(__file__)), 'templates/model.py') curren...
def generate_model(args): """Generate model.""" model_name = args.get('<model>') if not model_name: logger.warning('Model name cannot be empty.') return logger.info('Start generating model.') model_template = os.path.join(dirname(abspath(__file__)), 'templates/model.py') curren...
[ "Generate", "model", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/cli.py#L213-L237
[ "def", "generate_model", "(", "args", ")", ":", "model_name", "=", "args", ".", "get", "(", "'<model>'", ")", "if", "not", "model_name", ":", "logger", ".", "warning", "(", "'Model name cannot be empty.'", ")", "return", "logger", ".", "info", "(", "'Start g...
d0308408ebb248dd752b77123b845f8ec637fab2
test
generate_macro
Genarate macro.
flask_boost/cli.py
def generate_macro(args): """Genarate macro.""" macro = args.get('<macro>').replace('-', '_') category = args.get('<category>') if not macro: logger.warning('Macro name cannot be empty.') return logger.info('Start generating macro.') current_path = os.getcwd() if category...
def generate_macro(args): """Genarate macro.""" macro = args.get('<macro>').replace('-', '_') category = args.get('<category>') if not macro: logger.warning('Macro name cannot be empty.') return logger.info('Start generating macro.') current_path = os.getcwd() if category...
[ "Genarate", "macro", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/cli.py#L240-L281
[ "def", "generate_macro", "(", "args", ")", ":", "macro", "=", "args", ".", "get", "(", "'<macro>'", ")", ".", "replace", "(", "'-'", ",", "'_'", ")", "category", "=", "args", ".", "get", "(", "'<category>'", ")", "if", "not", "macro", ":", "logger", ...
d0308408ebb248dd752b77123b845f8ec637fab2
test
_mkdir_p
mkdir -p path
flask_boost/cli.py
def _mkdir_p(path): """mkdir -p path""" try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise else: logger.info("New: %s%s", path, os.path.sep)
def _mkdir_p(path): """mkdir -p path""" try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise else: logger.info("New: %s%s", path, os.path.sep)
[ "mkdir", "-", "p", "path" ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/cli.py#L303-L313
[ "def", "_mkdir_p", "(", "path", ")", ":", "try", ":", "os", ".", "makedirs", "(", "path", ")", "except", "OSError", "as", "exc", ":", "if", "exc", ".", "errno", "==", "errno", ".", "EEXIST", "and", "os", ".", "path", ".", "isdir", "(", "path", ")...
d0308408ebb248dd752b77123b845f8ec637fab2
test
_rewrite_and_copy
Replace vars and copy.
flask_boost/cli.py
def _rewrite_and_copy(src_file, dst_file, project_name): """Replace vars and copy.""" # Create temp file fh, abs_path = mkstemp() with io.open(abs_path, 'w', encoding='utf-8') as new_file: with io.open(src_file, 'r', encoding='utf-8') as old_file: for line in old_file: ...
def _rewrite_and_copy(src_file, dst_file, project_name): """Replace vars and copy.""" # Create temp file fh, abs_path = mkstemp() with io.open(abs_path, 'w', encoding='utf-8') as new_file: with io.open(src_file, 'r', encoding='utf-8') as old_file: for line in old_file: ...
[ "Replace", "vars", "and", "copy", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/cli.py#L316-L330
[ "def", "_rewrite_and_copy", "(", "src_file", ",", "dst_file", ",", "project_name", ")", ":", "# Create temp file", "fh", ",", "abs_path", "=", "mkstemp", "(", ")", "with", "io", ".", "open", "(", "abs_path", ",", "'w'", ",", "encoding", "=", "'utf-8'", ")"...
d0308408ebb248dd752b77123b845f8ec637fab2
test
timesince
Friendly time gap
flask_boost/project/application/utils/filters.py
def timesince(value): """Friendly time gap""" if not value: return "" if not isinstance(value, datetime.date): return value now = datetime.datetime.now() delta = now - value if value > now: return "right now" elif delta.days > 365: return '%d years ago' % (...
def timesince(value): """Friendly time gap""" if not value: return "" if not isinstance(value, datetime.date): return value now = datetime.datetime.now() delta = now - value if value > now: return "right now" elif delta.days > 365: return '%d years ago' % (...
[ "Friendly", "time", "gap" ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/utils/filters.py#L5-L29
[ "def", "timesince", "(", "value", ")", ":", "if", "not", "value", ":", "return", "\"\"", "if", "not", "isinstance", "(", "value", ",", "datetime", ".", "date", ")", ":", "return", "value", "now", "=", "datetime", ".", "datetime", ".", "now", "(", ")"...
d0308408ebb248dd752b77123b845f8ec637fab2
test
check_url
Check url schema.
flask_boost/project/application/forms/_helper.py
def check_url(form, field): """Check url schema.""" url = field.data.strip() if not url: return result = urlparse(url) if result.scheme == "": field.data = "http://%s" % re.sub(r'^:?/*', '', url)
def check_url(form, field): """Check url schema.""" url = field.data.strip() if not url: return result = urlparse(url) if result.scheme == "": field.data = "http://%s" % re.sub(r'^:?/*', '', url)
[ "Check", "url", "schema", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/forms/_helper.py#L6-L13
[ "def", "check_url", "(", "form", ",", "field", ")", ":", "url", "=", "field", ".", "data", ".", "strip", "(", ")", "if", "not", "url", ":", "return", "result", "=", "urlparse", "(", "url", ")", "if", "result", ".", "scheme", "==", "\"\"", ":", "f...
d0308408ebb248dd752b77123b845f8ec637fab2
test
encode
Encode something with SECRET_KEY.
flask_boost/project/application/utils/security.py
def encode(something): """Encode something with SECRET_KEY.""" secret_key = current_app.config.get('SECRET_KEY') s = URLSafeSerializer(secret_key) return s.dumps(something)
def encode(something): """Encode something with SECRET_KEY.""" secret_key = current_app.config.get('SECRET_KEY') s = URLSafeSerializer(secret_key) return s.dumps(something)
[ "Encode", "something", "with", "SECRET_KEY", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/utils/security.py#L6-L10
[ "def", "encode", "(", "something", ")", ":", "secret_key", "=", "current_app", ".", "config", ".", "get", "(", "'SECRET_KEY'", ")", "s", "=", "URLSafeSerializer", "(", "secret_key", ")", "return", "s", ".", "dumps", "(", "something", ")" ]
d0308408ebb248dd752b77123b845f8ec637fab2
test
decode
Decode something with SECRET_KEY.
flask_boost/project/application/utils/security.py
def decode(something): """Decode something with SECRET_KEY.""" secret_key = current_app.config.get('SECRET_KEY') s = URLSafeSerializer(secret_key) try: return s.loads(something) except BadSignature: return None
def decode(something): """Decode something with SECRET_KEY.""" secret_key = current_app.config.get('SECRET_KEY') s = URLSafeSerializer(secret_key) try: return s.loads(something) except BadSignature: return None
[ "Decode", "something", "with", "SECRET_KEY", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/utils/security.py#L13-L20
[ "def", "decode", "(", "something", ")", ":", "secret_key", "=", "current_app", ".", "config", ".", "get", "(", "'SECRET_KEY'", ")", "s", "=", "URLSafeSerializer", "(", "secret_key", ")", "try", ":", "return", "s", ".", "loads", "(", "something", ")", "ex...
d0308408ebb248dd752b77123b845f8ec637fab2
test
jsonify
JSON decorator.
flask_boost/project/application/utils/decorators.py
def jsonify(func): """JSON decorator.""" @functools.wraps(func) def wrapper(*args, **kwargs): r = func(*args, **kwargs) if isinstance(r, tuple): code, data = r else: code, data = 200, r return Response(json.dumps(data), status=code, mimetype='applicat...
def jsonify(func): """JSON decorator.""" @functools.wraps(func) def wrapper(*args, **kwargs): r = func(*args, **kwargs) if isinstance(r, tuple): code, data = r else: code, data = 200, r return Response(json.dumps(data), status=code, mimetype='applicat...
[ "JSON", "decorator", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/utils/decorators.py#L6-L18
[ "def", "jsonify", "(", "func", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "r", "=", "func", "(", "*", "args", ",", "*", "*", "kwargs", ")", "if", "isinstanc...
d0308408ebb248dd752b77123b845f8ec637fab2
test
absolute_url_for
Absolute url for endpoint.
flask_boost/project/application/utils/helpers.py
def absolute_url_for(endpoint, **values): """Absolute url for endpoint.""" config = current_app.config site_domain = config.get('SITE_DOMAIN') relative_url = url_for(endpoint, **values) return join_url(site_domain, relative_url)
def absolute_url_for(endpoint, **values): """Absolute url for endpoint.""" config = current_app.config site_domain = config.get('SITE_DOMAIN') relative_url = url_for(endpoint, **values) return join_url(site_domain, relative_url)
[ "Absolute", "url", "for", "endpoint", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/utils/helpers.py#L7-L12
[ "def", "absolute_url_for", "(", "endpoint", ",", "*", "*", "values", ")", ":", "config", "=", "current_app", ".", "config", "site_domain", "=", "config", ".", "get", "(", "'SITE_DOMAIN'", ")", "relative_url", "=", "url_for", "(", "endpoint", ",", "*", "*",...
d0308408ebb248dd752b77123b845f8ec637fab2
test
load_config
Load config.
flask_boost/project/config/__init__.py
def load_config(): """Load config.""" mode = os.environ.get('MODE') try: if mode == 'PRODUCTION': from .production import ProductionConfig return ProductionConfig elif mode == 'TESTING': from .testing import TestingConfig return TestingConfig ...
def load_config(): """Load config.""" mode = os.environ.get('MODE') try: if mode == 'PRODUCTION': from .production import ProductionConfig return ProductionConfig elif mode == 'TESTING': from .testing import TestingConfig return TestingConfig ...
[ "Load", "config", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/config/__init__.py#L5-L20
[ "def", "load_config", "(", ")", ":", "mode", "=", "os", ".", "environ", ".", "get", "(", "'MODE'", ")", "try", ":", "if", "mode", "==", "'PRODUCTION'", ":", "from", ".", "production", "import", "ProductionConfig", "return", "ProductionConfig", "elif", "mod...
d0308408ebb248dd752b77123b845f8ec637fab2
test
signin_user
Sign in user.
flask_boost/project/application/utils/account.py
def signin_user(user, permenent=True): """Sign in user.""" session.permanent = permenent session['user_id'] = user.id
def signin_user(user, permenent=True): """Sign in user.""" session.permanent = permenent session['user_id'] = user.id
[ "Sign", "in", "user", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/utils/account.py#L6-L9
[ "def", "signin_user", "(", "user", ",", "permenent", "=", "True", ")", ":", "session", ".", "permanent", "=", "permenent", "session", "[", "'user_id'", "]", "=", "user", ".", "id" ]
d0308408ebb248dd752b77123b845f8ec637fab2
test
get_current_user
Get current user.
flask_boost/project/application/utils/account.py
def get_current_user(): """Get current user.""" if not 'user_id' in session: return None user = User.query.filter(User.id == session['user_id']).first() if not user: signout_user() return None return user
def get_current_user(): """Get current user.""" if not 'user_id' in session: return None user = User.query.filter(User.id == session['user_id']).first() if not user: signout_user() return None return user
[ "Get", "current", "user", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/utils/account.py#L17-L25
[ "def", "get_current_user", "(", ")", ":", "if", "not", "'user_id'", "in", "session", ":", "return", "None", "user", "=", "User", ".", "query", ".", "filter", "(", "User", ".", "id", "==", "session", "[", "'user_id'", "]", ")", ".", "first", "(", ")",...
d0308408ebb248dd752b77123b845f8ec637fab2
test
signin
Signin
flask_boost/project/application/controllers/account.py
def signin(): """Signin""" form = SigninForm() if form.validate_on_submit(): signin_user(form.user) return redirect(url_for('site.index')) return render_template('account/signin/signin.html', form=form)
def signin(): """Signin""" form = SigninForm() if form.validate_on_submit(): signin_user(form.user) return redirect(url_for('site.index')) return render_template('account/signin/signin.html', form=form)
[ "Signin" ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/controllers/account.py#L13-L19
[ "def", "signin", "(", ")", ":", "form", "=", "SigninForm", "(", ")", "if", "form", ".", "validate_on_submit", "(", ")", ":", "signin_user", "(", "form", ".", "user", ")", "return", "redirect", "(", "url_for", "(", "'site.index'", ")", ")", "return", "r...
d0308408ebb248dd752b77123b845f8ec637fab2
test
signup
Signup
flask_boost/project/application/controllers/account.py
def signup(): """Signup""" form = SignupForm() if form.validate_on_submit(): params = form.data.copy() params.pop('repassword') user = User(**params) db.session.add(user) db.session.commit() signin_user(user) return redirect(url_for('site.index')) ...
def signup(): """Signup""" form = SignupForm() if form.validate_on_submit(): params = form.data.copy() params.pop('repassword') user = User(**params) db.session.add(user) db.session.commit() signin_user(user) return redirect(url_for('site.index')) ...
[ "Signup" ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/controllers/account.py#L24-L35
[ "def", "signup", "(", ")", ":", "form", "=", "SignupForm", "(", ")", "if", "form", ".", "validate_on_submit", "(", ")", ":", "params", "=", "form", ".", "data", ".", "copy", "(", ")", "params", ".", "pop", "(", "'repassword'", ")", "user", "=", "Us...
d0308408ebb248dd752b77123b845f8ec637fab2
test
create_app
Create Flask app.
flask_boost/project/application/__init__.py
def create_app(): """Create Flask app.""" config = load_config() app = Flask(__name__) app.config.from_object(config) # Proxy fix app.wsgi_app = ProxyFix(app.wsgi_app) # CSRF protect CsrfProtect(app) if app.debug or app.testing: DebugToolbarExtension(app) # Serve...
def create_app(): """Create Flask app.""" config = load_config() app = Flask(__name__) app.config.from_object(config) # Proxy fix app.wsgi_app = ProxyFix(app.wsgi_app) # CSRF protect CsrfProtect(app) if app.debug or app.testing: DebugToolbarExtension(app) # Serve...
[ "Create", "Flask", "app", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/__init__.py#L31-L76
[ "def", "create_app", "(", ")", ":", "config", "=", "load_config", "(", ")", "app", "=", "Flask", "(", "__name__", ")", "app", ".", "config", ".", "from_object", "(", "config", ")", "# Proxy fix", "app", ".", "wsgi_app", "=", "ProxyFix", "(", "app", "."...
d0308408ebb248dd752b77123b845f8ec637fab2
test
register_jinja
Register jinja filters, vars, functions.
flask_boost/project/application/__init__.py
def register_jinja(app): """Register jinja filters, vars, functions.""" import jinja2 from .utils import filters, permissions, helpers if app.debug or app.testing: my_loader = jinja2.ChoiceLoader([ app.jinja_loader, jinja2.FileSystemLoader([ os.path.join(...
def register_jinja(app): """Register jinja filters, vars, functions.""" import jinja2 from .utils import filters, permissions, helpers if app.debug or app.testing: my_loader = jinja2.ChoiceLoader([ app.jinja_loader, jinja2.FileSystemLoader([ os.path.join(...
[ "Register", "jinja", "filters", "vars", "functions", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/__init__.py#L79-L125
[ "def", "register_jinja", "(", "app", ")", ":", "import", "jinja2", "from", ".", "utils", "import", "filters", ",", "permissions", ",", "helpers", "if", "app", ".", "debug", "or", "app", ".", "testing", ":", "my_loader", "=", "jinja2", ".", "ChoiceLoader", ...
d0308408ebb248dd752b77123b845f8ec637fab2
test
register_routes
Register routes.
flask_boost/project/application/__init__.py
def register_routes(app): """Register routes.""" from . import controllers from flask.blueprints import Blueprint for module in _import_submodules_from_package(controllers): bp = getattr(module, 'bp') if bp and isinstance(bp, Blueprint): app.register_blueprint(bp)
def register_routes(app): """Register routes.""" from . import controllers from flask.blueprints import Blueprint for module in _import_submodules_from_package(controllers): bp = getattr(module, 'bp') if bp and isinstance(bp, Blueprint): app.register_blueprint(bp)
[ "Register", "routes", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/__init__.py#L135-L143
[ "def", "register_routes", "(", "app", ")", ":", "from", ".", "import", "controllers", "from", "flask", ".", "blueprints", "import", "Blueprint", "for", "module", "in", "_import_submodules_from_package", "(", "controllers", ")", ":", "bp", "=", "getattr", "(", ...
d0308408ebb248dd752b77123b845f8ec637fab2
test
register_error_handle
Register HTTP error pages.
flask_boost/project/application/__init__.py
def register_error_handle(app): """Register HTTP error pages.""" @app.errorhandler(403) def page_403(error): return render_template('site/403/403.html'), 403 @app.errorhandler(404) def page_404(error): return render_template('site/404/404.html'), 404 @app.errorhandler(500) ...
def register_error_handle(app): """Register HTTP error pages.""" @app.errorhandler(403) def page_403(error): return render_template('site/403/403.html'), 403 @app.errorhandler(404) def page_404(error): return render_template('site/404/404.html'), 404 @app.errorhandler(500) ...
[ "Register", "HTTP", "error", "pages", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/__init__.py#L146-L159
[ "def", "register_error_handle", "(", "app", ")", ":", "@", "app", ".", "errorhandler", "(", "403", ")", "def", "page_403", "(", "error", ")", ":", "return", "render_template", "(", "'site/403/403.html'", ")", ",", "403", "@", "app", ".", "errorhandler", "(...
d0308408ebb248dd752b77123b845f8ec637fab2
test
register_hooks
Register hooks.
flask_boost/project/application/__init__.py
def register_hooks(app): """Register hooks.""" @app.before_request def before_request(): g.user = get_current_user() if g.user and g.user.is_admin: g._before_request_time = time.time() @app.after_request def after_request(response): if hasattr(g, '_before_reques...
def register_hooks(app): """Register hooks.""" @app.before_request def before_request(): g.user = get_current_user() if g.user and g.user.is_admin: g._before_request_time = time.time() @app.after_request def after_request(response): if hasattr(g, '_before_reques...
[ "Register", "hooks", "." ]
hustlzp/Flask-Boost
python
https://github.com/hustlzp/Flask-Boost/blob/d0308408ebb248dd752b77123b845f8ec637fab2/flask_boost/project/application/__init__.py#L162-L176
[ "def", "register_hooks", "(", "app", ")", ":", "@", "app", ".", "before_request", "def", "before_request", "(", ")", ":", "g", ".", "user", "=", "get_current_user", "(", ")", "if", "g", ".", "user", "and", "g", ".", "user", ".", "is_admin", ":", "g",...
d0308408ebb248dd752b77123b845f8ec637fab2
test
_dataframe_to_csv
serialize the dataframe with different delimiters
azureml/serialization.py
def _dataframe_to_csv(writer, dataframe, delimiter, with_header): """serialize the dataframe with different delimiters""" encoding_writer = codecs.getwriter('utf-8')(writer) dataframe.to_csv( path_or_buf=encoding_writer, sep=delimiter, header=with_header, index=False )
def _dataframe_to_csv(writer, dataframe, delimiter, with_header): """serialize the dataframe with different delimiters""" encoding_writer = codecs.getwriter('utf-8')(writer) dataframe.to_csv( path_or_buf=encoding_writer, sep=delimiter, header=with_header, index=False )
[ "serialize", "the", "dataframe", "with", "different", "delimiters" ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/serialization.py#L47-L55
[ "def", "_dataframe_to_csv", "(", "writer", ",", "dataframe", ",", "delimiter", ",", "with_header", ")", ":", "encoding_writer", "=", "codecs", ".", "getwriter", "(", "'utf-8'", ")", "(", "writer", ")", "dataframe", ".", "to_csv", "(", "path_or_buf", "=", "en...
d1211b289747671898eb063013e0dc53d3c80acd
test
_dataframe_from_csv
Returns csv data as a pandas Dataframe object
azureml/serialization.py
def _dataframe_from_csv(reader, delimiter, with_header, skipspace): """Returns csv data as a pandas Dataframe object""" sep = delimiter header = 0 if not with_header: header = None return pd.read_csv( reader, header=header, sep=sep, skipinitialspace=skipspace...
def _dataframe_from_csv(reader, delimiter, with_header, skipspace): """Returns csv data as a pandas Dataframe object""" sep = delimiter header = 0 if not with_header: header = None return pd.read_csv( reader, header=header, sep=sep, skipinitialspace=skipspace...
[ "Returns", "csv", "data", "as", "a", "pandas", "Dataframe", "object" ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/serialization.py#L63-L76
[ "def", "_dataframe_from_csv", "(", "reader", ",", "delimiter", ",", "with_header", ",", "skipspace", ")", ":", "sep", "=", "delimiter", "header", "=", "0", "if", "not", "with_header", ":", "header", "=", "None", "return", "pd", ".", "read_csv", "(", "reade...
d1211b289747671898eb063013e0dc53d3c80acd
test
serialize_dataframe
Serialize a dataframe. Parameters ---------- writer : file File-like object to write to. Must be opened in binary mode. data_type_id : dict Serialization format to use. See the azureml.DataTypeIds class for constants. dataframe: pandas.DataFrame Dataframe to serializ...
azureml/serialization.py
def serialize_dataframe(writer, data_type_id, dataframe): """ Serialize a dataframe. Parameters ---------- writer : file File-like object to write to. Must be opened in binary mode. data_type_id : dict Serialization format to use. See the azureml.DataTypeIds class for co...
def serialize_dataframe(writer, data_type_id, dataframe): """ Serialize a dataframe. Parameters ---------- writer : file File-like object to write to. Must be opened in binary mode. data_type_id : dict Serialization format to use. See the azureml.DataTypeIds class for co...
[ "Serialize", "a", "dataframe", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/serialization.py#L107-L128
[ "def", "serialize_dataframe", "(", "writer", ",", "data_type_id", ",", "dataframe", ")", ":", "_not_none", "(", "'writer'", ",", "writer", ")", "_not_none_or_empty", "(", "'data_type_id'", ",", "data_type_id", ")", "_not_none", "(", "'dataframe'", ",", "dataframe"...
d1211b289747671898eb063013e0dc53d3c80acd
test
deserialize_dataframe
Deserialize a dataframe. Parameters ---------- reader : file File-like object to read from. Must be opened in binary mode. data_type_id : dict Serialization format of the raw data. See the azureml.DataTypeIds class for constants. Returns ------- pandas.DataFrame ...
azureml/serialization.py
def deserialize_dataframe(reader, data_type_id): """ Deserialize a dataframe. Parameters ---------- reader : file File-like object to read from. Must be opened in binary mode. data_type_id : dict Serialization format of the raw data. See the azureml.DataTypeIds class for...
def deserialize_dataframe(reader, data_type_id): """ Deserialize a dataframe. Parameters ---------- reader : file File-like object to read from. Must be opened in binary mode. data_type_id : dict Serialization format of the raw data. See the azureml.DataTypeIds class for...
[ "Deserialize", "a", "dataframe", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/serialization.py#L130-L153
[ "def", "deserialize_dataframe", "(", "reader", ",", "data_type_id", ")", ":", "_not_none", "(", "'reader'", ",", "reader", ")", "_not_none_or_empty", "(", "'data_type_id'", ",", "data_type_id", ")", "serializer", "=", "_SERIALIZERS", ".", "get", "(", "data_type_id...
d1211b289747671898eb063013e0dc53d3c80acd
test
SourceDataset._update_from_dataframe
Serialize the specified DataFrame and replace the existing dataset. Parameters ---------- dataframe : pandas.DataFrame Data to serialize. data_type_id : str, optional Format to serialize to. If None, the existing format is preserved. Suppo...
azureml/__init__.py
def _update_from_dataframe(self, dataframe, data_type_id=None, name=None, description=None): """ Serialize the specified DataFrame and replace the existing dataset. Parameters ---------- dataframe : pandas.DataFrame Data to serialize. ...
def _update_from_dataframe(self, dataframe, data_type_id=None, name=None, description=None): """ Serialize the specified DataFrame and replace the existing dataset. Parameters ---------- dataframe : pandas.DataFrame Data to serialize. ...
[ "Serialize", "the", "specified", "DataFrame", "and", "replace", "the", "existing", "dataset", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L134-L176
[ "def", "_update_from_dataframe", "(", "self", ",", "dataframe", ",", "data_type_id", "=", "None", ",", "name", "=", "None", ",", "description", "=", "None", ")", ":", "_not_none", "(", "'dataframe'", ",", "dataframe", ")", "if", "data_type_id", "is", "None",...
d1211b289747671898eb063013e0dc53d3c80acd
test
SourceDataset._update_from_raw_data
Upload already serialized raw data and replace the existing dataset. Parameters ---------- raw_data: bytes Dataset contents to upload. data_type_id : str Serialization format of the raw data. If None, the format of the existing dataset is used. ...
azureml/__init__.py
def _update_from_raw_data(self, raw_data, data_type_id=None, name=None, description=None): """ Upload already serialized raw data and replace the existing dataset. Parameters ---------- raw_data: bytes Dataset contents to upload. ...
def _update_from_raw_data(self, raw_data, data_type_id=None, name=None, description=None): """ Upload already serialized raw data and replace the existing dataset. Parameters ---------- raw_data: bytes Dataset contents to upload. ...
[ "Upload", "already", "serialized", "raw", "data", "and", "replace", "the", "existing", "dataset", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L178-L214
[ "def", "_update_from_raw_data", "(", "self", ",", "raw_data", ",", "data_type_id", "=", "None", ",", "name", "=", "None", ",", "description", "=", "None", ")", ":", "_not_none", "(", "'raw_data'", ",", "raw_data", ")", "if", "data_type_id", "is", "None", "...
d1211b289747671898eb063013e0dc53d3c80acd
test
SourceDataset.contents_url
Full URL to the dataset contents.
azureml/__init__.py
def contents_url(self): """Full URL to the dataset contents.""" loc = self.download_location return loc.base_uri + loc.location + loc.access_credential
def contents_url(self): """Full URL to the dataset contents.""" loc = self.download_location return loc.base_uri + loc.location + loc.access_credential
[ "Full", "URL", "to", "the", "dataset", "contents", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L411-L414
[ "def", "contents_url", "(", "self", ")", ":", "loc", "=", "self", ".", "download_location", "return", "loc", ".", "base_uri", "+", "loc", ".", "location", "+", "loc", ".", "access_credential" ]
d1211b289747671898eb063013e0dc53d3c80acd
test
Datasets.add_from_dataframe
Serialize the specified DataFrame and upload it as a new dataset. Parameters ---------- dataframe : pandas.DataFrame Data to serialize. data_type_id : str Format to serialize to. Supported formats are: 'PlainText' 'Gene...
azureml/__init__.py
def add_from_dataframe(self, dataframe, data_type_id, name, description): """ Serialize the specified DataFrame and upload it as a new dataset. Parameters ---------- dataframe : pandas.DataFrame Data to serialize. data_type_id : str Format to seri...
def add_from_dataframe(self, dataframe, data_type_id, name, description): """ Serialize the specified DataFrame and upload it as a new dataset. Parameters ---------- dataframe : pandas.DataFrame Data to serialize. data_type_id : str Format to seri...
[ "Serialize", "the", "specified", "DataFrame", "and", "upload", "it", "as", "a", "new", "dataset", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L465-L507
[ "def", "add_from_dataframe", "(", "self", ",", "dataframe", ",", "data_type_id", ",", "name", ",", "description", ")", ":", "_not_none", "(", "'dataframe'", ",", "dataframe", ")", "_not_none_or_empty", "(", "'data_type_id'", ",", "data_type_id", ")", "_not_none_or...
d1211b289747671898eb063013e0dc53d3c80acd
test
Datasets.add_from_raw_data
Upload already serialized raw data as a new dataset. Parameters ---------- raw_data: bytes Dataset contents to upload. data_type_id : str Serialization format of the raw data. Supported formats are: 'PlainText' 'Generic...
azureml/__init__.py
def add_from_raw_data(self, raw_data, data_type_id, name, description): """ Upload already serialized raw data as a new dataset. Parameters ---------- raw_data: bytes Dataset contents to upload. data_type_id : str Serialization format of the raw d...
def add_from_raw_data(self, raw_data, data_type_id, name, description): """ Upload already serialized raw data as a new dataset. Parameters ---------- raw_data: bytes Dataset contents to upload. data_type_id : str Serialization format of the raw d...
[ "Upload", "already", "serialized", "raw", "data", "as", "a", "new", "dataset", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L509-L545
[ "def", "add_from_raw_data", "(", "self", ",", "raw_data", ",", "data_type_id", ",", "name", ",", "description", ")", ":", "_not_none", "(", "'raw_data'", ",", "raw_data", ")", "_not_none_or_empty", "(", "'data_type_id'", ",", "data_type_id", ")", "_not_none_or_emp...
d1211b289747671898eb063013e0dc53d3c80acd
test
IntermediateDataset.open
Open and return a stream for the dataset contents.
azureml/__init__.py
def open(self): '''Open and return a stream for the dataset contents.''' return self.workspace._rest.open_intermediate_dataset_contents( self.workspace.workspace_id, self.experiment.experiment_id, self.node_id, self.port_name )
def open(self): '''Open and return a stream for the dataset contents.''' return self.workspace._rest.open_intermediate_dataset_contents( self.workspace.workspace_id, self.experiment.experiment_id, self.node_id, self.port_name )
[ "Open", "and", "return", "a", "stream", "for", "the", "dataset", "contents", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L603-L610
[ "def", "open", "(", "self", ")", ":", "return", "self", ".", "workspace", ".", "_rest", ".", "open_intermediate_dataset_contents", "(", "self", ".", "workspace", ".", "workspace_id", ",", "self", ".", "experiment", ".", "experiment_id", ",", "self", ".", "no...
d1211b289747671898eb063013e0dc53d3c80acd
test
IntermediateDataset.read_as_binary
Read and return the dataset contents as binary.
azureml/__init__.py
def read_as_binary(self): '''Read and return the dataset contents as binary.''' return self.workspace._rest.read_intermediate_dataset_contents_binary( self.workspace.workspace_id, self.experiment.experiment_id, self.node_id, self.port_name )
def read_as_binary(self): '''Read and return the dataset contents as binary.''' return self.workspace._rest.read_intermediate_dataset_contents_binary( self.workspace.workspace_id, self.experiment.experiment_id, self.node_id, self.port_name )
[ "Read", "and", "return", "the", "dataset", "contents", "as", "binary", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L612-L619
[ "def", "read_as_binary", "(", "self", ")", ":", "return", "self", ".", "workspace", ".", "_rest", ".", "read_intermediate_dataset_contents_binary", "(", "self", ".", "workspace", ".", "workspace_id", ",", "self", ".", "experiment", ".", "experiment_id", ",", "se...
d1211b289747671898eb063013e0dc53d3c80acd
test
IntermediateDataset.read_as_text
Read and return the dataset contents as text.
azureml/__init__.py
def read_as_text(self): '''Read and return the dataset contents as text.''' return self.workspace._rest.read_intermediate_dataset_contents_text( self.workspace.workspace_id, self.experiment.experiment_id, self.node_id, self.port_name )
def read_as_text(self): '''Read and return the dataset contents as text.''' return self.workspace._rest.read_intermediate_dataset_contents_text( self.workspace.workspace_id, self.experiment.experiment_id, self.node_id, self.port_name )
[ "Read", "and", "return", "the", "dataset", "contents", "as", "text", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L621-L628
[ "def", "read_as_text", "(", "self", ")", ":", "return", "self", ".", "workspace", ".", "_rest", ".", "read_intermediate_dataset_contents_text", "(", "self", ".", "workspace", ".", "workspace_id", ",", "self", ".", "experiment", ".", "experiment_id", ",", "self",...
d1211b289747671898eb063013e0dc53d3c80acd
test
IntermediateDataset._to_dataframe
Read and return the dataset contents as a pandas DataFrame.
azureml/__init__.py
def _to_dataframe(self): """Read and return the dataset contents as a pandas DataFrame.""" #TODO: figure out why passing in the opened stream directly gives invalid data data = self.read_as_binary() reader = BytesIO(data) return deserialize_dataframe(reader, self.data_type_id)
def _to_dataframe(self): """Read and return the dataset contents as a pandas DataFrame.""" #TODO: figure out why passing in the opened stream directly gives invalid data data = self.read_as_binary() reader = BytesIO(data) return deserialize_dataframe(reader, self.data_type_id)
[ "Read", "and", "return", "the", "dataset", "contents", "as", "a", "pandas", "DataFrame", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L630-L635
[ "def", "_to_dataframe", "(", "self", ")", ":", "#TODO: figure out why passing in the opened stream directly gives invalid data", "data", "=", "self", ".", "read_as_binary", "(", ")", "reader", "=", "BytesIO", "(", "data", ")", "return", "deserialize_dataframe", "(", "re...
d1211b289747671898eb063013e0dc53d3c80acd
test
Experiment.get_intermediate_dataset
Get an intermediate dataset. Parameters ---------- node_id : str Module node id from the experiment graph. port_name : str Output port of the module. data_type_id : str Serialization format of the raw data. See the azureml.DataType...
azureml/__init__.py
def get_intermediate_dataset(self, node_id, port_name, data_type_id): """ Get an intermediate dataset. Parameters ---------- node_id : str Module node id from the experiment graph. port_name : str Output port of the module. data_type_id : ...
def get_intermediate_dataset(self, node_id, port_name, data_type_id): """ Get an intermediate dataset. Parameters ---------- node_id : str Module node id from the experiment graph. port_name : str Output port of the module. data_type_id : ...
[ "Get", "an", "intermediate", "dataset", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/__init__.py#L740-L762
[ "def", "get_intermediate_dataset", "(", "self", ",", "node_id", ",", "port_name", ",", "data_type_id", ")", ":", "return", "IntermediateDataset", "(", "self", ".", "workspace", ",", "self", ",", "node_id", ",", "port_name", ",", "data_type_id", ")" ]
d1211b289747671898eb063013e0dc53d3c80acd
test
_RestClient.get_experiments
Runs HTTP GET request to retrieve the list of experiments.
azureml/http.py
def get_experiments(self, workspace_id): """Runs HTTP GET request to retrieve the list of experiments.""" api_path = self.EXPERIMENTS_URI_FMT.format(workspace_id) return self._send_get_req(api_path)
def get_experiments(self, workspace_id): """Runs HTTP GET request to retrieve the list of experiments.""" api_path = self.EXPERIMENTS_URI_FMT.format(workspace_id) return self._send_get_req(api_path)
[ "Runs", "HTTP", "GET", "request", "to", "retrieve", "the", "list", "of", "experiments", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/http.py#L65-L68
[ "def", "get_experiments", "(", "self", ",", "workspace_id", ")", ":", "api_path", "=", "self", ".", "EXPERIMENTS_URI_FMT", ".", "format", "(", "workspace_id", ")", "return", "self", ".", "_send_get_req", "(", "api_path", ")" ]
d1211b289747671898eb063013e0dc53d3c80acd
test
_RestClient.get_datasets
Runs HTTP GET request to retrieve the list of datasets.
azureml/http.py
def get_datasets(self, workspace_id): """Runs HTTP GET request to retrieve the list of datasets.""" api_path = self.DATASOURCES_URI_FMT.format(workspace_id) return self._send_get_req(api_path)
def get_datasets(self, workspace_id): """Runs HTTP GET request to retrieve the list of datasets.""" api_path = self.DATASOURCES_URI_FMT.format(workspace_id) return self._send_get_req(api_path)
[ "Runs", "HTTP", "GET", "request", "to", "retrieve", "the", "list", "of", "datasets", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/http.py#L70-L73
[ "def", "get_datasets", "(", "self", ",", "workspace_id", ")", ":", "api_path", "=", "self", ".", "DATASOURCES_URI_FMT", ".", "format", "(", "workspace_id", ")", "return", "self", ".", "_send_get_req", "(", "api_path", ")" ]
d1211b289747671898eb063013e0dc53d3c80acd
test
_RestClient.get_dataset
Runs HTTP GET request to retrieve a single dataset.
azureml/http.py
def get_dataset(self, workspace_id, dataset_id): """Runs HTTP GET request to retrieve a single dataset.""" api_path = self.DATASOURCE_URI_FMT.format(workspace_id, dataset_id) return self._send_get_req(api_path)
def get_dataset(self, workspace_id, dataset_id): """Runs HTTP GET request to retrieve a single dataset.""" api_path = self.DATASOURCE_URI_FMT.format(workspace_id, dataset_id) return self._send_get_req(api_path)
[ "Runs", "HTTP", "GET", "request", "to", "retrieve", "a", "single", "dataset", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/http.py#L75-L78
[ "def", "get_dataset", "(", "self", ",", "workspace_id", ",", "dataset_id", ")", ":", "api_path", "=", "self", ".", "DATASOURCE_URI_FMT", ".", "format", "(", "workspace_id", ",", "dataset_id", ")", "return", "self", ".", "_send_get_req", "(", "api_path", ")" ]
d1211b289747671898eb063013e0dc53d3c80acd
test
publish
publishes a callable function or decorates a function to be published. Returns a callable, iterable object. Calling the object will invoke the published service. Iterating the object will give the API URL, API key, and API help url. To define a function which will be published to Azure you can simply decorate ...
azureml/services.py
def publish(func_or_workspace_id, workspace_id_or_token = None, workspace_token_or_none = None, files=(), endpoint=None): '''publishes a callable function or decorates a function to be published. Returns a callable, iterable object. Calling the object will invoke the published service. Iterating the object will...
def publish(func_or_workspace_id, workspace_id_or_token = None, workspace_token_or_none = None, files=(), endpoint=None): '''publishes a callable function or decorates a function to be published. Returns a callable, iterable object. Calling the object will invoke the published service. Iterating the object will...
[ "publishes", "a", "callable", "function", "or", "decorates", "a", "function", "to", "be", "published", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/services.py#L896-L945
[ "def", "publish", "(", "func_or_workspace_id", ",", "workspace_id_or_token", "=", "None", ",", "workspace_token_or_none", "=", "None", ",", "files", "=", "(", ")", ",", "endpoint", "=", "None", ")", ":", "if", "not", "callable", "(", "func_or_workspace_id", ")...
d1211b289747671898eb063013e0dc53d3c80acd
test
service
Marks a function as having been published and causes all invocations to go to the remote operationalized service. >>> @service(url, api_key) >>> def f(a, b): >>> pass
azureml/services.py
def service(url, api_key, help_url = None): '''Marks a function as having been published and causes all invocations to go to the remote operationalized service. >>> @service(url, api_key) >>> def f(a, b): >>> pass ''' def do_publish(func): return published(url, api_key, help_url, func, None) re...
def service(url, api_key, help_url = None): '''Marks a function as having been published and causes all invocations to go to the remote operationalized service. >>> @service(url, api_key) >>> def f(a, b): >>> pass ''' def do_publish(func): return published(url, api_key, help_url, func, None) re...
[ "Marks", "a", "function", "as", "having", "been", "published", "and", "causes", "all", "invocations", "to", "go", "to", "the", "remote", "operationalized", "service", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/services.py#L947-L957
[ "def", "service", "(", "url", ",", "api_key", ",", "help_url", "=", "None", ")", ":", "def", "do_publish", "(", "func", ")", ":", "return", "published", "(", "url", ",", "api_key", ",", "help_url", ",", "func", ",", "None", ")", "return", "do_publish" ...
d1211b289747671898eb063013e0dc53d3c80acd
test
types
Specifies the types used for the arguments of a published service. @types(a=int, b = str) def f(a, b): pass
azureml/services.py
def types(**args): """Specifies the types used for the arguments of a published service. @types(a=int, b = str) def f(a, b): pass """ def l(func): if hasattr(func, '__annotations__'): func.__annotations__.update(args) else: func.__annotations__ = args return ...
def types(**args): """Specifies the types used for the arguments of a published service. @types(a=int, b = str) def f(a, b): pass """ def l(func): if hasattr(func, '__annotations__'): func.__annotations__.update(args) else: func.__annotations__ = args return ...
[ "Specifies", "the", "types", "used", "for", "the", "arguments", "of", "a", "published", "service", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/services.py#L959-L972
[ "def", "types", "(", "*", "*", "args", ")", ":", "def", "l", "(", "func", ")", ":", "if", "hasattr", "(", "func", ",", "'__annotations__'", ")", ":", "func", ".", "__annotations__", ".", "update", "(", "args", ")", "else", ":", "func", ".", "__anno...
d1211b289747671898eb063013e0dc53d3c80acd
test
returns
Specifies the return type for a published service. @returns(int) def f(...): pass
azureml/services.py
def returns(type): """Specifies the return type for a published service. @returns(int) def f(...): pass """ def l(func): if hasattr(func, '__annotations__'): func.__annotations__['return'] = type else: func.__annotations__ = {'return': type} return func r...
def returns(type): """Specifies the return type for a published service. @returns(int) def f(...): pass """ def l(func): if hasattr(func, '__annotations__'): func.__annotations__['return'] = type else: func.__annotations__ = {'return': type} return func r...
[ "Specifies", "the", "return", "type", "for", "a", "published", "service", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/services.py#L974-L987
[ "def", "returns", "(", "type", ")", ":", "def", "l", "(", "func", ")", ":", "if", "hasattr", "(", "func", ",", "'__annotations__'", ")", ":", "func", ".", "__annotations__", "[", "'return'", "]", "=", "type", "else", ":", "func", ".", "__annotations__"...
d1211b289747671898eb063013e0dc53d3c80acd
test
attach
attaches a file to the payload to be uploaded. If contents is omitted the file is read from disk. If name is a tuple it specifies the on-disk filename and the destination filename.
azureml/services.py
def attach(name, contents = None): """attaches a file to the payload to be uploaded. If contents is omitted the file is read from disk. If name is a tuple it specifies the on-disk filename and the destination filename. """ def do_attach(func): if hasattr(func, '__attachments__'): func.__att...
def attach(name, contents = None): """attaches a file to the payload to be uploaded. If contents is omitted the file is read from disk. If name is a tuple it specifies the on-disk filename and the destination filename. """ def do_attach(func): if hasattr(func, '__attachments__'): func.__att...
[ "attaches", "a", "file", "to", "the", "payload", "to", "be", "uploaded", "." ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/services.py#L989-L1001
[ "def", "attach", "(", "name", ",", "contents", "=", "None", ")", ":", "def", "do_attach", "(", "func", ")", ":", "if", "hasattr", "(", "func", ",", "'__attachments__'", ")", ":", "func", ".", "__attachments__", ".", "append", "(", "(", "name", ",", "...
d1211b289747671898eb063013e0dc53d3c80acd
test
_Serializer.find_globals
walks the byte code to find the variables which are actually globals
azureml/services.py
def find_globals(code): """walks the byte code to find the variables which are actually globals""" cur_byte = 0 byte_code = code.co_code names = set() while cur_byte < len(byte_code): op = ord(byte_code[cur_byte]) if op >= dis.HAVE_ARGUMENT: ...
def find_globals(code): """walks the byte code to find the variables which are actually globals""" cur_byte = 0 byte_code = code.co_code names = set() while cur_byte < len(byte_code): op = ord(byte_code[cur_byte]) if op >= dis.HAVE_ARGUMENT: ...
[ "walks", "the", "byte", "code", "to", "find", "the", "variables", "which", "are", "actually", "globals" ]
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/services.py#L394-L412
[ "def", "find_globals", "(", "code", ")", ":", "cur_byte", "=", "0", "byte_code", "=", "code", ".", "co_code", "names", "=", "set", "(", ")", "while", "cur_byte", "<", "len", "(", "byte_code", ")", ":", "op", "=", "ord", "(", "byte_code", "[", "cur_by...
d1211b289747671898eb063013e0dc53d3c80acd
test
published.map
maps the function onto multiple inputs. The input should be multiple sequences. The sequences will be zipped together forming the positional arguments for the call. This is equivalent to map(func, ...) but is executed with a single network call.
azureml/services.py
def map(self, *args): """maps the function onto multiple inputs. The input should be multiple sequences. The sequences will be zipped together forming the positional arguments for the call. This is equivalent to map(func, ...) but is executed with a single network call.""" call_args = [self._map_args...
def map(self, *args): """maps the function onto multiple inputs. The input should be multiple sequences. The sequences will be zipped together forming the positional arguments for the call. This is equivalent to map(func, ...) but is executed with a single network call.""" call_args = [self._map_args...
[ "maps", "the", "function", "onto", "multiple", "inputs", ".", "The", "input", "should", "be", "multiple", "sequences", ".", "The", "sequences", "will", "be", "zipped", "together", "forming", "the", "positional", "arguments", "for", "the", "call", ".", "This", ...
Azure/Azure-MachineLearning-ClientLibrary-Python
python
https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python/blob/d1211b289747671898eb063013e0dc53d3c80acd/azureml/services.py#L588-L602
[ "def", "map", "(", "self", ",", "*", "args", ")", ":", "call_args", "=", "[", "self", ".", "_map_args", "(", "*", "cur_args", ")", "for", "cur_args", "in", "zip", "(", "*", "args", ")", "]", "r", "=", "self", ".", "_invoke", "(", "call_args", ")"...
d1211b289747671898eb063013e0dc53d3c80acd
test
Pen.copy
Create a copy of this pen.
xdot/ui/pen.py
def copy(self): """Create a copy of this pen.""" pen = Pen() pen.__dict__ = self.__dict__.copy() return pen
def copy(self): """Create a copy of this pen.""" pen = Pen() pen.__dict__ = self.__dict__.copy() return pen
[ "Create", "a", "copy", "of", "this", "pen", "." ]
jrfonseca/xdot.py
python
https://github.com/jrfonseca/xdot.py/blob/6248c81c21a0fe825089311b17f2c302eea614a2/xdot/ui/pen.py#L46-L50
[ "def", "copy", "(", "self", ")", ":", "pen", "=", "Pen", "(", ")", "pen", ".", "__dict__", "=", "self", ".", "__dict__", ".", "copy", "(", ")", "return", "pen" ]
6248c81c21a0fe825089311b17f2c302eea614a2
test
lookup_color
Return RGBA values of color c c should be either an X11 color or a brewer color set and index e.g. "navajowhite", "greens3/2"
xdot/ui/colors.py
def lookup_color(c): """Return RGBA values of color c c should be either an X11 color or a brewer color set and index e.g. "navajowhite", "greens3/2" """ import sys import gi gi.require_version('Gtk', '3.0') gi.require_version('PangoCairo', '1.0') from gi.repository import Gdk ...
def lookup_color(c): """Return RGBA values of color c c should be either an X11 color or a brewer color set and index e.g. "navajowhite", "greens3/2" """ import sys import gi gi.require_version('Gtk', '3.0') gi.require_version('PangoCairo', '1.0') from gi.repository import Gdk ...
[ "Return", "RGBA", "values", "of", "color", "c" ]
jrfonseca/xdot.py
python
https://github.com/jrfonseca/xdot.py/blob/6248c81c21a0fe825089311b17f2c302eea614a2/xdot/ui/colors.py#L308-L348
[ "def", "lookup_color", "(", "c", ")", ":", "import", "sys", "import", "gi", "gi", ".", "require_version", "(", "'Gtk'", ",", "'3.0'", ")", "gi", ".", "require_version", "(", "'PangoCairo'", ",", "'1.0'", ")", "from", "gi", ".", "repository", "import", "G...
6248c81c21a0fe825089311b17f2c302eea614a2
test
Shape.draw
Draw this shape with the given cairo context
xdot/ui/elements.py
def draw(self, cr, highlight=False, bounding=None): """Draw this shape with the given cairo context""" if bounding is None or self._intersects(bounding): self._draw(cr, highlight, bounding)
def draw(self, cr, highlight=False, bounding=None): """Draw this shape with the given cairo context""" if bounding is None or self._intersects(bounding): self._draw(cr, highlight, bounding)
[ "Draw", "this", "shape", "with", "the", "given", "cairo", "context" ]
jrfonseca/xdot.py
python
https://github.com/jrfonseca/xdot.py/blob/6248c81c21a0fe825089311b17f2c302eea614a2/xdot/ui/elements.py#L55-L58
[ "def", "draw", "(", "self", ",", "cr", ",", "highlight", "=", "False", ",", "bounding", "=", "None", ")", ":", "if", "bounding", "is", "None", "or", "self", ".", "_intersects", "(", "bounding", ")", ":", "self", ".", "_draw", "(", "cr", ",", "highl...
6248c81c21a0fe825089311b17f2c302eea614a2
test
BezierShape._cubic_bernstein_extrema
Find extremas of a function of real domain defined by evaluating a cubic bernstein polynomial of given bernstein coefficients.
xdot/ui/elements.py
def _cubic_bernstein_extrema(p0, p1, p2, p3): """ Find extremas of a function of real domain defined by evaluating a cubic bernstein polynomial of given bernstein coefficients. """ # compute coefficients of derivative a = 3.*(p3-p0+3.*(p1-p2)) b = 6.*(p0+p2-2.*p1)...
def _cubic_bernstein_extrema(p0, p1, p2, p3): """ Find extremas of a function of real domain defined by evaluating a cubic bernstein polynomial of given bernstein coefficients. """ # compute coefficients of derivative a = 3.*(p3-p0+3.*(p1-p2)) b = 6.*(p0+p2-2.*p1)...
[ "Find", "extremas", "of", "a", "function", "of", "real", "domain", "defined", "by", "evaluating", "a", "cubic", "bernstein", "polynomial", "of", "given", "bernstein", "coefficients", "." ]
jrfonseca/xdot.py
python
https://github.com/jrfonseca/xdot.py/blob/6248c81c21a0fe825089311b17f2c302eea614a2/xdot/ui/elements.py#L357-L383
[ "def", "_cubic_bernstein_extrema", "(", "p0", ",", "p1", ",", "p2", ",", "p3", ")", ":", "# compute coefficients of derivative", "a", "=", "3.", "*", "(", "p3", "-", "p0", "+", "3.", "*", "(", "p1", "-", "p2", ")", ")", "b", "=", "6.", "*", "(", ...
6248c81c21a0fe825089311b17f2c302eea614a2
test
BezierShape._cubic_bernstein
Evaluate polynomial of given bernstein coefficients using de Casteljau's algorithm.
xdot/ui/elements.py
def _cubic_bernstein(p0, p1, p2, p3, t): """ Evaluate polynomial of given bernstein coefficients using de Casteljau's algorithm. """ u = 1 - t return p0*(u**3) + 3*t*u*(p1*u + p2*t) + p3*(t**3)
def _cubic_bernstein(p0, p1, p2, p3, t): """ Evaluate polynomial of given bernstein coefficients using de Casteljau's algorithm. """ u = 1 - t return p0*(u**3) + 3*t*u*(p1*u + p2*t) + p3*(t**3)
[ "Evaluate", "polynomial", "of", "given", "bernstein", "coefficients", "using", "de", "Casteljau", "s", "algorithm", "." ]
jrfonseca/xdot.py
python
https://github.com/jrfonseca/xdot.py/blob/6248c81c21a0fe825089311b17f2c302eea614a2/xdot/ui/elements.py#L386-L392
[ "def", "_cubic_bernstein", "(", "p0", ",", "p1", ",", "p2", ",", "p3", ",", "t", ")", ":", "u", "=", "1", "-", "t", "return", "p0", "*", "(", "u", "**", "3", ")", "+", "3", "*", "t", "*", "u", "*", "(", "p1", "*", "u", "+", "p2", "*", ...
6248c81c21a0fe825089311b17f2c302eea614a2
test
TreeItemChoiceField._build_choices
Build choices list runtime using 'sitetree_tree' tag
sitetree/fields.py
def _build_choices(self): """Build choices list runtime using 'sitetree_tree' tag""" tree_token = u'sitetree_tree from "%s" template "%s"' % (self.tree, self.template) context_kwargs = {'current_app': 'admin'} context = template.Context(context_kwargs) if VERSION >= (1, 8) else template...
def _build_choices(self): """Build choices list runtime using 'sitetree_tree' tag""" tree_token = u'sitetree_tree from "%s" template "%s"' % (self.tree, self.template) context_kwargs = {'current_app': 'admin'} context = template.Context(context_kwargs) if VERSION >= (1, 8) else template...
[ "Build", "choices", "list", "runtime", "using", "sitetree_tree", "tag" ]
idlesign/django-sitetree
python
https://github.com/idlesign/django-sitetree/blob/61de4608e6e415247c75fe8691027d7c4ed0d1e7/sitetree/fields.py#L40-L59
[ "def", "_build_choices", "(", "self", ")", ":", "tree_token", "=", "u'sitetree_tree from \"%s\" template \"%s\"'", "%", "(", "self", ".", "tree", ",", "self", ".", "template", ")", "context_kwargs", "=", "{", "'current_app'", ":", "'admin'", "}", "context", "=",...
61de4608e6e415247c75fe8691027d7c4ed0d1e7
test
options_getter
Compatibility function to get rid of optparse in management commands after Django 1.10. :param tuple command_options: tuple with `CommandOption` objects.
sitetree/compat.py
def options_getter(command_options): """Compatibility function to get rid of optparse in management commands after Django 1.10. :param tuple command_options: tuple with `CommandOption` objects. """ def get_options(option_func=None): from optparse import make_option from django.core.man...
def options_getter(command_options): """Compatibility function to get rid of optparse in management commands after Django 1.10. :param tuple command_options: tuple with `CommandOption` objects. """ def get_options(option_func=None): from optparse import make_option from django.core.man...
[ "Compatibility", "function", "to", "get", "rid", "of", "optparse", "in", "management", "commands", "after", "Django", "1", ".", "10", "." ]
idlesign/django-sitetree
python
https://github.com/idlesign/django-sitetree/blob/61de4608e6e415247c75fe8691027d7c4ed0d1e7/sitetree/compat.py#L20-L45
[ "def", "options_getter", "(", "command_options", ")", ":", "def", "get_options", "(", "option_func", "=", "None", ")", ":", "from", "optparse", "import", "make_option", "from", "django", ".", "core", ".", "management", ".", "base", "import", "BaseCommand", "fu...
61de4608e6e415247c75fe8691027d7c4ed0d1e7
test
get_sitetree
Returns SiteTree (thread-singleton) object, implementing utility methods. :rtype: SiteTree
sitetree/sitetreeapp.py
def get_sitetree(): """Returns SiteTree (thread-singleton) object, implementing utility methods. :rtype: SiteTree """ sitetree = getattr(_THREAD_LOCAL, _THREAD_SITETREE, None) if sitetree is None: sitetree = SiteTree() setattr(_THREAD_LOCAL, _THREAD_SITETREE, sitetree) return ...
def get_sitetree(): """Returns SiteTree (thread-singleton) object, implementing utility methods. :rtype: SiteTree """ sitetree = getattr(_THREAD_LOCAL, _THREAD_SITETREE, None) if sitetree is None: sitetree = SiteTree() setattr(_THREAD_LOCAL, _THREAD_SITETREE, sitetree) return ...
[ "Returns", "SiteTree", "(", "thread", "-", "singleton", ")", "object", "implementing", "utility", "methods", "." ]
idlesign/django-sitetree
python
https://github.com/idlesign/django-sitetree/blob/61de4608e6e415247c75fe8691027d7c4ed0d1e7/sitetree/sitetreeapp.py#L72-L83
[ "def", "get_sitetree", "(", ")", ":", "sitetree", "=", "getattr", "(", "_THREAD_LOCAL", ",", "_THREAD_SITETREE", ",", "None", ")", "if", "sitetree", "is", "None", ":", "sitetree", "=", "SiteTree", "(", ")", "setattr", "(", "_THREAD_LOCAL", ",", "_THREAD_SITE...
61de4608e6e415247c75fe8691027d7c4ed0d1e7