repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
3 values
summary
stringlengths
4
350
spotify/gordon-gcp
src/gordon_gcp/plugins/janitor/__init__.py
get_reconciler
def get_reconciler(config, metrics, rrset_channel, changes_channel, **kw): """Get a GDNSReconciler client. A factory function that validates configuration, creates an auth and :class:`GDNSClient` instance, and returns a GDNSReconciler provider. Args: config (dict): Google Cloud Pub/Sub-rel...
python
def get_reconciler(config, metrics, rrset_channel, changes_channel, **kw): """Get a GDNSReconciler client. A factory function that validates configuration, creates an auth and :class:`GDNSClient` instance, and returns a GDNSReconciler provider. Args: config (dict): Google Cloud Pub/Sub-rel...
[ "def", "get_reconciler", "(", "config", ",", "metrics", ",", "rrset_channel", ",", "changes_channel", ",", "*", "*", "kw", ")", ":", "builder", "=", "reconciler", ".", "GDNSReconcilerBuilder", "(", "config", ",", "metrics", ",", "rrset_channel", ",", "changes_...
Get a GDNSReconciler client. A factory function that validates configuration, creates an auth and :class:`GDNSClient` instance, and returns a GDNSReconciler provider. Args: config (dict): Google Cloud Pub/Sub-related configuration. metrics (obj): :interface:`IMetricRelay` implementatio...
[ "Get", "a", "GDNSReconciler", "client", "." ]
5ab19e3c2fe6ace72ee91e2ef1a1326f90b805da
https://github.com/spotify/gordon-gcp/blob/5ab19e3c2fe6ace72ee91e2ef1a1326f90b805da/src/gordon_gcp/plugins/janitor/__init__.py#L56-L77
train
Returns a GDNSReconciler client.
spotify/gordon-gcp
src/gordon_gcp/plugins/janitor/__init__.py
get_authority
def get_authority(config, metrics, rrset_channel, **kwargs): """Get a GCEAuthority client. A factory function that validates configuration and creates a proper GCEAuthority. Args: config (dict): GCEAuthority related configuration. metrics (obj): :interface:`IMetricRelay` implementation...
python
def get_authority(config, metrics, rrset_channel, **kwargs): """Get a GCEAuthority client. A factory function that validates configuration and creates a proper GCEAuthority. Args: config (dict): GCEAuthority related configuration. metrics (obj): :interface:`IMetricRelay` implementation...
[ "def", "get_authority", "(", "config", ",", "metrics", ",", "rrset_channel", ",", "*", "*", "kwargs", ")", ":", "builder", "=", "authority", ".", "GCEAuthorityBuilder", "(", "config", ",", "metrics", ",", "rrset_channel", ",", "*", "*", "kwargs", ")", "ret...
Get a GCEAuthority client. A factory function that validates configuration and creates a proper GCEAuthority. Args: config (dict): GCEAuthority related configuration. metrics (obj): :interface:`IMetricRelay` implementation. rrset_channel (asyncio.Queue): Queue used for sending mess...
[ "Get", "a", "GCEAuthority", "client", "." ]
5ab19e3c2fe6ace72ee91e2ef1a1326f90b805da
https://github.com/spotify/gordon-gcp/blob/5ab19e3c2fe6ace72ee91e2ef1a1326f90b805da/src/gordon_gcp/plugins/janitor/__init__.py#L80-L98
train
Returns a GCEAuthority client.
gotlium/ahc
modules/git_jail.py
Git_jail.enable
def enable(self, folder): host_name = self.base.options.ip email = self.base.options.user isHost(host_name) self.__userExists(email) data = self.getHostData(host_name) website_dir = data['website_dir'] full_path = '%s/%s' % (website_dir, folder) full_path_git = '%s/.git' % full_path repository = '%s/...
python
def enable(self, folder): host_name = self.base.options.ip email = self.base.options.user isHost(host_name) self.__userExists(email) data = self.getHostData(host_name) website_dir = data['website_dir'] full_path = '%s/%s' % (website_dir, folder) full_path_git = '%s/.git' % full_path repository = '%s/...
[ "def", "enable", "(", "self", ",", "folder", ")", ":", "host_name", "=", "self", ".", "base", ".", "options", ".", "ip", "email", "=", "self", ".", "base", ".", "options", ".", "user", "isHost", "(", "host_name", ")", "self", ".", "__userExists", "("...
os.system( 'cd %s; git rm --cached %s; git add ./%s/*' % ( website_dir, folder, folder ))
[ "os", ".", "system", "(", "cd", "%s", ";", "git", "rm", "--", "cached", "%s", ";", "git", "add", ".", "/", "%s", "/", "*", "%", "(", "website_dir", "folder", "folder", "))" ]
1a3f6d46b5405ea1334c9a4c132eca3347295443
https://github.com/gotlium/ahc/blob/1a3f6d46b5405ea1334c9a4c132eca3347295443/modules/git_jail.py#L144-L229
train
enable folder in the git repository
spotify/gordon-gcp
src/gordon_gcp/clients/auth.py
GAuthClient.refresh_token
async def refresh_token(self): """Refresh oauth access token attached to this HTTP session. Raises: :exc:`.GCPAuthError`: if no token was found in the response. :exc:`.GCPHTTPError`: if any exception occurred, specifically a :exc:`.GCPHTTPResponse...
python
async def refresh_token(self): """Refresh oauth access token attached to this HTTP session. Raises: :exc:`.GCPAuthError`: if no token was found in the response. :exc:`.GCPHTTPError`: if any exception occurred, specifically a :exc:`.GCPHTTPResponse...
[ "async", "def", "refresh_token", "(", "self", ")", ":", "url", ",", "headers", ",", "body", "=", "self", ".", "_setup_token_request", "(", ")", "request_id", "=", "uuid", ".", "uuid4", "(", ")", "logging", ".", "debug", "(", "_utils", ".", "REQ_LOG_FMT",...
Refresh oauth access token attached to this HTTP session. Raises: :exc:`.GCPAuthError`: if no token was found in the response. :exc:`.GCPHTTPError`: if any exception occurred, specifically a :exc:`.GCPHTTPResponseError`, if the exception i...
[ "Refresh", "oauth", "access", "token", "attached", "to", "this", "HTTP", "session", "." ]
5ab19e3c2fe6ace72ee91e2ef1a1326f90b805da
https://github.com/spotify/gordon-gcp/blob/5ab19e3c2fe6ace72ee91e2ef1a1326f90b805da/src/gordon_gcp/clients/auth.py#L168-L208
train
Refresh the oauth access token attached to this HTTP session.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.list_to_obj
def list_to_obj(cls, list_, columns, row_columns=None, tab='', key_on=None, no_header=False): """ :param list_: list of list or list of dictionary to use as the source :param columns: list of strings to label the columns when ...
python
def list_to_obj(cls, list_, columns, row_columns=None, tab='', key_on=None, no_header=False): """ :param list_: list of list or list of dictionary to use as the source :param columns: list of strings to label the columns when ...
[ "def", "list_to_obj", "(", "cls", ",", "list_", ",", "columns", ",", "row_columns", "=", "None", ",", "tab", "=", "''", ",", "key_on", "=", "None", ",", "no_header", "=", "False", ")", ":", "if", "not", "list_", ":", "return", "cls", "(", "columns", ...
:param list_: list of list or list of dictionary to use as the source :param columns: list of strings to label the columns when converting to str :param row_columns: list of columns in the actually data :param tab: ...
[ ":", "param", "list_", ":", "list", "of", "list", "or", "list", "of", "dictionary", "to", "use", "as", "the", "source", ":", "param", "columns", ":", "list", "of", "strings", "to", "label", "the", "columns", "when", "converting", "to", "str", ":", "par...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L123-L176
train
Converts a list of dictionaries to SeabornTable object
SeabornGames/Table
seaborn_table/table.py
SeabornTable.dict_to_obj
def dict_to_obj(cls, dict_, columns, row_columns, tab='', key_on=None): """ :param dict_: dict of dict or dict of list :param columns: list of strings to label the columns on print out :param row_columns: list of columns in the actually data :param tab: str of the tab to use befo...
python
def dict_to_obj(cls, dict_, columns, row_columns, tab='', key_on=None): """ :param dict_: dict of dict or dict of list :param columns: list of strings to label the columns on print out :param row_columns: list of columns in the actually data :param tab: str of the tab to use befo...
[ "def", "dict_to_obj", "(", "cls", ",", "dict_", ",", "columns", ",", "row_columns", ",", "tab", "=", "''", ",", "key_on", "=", "None", ")", ":", "if", "isinstance", "(", "list", "(", "dict_", ".", "values", "(", ")", ")", "[", "0", "]", ",", "dic...
:param dict_: dict of dict or dict of list :param columns: list of strings to label the columns on print out :param row_columns: list of columns in the actually data :param tab: str of the tab to use before the row on printout :param key_on: str of the column to key each row on :...
[ ":", "param", "dict_", ":", "dict", "of", "dict", "or", "dict", "of", "list", ":", "param", "columns", ":", "list", "of", "strings", "to", "label", "the", "columns", "on", "print", "out", ":", "param", "row_columns", ":", "list", "of", "columns", "in",...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L179-L221
train
Convert a dictionary of Seaborn SeabornRecord objects into SeabornTable objects.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.csv_to_obj
def csv_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, deliminator=',', eval_cells=True): """ This will convert a csv file or csv text into a seaborn table and return it :param file_path: str of the path to th...
python
def csv_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, deliminator=',', eval_cells=True): """ This will convert a csv file or csv text into a seaborn table and return it :param file_path: str of the path to th...
[ "def", "csv_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "remove_empty_rows", "=", "True", ",", "key_on", "=", "None", ",", "deliminator", "=", "','", ",", "eval_cells", "=", "True", ")",...
This will convert a csv file or csv text into a seaborn table and return it :param file_path: str of the path to the file :param text: str of the csv text :param columns: list of str of columns to use :param remove_empty_rows: bool if True will remove empty rows w...
[ "This", "will", "convert", "a", "csv", "file", "or", "csv", "text", "into", "a", "seaborn", "table", "and", "return", "it", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "the"...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L244-L273
train
This will convert a csv file or csv text into a Seaborn table object.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.grid_to_obj
def grid_to_obj(cls, file_path=None, text='', edges=None, columns=None, eval_cells=True, key_on=None): """ This will convert a grid file or grid text into a seaborn table and return it :param file_path: str of the path to the file :param text: str of ...
python
def grid_to_obj(cls, file_path=None, text='', edges=None, columns=None, eval_cells=True, key_on=None): """ This will convert a grid file or grid text into a seaborn table and return it :param file_path: str of the path to the file :param text: str of ...
[ "def", "grid_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "edges", "=", "None", ",", "columns", "=", "None", ",", "eval_cells", "=", "True", ",", "key_on", "=", "None", ")", ":", "edges", "=", "edges", "if", "edg...
This will convert a grid file or grid text into a seaborn table and return it :param file_path: str of the path to the file :param text: str of the grid text :param columns: list of str of columns to use :param key_on: list of str of columns to key on :p...
[ "This", "will", "convert", "a", "grid", "file", "or", "grid", "text", "into", "a", "seaborn", "table", "and", "return", "it", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "th...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L276-L303
train
This will convert a grid file or text into a Seaborn table object.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.txt_to_obj
def txt_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, row_columns=None, deliminator='\t', eval_cells=True): """ This will convert text file or text to a seaborn table and return it :param file_path: str of th...
python
def txt_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, row_columns=None, deliminator='\t', eval_cells=True): """ This will convert text file or text to a seaborn table and return it :param file_path: str of th...
[ "def", "txt_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "remove_empty_rows", "=", "True", ",", "key_on", "=", "None", ",", "row_columns", "=", "None", ",", "deliminator", "=", "'\\t'", "...
This will convert text file or text to a seaborn table and return it :param file_path: str of the path to the file :param text: str of the csv text :param columns: list of str of columns to use :param row_columns: list of str of columns in data but not to use :param remov...
[ "This", "will", "convert", "text", "file", "or", "text", "to", "a", "seaborn", "table", "and", "return", "it", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "the", "csv", "tex...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L315-L334
train
This will convert a text file or text to a Seaborn table object and return it.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.str_to_obj
def str_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, row_columns=None, deliminator='\t', eval_cells=True): """ This will convert text file or text to a seaborn table and return it :param file_path: str of th...
python
def str_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, row_columns=None, deliminator='\t', eval_cells=True): """ This will convert text file or text to a seaborn table and return it :param file_path: str of th...
[ "def", "str_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "remove_empty_rows", "=", "True", ",", "key_on", "=", "None", ",", "row_columns", "=", "None", ",", "deliminator", "=", "'\\t'", "...
This will convert text file or text to a seaborn table and return it :param file_path: str of the path to the file :param text: str of the csv text :param columns: list of str of columns to use :param row_columns: list of str of columns in data but not to use :param remov...
[ "This", "will", "convert", "text", "file", "or", "text", "to", "a", "seaborn", "table", "and", "return", "it", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "the", "csv", "tex...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L337-L365
train
This will convert a text file or text to a Seaborn table object and return it.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.rst_to_obj
def rst_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, deliminator=' ', eval_cells=True): """ This will convert a rst file or text to a seaborn table :param file_path: str of the path to the file :param text: ...
python
def rst_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, deliminator=' ', eval_cells=True): """ This will convert a rst file or text to a seaborn table :param file_path: str of the path to the file :param text: ...
[ "def", "rst_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "remove_empty_rows", "=", "True", ",", "key_on", "=", "None", ",", "deliminator", "=", "' '", ",", "eval_cells", "=", "True", ")",...
This will convert a rst file or text to a seaborn table :param file_path: str of the path to the file :param text: str of the csv text :param columns: list of str of columns to use :param remove_empty_rows: bool if True will remove empty rows :param key_on: list of str of columns...
[ "This", "will", "convert", "a", "rst", "file", "or", "text", "to", "a", "seaborn", "table", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "the", "csv", "text", ":", "param", ...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L368-L394
train
This will convert a rst file or text to a Seaborn table object.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.psql_to_obj
def psql_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, deliminator=' | ', eval_cells=True): """ This will convert a psql file or text to a seaborn table :param file_path: str of the path to the file :param ...
python
def psql_to_obj(cls, file_path=None, text='', columns=None, remove_empty_rows=True, key_on=None, deliminator=' | ', eval_cells=True): """ This will convert a psql file or text to a seaborn table :param file_path: str of the path to the file :param ...
[ "def", "psql_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "remove_empty_rows", "=", "True", ",", "key_on", "=", "None", ",", "deliminator", "=", "' | '", ",", "eval_cells", "=", "True", "...
This will convert a psql file or text to a seaborn table :param file_path: str of the path to the file :param text: str of the csv text :param columns: list of str of columns to use :param remove_empty_rows: bool if True will remove empty rows :param key_on: list of str of column...
[ "This", "will", "convert", "a", "psql", "file", "or", "text", "to", "a", "seaborn", "table", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "the", "csv", "text", ":", "param", ...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L397-L423
train
This will convert a psql file or text to a Seaborn table object.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.html_to_obj
def html_to_obj(cls, file_path=None, text='', columns=None, key_on=None, ignore_code_blocks=True, eval_cells=True): """ This will convert a html file or text to a seaborn table :param file_path: str of the path to the file :param text: str of the csv text :par...
python
def html_to_obj(cls, file_path=None, text='', columns=None, key_on=None, ignore_code_blocks=True, eval_cells=True): """ This will convert a html file or text to a seaborn table :param file_path: str of the path to the file :param text: str of the csv text :par...
[ "def", "html_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "key_on", "=", "None", ",", "ignore_code_blocks", "=", "True", ",", "eval_cells", "=", "True", ")", ":", "raise", "NotImplemented" ...
This will convert a html file or text to a seaborn table :param file_path: str of the path to the file :param text: str of the csv text :param columns: list of str of columns to use :param remove_empty_rows: bool if True will remove empty rows :param key_on: list of str of column...
[ "This", "will", "convert", "a", "html", "file", "or", "text", "to", "a", "seaborn", "table", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "the", "csv", "text", ":", "param", ...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L426-L439
train
This will convert a html file or text to a seaborn table object
SeabornGames/Table
seaborn_table/table.py
SeabornTable.mark_down_to_dict_of_obj
def mark_down_to_dict_of_obj(cls, file_path=None, text='', columns=None, key_on=None, eval_cells=True): """ This will read multiple tables separated by a #### Header and return it as a dictionary of headers :param file_path: str of the path to the file ...
python
def mark_down_to_dict_of_obj(cls, file_path=None, text='', columns=None, key_on=None, eval_cells=True): """ This will read multiple tables separated by a #### Header and return it as a dictionary of headers :param file_path: str of the path to the file ...
[ "def", "mark_down_to_dict_of_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "key_on", "=", "None", ",", "eval_cells", "=", "True", ")", ":", "text", "=", "cls", ".", "_get_lines", "(", "file_p...
This will read multiple tables separated by a #### Header and return it as a dictionary of headers :param file_path: str of the path to the file :param text: str of the mark down text :param columns: list of str of columns to use :param key_on: list of str of columns to key on ...
[ "This", "will", "read", "multiple", "tables", "separated", "by", "a", "####", "Header", "and", "return", "it", "as", "a", "dictionary", "of", "headers", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text"...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L442-L462
train
This will read multiple tables separated by a #### Header and return a dictionary of headers and SeabornTable objects.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.md_to_obj
def md_to_obj(cls, file_path=None, text='', columns=None, key_on=None, ignore_code_blocks=True, eval_cells=True): """ This will convert a mark down file to a seaborn table :param file_path: str of the path to the file :param text: str of the mark down text :para...
python
def md_to_obj(cls, file_path=None, text='', columns=None, key_on=None, ignore_code_blocks=True, eval_cells=True): """ This will convert a mark down file to a seaborn table :param file_path: str of the path to the file :param text: str of the mark down text :para...
[ "def", "md_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "key_on", "=", "None", ",", "ignore_code_blocks", "=", "True", ",", "eval_cells", "=", "True", ")", ":", "return", "cls", ".", "m...
This will convert a mark down file to a seaborn table :param file_path: str of the path to the file :param text: str of the mark down text :param columns: list of str of columns to use :param key_on: list of str of columns to key on :param ignore_code_blocks: bool if true will fi...
[ "This", "will", "convert", "a", "mark", "down", "file", "to", "a", "seaborn", "table", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "the", "mark", "down", "text", ":", "param...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L465-L481
train
This will convert a mark down file to a Seaborn table object
SeabornGames/Table
seaborn_table/table.py
SeabornTable.mark_down_to_obj
def mark_down_to_obj(cls, file_path=None, text='', columns=None, key_on=None, ignore_code_blocks=True, eval_cells=True): """ This will convert a mark down file to a seaborn table and return it :param file_path: str of the path to the file :param text: st...
python
def mark_down_to_obj(cls, file_path=None, text='', columns=None, key_on=None, ignore_code_blocks=True, eval_cells=True): """ This will convert a mark down file to a seaborn table and return it :param file_path: str of the path to the file :param text: st...
[ "def", "mark_down_to_obj", "(", "cls", ",", "file_path", "=", "None", ",", "text", "=", "''", ",", "columns", "=", "None", ",", "key_on", "=", "None", ",", "ignore_code_blocks", "=", "True", ",", "eval_cells", "=", "True", ")", ":", "text", "=", "cls",...
This will convert a mark down file to a seaborn table and return it :param file_path: str of the path to the file :param text: str of the mark down text :param columns: list of str of columns to use :param key_on: list of str of columns to key on :param ignore_code_block...
[ "This", "will", "convert", "a", "mark", "down", "file", "to", "a", "seaborn", "table", "and", "return", "it", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "text", ":", "str", "of", "the", "mark", "dow...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L484-L519
train
This will convert a mark down file to a Seaborn table and return it.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.objs_to_mark_down
def objs_to_mark_down(cls, tables, file_path=None, keys=None, pretty_columns=True, quote_numbers=True): """ This will return a str of multiple mark down tables. :param tables: dict of {str <name>:SeabornTable} :param file_path: str of the path to th...
python
def objs_to_mark_down(cls, tables, file_path=None, keys=None, pretty_columns=True, quote_numbers=True): """ This will return a str of multiple mark down tables. :param tables: dict of {str <name>:SeabornTable} :param file_path: str of the path to th...
[ "def", "objs_to_mark_down", "(", "cls", ",", "tables", ",", "file_path", "=", "None", ",", "keys", "=", "None", ",", "pretty_columns", "=", "True", ",", "quote_numbers", "=", "True", ")", ":", "keys", "=", "keys", "or", "tables", ".", "keys", "(", ")",...
This will return a str of multiple mark down tables. :param tables: dict of {str <name>:SeabornTable} :param file_path: str of the path to the file :param keys: list of str of the order of keys to use :param pretty_columns: bool if True will make the columns pretty...
[ "This", "will", "return", "a", "str", "of", "multiple", "mark", "down", "tables", ".", ":", "param", "tables", ":", "dict", "of", "{", "str", "<name", ">", ":", "SeabornTable", "}", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "t...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L522-L539
train
This will return a str of multiple mark down tables.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_md
def obj_to_md(self, file_path=None, title_columns=False, quote_numbers=True): """ This will return a str of a mark down tables. :param title_columns: bool if True will title all headers :param file_path: str of the path to the file to write to :param quote_numbe...
python
def obj_to_md(self, file_path=None, title_columns=False, quote_numbers=True): """ This will return a str of a mark down tables. :param title_columns: bool if True will title all headers :param file_path: str of the path to the file to write to :param quote_numbe...
[ "def", "obj_to_md", "(", "self", ",", "file_path", "=", "None", ",", "title_columns", "=", "False", ",", "quote_numbers", "=", "True", ")", ":", "return", "self", ".", "obj_to_mark_down", "(", "file_path", "=", "file_path", ",", "title_columns", "=", "title_...
This will return a str of a mark down tables. :param title_columns: bool if True will title all headers :param file_path: str of the path to the file to write to :param quote_numbers: bool if True will quote numbers that are strings :return: str
[ "This", "will", "return", "a", "str", "of", "a", "mark", "down", "tables", ".", ":", "param", "title_columns", ":", "bool", "if", "True", "will", "title", "all", "headers", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file"...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L541-L552
train
This will return a str of a mark down tables.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_mark_down
def obj_to_mark_down(self, file_path=None, title_columns=False, quote_numbers=True, quote_empty_str=False): """ This will return a str of a mark down table. :param title_columns: bool if True will title all headers :param file_path: str of the path to the...
python
def obj_to_mark_down(self, file_path=None, title_columns=False, quote_numbers=True, quote_empty_str=False): """ This will return a str of a mark down table. :param title_columns: bool if True will title all headers :param file_path: str of the path to the...
[ "def", "obj_to_mark_down", "(", "self", ",", "file_path", "=", "None", ",", "title_columns", "=", "False", ",", "quote_numbers", "=", "True", ",", "quote_empty_str", "=", "False", ")", ":", "md", ",", "column_widths", "=", "self", ".", "get_data_and_shared_col...
This will return a str of a mark down table. :param title_columns: bool if True will title all headers :param file_path: str of the path to the file to write to :param quote_numbers: bool if True will quote numbers that are strings :param quote_empty_str: bool if True will quot...
[ "This", "will", "return", "a", "str", "of", "a", "mark", "down", "table", ".", ":", "param", "title_columns", ":", "bool", "if", "True", "will", "title", "all", "headers", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file",...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L554-L575
train
This will return a str of a mark down table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_txt
def obj_to_txt(self, file_path=None, deliminator=None, tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use ...
python
def obj_to_txt(self, file_path=None, deliminator=None, tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use ...
[ "def", "obj_to_txt", "(", "self", ",", "file_path", "=", "None", ",", "deliminator", "=", "None", ",", "tab", "=", "None", ",", "quote_numbers", "=", "True", ",", "quote_empty_str", "=", "False", ")", ":", "return", "self", ".", "obj_to_str", "(", "file_...
This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use :param tab: string of offset of the table :param quote_numbers: bool if True will quote numbers that are strings ...
[ "This", "will", "return", "a", "simple", "str", "table", ".", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "keys", ":", "list", "of", "str", "of", "the", "order", "of", "keys", "to", "use", ":", "pa...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L577-L590
train
This will return a simple str table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_str
def obj_to_str(self, file_path=None, deliminator=None, tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use ...
python
def obj_to_str(self, file_path=None, deliminator=None, tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use ...
[ "def", "obj_to_str", "(", "self", ",", "file_path", "=", "None", ",", "deliminator", "=", "None", ",", "tab", "=", "None", ",", "quote_numbers", "=", "True", ",", "quote_empty_str", "=", "False", ")", ":", "deliminator", "=", "self", ".", "deliminator", ...
This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use :param tab: string of offset of the table :param quote_numbers: bool if True will quote numbers that are strings ...
[ "This", "will", "return", "a", "simple", "str", "table", ".", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "keys", ":", "list", "of", "str", "of", "the", "order", "of", "keys", "to", "use", ":", "pa...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L592-L617
train
This will return a simple str table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_psql
def obj_to_psql(self, file_path=None, deliminator=' | ', tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a str of a psql table. :param file_path: str of the path to the file :param deliminator: str of the bar separating columns ...
python
def obj_to_psql(self, file_path=None, deliminator=' | ', tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a str of a psql table. :param file_path: str of the path to the file :param deliminator: str of the bar separating columns ...
[ "def", "obj_to_psql", "(", "self", ",", "file_path", "=", "None", ",", "deliminator", "=", "' | '", ",", "tab", "=", "None", ",", "quote_numbers", "=", "True", ",", "quote_empty_str", "=", "False", ")", ":", "tab", "=", "self", ".", "tab", "if", "tab",...
This will return a str of a psql table. :param file_path: str of the path to the file :param deliminator: str of the bar separating columns :param keys: list of str of the order of keys to use :param tab: string of offset of the table :param quote...
[ "This", "will", "return", "a", "str", "of", "a", "psql", "table", ".", ":", "param", "file_path", ":", "str", "of", "the", "path", "to", "the", "file", ":", "param", "deliminator", ":", "str", "of", "the", "bar", "separating", "columns", ":", "param", ...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L645-L678
train
This will return a string of a psql table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_json
def obj_to_json(self, file_path=None, indent=2, sort_keys=False, quote_numbers=True): """ This will return a str of a json list. :param file_path: path to data file, defaults to self's contents if left alone :param indent: i...
python
def obj_to_json(self, file_path=None, indent=2, sort_keys=False, quote_numbers=True): """ This will return a str of a json list. :param file_path: path to data file, defaults to self's contents if left alone :param indent: i...
[ "def", "obj_to_json", "(", "self", ",", "file_path", "=", "None", ",", "indent", "=", "2", ",", "sort_keys", "=", "False", ",", "quote_numbers", "=", "True", ")", ":", "data", "=", "[", "row", ".", "obj_to_ordered_dict", "(", "self", ".", "columns", ")...
This will return a str of a json list. :param file_path: path to data file, defaults to self's contents if left alone :param indent: int if set to 2 will indent to spaces and include line breaks. :param sort_keys: so...
[ "This", "will", "return", "a", "str", "of", "a", "json", "list", ".", ":", "param", "file_path", ":", "path", "to", "data", "file", "defaults", "to", "self", "s", "contents", "if", "left", "alone", ":", "param", "indent", ":", "int", "if", "set", "to...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L680-L704
train
This will return a json list of the relevant data.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_grid
def obj_to_grid(self, file_path=None, delim=None, tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a str of a grid table. :param file_path: path to data file, defaults to self's contents if left alone :pa...
python
def obj_to_grid(self, file_path=None, delim=None, tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a str of a grid table. :param file_path: path to data file, defaults to self's contents if left alone :pa...
[ "def", "obj_to_grid", "(", "self", ",", "file_path", "=", "None", ",", "delim", "=", "None", ",", "tab", "=", "None", ",", "quote_numbers", "=", "True", ",", "quote_empty_str", "=", "False", ")", ":", "div_delims", "=", "{", "\"top\"", ":", "[", "'top ...
This will return a str of a grid table. :param file_path: path to data file, defaults to self's contents if left alone :param delim: dict of deliminators, defaults to obj_to_str's method: :param tab: stri...
[ "This", "will", "return", "a", "str", "of", "a", "grid", "table", ".", ":", "param", "file_path", ":", "path", "to", "data", "file", "defaults", "to", "self", "s", "contents", "if", "left", "alone", ":", "param", "delim", ":", "dict", "of", "deliminato...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L706-L761
train
This method will return a string representing the relevant data in a table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_csv
def obj_to_csv(self, file_path=None, quote_everything=False, space_columns=True, quote_numbers=True): """ This will return a str of a csv text that is friendly to excel :param file_path: str to the path :param quote_everything: bool if True will quote everything...
python
def obj_to_csv(self, file_path=None, quote_everything=False, space_columns=True, quote_numbers=True): """ This will return a str of a csv text that is friendly to excel :param file_path: str to the path :param quote_everything: bool if True will quote everything...
[ "def", "obj_to_csv", "(", "self", ",", "file_path", "=", "None", ",", "quote_everything", "=", "False", ",", "space_columns", "=", "True", ",", "quote_numbers", "=", "True", ")", ":", "list_of_list", ",", "column_widths", "=", "self", ".", "get_data_and_shared...
This will return a str of a csv text that is friendly to excel :param file_path: str to the path :param quote_everything: bool if True will quote everything if it needs it or not, this is so it looks pretty in excel. :param quote_numbers: bool if True w...
[ "This", "will", "return", "a", "str", "of", "a", "csv", "text", "that", "is", "friendly", "to", "excel", ":", "param", "file_path", ":", "str", "to", "the", "path", ":", "param", "quote_everything", ":", "bool", "if", "True", "will", "quote", "everything...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L763-L793
train
This will return a str of a csv text that is friendly to excel
SeabornGames/Table
seaborn_table/table.py
SeabornTable.obj_to_html
def obj_to_html(self, file_path=None, tab='', border=1, cell_padding=5, cell_spacing=1, border_color='black', align='center', row_span=None, quote_numbers=True, quote_empty_str=False): """ This will return a str of an html table. :param file_path: st...
python
def obj_to_html(self, file_path=None, tab='', border=1, cell_padding=5, cell_spacing=1, border_color='black', align='center', row_span=None, quote_numbers=True, quote_empty_str=False): """ This will return a str of an html table. :param file_path: st...
[ "def", "obj_to_html", "(", "self", ",", "file_path", "=", "None", ",", "tab", "=", "''", ",", "border", "=", "1", ",", "cell_padding", "=", "5", ",", "cell_spacing", "=", "1", ",", "border_color", "=", "'black'", ",", "align", "=", "'center'", ",", "...
This will return a str of an html table. :param file_path: str for path to the file :param tab: str to insert before each line e.g. ' ' :param border: int of the thickness of the table lines :param cell_padding: int of the padding for the cells :p...
[ "This", "will", "return", "a", "str", "of", "an", "html", "table", ".", ":", "param", "file_path", ":", "str", "for", "path", "to", "the", "file", ":", "param", "tab", ":", "str", "to", "insert", "before", "each", "line", "e", ".", "g", ".", ":", ...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L795-L832
train
This function will return a html table of the object that is in the format of the object.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.share_column_widths
def share_column_widths(self, tables, shared_limit=None): """ To have this table use sync with the columns in tables Note, this will need to be called on the other tables to be fully synced. :param tables: list of SeabornTables to share column widths :param sh...
python
def share_column_widths(self, tables, shared_limit=None): """ To have this table use sync with the columns in tables Note, this will need to be called on the other tables to be fully synced. :param tables: list of SeabornTables to share column widths :param sh...
[ "def", "share_column_widths", "(", "self", ",", "tables", ",", "shared_limit", "=", "None", ")", ":", "for", "table", "in", "tables", ":", "record", "=", "(", "table", ",", "shared_limit", ")", "if", "not", "record", "in", "self", ".", "shared_tables", "...
To have this table use sync with the columns in tables Note, this will need to be called on the other tables to be fully synced. :param tables: list of SeabornTables to share column widths :param shared_limit: int if diff is greater than this than ignore it. :return: None
[ "To", "have", "this", "table", "use", "sync", "with", "the", "columns", "in", "tables", "Note", "this", "will", "need", "to", "be", "called", "on", "the", "other", "tables", "to", "be", "fully", "synced", ".", ":", "param", "tables", ":", "list", "of",...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L855-L867
train
Share column widths of Seaborn tables with this table
SeabornGames/Table
seaborn_table/table.py
SeabornTable.key_on
def key_on(self, value): """ :param value: str of which column to key the rows on like a dictionary :return: None """ if isinstance(value, BASESTRING): value = (value,) self._key_on = value
python
def key_on(self, value): """ :param value: str of which column to key the rows on like a dictionary :return: None """ if isinstance(value, BASESTRING): value = (value,) self._key_on = value
[ "def", "key_on", "(", "self", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "BASESTRING", ")", ":", "value", "=", "(", "value", ",", ")", "self", ".", "_key_on", "=", "value" ]
:param value: str of which column to key the rows on like a dictionary :return: None
[ ":", "param", "value", ":", "str", "of", "which", "column", "to", "key", "the", "rows", "on", "like", "a", "dictionary", ":", "return", ":", "None" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L920-L927
train
Sets the value of the _key_on attribute of the object.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.map
def map(self, func): """ This will replace every cell in the function with func(cell) :param func: func to call :return: None """ for row in self.table: for i, cell in enumerate(row): row[i] = func(cell)
python
def map(self, func): """ This will replace every cell in the function with func(cell) :param func: func to call :return: None """ for row in self.table: for i, cell in enumerate(row): row[i] = func(cell)
[ "def", "map", "(", "self", ",", "func", ")", ":", "for", "row", "in", "self", ".", "table", ":", "for", "i", ",", "cell", "in", "enumerate", "(", "row", ")", ":", "row", "[", "i", "]", "=", "func", "(", "cell", ")" ]
This will replace every cell in the function with func(cell) :param func: func to call :return: None
[ "This", "will", "replace", "every", "cell", "in", "the", "function", "with", "func", "(", "cell", ")", ":", "param", "func", ":", "func", "to", "call", ":", "return", ":", "None" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L933-L941
train
This will replace every cell in the function with func ( cell )
SeabornGames/Table
seaborn_table/table.py
SeabornTable.naming_convention_columns
def naming_convention_columns(self, convention='underscore', remove_empty=True): """ This will change the column names to a particular naming convention. underscore: lower case all letters and replaces spaces with _ title: uppercase first letter ...
python
def naming_convention_columns(self, convention='underscore', remove_empty=True): """ This will change the column names to a particular naming convention. underscore: lower case all letters and replaces spaces with _ title: uppercase first letter ...
[ "def", "naming_convention_columns", "(", "self", ",", "convention", "=", "'underscore'", ",", "remove_empty", "=", "True", ")", ":", "converter", "=", "getattr", "(", "self", ",", "'_%s_column'", "%", "convention", ",", "None", ")", "assert", "converter", "is"...
This will change the column names to a particular naming convention. underscore: lower case all letters and replaces spaces with _ title: uppercase first letter and replaces _ with spaces :param convention: str enum of "lowercase_underscore" :param remove_empty: bool if true will...
[ "This", "will", "change", "the", "column", "names", "to", "a", "particular", "naming", "convention", ".", "underscore", ":", "lower", "case", "all", "letters", "and", "replaces", "spaces", "with", "_", "title", ":", "uppercase", "first", "letter", "and", "re...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L963-L979
train
This will change the column names to a particular naming convention.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.remove_column
def remove_column(self, key): """ :param key: str of the column to remove from every row in the table :return: None """ if isinstance(key, int): index = key key = self.row_columns[key] else: index = self._column_index[key] for r...
python
def remove_column(self, key): """ :param key: str of the column to remove from every row in the table :return: None """ if isinstance(key, int): index = key key = self.row_columns[key] else: index = self._column_index[key] for r...
[ "def", "remove_column", "(", "self", ",", "key", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "index", "=", "key", "key", "=", "self", ".", "row_columns", "[", "key", "]", "else", ":", "index", "=", "self", ".", "_column_index", ...
:param key: str of the column to remove from every row in the table :return: None
[ ":", "param", "key", ":", "str", "of", "the", "column", "to", "remove", "from", "every", "row", "in", "the", "table", ":", "return", ":", "None" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L981-L995
train
Removes the column with the given key from every row in the table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.filter_by
def filter_by(self, **kwargs): """ :param kwargs: dict of column == value :return: SeabornTable """ ret = self.__class__( columns=self.columns, row_columns=self.row_columns, tab=self.tab, key_on=self.key_on) for row in self: if False no...
python
def filter_by(self, **kwargs): """ :param kwargs: dict of column == value :return: SeabornTable """ ret = self.__class__( columns=self.columns, row_columns=self.row_columns, tab=self.tab, key_on=self.key_on) for row in self: if False no...
[ "def", "filter_by", "(", "self", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "self", ".", "__class__", "(", "columns", "=", "self", ".", "columns", ",", "row_columns", "=", "self", ".", "row_columns", ",", "tab", "=", "self", ".", "tab", ",", "k...
:param kwargs: dict of column == value :return: SeabornTable
[ ":", "param", "kwargs", ":", "dict", "of", "column", "==", "value", ":", "return", ":", "SeabornTable" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L997-L1008
train
Returns a new SeabornTable with only the rows that match the given kwargs.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.filter
def filter(self, column, condition='!=', value=None): """ :param column: str or index of the column :param condition: str of the python operator :param value: obj of the value to test for :return: SeabornTable """ ret = self.__class__( columns=self.col...
python
def filter(self, column, condition='!=', value=None): """ :param column: str or index of the column :param condition: str of the python operator :param value: obj of the value to test for :return: SeabornTable """ ret = self.__class__( columns=self.col...
[ "def", "filter", "(", "self", ",", "column", ",", "condition", "=", "'!='", ",", "value", "=", "None", ")", ":", "ret", "=", "self", ".", "__class__", "(", "columns", "=", "self", ".", "columns", ",", "row_columns", "=", "self", ".", "row_columns", "...
:param column: str or index of the column :param condition: str of the python operator :param value: obj of the value to test for :return: SeabornTable
[ ":", "param", "column", ":", "str", "or", "index", "of", "the", "column", ":", "param", "condition", ":", "str", "of", "the", "python", "operator", ":", "param", "value", ":", "obj", "of", "the", "value", "to", "test", "for", ":", "return", ":", "Sea...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1010-L1026
train
Returns a new SeabornTable with only the rows that match the condition and the value.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.append
def append(self, row=None): """ This will add a row to the table :param row: obj, list, or dictionary :return: SeabornRow that was added to the table """ self.table.append(self._normalize_row(row)) return self.table[-1]
python
def append(self, row=None): """ This will add a row to the table :param row: obj, list, or dictionary :return: SeabornRow that was added to the table """ self.table.append(self._normalize_row(row)) return self.table[-1]
[ "def", "append", "(", "self", ",", "row", "=", "None", ")", ":", "self", ".", "table", ".", "append", "(", "self", ".", "_normalize_row", "(", "row", ")", ")", "return", "self", ".", "table", "[", "-", "1", "]" ]
This will add a row to the table :param row: obj, list, or dictionary :return: SeabornRow that was added to the table
[ "This", "will", "add", "a", "row", "to", "the", "table", ":", "param", "row", ":", "obj", "list", "or", "dictionary", ":", "return", ":", "SeabornRow", "that", "was", "added", "to", "the", "table" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1028-L1035
train
This will add a row to the table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.pertibate_to_obj
def pertibate_to_obj(cls, columns, pertibate_values, generated_columns=None, filter_func=None, max_size=None, deliminator=None, tab=None): """ This will create and add rows to the table by pertibating the parameters for the provided colum...
python
def pertibate_to_obj(cls, columns, pertibate_values, generated_columns=None, filter_func=None, max_size=None, deliminator=None, tab=None): """ This will create and add rows to the table by pertibating the parameters for the provided colum...
[ "def", "pertibate_to_obj", "(", "cls", ",", "columns", ",", "pertibate_values", ",", "generated_columns", "=", "None", ",", "filter_func", "=", "None", ",", "max_size", "=", "None", ",", "deliminator", "=", "None", ",", "tab", "=", "None", ")", ":", "table...
This will create and add rows to the table by pertibating the parameters for the provided columns :param columns: list of str of columns in the table :param pertibate_values: dict of {'column': [values]} :param generated_columns: dict of {'column': func} :param filter_func: f...
[ "This", "will", "create", "and", "add", "rows", "to", "the", "table", "by", "pertibating", "the", "parameters", "for", "the", "provided", "columns", ":", "param", "columns", ":", "list", "of", "str", "of", "columns", "in", "the", "table", ":", "param", "...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1042-L1061
train
This will create and add rows to the Seaborn table by pertibating the pertibate_values dictionary of values for the columns in the Seaborn table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.pertibate
def pertibate(self, pertibate_columns=None, filter_func=None, max_size=1000): """ :param pertibate_columns: list of str fo columns to pertibate see DOE :param filter_func: func that takes a SeabornRow and return True if this row should be exist ...
python
def pertibate(self, pertibate_columns=None, filter_func=None, max_size=1000): """ :param pertibate_columns: list of str fo columns to pertibate see DOE :param filter_func: func that takes a SeabornRow and return True if this row should be exist ...
[ "def", "pertibate", "(", "self", ",", "pertibate_columns", "=", "None", ",", "filter_func", "=", "None", ",", "max_size", "=", "1000", ")", ":", "pertibate_columns", "=", "pertibate_columns", "or", "self", ".", "columns", "for", "c", "in", "pertibate_columns",...
:param pertibate_columns: list of str fo columns to pertibate see DOE :param filter_func: func that takes a SeabornRow and return True if this row should be exist :param max_size: int of the max number of rows to try but some may be filtered out ...
[ ":", "param", "pertibate_columns", ":", "list", "of", "str", "fo", "columns", "to", "pertibate", "see", "DOE", ":", "param", "filter_func", ":", "func", "that", "takes", "a", "SeabornRow", "and", "return", "True", "if", "this", "row", "should", "be", "exis...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1063-L1096
train
Pertibate the Seaborn table.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.pop_empty_columns
def pop_empty_columns(self, empty=None): """ This will pop columns from the printed columns if they only contain '' or None :param empty: list of values to treat as empty """ empty = ['', None] if empty is None else empty if len(self) == 0: ret...
python
def pop_empty_columns(self, empty=None): """ This will pop columns from the printed columns if they only contain '' or None :param empty: list of values to treat as empty """ empty = ['', None] if empty is None else empty if len(self) == 0: ret...
[ "def", "pop_empty_columns", "(", "self", ",", "empty", "=", "None", ")", ":", "empty", "=", "[", "''", ",", "None", "]", "if", "empty", "is", "None", "else", "empty", "if", "len", "(", "self", ")", "==", "0", ":", "return", "for", "col", "in", "l...
This will pop columns from the printed columns if they only contain '' or None :param empty: list of values to treat as empty
[ "This", "will", "pop", "columns", "from", "the", "printed", "columns", "if", "they", "only", "contain", "or", "None", ":", "param", "empty", ":", "list", "of", "values", "to", "treat", "as", "empty" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1280-L1292
train
This will pop columns from the printed columns if they only contain '' or None
SeabornGames/Table
seaborn_table/table.py
SeabornTable.insert
def insert(self, index, column, default_value='', values=None, compute_value_func=None, compute_key=None): """ This will insert a new column at index and then set the value unless compute_value is provided :param index: int index of where to insert the column ...
python
def insert(self, index, column, default_value='', values=None, compute_value_func=None, compute_key=None): """ This will insert a new column at index and then set the value unless compute_value is provided :param index: int index of where to insert the column ...
[ "def", "insert", "(", "self", ",", "index", ",", "column", ",", "default_value", "=", "''", ",", "values", "=", "None", ",", "compute_value_func", "=", "None", ",", "compute_key", "=", "None", ")", ":", "for", "row", "in", "self", ".", "table", ":", ...
This will insert a new column at index and then set the value unless compute_value is provided :param index: int index of where to insert the column :param column: str of the name of the column :param default_value: obj of the default value :param values: obj of the column va...
[ "This", "will", "insert", "a", "new", "column", "at", "index", "and", "then", "set", "the", "value", "unless", "compute_value", "is", "provided", ":", "param", "index", ":", "int", "index", "of", "where", "to", "insert", "the", "column", ":", "param", "c...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1330-L1365
train
This will insert a new column at index and then set the value
SeabornGames/Table
seaborn_table/table.py
SeabornTable.sort_by_key
def sort_by_key(self, keys=None): """ :param keys: list of str to sort by, if name starts with - reverse order :return: None """ keys = keys or self.key_on keys = keys if isinstance(keys, (list, tuple)) else [keys] for key in reversed(keys): ...
python
def sort_by_key(self, keys=None): """ :param keys: list of str to sort by, if name starts with - reverse order :return: None """ keys = keys or self.key_on keys = keys if isinstance(keys, (list, tuple)) else [keys] for key in reversed(keys): ...
[ "def", "sort_by_key", "(", "self", ",", "keys", "=", "None", ")", ":", "keys", "=", "keys", "or", "self", ".", "key_on", "keys", "=", "keys", "if", "isinstance", "(", "keys", ",", "(", "list", ",", "tuple", ")", ")", "else", "[", "keys", "]", "fo...
:param keys: list of str to sort by, if name starts with - reverse order :return: None
[ ":", "param", "keys", ":", "list", "of", "str", "to", "sort", "by", "if", "name", "starts", "with", "-", "reverse", "order", ":", "return", ":", "None" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1371-L1381
train
Sort the table by the given keys.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.get_data_and_column_widths
def get_data_and_column_widths(self, data_kwargs, width_kwargs): """ :param data_kwargs: kwargs used for converting data to strings :param width_kwargs: kwargs used for determining column widths :return: tuple(list of list of strings, list of int) """ data_kwargs = data_...
python
def get_data_and_column_widths(self, data_kwargs, width_kwargs): """ :param data_kwargs: kwargs used for converting data to strings :param width_kwargs: kwargs used for determining column widths :return: tuple(list of list of strings, list of int) """ data_kwargs = data_...
[ "def", "get_data_and_column_widths", "(", "self", ",", "data_kwargs", ",", "width_kwargs", ")", ":", "data_kwargs", "=", "data_kwargs", ".", "copy", "(", ")", "safe_str", "=", "data_kwargs", ".", "pop", "(", "'safe_str'", ",", "self", ".", "_safe_str", ")", ...
:param data_kwargs: kwargs used for converting data to strings :param width_kwargs: kwargs used for determining column widths :return: tuple(list of list of strings, list of int)
[ ":", "param", "data_kwargs", ":", "kwargs", "used", "for", "converting", "data", "to", "strings", ":", "param", "width_kwargs", ":", "kwargs", "used", "for", "determining", "column", "widths", ":", "return", ":", "tuple", "(", "list", "of", "list", "of", "...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1409-L1422
train
Returns a tuple of data and column widths for the current locale.
SeabornGames/Table
seaborn_table/table.py
SeabornTable.get_data_and_shared_column_widths
def get_data_and_shared_column_widths(self, data_kwargs, width_kwargs): """ :param data_kwargs: kwargs used for converting data to strings :param width_kwargs: kwargs used for determining column widths :return: tuple(list of list of strings, list of int) """ list_of_list...
python
def get_data_and_shared_column_widths(self, data_kwargs, width_kwargs): """ :param data_kwargs: kwargs used for converting data to strings :param width_kwargs: kwargs used for determining column widths :return: tuple(list of list of strings, list of int) """ list_of_list...
[ "def", "get_data_and_shared_column_widths", "(", "self", ",", "data_kwargs", ",", "width_kwargs", ")", ":", "list_of_list", ",", "column_widths", "=", "self", ".", "get_data_and_column_widths", "(", "data_kwargs", ",", "width_kwargs", ")", "for", "table", ",", "shar...
:param data_kwargs: kwargs used for converting data to strings :param width_kwargs: kwargs used for determining column widths :return: tuple(list of list of strings, list of int)
[ ":", "param", "data_kwargs", ":", "kwargs", "used", "for", "converting", "data", "to", "strings", ":", "param", "width_kwargs", ":", "kwargs", "used", "for", "determining", "column", "widths", ":", "return", ":", "tuple", "(", "list", "of", "list", "of", "...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1425-L1440
train
This method returns a list of lists of strings and column widths for the current session.
SeabornGames/Table
seaborn_table/table.py
SeabornTable._safe_str
def _safe_str(cls, cell, quote_numbers=True, repr_line_break=False, deliminator=None, quote_empty_str=False, title_columns=False, _is_header=False): """ :param cell: obj to turn in to a string :param quote_numbers: bool if True will quote numbers that are str...
python
def _safe_str(cls, cell, quote_numbers=True, repr_line_break=False, deliminator=None, quote_empty_str=False, title_columns=False, _is_header=False): """ :param cell: obj to turn in to a string :param quote_numbers: bool if True will quote numbers that are str...
[ "def", "_safe_str", "(", "cls", ",", "cell", ",", "quote_numbers", "=", "True", ",", "repr_line_break", "=", "False", ",", "deliminator", "=", "None", ",", "quote_empty_str", "=", "False", ",", "title_columns", "=", "False", ",", "_is_header", "=", "False", ...
:param cell: obj to turn in to a string :param quote_numbers: bool if True will quote numbers that are strings :param repr_line_break: if True will replace \n with \\n :param deliminator: if the deliminator is in the cell it will be quoted :param quote_empty_str: bool if True will quote...
[ ":", "param", "cell", ":", "obj", "to", "turn", "in", "to", "a", "string", ":", "param", "quote_numbers", ":", "bool", "if", "True", "will", "quote", "numbers", "that", "are", "strings", ":", "param", "repr_line_break", ":", "if", "True", "will", "replac...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1443-L1470
train
Convert a string to a unicode string.
SeabornGames/Table
seaborn_table/table.py
SeabornTable._excel_cell
def _excel_cell(cls, cell, quote_everything=False, quote_numbers=True, _is_header=False): """ This will return a text that excel interprets correctly when importing csv :param cell: obj to store in the cell :param quote_everything: bool to quote ev...
python
def _excel_cell(cls, cell, quote_everything=False, quote_numbers=True, _is_header=False): """ This will return a text that excel interprets correctly when importing csv :param cell: obj to store in the cell :param quote_everything: bool to quote ev...
[ "def", "_excel_cell", "(", "cls", ",", "cell", ",", "quote_everything", "=", "False", ",", "quote_numbers", "=", "True", ",", "_is_header", "=", "False", ")", ":", "if", "cell", "is", "None", ":", "return", "u''", "if", "cell", "is", "True", ":", "retu...
This will return a text that excel interprets correctly when importing csv :param cell: obj to store in the cell :param quote_everything: bool to quote even if not necessary :param quote_numbers: bool if True will quote numbers that are str...
[ "This", "will", "return", "a", "text", "that", "excel", "interprets", "correctly", "when", "importing", "csv", ":", "param", "cell", ":", "obj", "to", "store", "in", "the", "cell", ":", "param", "quote_everything", ":", "bool", "to", "quote", "even", "if",...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1473-L1510
train
This function returns a string that excel interprets correctly when we import the log file.
SeabornGames/Table
seaborn_table/table.py
SeabornTable._get_normalized_columns
def _get_normalized_columns(cls, list_): """ :param list_: list of dict :return: list of string of every key in all the dictionaries """ ret = [] for row in list_: if len(row.keys()) > len(ret): ret = cls._ordered_keys(row) for row in ...
python
def _get_normalized_columns(cls, list_): """ :param list_: list of dict :return: list of string of every key in all the dictionaries """ ret = [] for row in list_: if len(row.keys()) > len(ret): ret = cls._ordered_keys(row) for row in ...
[ "def", "_get_normalized_columns", "(", "cls", ",", "list_", ")", ":", "ret", "=", "[", "]", "for", "row", "in", "list_", ":", "if", "len", "(", "row", ".", "keys", "(", ")", ")", ">", "len", "(", "ret", ")", ":", "ret", "=", "cls", ".", "_order...
:param list_: list of dict :return: list of string of every key in all the dictionaries
[ ":", "param", "list_", ":", "list", "of", "dict", ":", "return", ":", "list", "of", "string", "of", "every", "key", "in", "all", "the", "dictionaries" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1550-L1566
train
returns a list of all the columns that are not in the list
SeabornGames/Table
seaborn_table/table.py
SeabornTable._ordered_keys
def _ordered_keys(dict_): """ :param dict_: dict of OrderedDict to be processed :return: list of str of keys in the original order or in alphabetical order """ return isinstance(dict_, OrderedDict) and dict_.keys() or \ dict_ and sorted(dict_.keys()) or...
python
def _ordered_keys(dict_): """ :param dict_: dict of OrderedDict to be processed :return: list of str of keys in the original order or in alphabetical order """ return isinstance(dict_, OrderedDict) and dict_.keys() or \ dict_ and sorted(dict_.keys()) or...
[ "def", "_ordered_keys", "(", "dict_", ")", ":", "return", "isinstance", "(", "dict_", ",", "OrderedDict", ")", "and", "dict_", ".", "keys", "(", ")", "or", "dict_", "and", "sorted", "(", "dict_", ".", "keys", "(", ")", ")", "or", "[", "]" ]
:param dict_: dict of OrderedDict to be processed :return: list of str of keys in the original order or in alphabetical order
[ ":", "param", "dict_", ":", "dict", "of", "OrderedDict", "to", "be", "processed", ":", "return", ":", "list", "of", "str", "of", "keys", "in", "the", "original", "order", "or", "in", "alphabetical", "order" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1569-L1576
train
Returns a list of str of keys in the original order or in alphabetical order
SeabornGames/Table
seaborn_table/table.py
SeabornTable._key_on_columns
def _key_on_columns(key_on, columns): """ :param key_on: str of column :param columns: list of str of columns :return: list of str with the key_on in the front of the list """ if key_on is not None: if key_on in columns: columns.remove(key_on) ...
python
def _key_on_columns(key_on, columns): """ :param key_on: str of column :param columns: list of str of columns :return: list of str with the key_on in the front of the list """ if key_on is not None: if key_on in columns: columns.remove(key_on) ...
[ "def", "_key_on_columns", "(", "key_on", ",", "columns", ")", ":", "if", "key_on", "is", "not", "None", ":", "if", "key_on", "in", "columns", ":", "columns", ".", "remove", "(", "key_on", ")", "columns", "=", "[", "key_on", "]", "+", "columns", "return...
:param key_on: str of column :param columns: list of str of columns :return: list of str with the key_on in the front of the list
[ ":", "param", "key_on", ":", "str", "of", "column", ":", "param", "columns", ":", "list", "of", "str", "of", "columns", ":", "return", ":", "list", "of", "str", "with", "the", "key_on", "in", "the", "front", "of", "the", "list" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1579-L1589
train
Return a list of columns where the key_on is in the front of the list.
SeabornGames/Table
seaborn_table/table.py
SeabornTable._index_iterator
def _index_iterator(column_size, max_size, mix_index=False): """ This will iterate over the indexes and return a list of indexes :param column_size: list of int of the size of each list :param max_size: int of the max number of iterations :param mix_index: bool if True will g...
python
def _index_iterator(column_size, max_size, mix_index=False): """ This will iterate over the indexes and return a list of indexes :param column_size: list of int of the size of each list :param max_size: int of the max number of iterations :param mix_index: bool if True will g...
[ "def", "_index_iterator", "(", "column_size", ",", "max_size", ",", "mix_index", "=", "False", ")", ":", "# todo implement a proper partial factorial design", "indexes", "=", "[", "0", "]", "*", "len", "(", "column_size", ")", "index_order", "=", "[", "0", "]", ...
This will iterate over the indexes and return a list of indexes :param column_size: list of int of the size of each list :param max_size: int of the max number of iterations :param mix_index: bool if True will go first then last then middle :return: list of int of indexes
[ "This", "will", "iterate", "over", "the", "indexes", "and", "return", "a", "list", "of", "indexes", ":", "param", "column_size", ":", "list", "of", "int", "of", "the", "size", "of", "each", "list", ":", "param", "max_size", ":", "int", "of", "the", "ma...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1600-L1631
train
This will iterate over the indexes and return a list of indexes that are in the given column size.
SeabornGames/Table
seaborn_table/table.py
SeabornTable._html_link_cells
def _html_link_cells(self): """ This will return a new table with cell linked with their columns that have <Link> in the name :return: """ new_table = self.copy() for row in new_table: for c in new_table.columns: link = '%s <Link>' % c ...
python
def _html_link_cells(self): """ This will return a new table with cell linked with their columns that have <Link> in the name :return: """ new_table = self.copy() for row in new_table: for c in new_table.columns: link = '%s <Link>' % c ...
[ "def", "_html_link_cells", "(", "self", ")", ":", "new_table", "=", "self", ".", "copy", "(", ")", "for", "row", "in", "new_table", ":", "for", "c", "in", "new_table", ".", "columns", ":", "link", "=", "'%s <Link>'", "%", "c", "if", "row", ".", "get"...
This will return a new table with cell linked with their columns that have <Link> in the name :return:
[ "This", "will", "return", "a", "new", "table", "with", "cell", "linked", "with", "their", "columns", "that", "have", "<Link", ">", "in", "the", "name", ":", "return", ":" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1659-L1673
train
This will return a new table with the columns that have <Link > in the name
SeabornGames/Table
seaborn_table/table.py
SeabornTable._column_width
def _column_width(self, index=None, name=None, max_width=300, **kwargs): """ :param index: int of the column index :param name: str of the name of the column :param max_width: int of the max size of characters in the width :return: int of the width of this column """ ...
python
def _column_width(self, index=None, name=None, max_width=300, **kwargs): """ :param index: int of the column index :param name: str of the name of the column :param max_width: int of the max size of characters in the width :return: int of the width of this column """ ...
[ "def", "_column_width", "(", "self", ",", "index", "=", "None", ",", "name", "=", "None", ",", "max_width", "=", "300", ",", "*", "*", "kwargs", ")", ":", "assert", "name", "is", "not", "None", "or", "index", "is", "not", "None", "if", "name", "and...
:param index: int of the column index :param name: str of the name of the column :param max_width: int of the max size of characters in the width :return: int of the width of this column
[ ":", "param", "index", ":", "int", "of", "the", "column", "index", ":", "param", "name", ":", "str", "of", "the", "name", "of", "the", "column", ":", "param", "max_width", ":", "int", "of", "the", "max", "size", "of", "characters", "in", "the", "widt...
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1709-L1734
train
Returns the width of the column.
SeabornGames/Table
seaborn_table/table.py
SeabornRow.update
def update(self, dict_): """ This will update the row values if the columns exist :param dict_: dict of values to update :return: None """ for key, value in dict_.items(): index = self.column_index.get(key, None) if index is not None: ...
python
def update(self, dict_): """ This will update the row values if the columns exist :param dict_: dict of values to update :return: None """ for key, value in dict_.items(): index = self.column_index.get(key, None) if index is not None: ...
[ "def", "update", "(", "self", ",", "dict_", ")", ":", "for", "key", ",", "value", "in", "dict_", ".", "items", "(", ")", ":", "index", "=", "self", ".", "column_index", ".", "get", "(", "key", ",", "None", ")", "if", "index", "is", "not", "None",...
This will update the row values if the columns exist :param dict_: dict of values to update :return: None
[ "This", "will", "update", "the", "row", "values", "if", "the", "columns", "exist", ":", "param", "dict_", ":", "dict", "of", "values", "to", "update", ":", "return", ":", "None" ]
0c474ef2fb00db0e7cf47e8af91e3556c2e7485a
https://github.com/SeabornGames/Table/blob/0c474ef2fb00db0e7cf47e8af91e3556c2e7485a/seaborn_table/table.py#L1795-L1804
train
This will update the row values if the columns exist in the dict_.
rfverbruggen/rachiopy
rachiopy/device.py
Device.get
def get(self, dev_id): """Retrieve the information for a device entity.""" path = '/'.join(['device', dev_id]) return self.rachio.get(path)
python
def get(self, dev_id): """Retrieve the information for a device entity.""" path = '/'.join(['device', dev_id]) return self.rachio.get(path)
[ "def", "get", "(", "self", ",", "dev_id", ")", ":", "path", "=", "'/'", ".", "join", "(", "[", "'device'", ",", "dev_id", "]", ")", "return", "self", ".", "rachio", ".", "get", "(", "path", ")" ]
Retrieve the information for a device entity.
[ "Retrieve", "the", "information", "for", "a", "device", "entity", "." ]
c91abc9984f0f453e60fa905285c1b640c3390ae
https://github.com/rfverbruggen/rachiopy/blob/c91abc9984f0f453e60fa905285c1b640c3390ae/rachiopy/device.py#L11-L14
train
Retrieve the information for a device entity.
rfverbruggen/rachiopy
rachiopy/device.py
Device.getEvent
def getEvent(self, dev_id, starttime, endtime): """Retrieve events for a device entity.""" path = 'device/%s/event?startTime=%s&endTime=%s' % \ (dev_id, starttime, endtime) return self.rachio.get(path)
python
def getEvent(self, dev_id, starttime, endtime): """Retrieve events for a device entity.""" path = 'device/%s/event?startTime=%s&endTime=%s' % \ (dev_id, starttime, endtime) return self.rachio.get(path)
[ "def", "getEvent", "(", "self", ",", "dev_id", ",", "starttime", ",", "endtime", ")", ":", "path", "=", "'device/%s/event?startTime=%s&endTime=%s'", "%", "(", "dev_id", ",", "starttime", ",", "endtime", ")", "return", "self", ".", "rachio", ".", "get", "(", ...
Retrieve events for a device entity.
[ "Retrieve", "events", "for", "a", "device", "entity", "." ]
c91abc9984f0f453e60fa905285c1b640c3390ae
https://github.com/rfverbruggen/rachiopy/blob/c91abc9984f0f453e60fa905285c1b640c3390ae/rachiopy/device.py#L21-L25
train
Retrieve events for a device entity.
rfverbruggen/rachiopy
rachiopy/device.py
Device.getForecast
def getForecast(self, dev_id, units): """Retrieve current and predicted forecast.""" assert units in ['US', 'METRIC'], 'units must be either US or METRIC' path = 'device/%s/forecast?units=%s' % (dev_id, units) return self.rachio.get(path)
python
def getForecast(self, dev_id, units): """Retrieve current and predicted forecast.""" assert units in ['US', 'METRIC'], 'units must be either US or METRIC' path = 'device/%s/forecast?units=%s' % (dev_id, units) return self.rachio.get(path)
[ "def", "getForecast", "(", "self", ",", "dev_id", ",", "units", ")", ":", "assert", "units", "in", "[", "'US'", ",", "'METRIC'", "]", ",", "'units must be either US or METRIC'", "path", "=", "'device/%s/forecast?units=%s'", "%", "(", "dev_id", ",", "units", ")...
Retrieve current and predicted forecast.
[ "Retrieve", "current", "and", "predicted", "forecast", "." ]
c91abc9984f0f453e60fa905285c1b640c3390ae
https://github.com/rfverbruggen/rachiopy/blob/c91abc9984f0f453e60fa905285c1b640c3390ae/rachiopy/device.py#L32-L36
train
Retrieve current and predicted forecast.
rfverbruggen/rachiopy
rachiopy/device.py
Device.stopWater
def stopWater(self, dev_id): """Stop all watering on device.""" path = 'device/stop_water' payload = {'id': dev_id} return self.rachio.put(path, payload)
python
def stopWater(self, dev_id): """Stop all watering on device.""" path = 'device/stop_water' payload = {'id': dev_id} return self.rachio.put(path, payload)
[ "def", "stopWater", "(", "self", ",", "dev_id", ")", ":", "path", "=", "'device/stop_water'", "payload", "=", "{", "'id'", ":", "dev_id", "}", "return", "self", ".", "rachio", ".", "put", "(", "path", ",", "payload", ")" ]
Stop all watering on device.
[ "Stop", "all", "watering", "on", "device", "." ]
c91abc9984f0f453e60fa905285c1b640c3390ae
https://github.com/rfverbruggen/rachiopy/blob/c91abc9984f0f453e60fa905285c1b640c3390ae/rachiopy/device.py#L38-L42
train
Stop all watering on the device.
rfverbruggen/rachiopy
rachiopy/device.py
Device.rainDelay
def rainDelay(self, dev_id, duration): """Rain delay device.""" path = 'device/rain_delay' payload = {'id': dev_id, 'duration': duration} return self.rachio.put(path, payload)
python
def rainDelay(self, dev_id, duration): """Rain delay device.""" path = 'device/rain_delay' payload = {'id': dev_id, 'duration': duration} return self.rachio.put(path, payload)
[ "def", "rainDelay", "(", "self", ",", "dev_id", ",", "duration", ")", ":", "path", "=", "'device/rain_delay'", "payload", "=", "{", "'id'", ":", "dev_id", ",", "'duration'", ":", "duration", "}", "return", "self", ".", "rachio", ".", "put", "(", "path", ...
Rain delay device.
[ "Rain", "delay", "device", "." ]
c91abc9984f0f453e60fa905285c1b640c3390ae
https://github.com/rfverbruggen/rachiopy/blob/c91abc9984f0f453e60fa905285c1b640c3390ae/rachiopy/device.py#L44-L48
train
Rain delay device.
rfverbruggen/rachiopy
rachiopy/device.py
Device.on
def on(self, dev_id): """Turn ON all features of the device. schedules, weather intelligence, water budget, etc. """ path = 'device/on' payload = {'id': dev_id} return self.rachio.put(path, payload)
python
def on(self, dev_id): """Turn ON all features of the device. schedules, weather intelligence, water budget, etc. """ path = 'device/on' payload = {'id': dev_id} return self.rachio.put(path, payload)
[ "def", "on", "(", "self", ",", "dev_id", ")", ":", "path", "=", "'device/on'", "payload", "=", "{", "'id'", ":", "dev_id", "}", "return", "self", ".", "rachio", ".", "put", "(", "path", ",", "payload", ")" ]
Turn ON all features of the device. schedules, weather intelligence, water budget, etc.
[ "Turn", "ON", "all", "features", "of", "the", "device", "." ]
c91abc9984f0f453e60fa905285c1b640c3390ae
https://github.com/rfverbruggen/rachiopy/blob/c91abc9984f0f453e60fa905285c1b640c3390ae/rachiopy/device.py#L50-L57
train
Turn ON all features of the device.
rfverbruggen/rachiopy
rachiopy/device.py
Device.off
def off(self, dev_id): """Turn OFF all features of the device. schedules, weather intelligence, water budget, etc. """ path = 'device/off' payload = {'id': dev_id} return self.rachio.put(path, payload)
python
def off(self, dev_id): """Turn OFF all features of the device. schedules, weather intelligence, water budget, etc. """ path = 'device/off' payload = {'id': dev_id} return self.rachio.put(path, payload)
[ "def", "off", "(", "self", ",", "dev_id", ")", ":", "path", "=", "'device/off'", "payload", "=", "{", "'id'", ":", "dev_id", "}", "return", "self", ".", "rachio", ".", "put", "(", "path", ",", "payload", ")" ]
Turn OFF all features of the device. schedules, weather intelligence, water budget, etc.
[ "Turn", "OFF", "all", "features", "of", "the", "device", "." ]
c91abc9984f0f453e60fa905285c1b640c3390ae
https://github.com/rfverbruggen/rachiopy/blob/c91abc9984f0f453e60fa905285c1b640c3390ae/rachiopy/device.py#L59-L66
train
Turn OFF all features of the device.
F483/btctxstore
btctxstore/api.py
BtcTxStore.create_wallet
def create_wallet(self, master_secret=b""): """Create a BIP0032-style hierarchical wallet. @param: master_secret Create from master secret, otherwise random. """ master_secret = deserialize.bytes_str(master_secret) bip32node = control.create_wallet(self.testnet, ...
python
def create_wallet(self, master_secret=b""): """Create a BIP0032-style hierarchical wallet. @param: master_secret Create from master secret, otherwise random. """ master_secret = deserialize.bytes_str(master_secret) bip32node = control.create_wallet(self.testnet, ...
[ "def", "create_wallet", "(", "self", ",", "master_secret", "=", "b\"\"", ")", ":", "master_secret", "=", "deserialize", ".", "bytes_str", "(", "master_secret", ")", "bip32node", "=", "control", ".", "create_wallet", "(", "self", ".", "testnet", ",", "master_se...
Create a BIP0032-style hierarchical wallet. @param: master_secret Create from master secret, otherwise random.
[ "Create", "a", "BIP0032", "-", "style", "hierarchical", "wallet", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L33-L41
train
Create a BIP0032 - style hierarchical wallet.
F483/btctxstore
btctxstore/api.py
BtcTxStore.create_key
def create_key(self, master_secret=b""): """Create new private key and return in wif format. @param: master_secret Create from master secret, otherwise random. """ master_secret = deserialize.bytes_str(master_secret) bip32node = control.create_wallet(self.testnet, ...
python
def create_key(self, master_secret=b""): """Create new private key and return in wif format. @param: master_secret Create from master secret, otherwise random. """ master_secret = deserialize.bytes_str(master_secret) bip32node = control.create_wallet(self.testnet, ...
[ "def", "create_key", "(", "self", ",", "master_secret", "=", "b\"\"", ")", ":", "master_secret", "=", "deserialize", ".", "bytes_str", "(", "master_secret", ")", "bip32node", "=", "control", ".", "create_wallet", "(", "self", ".", "testnet", ",", "master_secre...
Create new private key and return in wif format. @param: master_secret Create from master secret, otherwise random.
[ "Create", "new", "private", "key", "and", "return", "in", "wif", "format", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L54-L62
train
Create new private key and return in wif format.
F483/btctxstore
btctxstore/api.py
BtcTxStore.create_tx
def create_tx(self, txins=None, txouts=None, lock_time=0): """Create unsigned rawtx with given txins/txouts as json data. <txins>: '[{"txid" : hexdata, "index" : integer}, ...]' <txouts>: '[{"address" : hexdata, "value" : satoshis}, ...]' """ txins = [] if txins is None else txin...
python
def create_tx(self, txins=None, txouts=None, lock_time=0): """Create unsigned rawtx with given txins/txouts as json data. <txins>: '[{"txid" : hexdata, "index" : integer}, ...]' <txouts>: '[{"address" : hexdata, "value" : satoshis}, ...]' """ txins = [] if txins is None else txin...
[ "def", "create_tx", "(", "self", ",", "txins", "=", "None", ",", "txouts", "=", "None", ",", "lock_time", "=", "0", ")", ":", "txins", "=", "[", "]", "if", "txins", "is", "None", "else", "txins", "txouts", "=", "[", "]", "if", "txouts", "is", "No...
Create unsigned rawtx with given txins/txouts as json data. <txins>: '[{"txid" : hexdata, "index" : integer}, ...]' <txouts>: '[{"address" : hexdata, "value" : satoshis}, ...]'
[ "Create", "unsigned", "rawtx", "with", "given", "txins", "/", "txouts", "as", "json", "data", ".", "<txins", ">", ":", "[", "{", "txid", ":", "hexdata", "index", ":", "integer", "}", "...", "]", "<txouts", ">", ":", "[", "{", "address", ":", "hexdata...
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L82-L94
train
Create unsigned rawtx with given txins and txouts as json data.
F483/btctxstore
btctxstore/api.py
BtcTxStore.send
def send(self, wifs, txouts, change_address=None, lock_time=0, fee=10000): """TODO add doc string""" # FIXME test!! rawtx = self.create_tx(txouts=txouts, lock_time=lock_time) rawtx = self.add_inputs(rawtx, wifs, change_address=change_address, fee=fee) ...
python
def send(self, wifs, txouts, change_address=None, lock_time=0, fee=10000): """TODO add doc string""" # FIXME test!! rawtx = self.create_tx(txouts=txouts, lock_time=lock_time) rawtx = self.add_inputs(rawtx, wifs, change_address=change_address, fee=fee) ...
[ "def", "send", "(", "self", ",", "wifs", ",", "txouts", ",", "change_address", "=", "None", ",", "lock_time", "=", "0", ",", "fee", "=", "10000", ")", ":", "# FIXME test!!", "rawtx", "=", "self", ".", "create_tx", "(", "txouts", "=", "txouts", ",", "...
TODO add doc string
[ "TODO", "add", "doc", "string" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L96-L102
train
Send a set of txouts to the blockchain.
F483/btctxstore
btctxstore/api.py
BtcTxStore.add_inputs
def add_inputs(self, rawtx, wifs, change_address=None, fee=10000, dont_sign=False): """Add sufficient inputs from given <wifs> to cover <rawtx> outputs and <fee>. If no <change_address> is given, change will be sent to first wif. """ tx = deserialize.tx(rawtx) ...
python
def add_inputs(self, rawtx, wifs, change_address=None, fee=10000, dont_sign=False): """Add sufficient inputs from given <wifs> to cover <rawtx> outputs and <fee>. If no <change_address> is given, change will be sent to first wif. """ tx = deserialize.tx(rawtx) ...
[ "def", "add_inputs", "(", "self", ",", "rawtx", ",", "wifs", ",", "change_address", "=", "None", ",", "fee", "=", "10000", ",", "dont_sign", "=", "False", ")", ":", "tx", "=", "deserialize", ".", "tx", "(", "rawtx", ")", "keys", "=", "deserialize", "...
Add sufficient inputs from given <wifs> to cover <rawtx> outputs and <fee>. If no <change_address> is given, change will be sent to first wif.
[ "Add", "sufficient", "inputs", "from", "given", "<wifs", ">", "to", "cover", "<rawtx", ">", "outputs", "and", "<fee", ">", ".", "If", "no", "<change_address", ">", "is", "given", "change", "will", "be", "sent", "to", "first", "wif", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L104-L121
train
Add sufficient inputs from given rawtx to cover outputs and fee.
F483/btctxstore
btctxstore/api.py
BtcTxStore.sign_tx
def sign_tx(self, rawtx, wifs): """Sign <rawtx> with given <wifs> as json data. <wifs>: '["privatekey_in_wif_format", ...]' """ tx = deserialize.tx(rawtx) keys = deserialize.keys(self.testnet, wifs) tx = control.sign_tx(self.service, self.testnet, tx, keys) retur...
python
def sign_tx(self, rawtx, wifs): """Sign <rawtx> with given <wifs> as json data. <wifs>: '["privatekey_in_wif_format", ...]' """ tx = deserialize.tx(rawtx) keys = deserialize.keys(self.testnet, wifs) tx = control.sign_tx(self.service, self.testnet, tx, keys) retur...
[ "def", "sign_tx", "(", "self", ",", "rawtx", ",", "wifs", ")", ":", "tx", "=", "deserialize", ".", "tx", "(", "rawtx", ")", "keys", "=", "deserialize", ".", "keys", "(", "self", ".", "testnet", ",", "wifs", ")", "tx", "=", "control", ".", "sign_tx"...
Sign <rawtx> with given <wifs> as json data. <wifs>: '["privatekey_in_wif_format", ...]'
[ "Sign", "<rawtx", ">", "with", "given", "<wifs", ">", "as", "json", "data", ".", "<wifs", ">", ":", "[", "privatekey_in_wif_format", "...", "]" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L123-L130
train
Sign rawtx with given wifs as json data.
F483/btctxstore
btctxstore/api.py
BtcTxStore.retrieve_tx
def retrieve_tx(self, txid): """Returns rawtx for <txid>.""" txid = deserialize.txid(txid) tx = self.service.get_tx(txid) return serialize.tx(tx)
python
def retrieve_tx(self, txid): """Returns rawtx for <txid>.""" txid = deserialize.txid(txid) tx = self.service.get_tx(txid) return serialize.tx(tx)
[ "def", "retrieve_tx", "(", "self", ",", "txid", ")", ":", "txid", "=", "deserialize", ".", "txid", "(", "txid", ")", "tx", "=", "self", ".", "service", ".", "get_tx", "(", "txid", ")", "return", "serialize", ".", "tx", "(", "tx", ")" ]
Returns rawtx for <txid>.
[ "Returns", "rawtx", "for", "<txid", ">", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L136-L140
train
Returns rawtx for txid.
F483/btctxstore
btctxstore/api.py
BtcTxStore.retrieve_utxos
def retrieve_utxos(self, addresses): """Get current utxos for <address>.""" addresses = deserialize.addresses(self.testnet, addresses) spendables = control.retrieve_utxos(self.service, addresses) return serialize.utxos(spendables)
python
def retrieve_utxos(self, addresses): """Get current utxos for <address>.""" addresses = deserialize.addresses(self.testnet, addresses) spendables = control.retrieve_utxos(self.service, addresses) return serialize.utxos(spendables)
[ "def", "retrieve_utxos", "(", "self", ",", "addresses", ")", ":", "addresses", "=", "deserialize", ".", "addresses", "(", "self", ".", "testnet", ",", "addresses", ")", "spendables", "=", "control", ".", "retrieve_utxos", "(", "self", ".", "service", ",", ...
Get current utxos for <address>.
[ "Get", "current", "utxos", "for", "<address", ">", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L142-L146
train
Retrieve current utxos for addresses.
F483/btctxstore
btctxstore/api.py
BtcTxStore.publish
def publish(self, rawtx): """Publish signed <rawtx> to bitcoin network.""" tx = deserialize.signedtx(rawtx) if not self.dryrun: self.service.send_tx(tx) return serialize.txid(tx.hash())
python
def publish(self, rawtx): """Publish signed <rawtx> to bitcoin network.""" tx = deserialize.signedtx(rawtx) if not self.dryrun: self.service.send_tx(tx) return serialize.txid(tx.hash())
[ "def", "publish", "(", "self", ",", "rawtx", ")", ":", "tx", "=", "deserialize", ".", "signedtx", "(", "rawtx", ")", "if", "not", "self", ".", "dryrun", ":", "self", ".", "service", ".", "send_tx", "(", "tx", ")", "return", "serialize", ".", "txid", ...
Publish signed <rawtx> to bitcoin network.
[ "Publish", "signed", "<rawtx", ">", "to", "bitcoin", "network", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L148-L153
train
Publish signed tx to bitcoin network.
F483/btctxstore
btctxstore/api.py
BtcTxStore.sign_data
def sign_data(self, wif, hexdata): """Signing <hexdata> with <wif> private key.""" data = deserialize.binary(hexdata) key = deserialize.key(self.testnet, wif) sigdata = control.sign_data(self.testnet, data, key) return serialize.signature(sigdata)
python
def sign_data(self, wif, hexdata): """Signing <hexdata> with <wif> private key.""" data = deserialize.binary(hexdata) key = deserialize.key(self.testnet, wif) sigdata = control.sign_data(self.testnet, data, key) return serialize.signature(sigdata)
[ "def", "sign_data", "(", "self", ",", "wif", ",", "hexdata", ")", ":", "data", "=", "deserialize", ".", "binary", "(", "hexdata", ")", "key", "=", "deserialize", ".", "key", "(", "self", ".", "testnet", ",", "wif", ")", "sigdata", "=", "control", "."...
Signing <hexdata> with <wif> private key.
[ "Signing", "<hexdata", ">", "with", "<wif", ">", "private", "key", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L159-L164
train
Signs data with private key.
F483/btctxstore
btctxstore/api.py
BtcTxStore.verify_signature
def verify_signature(self, address, signature, hexdata): """Verify <signature> of <hexdata> by <address>.""" try: address = deserialize.address(self.testnet, address) data = deserialize.binary(hexdata) signature = deserialize.signature(signature) return co...
python
def verify_signature(self, address, signature, hexdata): """Verify <signature> of <hexdata> by <address>.""" try: address = deserialize.address(self.testnet, address) data = deserialize.binary(hexdata) signature = deserialize.signature(signature) return co...
[ "def", "verify_signature", "(", "self", ",", "address", ",", "signature", ",", "hexdata", ")", ":", "try", ":", "address", "=", "deserialize", ".", "address", "(", "self", ".", "testnet", ",", "address", ")", "data", "=", "deserialize", ".", "binary", "(...
Verify <signature> of <hexdata> by <address>.
[ "Verify", "<signature", ">", "of", "<hexdata", ">", "by", "<address", ">", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L166-L175
train
Verify the signature of a given hexdata by the specified address.
F483/btctxstore
btctxstore/api.py
BtcTxStore.sign_unicode
def sign_unicode(self, wif, message): """Signing <unicode> with <wif> private key.""" hexdata = binascii.hexlify(message.encode("utf-8")) return self.sign_data(wif, hexdata)
python
def sign_unicode(self, wif, message): """Signing <unicode> with <wif> private key.""" hexdata = binascii.hexlify(message.encode("utf-8")) return self.sign_data(wif, hexdata)
[ "def", "sign_unicode", "(", "self", ",", "wif", ",", "message", ")", ":", "hexdata", "=", "binascii", ".", "hexlify", "(", "message", ".", "encode", "(", "\"utf-8\"", ")", ")", "return", "self", ".", "sign_data", "(", "wif", ",", "hexdata", ")" ]
Signing <unicode> with <wif> private key.
[ "Signing", "<unicode", ">", "with", "<wif", ">", "private", "key", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L177-L180
train
Signs a message with a private key.
F483/btctxstore
btctxstore/api.py
BtcTxStore.verify_signature_unicode
def verify_signature_unicode(self, address, signature, message): """Verify <signature> of <unicode> by <address>.""" hexdata = binascii.hexlify(message.encode("utf-8")) return self.verify_signature(address, signature, hexdata)
python
def verify_signature_unicode(self, address, signature, message): """Verify <signature> of <unicode> by <address>.""" hexdata = binascii.hexlify(message.encode("utf-8")) return self.verify_signature(address, signature, hexdata)
[ "def", "verify_signature_unicode", "(", "self", ",", "address", ",", "signature", ",", "message", ")", ":", "hexdata", "=", "binascii", ".", "hexlify", "(", "message", ".", "encode", "(", "\"utf-8\"", ")", ")", "return", "self", ".", "verify_signature", "(",...
Verify <signature> of <unicode> by <address>.
[ "Verify", "<signature", ">", "of", "<unicode", ">", "by", "<address", ">", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L182-L185
train
Verify the signature of a message by an unicode address.
F483/btctxstore
btctxstore/api.py
BtcTxStore.add_hash160data
def add_hash160data(self, rawtx, hexdata, dust_limit=common.DUST_LIMIT): """Writes <hexdata> as new Pay-to-PubkeyHash output to <rawtx>.""" tx = deserialize.unsignedtx(rawtx) dust_limit = deserialize.positive_integer(dust_limit) hash160data_txout = deserialize.hash160data_txout(hexdata, ...
python
def add_hash160data(self, rawtx, hexdata, dust_limit=common.DUST_LIMIT): """Writes <hexdata> as new Pay-to-PubkeyHash output to <rawtx>.""" tx = deserialize.unsignedtx(rawtx) dust_limit = deserialize.positive_integer(dust_limit) hash160data_txout = deserialize.hash160data_txout(hexdata, ...
[ "def", "add_hash160data", "(", "self", ",", "rawtx", ",", "hexdata", ",", "dust_limit", "=", "common", ".", "DUST_LIMIT", ")", ":", "tx", "=", "deserialize", ".", "unsignedtx", "(", "rawtx", ")", "dust_limit", "=", "deserialize", ".", "positive_integer", "("...
Writes <hexdata> as new Pay-to-PubkeyHash output to <rawtx>.
[ "Writes", "<hexdata", ">", "as", "new", "Pay", "-", "to", "-", "PubkeyHash", "output", "to", "<rawtx", ">", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L191-L197
train
Writes hexdata as new Pay - to - PubkeyHash output to rawtx.
F483/btctxstore
btctxstore/api.py
BtcTxStore.get_hash160data
def get_hash160data(self, rawtx, output_index): """TODO doc string""" tx = deserialize.unsignedtx(rawtx) output_index = deserialize.positive_integer(output_index) data = control.get_hash160_data(tx, output_index) return serialize.data(data)
python
def get_hash160data(self, rawtx, output_index): """TODO doc string""" tx = deserialize.unsignedtx(rawtx) output_index = deserialize.positive_integer(output_index) data = control.get_hash160_data(tx, output_index) return serialize.data(data)
[ "def", "get_hash160data", "(", "self", ",", "rawtx", ",", "output_index", ")", ":", "tx", "=", "deserialize", ".", "unsignedtx", "(", "rawtx", ")", "output_index", "=", "deserialize", ".", "positive_integer", "(", "output_index", ")", "data", "=", "control", ...
TODO doc string
[ "TODO", "doc", "string" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L199-L204
train
Get the data for a hash160 transaction
F483/btctxstore
btctxstore/api.py
BtcTxStore.store_hash160data
def store_hash160data(self, hexdata, wifs, change_address=None, txouts=None, fee=10000, lock_time=0, dust_limit=common.DUST_LIMIT): """TODO doc string""" rawtx = self.create_tx(txouts=txouts, lock_time=lock_time) rawtx = self.add_hash160data(ra...
python
def store_hash160data(self, hexdata, wifs, change_address=None, txouts=None, fee=10000, lock_time=0, dust_limit=common.DUST_LIMIT): """TODO doc string""" rawtx = self.create_tx(txouts=txouts, lock_time=lock_time) rawtx = self.add_hash160data(ra...
[ "def", "store_hash160data", "(", "self", ",", "hexdata", ",", "wifs", ",", "change_address", "=", "None", ",", "txouts", "=", "None", ",", "fee", "=", "10000", ",", "lock_time", "=", "0", ",", "dust_limit", "=", "common", ".", "DUST_LIMIT", ")", ":", "...
TODO doc string
[ "TODO", "doc", "string" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L206-L214
train
This function is used to store the data in the database.
F483/btctxstore
btctxstore/api.py
BtcTxStore.retrieve_hash160data
def retrieve_hash160data(self, txid, output_index): """TODO doc string""" rawtx = self.retrieve_tx(txid) return self.get_hash160_data(rawtx, output_index)
python
def retrieve_hash160data(self, txid, output_index): """TODO doc string""" rawtx = self.retrieve_tx(txid) return self.get_hash160_data(rawtx, output_index)
[ "def", "retrieve_hash160data", "(", "self", ",", "txid", ",", "output_index", ")", ":", "rawtx", "=", "self", ".", "retrieve_tx", "(", "txid", ")", "return", "self", ".", "get_hash160_data", "(", "rawtx", ",", "output_index", ")" ]
TODO doc string
[ "TODO", "doc", "string" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L216-L219
train
Retrieve the hash160 data for a transaction.
F483/btctxstore
btctxstore/api.py
BtcTxStore.add_nulldata
def add_nulldata(self, rawtx, hexdata): """Writes <hexdata> as new nulldata output to <rawtx>.""" tx = deserialize.unsignedtx(rawtx) nulldata_txout = deserialize.nulldata_txout(hexdata) tx = control.add_nulldata_output(tx, nulldata_txout) return serialize.tx(tx)
python
def add_nulldata(self, rawtx, hexdata): """Writes <hexdata> as new nulldata output to <rawtx>.""" tx = deserialize.unsignedtx(rawtx) nulldata_txout = deserialize.nulldata_txout(hexdata) tx = control.add_nulldata_output(tx, nulldata_txout) return serialize.tx(tx)
[ "def", "add_nulldata", "(", "self", ",", "rawtx", ",", "hexdata", ")", ":", "tx", "=", "deserialize", ".", "unsignedtx", "(", "rawtx", ")", "nulldata_txout", "=", "deserialize", ".", "nulldata_txout", "(", "hexdata", ")", "tx", "=", "control", ".", "add_nu...
Writes <hexdata> as new nulldata output to <rawtx>.
[ "Writes", "<hexdata", ">", "as", "new", "nulldata", "output", "to", "<rawtx", ">", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L225-L230
train
Writes <hexdata > as new nulldata output to rawtx.
F483/btctxstore
btctxstore/api.py
BtcTxStore.get_nulldata
def get_nulldata(self, rawtx): """Returns nulldata from <rawtx> as hexdata.""" tx = deserialize.tx(rawtx) index, data = control.get_nulldata(tx) return serialize.data(data)
python
def get_nulldata(self, rawtx): """Returns nulldata from <rawtx> as hexdata.""" tx = deserialize.tx(rawtx) index, data = control.get_nulldata(tx) return serialize.data(data)
[ "def", "get_nulldata", "(", "self", ",", "rawtx", ")", ":", "tx", "=", "deserialize", ".", "tx", "(", "rawtx", ")", "index", ",", "data", "=", "control", ".", "get_nulldata", "(", "tx", ")", "return", "serialize", ".", "data", "(", "data", ")" ]
Returns nulldata from <rawtx> as hexdata.
[ "Returns", "nulldata", "from", "<rawtx", ">", "as", "hexdata", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L232-L236
train
Returns nulldata from rawtx as hexdata.
F483/btctxstore
btctxstore/api.py
BtcTxStore.store_nulldata
def store_nulldata(self, hexdata, wifs, change_address=None, txouts=None, fee=10000, lock_time=0): """Store <hexdata> in blockchain and return new txid. Utxos taken from <wifs> and change sent to <change_address>. <wifs>: '["privatekey_in_wif_format", ...]' """ ...
python
def store_nulldata(self, hexdata, wifs, change_address=None, txouts=None, fee=10000, lock_time=0): """Store <hexdata> in blockchain and return new txid. Utxos taken from <wifs> and change sent to <change_address>. <wifs>: '["privatekey_in_wif_format", ...]' """ ...
[ "def", "store_nulldata", "(", "self", ",", "hexdata", ",", "wifs", ",", "change_address", "=", "None", ",", "txouts", "=", "None", ",", "fee", "=", "10000", ",", "lock_time", "=", "0", ")", ":", "rawtx", "=", "self", ".", "create_tx", "(", "txouts", ...
Store <hexdata> in blockchain and return new txid. Utxos taken from <wifs> and change sent to <change_address>. <wifs>: '["privatekey_in_wif_format", ...]'
[ "Store", "<hexdata", ">", "in", "blockchain", "and", "return", "new", "txid", ".", "Utxos", "taken", "from", "<wifs", ">", "and", "change", "sent", "to", "<change_address", ">", ".", "<wifs", ">", ":", "[", "privatekey_in_wif_format", "...", "]" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L238-L248
train
Store a null data in blockchain and return new txid.
F483/btctxstore
btctxstore/api.py
BtcTxStore.retrieve_nulldata
def retrieve_nulldata(self, txid): """Returns nulldata stored in blockchain <txid> as hexdata.""" rawtx = self.retrieve_tx(txid) return self.get_nulldata(rawtx)
python
def retrieve_nulldata(self, txid): """Returns nulldata stored in blockchain <txid> as hexdata.""" rawtx = self.retrieve_tx(txid) return self.get_nulldata(rawtx)
[ "def", "retrieve_nulldata", "(", "self", ",", "txid", ")", ":", "rawtx", "=", "self", ".", "retrieve_tx", "(", "txid", ")", "return", "self", ".", "get_nulldata", "(", "rawtx", ")" ]
Returns nulldata stored in blockchain <txid> as hexdata.
[ "Returns", "nulldata", "stored", "in", "blockchain", "<txid", ">", "as", "hexdata", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L250-L253
train
Returns nulldata stored in blockchain <txid > as hexdata.
F483/btctxstore
btctxstore/api.py
BtcTxStore.get_data_blob
def get_data_blob(self, rawtx): """TODO add docstring""" tx = deserialize.tx(rawtx) data = control.get_data_blob(tx) return serialize.data(data)
python
def get_data_blob(self, rawtx): """TODO add docstring""" tx = deserialize.tx(rawtx) data = control.get_data_blob(tx) return serialize.data(data)
[ "def", "get_data_blob", "(", "self", ",", "rawtx", ")", ":", "tx", "=", "deserialize", ".", "tx", "(", "rawtx", ")", "data", "=", "control", ".", "get_data_blob", "(", "tx", ")", "return", "serialize", ".", "data", "(", "data", ")" ]
TODO add docstring
[ "TODO", "add", "docstring" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L259-L263
train
Get the data blob for a raw transaction
F483/btctxstore
btctxstore/api.py
BtcTxStore.add_data_blob
def add_data_blob(self, rawtx, hexdata, dust_limit=common.DUST_LIMIT): """TODO add docstring""" tx = deserialize.tx(rawtx) data = deserialize.binary(hexdata) tx = control.add_data_blob(tx, data, dust_limit=dust_limit) return serialize.tx(tx)
python
def add_data_blob(self, rawtx, hexdata, dust_limit=common.DUST_LIMIT): """TODO add docstring""" tx = deserialize.tx(rawtx) data = deserialize.binary(hexdata) tx = control.add_data_blob(tx, data, dust_limit=dust_limit) return serialize.tx(tx)
[ "def", "add_data_blob", "(", "self", ",", "rawtx", ",", "hexdata", ",", "dust_limit", "=", "common", ".", "DUST_LIMIT", ")", ":", "tx", "=", "deserialize", ".", "tx", "(", "rawtx", ")", "data", "=", "deserialize", ".", "binary", "(", "hexdata", ")", "t...
TODO add docstring
[ "TODO", "add", "docstring" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L265-L270
train
Add data blob to the current object
F483/btctxstore
btctxstore/api.py
BtcTxStore.store_data_blob
def store_data_blob(self, hexdata, wifs, change_address=None, txouts=None, fee=10000, lock_time=0, dust_limit=common.DUST_LIMIT): """TODO add docstring""" rawtx = self.create_tx(txouts=txouts, lock_time=lock_time) rawtx = self.add_data_blob(rawtx, ...
python
def store_data_blob(self, hexdata, wifs, change_address=None, txouts=None, fee=10000, lock_time=0, dust_limit=common.DUST_LIMIT): """TODO add docstring""" rawtx = self.create_tx(txouts=txouts, lock_time=lock_time) rawtx = self.add_data_blob(rawtx, ...
[ "def", "store_data_blob", "(", "self", ",", "hexdata", ",", "wifs", ",", "change_address", "=", "None", ",", "txouts", "=", "None", ",", "fee", "=", "10000", ",", "lock_time", "=", "0", ",", "dust_limit", "=", "common", ".", "DUST_LIMIT", ")", ":", "ra...
TODO add docstring
[ "TODO", "add", "docstring" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L272-L280
train
Store data in the database.
F483/btctxstore
btctxstore/api.py
BtcTxStore.retrieve_data_blob
def retrieve_data_blob(self, txid): """TODO add docstring""" rawtx = self.retrieve_tx(txid) return self.get_data_blob(rawtx)
python
def retrieve_data_blob(self, txid): """TODO add docstring""" rawtx = self.retrieve_tx(txid) return self.get_data_blob(rawtx)
[ "def", "retrieve_data_blob", "(", "self", ",", "txid", ")", ":", "rawtx", "=", "self", ".", "retrieve_tx", "(", "txid", ")", "return", "self", ".", "get_data_blob", "(", "rawtx", ")" ]
TODO add docstring
[ "TODO", "add", "docstring" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L282-L285
train
Retrieve the data blob for a given transaction id.
F483/btctxstore
btctxstore/api.py
BtcTxStore.add_broadcast_message
def add_broadcast_message(self, rawtx, message, sender_wif, dust_limit=common.DUST_LIMIT): """TODO add docstring""" tx = deserialize.tx(rawtx) message = deserialize.unicode_str(message) sender_key = deserialize.key(self.testnet, sender_wif) tx = cont...
python
def add_broadcast_message(self, rawtx, message, sender_wif, dust_limit=common.DUST_LIMIT): """TODO add docstring""" tx = deserialize.tx(rawtx) message = deserialize.unicode_str(message) sender_key = deserialize.key(self.testnet, sender_wif) tx = cont...
[ "def", "add_broadcast_message", "(", "self", ",", "rawtx", ",", "message", ",", "sender_wif", ",", "dust_limit", "=", "common", ".", "DUST_LIMIT", ")", ":", "tx", "=", "deserialize", ".", "tx", "(", "rawtx", ")", "message", "=", "deserialize", ".", "unicod...
TODO add docstring
[ "TODO", "add", "docstring" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L291-L299
train
Add a broadcast message to the cache.
F483/btctxstore
btctxstore/api.py
BtcTxStore.get_broadcast_message
def get_broadcast_message(self, rawtx): """TODO add docstring""" tx = deserialize.tx(rawtx) result = control.get_broadcast_message(self.testnet, tx) result["signature"] = serialize.signature(result["signature"]) return result
python
def get_broadcast_message(self, rawtx): """TODO add docstring""" tx = deserialize.tx(rawtx) result = control.get_broadcast_message(self.testnet, tx) result["signature"] = serialize.signature(result["signature"]) return result
[ "def", "get_broadcast_message", "(", "self", ",", "rawtx", ")", ":", "tx", "=", "deserialize", ".", "tx", "(", "rawtx", ")", "result", "=", "control", ".", "get_broadcast_message", "(", "self", ".", "testnet", ",", "tx", ")", "result", "[", "\"signature\""...
TODO add docstring
[ "TODO", "add", "docstring" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L301-L306
train
get broadcast message
F483/btctxstore
btctxstore/api.py
BtcTxStore.store_broadcast_message
def store_broadcast_message(self, message, sender_wif, wifs, change_address=None, txouts=None, fee=10000, lock_time=0, dust_limit=common.DUST_LIMIT): """TODO add docstring""" rawtx = self.create_tx(txouts=txouts, lock_time=lock_time) ...
python
def store_broadcast_message(self, message, sender_wif, wifs, change_address=None, txouts=None, fee=10000, lock_time=0, dust_limit=common.DUST_LIMIT): """TODO add docstring""" rawtx = self.create_tx(txouts=txouts, lock_time=lock_time) ...
[ "def", "store_broadcast_message", "(", "self", ",", "message", ",", "sender_wif", ",", "wifs", ",", "change_address", "=", "None", ",", "txouts", "=", "None", ",", "fee", "=", "10000", ",", "lock_time", "=", "0", ",", "dust_limit", "=", "common", ".", "D...
TODO add docstring
[ "TODO", "add", "docstring" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L308-L317
train
Store a broadcast message in the database.
F483/btctxstore
btctxstore/api.py
BtcTxStore.retrieve_broadcast_message
def retrieve_broadcast_message(self, txid): """TODO add docstring""" rawtx = self.retrieve_tx(txid) return self.get_broadcast_message(rawtx)
python
def retrieve_broadcast_message(self, txid): """TODO add docstring""" rawtx = self.retrieve_tx(txid) return self.get_broadcast_message(rawtx)
[ "def", "retrieve_broadcast_message", "(", "self", ",", "txid", ")", ":", "rawtx", "=", "self", ".", "retrieve_tx", "(", "txid", ")", "return", "self", ".", "get_broadcast_message", "(", "rawtx", ")" ]
TODO add docstring
[ "TODO", "add", "docstring" ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L319-L322
train
Retrieve a broadcast message from the database.
F483/btctxstore
btctxstore/api.py
BtcTxStore.confirms
def confirms(self, txid): """Returns number of confirms or None if unpublished.""" txid = deserialize.txid(txid) return self.service.confirms(txid)
python
def confirms(self, txid): """Returns number of confirms or None if unpublished.""" txid = deserialize.txid(txid) return self.service.confirms(txid)
[ "def", "confirms", "(", "self", ",", "txid", ")", ":", "txid", "=", "deserialize", ".", "txid", "(", "txid", ")", "return", "self", ".", "service", ".", "confirms", "(", "txid", ")" ]
Returns number of confirms or None if unpublished.
[ "Returns", "number", "of", "confirms", "or", "None", "if", "unpublished", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L328-L331
train
Returns the number of confirms for a given transaction id.
F483/btctxstore
btctxstore/api.py
BtcTxStore.split_utxos
def split_utxos(self, wif, limit, fee=10000, max_outputs=100): """Split utxos of <wif> unitil <limit> or <max_outputs> reached.""" key = deserialize.key(self.testnet, wif) limit = deserialize.positive_integer(limit) fee = deserialize.positive_integer(fee) max_outputs = deserializ...
python
def split_utxos(self, wif, limit, fee=10000, max_outputs=100): """Split utxos of <wif> unitil <limit> or <max_outputs> reached.""" key = deserialize.key(self.testnet, wif) limit = deserialize.positive_integer(limit) fee = deserialize.positive_integer(fee) max_outputs = deserializ...
[ "def", "split_utxos", "(", "self", ",", "wif", ",", "limit", ",", "fee", "=", "10000", ",", "max_outputs", "=", "100", ")", ":", "key", "=", "deserialize", ".", "key", "(", "self", ".", "testnet", ",", "wif", ")", "limit", "=", "deserialize", ".", ...
Split utxos of <wif> unitil <limit> or <max_outputs> reached.
[ "Split", "utxos", "of", "<wif", ">", "unitil", "<limit", ">", "or", "<max_outputs", ">", "reached", "." ]
5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25
https://github.com/F483/btctxstore/blob/5790ace3a3d4c9bcc759e7c931fc4a57d40b6c25/btctxstore/api.py#L337-L348
train
Split utxos of wif into limit and fee.
bunchesofdonald/django-hermes
hermes/south_migrations/0008_fill_slug_field.py
Migration.forwards
def forwards(self, orm): "Write your forwards methods here." # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..." for category in Category.objects.all(): category.slug = category._generate_slug() category.save()
python
def forwards(self, orm): "Write your forwards methods here." # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..." for category in Category.objects.all(): category.slug = category._generate_slug() category.save()
[ "def", "forwards", "(", "self", ",", "orm", ")", ":", "# Note: Remember to use orm['appname.ModelName'] rather than \"from appname.models...\"", "for", "category", "in", "Category", ".", "objects", ".", "all", "(", ")", ":", "category", ".", "slug", "=", "category", ...
Write your forwards methods here.
[ "Write", "your", "forwards", "methods", "here", "." ]
ff5395a7b5debfd0756aab43db61f7a6cfa06aea
https://github.com/bunchesofdonald/django-hermes/blob/ff5395a7b5debfd0756aab43db61f7a6cfa06aea/hermes/south_migrations/0008_fill_slug_field.py#L11-L16
train
Write your forwards methods here.
bunchesofdonald/django-hermes
hermes/south_migrations/0008_fill_slug_field.py
Migration.backwards
def backwards(self, orm): "Write your backwards methods here." for category in Category.objects.all(): category.slug = '' category.save()
python
def backwards(self, orm): "Write your backwards methods here." for category in Category.objects.all(): category.slug = '' category.save()
[ "def", "backwards", "(", "self", ",", "orm", ")", ":", "for", "category", "in", "Category", ".", "objects", ".", "all", "(", ")", ":", "category", ".", "slug", "=", "''", "category", ".", "save", "(", ")" ]
Write your backwards methods here.
[ "Write", "your", "backwards", "methods", "here", "." ]
ff5395a7b5debfd0756aab43db61f7a6cfa06aea
https://github.com/bunchesofdonald/django-hermes/blob/ff5395a7b5debfd0756aab43db61f7a6cfa06aea/hermes/south_migrations/0008_fill_slug_field.py#L18-L22
train
Write your backwards methods here.
rohankapoorcom/zm-py
zoneminder/monitor.py
TimePeriod.get_time_period
def get_time_period(value): """Get the corresponding TimePeriod from the value. Example values: 'all', 'hour', 'day', 'week', or 'month'. """ for time_period in TimePeriod: if time_period.period == value: return time_period raise ValueError('{} is not...
python
def get_time_period(value): """Get the corresponding TimePeriod from the value. Example values: 'all', 'hour', 'day', 'week', or 'month'. """ for time_period in TimePeriod: if time_period.period == value: return time_period raise ValueError('{} is not...
[ "def", "get_time_period", "(", "value", ")", ":", "for", "time_period", "in", "TimePeriod", ":", "if", "time_period", ".", "period", "==", "value", ":", "return", "time_period", "raise", "ValueError", "(", "'{} is not a valid TimePeriod'", ".", "format", "(", "v...
Get the corresponding TimePeriod from the value. Example values: 'all', 'hour', 'day', 'week', or 'month'.
[ "Get", "the", "corresponding", "TimePeriod", "from", "the", "value", "." ]
bd3a9f6b2f7b84b37589e2939f628b479a5531bf
https://github.com/rohankapoorcom/zm-py/blob/bd3a9f6b2f7b84b37589e2939f628b479a5531bf/zoneminder/monitor.py#L41-L49
train
Get the corresponding TimePeriod from the value.
rohankapoorcom/zm-py
zoneminder/monitor.py
Monitor.update_monitor
def update_monitor(self): """Update the monitor and monitor status from the ZM server.""" result = self._client.get_state(self._monitor_url) self._raw_result = result['monitor']
python
def update_monitor(self): """Update the monitor and monitor status from the ZM server.""" result = self._client.get_state(self._monitor_url) self._raw_result = result['monitor']
[ "def", "update_monitor", "(", "self", ")", ":", "result", "=", "self", ".", "_client", ".", "get_state", "(", "self", ".", "_monitor_url", ")", "self", ".", "_raw_result", "=", "result", "[", "'monitor'", "]" ]
Update the monitor and monitor status from the ZM server.
[ "Update", "the", "monitor", "and", "monitor", "status", "from", "the", "ZM", "server", "." ]
bd3a9f6b2f7b84b37589e2939f628b479a5531bf
https://github.com/rohankapoorcom/zm-py/blob/bd3a9f6b2f7b84b37589e2939f628b479a5531bf/zoneminder/monitor.py#L86-L89
train
Update the monitor status from the ZM server.
rohankapoorcom/zm-py
zoneminder/monitor.py
Monitor.function
def function(self, new_function): """Set the MonitorState of this Monitor.""" self._client.change_state( self._monitor_url, {'Monitor[Function]': new_function.value})
python
def function(self, new_function): """Set the MonitorState of this Monitor.""" self._client.change_state( self._monitor_url, {'Monitor[Function]': new_function.value})
[ "def", "function", "(", "self", ",", "new_function", ")", ":", "self", ".", "_client", ".", "change_state", "(", "self", ".", "_monitor_url", ",", "{", "'Monitor[Function]'", ":", "new_function", ".", "value", "}", ")" ]
Set the MonitorState of this Monitor.
[ "Set", "the", "MonitorState", "of", "this", "Monitor", "." ]
bd3a9f6b2f7b84b37589e2939f628b479a5531bf
https://github.com/rohankapoorcom/zm-py/blob/bd3a9f6b2f7b84b37589e2939f628b479a5531bf/zoneminder/monitor.py#L99-L103
train
Set the MonitorState of this Monitor.
rohankapoorcom/zm-py
zoneminder/monitor.py
Monitor.is_recording
def is_recording(self) -> Optional[bool]: """Indicate if this Monitor is currently recording.""" status_response = self._client.get_state( 'api/monitors/alarm/id:{}/command:status.json'.format( self._monitor_id ) ) if not status_response: ...
python
def is_recording(self) -> Optional[bool]: """Indicate if this Monitor is currently recording.""" status_response = self._client.get_state( 'api/monitors/alarm/id:{}/command:status.json'.format( self._monitor_id ) ) if not status_response: ...
[ "def", "is_recording", "(", "self", ")", "->", "Optional", "[", "bool", "]", ":", "status_response", "=", "self", ".", "_client", ".", "get_state", "(", "'api/monitors/alarm/id:{}/command:status.json'", ".", "format", "(", "self", ".", "_monitor_id", ")", ")", ...
Indicate if this Monitor is currently recording.
[ "Indicate", "if", "this", "Monitor", "is", "currently", "recording", "." ]
bd3a9f6b2f7b84b37589e2939f628b479a5531bf
https://github.com/rohankapoorcom/zm-py/blob/bd3a9f6b2f7b84b37589e2939f628b479a5531bf/zoneminder/monitor.py#L121-L140
train
Indicate if this Monitor is currently recording.
rohankapoorcom/zm-py
zoneminder/monitor.py
Monitor.is_available
def is_available(self) -> bool: """Indicate if this Monitor is currently available.""" status_response = self._client.get_state( 'api/monitors/daemonStatus/id:{}/daemon:zmc.json'.format( self._monitor_id ) ) if not status_response: _LO...
python
def is_available(self) -> bool: """Indicate if this Monitor is currently available.""" status_response = self._client.get_state( 'api/monitors/daemonStatus/id:{}/daemon:zmc.json'.format( self._monitor_id ) ) if not status_response: _LO...
[ "def", "is_available", "(", "self", ")", "->", "bool", ":", "status_response", "=", "self", ".", "_client", ".", "get_state", "(", "'api/monitors/daemonStatus/id:{}/daemon:zmc.json'", ".", "format", "(", "self", ".", "_monitor_id", ")", ")", "if", "not", "status...
Indicate if this Monitor is currently available.
[ "Indicate", "if", "this", "Monitor", "is", "currently", "available", "." ]
bd3a9f6b2f7b84b37589e2939f628b479a5531bf
https://github.com/rohankapoorcom/zm-py/blob/bd3a9f6b2f7b84b37589e2939f628b479a5531bf/zoneminder/monitor.py#L143-L161
train
Indicate if this Monitor is currently available.
rohankapoorcom/zm-py
zoneminder/monitor.py
Monitor.get_events
def get_events(self, time_period, include_archived=False) -> Optional[int]: """Get the number of events that have occurred on this Monitor. Specifically only gets events that have occurred within the TimePeriod provided. """ date_filter = '1%20{}'.format(time_period.period) ...
python
def get_events(self, time_period, include_archived=False) -> Optional[int]: """Get the number of events that have occurred on this Monitor. Specifically only gets events that have occurred within the TimePeriod provided. """ date_filter = '1%20{}'.format(time_period.period) ...
[ "def", "get_events", "(", "self", ",", "time_period", ",", "include_archived", "=", "False", ")", "->", "Optional", "[", "int", "]", ":", "date_filter", "=", "'1%20{}'", ".", "format", "(", "time_period", ".", "period", ")", "if", "time_period", "==", "Tim...
Get the number of events that have occurred on this Monitor. Specifically only gets events that have occurred within the TimePeriod provided.
[ "Get", "the", "number", "of", "events", "that", "have", "occurred", "on", "this", "Monitor", "." ]
bd3a9f6b2f7b84b37589e2939f628b479a5531bf
https://github.com/rohankapoorcom/zm-py/blob/bd3a9f6b2f7b84b37589e2939f628b479a5531bf/zoneminder/monitor.py#L163-L192
train
Get the number of events that have occurred on this Monitor.
rohankapoorcom/zm-py
zoneminder/monitor.py
Monitor._build_image_url
def _build_image_url(self, monitor, mode) -> str: """Build and return a ZoneMinder camera image url.""" query = urlencode({ 'mode': mode, 'buffer': monitor['StreamReplayBuffer'], 'monitor': monitor['Id'], }) url = '{zms_url}?{query}'.format( ...
python
def _build_image_url(self, monitor, mode) -> str: """Build and return a ZoneMinder camera image url.""" query = urlencode({ 'mode': mode, 'buffer': monitor['StreamReplayBuffer'], 'monitor': monitor['Id'], }) url = '{zms_url}?{query}'.format( ...
[ "def", "_build_image_url", "(", "self", ",", "monitor", ",", "mode", ")", "->", "str", ":", "query", "=", "urlencode", "(", "{", "'mode'", ":", "mode", ",", "'buffer'", ":", "monitor", "[", "'StreamReplayBuffer'", "]", ",", "'monitor'", ":", "monitor", "...
Build and return a ZoneMinder camera image url.
[ "Build", "and", "return", "a", "ZoneMinder", "camera", "image", "url", "." ]
bd3a9f6b2f7b84b37589e2939f628b479a5531bf
https://github.com/rohankapoorcom/zm-py/blob/bd3a9f6b2f7b84b37589e2939f628b479a5531bf/zoneminder/monitor.py#L194-L205
train
Build and return a ZoneMinder camera image url.
ponty/psidialogs
psidialogs/api/tkfiledialog_api.py
askopenfile
def askopenfile(mode="r", **options): "Ask for a filename to open, and returned the opened file" filename = askopenfilename(**options) if filename: return open(filename, mode) return None
python
def askopenfile(mode="r", **options): "Ask for a filename to open, and returned the opened file" filename = askopenfilename(**options) if filename: return open(filename, mode) return None
[ "def", "askopenfile", "(", "mode", "=", "\"r\"", ",", "*", "*", "options", ")", ":", "filename", "=", "askopenfilename", "(", "*", "*", "options", ")", "if", "filename", ":", "return", "open", "(", "filename", ",", "mode", ")", "return", "None" ]
Ask for a filename to open, and returned the opened file
[ "Ask", "for", "a", "filename", "to", "open", "and", "returned", "the", "opened", "file" ]
e385ab6b48cb43af52b810a1bf76a8135f4585b8
https://github.com/ponty/psidialogs/blob/e385ab6b48cb43af52b810a1bf76a8135f4585b8/psidialogs/api/tkfiledialog_api.py#L4-L10
train
Ask for a filename to open and returned the opened file
ponty/psidialogs
psidialogs/api/tkfiledialog_api.py
askopenfiles
def askopenfiles(mode="r", **options): """Ask for multiple filenames and return the open file objects returns a list of open file objects or an empty list if cancel selected """ files = askopenfilenames(**options) if files: ofiles = [] for filename in files: ofi...
python
def askopenfiles(mode="r", **options): """Ask for multiple filenames and return the open file objects returns a list of open file objects or an empty list if cancel selected """ files = askopenfilenames(**options) if files: ofiles = [] for filename in files: ofi...
[ "def", "askopenfiles", "(", "mode", "=", "\"r\"", ",", "*", "*", "options", ")", ":", "files", "=", "askopenfilenames", "(", "*", "*", "options", ")", "if", "files", ":", "ofiles", "=", "[", "]", "for", "filename", "in", "files", ":", "ofiles", ".", ...
Ask for multiple filenames and return the open file objects returns a list of open file objects or an empty list if cancel selected
[ "Ask", "for", "multiple", "filenames", "and", "return", "the", "open", "file", "objects" ]
e385ab6b48cb43af52b810a1bf76a8135f4585b8
https://github.com/ponty/psidialogs/blob/e385ab6b48cb43af52b810a1bf76a8135f4585b8/psidialogs/api/tkfiledialog_api.py#L13-L27
train
Ask for multiple filenames and return the open file objects.
ponty/psidialogs
psidialogs/api/tkfiledialog_api.py
asksaveasfile
def asksaveasfile(mode="w", **options): "Ask for a filename to save as, and returned the opened file" filename = asksaveasfilename(**options) if filename: return open(filename, mode) return None
python
def asksaveasfile(mode="w", **options): "Ask for a filename to save as, and returned the opened file" filename = asksaveasfilename(**options) if filename: return open(filename, mode) return None
[ "def", "asksaveasfile", "(", "mode", "=", "\"w\"", ",", "*", "*", "options", ")", ":", "filename", "=", "asksaveasfilename", "(", "*", "*", "options", ")", "if", "filename", ":", "return", "open", "(", "filename", ",", "mode", ")", "return", "None" ]
Ask for a filename to save as, and returned the opened file
[ "Ask", "for", "a", "filename", "to", "save", "as", "and", "returned", "the", "opened", "file" ]
e385ab6b48cb43af52b810a1bf76a8135f4585b8
https://github.com/ponty/psidialogs/blob/e385ab6b48cb43af52b810a1bf76a8135f4585b8/psidialogs/api/tkfiledialog_api.py#L30-L36
train
Ask for a filename to save as and returned the opened file