advutils package¶
Submodules¶
advutils.counters module¶
This module defines counters useful to generate numbers simulating digital counters
-
class
advutils.counters.
BaseCounter
(min_state, max_state, child=None, parent=None, invert_count=False)[source]¶ Bases:
future.types.newobject.newobject
Base class to create counters
-
count
¶
-
decrease
()[source]¶ Decreases counter Train state.
Returns: None, use getting methods to know new states
-
decrease_confirm
()[source]¶ - Decreases counter Train state and confirms when get_max_state() is depleted.
- That is when counters overall state change from 0 to get_max_state()-1.
Returns: True if confirmation otherwise None, use getting methods to know new states
-
get_counter_train
(train=None)[source]¶ Get each instance of train.
Parameters: train – list containing instances of parents Returns: list of instances from itself and children
-
get_max_state
(train=None)[source]¶ Get the overall maximum state of train.
Parameters: train – list containing parent maximum states Returns: overall maximum state. Note: maximum state is never reached but this.get_max_state()-1
-
get_max_state_train
(train=None)[source]¶ Get each max_state of train.
Parameters: train – list containing max_state of parents Returns: list of max_state from itself and children
-
get_state_train
(train=None)[source]¶ All states or state train.
Parameters: train – list containing parent states Returns: list of state from itself and children
-
increase
()[source]¶ Increases counter Train state.
Returns: None, use getting methods to know new states
-
increase_confirm
()[source]¶ Increases counter Train state and confirms when get_max_state() is depleted. That is when counters overall state change from get_max_state()-1 to 0.
Returns: True if confirmation otherwise None, use getting methods to know new states
-
invert_count
¶
-
invert_ranks
()[source]¶ Counters in Train are repositioned so that last counter takes first place and vice-versa.
Returns: master counter of actual counter train
-
master
¶
-
max_state
¶
-
min_state
¶
-
next
()¶
-
set_child
(child)[source]¶ Sets child safely by telling the other counter who is the new parent.
Parameters: child – child counter Returns: None
-
set_max_state_train
(values)[source]¶ Sets safely a counter max_state train.
Parameters: value – new train of max_state(list). If state exceeds max_state then state takes max_state-1. Returns: None
-
set_parent
(parent)[source]¶ Sets parent safely by telling the other counter who is the new child.
Parameters: parent – parent counter Returns: None
-
set_state_train
(values)[source]¶ Sets safely a counter state train.
Parameters: values – new train of states (list). If value exceeds max_state then value takes max_state-1 or if value is less than 0 it takes 0 Returns: None
-
set_this_max_state
(value)[source]¶ Sets safely this counter max_state.
Parameters: value – new max_state. If state exceeds max_state then state takes max_state-1 Returns: None
-
set_this_state
(value)[source]¶ Sets safely this counter state.
Parameters: value – new value state. If value exceeds max_state then value takes max_state-1 or if value is less than 0 it takes 0 Returns: None
-
state
¶
-
-
class
advutils.counters.
Bit
(state=1, name=None, description=None, child=None, parent=None)[source]¶ Bases:
advutils.counters.DigitCounter
Simulates a bit counter from 0 to 1
-
max_state
¶
-
-
class
advutils.counters.
Bitstream
(stream, invert_count=False, invert_order=False, order=None, default_class=<class 'advutils.counters.Bit'>)[source]¶ Bases:
advutils.counters.MechanicalCounter
Simulates a bitstream of data
example:
a = Bitstream([1,1,1]) for i in a: print(i)
-
class
advutils.counters.
DigitCounter
(max_state, child=None, parent=None, invert_count=False)[source]¶ Bases:
advutils.counters.IntegerCounter
Simulates a digit counter from 0 to 9
0 to
9 -
max_state
¶
-
-
class
advutils.counters.
IntegerCounter
(max_state, child=None, parent=None, invert_count=False)[source]¶ Bases:
advutils.counters.BaseCounter
Simulates an unsigned integer counter from 0 to Inf
0 to
Inf -
max_state
¶
-
set_state
(state, truncate=True, train=None)[source]¶ Sets safely this and all counters state train from the overall state.
Parameters: - state – overall state
- truncate –
it is by default True. If True it calculates the states as if in a for loop:
for i in xrange(state): this.increase() this.get_state()
If False it just stops to the last possible state before this.get_max_state()
- train – previously calculated train if this counter is not master ex: if this and master counters maxStates are T and M then extract the trains using get_max_state_train from both this and master, so that master elements reach until previous counter of this counter [M,10, ...,T-1]. Similarly, get_max_state method can be used as [master.get_max_state()/this.get_max_state()]
Returns: reached_overall_state
if truncate == True: assert reached_overall_state == state % a.get_max_state() else: remaining = state - reached_overall_state
-
state
¶
-
-
class
advutils.counters.
MechanicalCounter
(values, invert_count=False, invert_order=False, order=None, default_class=<class 'advutils.counters.DigitCounter'>)[source]¶ Bases:
advutils.counters.BaseCounter
Simulates a mechanical counter. It is a wrapper over a train of counters. By default it uses a DigitCounter for each slot in the Train.
0 0 0 0 0 to
9 9 9 9 9 -
config
(values=None, invert_count=None, invert_order=False, order=None)[source]¶ Safely configure MechanicalCounter instance values
Parameters: - values – list of maximum states (excluded) or default_class objects inherited from counter
- invert_count – Default is False that begins to increase counters, else decrease counters
- invert_order – if True, take inverted values from order
- order – index order from Train of counters
- default_class – default class of any object to convert from values.
-
decrease
()[source]¶ Decreases counter Train state.
Returns: None, use getting methods to know new states
-
decrease_confirm
()[source]¶ Decreases counter Train state and confirms when get_max_state() is depleted. That is when counters overall state change from self.min_state to get_max_state()-1.
Returns: True if confirmation otherwise None, use getting methods to know new states
-
get_counter_train
(train=None)[source]¶ Get each instance of train virtually organized.
Parameters: train – list containing instances of parents Returns: list of instances from itself and children
-
get_max_state
(train=None)[source]¶ Get the overall maximum state of train.
Parameters: train – list containing parent maximum states Returns: overall maximum state. Note: maximum state is never reached but this.get_max_state()-1
-
get_max_state_train
(train=None)[source]¶ Get each max_state of train.
Parameters: train – list containing max_state of parents Returns: list of max_state from itself and children
-
get_real_counter_train
()[source]¶ Get each instance of train physically organized.
Returns: list of instances from itself and children
-
get_real_max_state_train
()[source]¶ Get each max_state of train.
Returns: list of max_state from itself and children
-
get_real_state_train
()[source]¶ All states or state train.
Returns: list of state from itself and children
-
get_state_train
(train=None)[source]¶ All states or state train.
Parameters: train – list containing parent states Returns: list of state from itself and children
-
increase
()[source]¶ Increases counter Train state.
Returns: None, use getting methods to know new states
-
increase_confirm
()[source]¶ Increases counter Train state and confirms when get_max_state() is depleted. That is when counters overall state change from get_max_state()-1 to self.min_state.
Returns: True if confirmation otherwise None, use getting methods to know new states
-
invert_count
¶
-
invert_link_order
()[source]¶ Counters hierarchy in Train are repositioned so that last counter takes first this.Order and vice-versa.
Returns: master counter of actual counter train ..Note:
Same as self.invert_ranks()
-
invert_ranks
()[source]¶ Counters hierarchy in Train are repositioned so that last counter takes first this.Order and vice-versa.
Returns: master counter of actual counter train ..Note:
Same as self.invert_link_order() but self.invert_ranks() does not touch the links but the real positions
-
invert_real_order
()[source]¶ Counters in Train are repositioned so that last counter takes first place and vice-versa.
Returns: master counter of actual counter trainl
-
link
()[source]¶ Linker method to link counters in the train so that increasing and decreasing methods affect all the counters in the due order.
-
max_state
¶
-
next
()¶
-
order
¶
-
set_max_state_train
(values)[source]¶ Sets safely a counter max_state train.
Parameters: value – new train of max_state(list). If state exceeds max_state then state takes max_state-1 Returns: None
-
set_state
(state, truncate=True, train=None)[source]¶ Sets safely this and all counters state train from the overall state.
Parameters: - state – overall state
- truncate –
it is by default True. If True it calculates the states as if in a for loop:
for i in xrange(state): this.increase() return this.get_state()
If False it just stops to the last possible state before this.get_max_state()
- train – previously calculated train if this counter is not master ex: if this and master counters maxStates are T and M then extract the trains using get_max_state_train from both this and master, so that master elements reach until previous counter of this counter [M,10, ...,T-1]. Similarly, get_max_state method can be used as [master.get_max_state()/this.get_max_state()]
Returns: reached_overall_state
if truncate == True: assert reached_overall_state == state % a.get_max_state() else: remaining = state - reached_overall_state
-
set_state_train
(values)[source]¶ Sets safely a counter state train.
Parameters: values – new train of states (list). If value exceeds max_state then value takes max_state-1 or if value is less than self.min_state it takes self.min_state Returns: None
-
set_this_max_state
(value)[source]¶ Sets safely this counter max_state.
Parameters: value – new max_state. If state exceeds max_state then state takes max_state-1 Returns: None
-
set_this_state
(value)[source]¶ Sets safely this counter state.
Parameters: value – new value state. If value exceeds max_state then value takes max_state-1 or if value is less than 0 it takes 0 Returns: None
-
state
¶
-
train
¶
-
advutils.eventqueue module¶
This module define event classes for queueing tasks
-
class
advutils.eventqueue.
Event
(doc=None)[source]¶ Bases:
future.types.newobject.newobject
Class defining an event
-
class
advutils.eventqueue.
EventHandler
(event, sender)[source]¶ Bases:
future.types.newobject.newobject
Class to handle an Event instance
-
append
(func)[source]¶ Add new event handler function.
Event handler function must be defined like func(sender, earg). You can add handler also by using ‘+=’ operator.
-
advutils.password module¶
This module defines simple numerical and mapped passwords using letters in a deterministic way i.e. in order
-
class
advutils.password.
Permutator
(iterable, child=None, parent=None, invert_count=False)[source]¶ Bases:
advutils.counters.IntegerCounter
Permute an iterable object
-
get_value_train
(train=None)[source]¶ All states or state train.
Parameters: train – list containing parent states Returns: list of state from itself and children
-
next
()¶
-
-
class
advutils.password.
PermutatorTrain
(values, invert_count=False, invert_order=False, order=None, default_class=<class 'advutils.password.Permutator'>)[source]¶ Bases:
advutils.counters.MechanicalCounter
Permute a Train of iterable objects
-
get_real_value_train
()[source]¶ All states or state train.
Returns: list of state from itself and children
-
get_value_train
(train=None)[source]¶ All states or state train.
Parameters: train – list containing parent states Returns: list of state from itself and children
-
next
()¶
-
-
advutils.password.
deterministic
(length=1, iterable='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]¶ - It generates permutations faster but it is not
- customizable. (it uses product from itertools). Deterministic function generates “iterable^length” combinations from iterable each row of “length” columns.
Parameters: - length – length of how many columns, or factor number
- iterable – list of items to permute
Returns: itertools iterator
..Example:
factor = 1 assert len(list(deterministic(factor, iterable = COMBINATIONS))) == len(COMBINATIONS)**factor
-
advutils.password.
get_permutations
(length=1, combination='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', invert_count=False, invert_order=False, order=None)[source]¶ Like deterministic but customizable.
Parameters: - length – length of how many columns, or factor number
- combination – list of items to permute
- invert_count – Default is False, if True, take inverted index from combinations (see :param combinations)
- invert_order – Default is False, if True, take inverted index from order (see :param order)
- order – index order of columns
Returns: PermutatorTrain object (it can be use as a generator)
-
advutils.password.
repeat_iterator
(length=1, iterable='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]¶ Repeats iterable “length” times.
Parameters: - length – length of how many columns or times to repeat
- iterable – list of items to repeat
Returns: tuple of iterable rows and length columns
advutils.prettylogging module¶
ESC [ 0 m # reset all (colors and brightness) ESC [ 1 m # bright ESC [ 2 m # dim (looks same as normal brightness) ESC [ 22 m # normal brightness
# FOREGROUND: ESC [ 30 m # black ESC [ 31 m # red ESC [ 32 m # green ESC [ 33 m # yellow ESC [ 34 m # blue ESC [ 35 m # magenta ESC [ 36 m # cyan ESC [ 37 m # white ESC [ 39 m # reset
# BACKGROUND ESC [ 40 m # black ESC [ 41 m # red ESC [ 42 m # green ESC [ 43 m # yellow ESC [ 44 m # blue ESC [ 45 m # magenta ESC [ 46 m # cyan ESC [ 47 m # white ESC [ 49 m # reset
-
class
advutils.prettylogging.
ANSIcolor
(colors)[source]¶ Bases:
future.types.newobject.newobject
Class defining ANSI color codes used in terminals
-
BLACK
= '30'¶
-
BLACK_B
= '40'¶
-
BLUE
= '34'¶
-
BLUE_B
= '44'¶
-
BRIGHT
= 1¶
-
CYAN
= '36'¶
-
CYAN_B
= '46'¶
-
DIM
= 2¶
-
GREEN
= '32'¶
-
GREEN_B
= '42'¶
-
MAGENTA
= '35'¶
-
MAGENTA_B
= '45'¶
-
NORMAL
= 22¶
-
RED
= '31'¶
-
RED_B
= '41'¶
-
WHITE
= '37'¶
-
WHITE_B
= '47'¶
-
YELLOW
= '33'¶
-
YELLOW_B
= '43'¶
-
i
= 47¶
-
-
class
advutils.prettylogging.
CODE
(name=None, level=0, colors=None, formatting='[{_code}]{_head}{_body}{_end}')[source]¶ Bases:
advutils.BaseCopySupporter
Class to define Logger codes like HIDDEN, DEBUG, ERROR, LOG, WARNING, IGNORE
-
codify
(*args, **kwargs)[source]¶ Creates an instance of this CODE with default parameters
Parameters: - text – text to convert
- newLine – True to add new line at the end if needed
- use_color – True to use color
- use_format – True to use code formatting
- kwargs – additional kwargs to format
Returns: formatted text
-
convert
(text, newLine=False, use_color=None, use_format=False, **kwargs)[source]¶ Convert text to CODE format and colors.
Parameters: - text – text to convert
- newLine – True to add new line at the end if needed
- use_color – True to use color
- use_format – True to use code formatting
- kwargs – additional kwargs to format
Returns: formatted text
-
-
class
advutils.prettylogging.
CODElist
(iterable)[source]¶ Bases:
list
Especial list to hold CODE objects used in CodeMapper
-
class
advutils.prettylogging.
CodeLog
(std_out=<open file '<stdout>', mode 'w'>, code_mapper=None, default_codes=None, use_colors=None, use_codes=None)[source]¶ Bases:
future.types.newobject.newobject
Base Logger Class which supports CODE objects
-
convert
(text, codes=None, newLine=False, **kwargs)[source]¶ Convert text with code.
Parameters: - text – text to convert
- codes – codes to use for text
- newLine – True to add newline
- kwargs – additional arguments to pass to CODEs
Returns: string of formatted text
-
convert_code
(codes=None)[source]¶ Filter accepted codes and adequate them to use.
Parameters: codes – levels, codes or iterators with them. Returns: it gets None or list with only codes, no empty list (use if filtered)
-
default_codes
¶
-
use_codes
= None¶
-
use_colors
= None¶
-
-
class
advutils.prettylogging.
CodeMapper
(codes=None, refcodes=None, range=None, limit=True)[source]¶ Bases:
future.types.newobject.newobject
Manage and convert CODE objects to other CODE objects
-
codes
¶
-
-
class
advutils.prettylogging.
EmptyLogger
(std_out=<open file '<stdout>', mode 'w'>, code_mapper=None, default_codes=None, use_colors=None, use_codes=None)[source]¶ Bases:
advutils.prettylogging.CodeLog
Empty logger to not generate outputs
-
class
advutils.prettylogging.
Loggers
(logs=None, **kwargs)[source]¶ Bases:
future.types.newobject.newobject
Manage multiple loggers
-
class
advutils.prettylogging.
SimpleLogger
(std_out=<open file '<stdout>', mode 'w'>, code_mapper=None, default_codes=CODE(colors = <advutils.prettylogging.ANSIcolor object>, formatting = '[{_code}]{_head}{_body}{_end}', name = 'LOG', level = 0), use_colors=None, use_codes=None, verbosity=None)[source]¶ Bases:
advutils.prettylogging.CodeLog
Simple logger to print CODE objects
-
advutils.prettylogging.
formatter
(format_string, kwargs)[source]¶ Default formatter used to format strings. Instead of “{key}”.format(**kwargs) use formatter(“{key}”, kwargs) which ensures that no errors are generated when an user uses braces e.g. {}. Bear in mind that formatter consumes kwargs which in turns replaces an used key with empty string “”. This can generate unusual behaviour if not well used.
-
advutils.prettylogging.
have_colours
(stream)[source]¶ Detect if output console supports ANSI colors.
Parameters: stream – Returns:
-
advutils.prettylogging.
scale
(x, range, drange)[source]¶ From real coordinates get rendered coordinates.
Parameters: - x – source value
- range – (min,max) of x
- drange – (min,max) of sx
Returns: scaled x (sx)
advutils.randwords module¶
This module have some utilities to create random words from source
Created on Thu Jan 28 16:59:13 2016
@author: dev
-
advutils.randwords.
generate
(source=None, minwords=2, maxwords=5, rand=True)[source]¶ Generate random words from source
Parameters: - source –
- minwords –
- maxwords –
- rand –
Returns:
advutils.threader module¶
This module defines APIs for multitasking and queueing
-
class
advutils.threader.
Designator
(maxsize=0)[source]¶ Bases:
Queue.PriorityQueue
Task Designator with priority queue
-
get
(block=True, timeout=None)[source]¶ Remove and return an item from the queue.
If optional args ‘block’ is true and ‘timeout’ is None (the default), block if necessary until an item is available. If ‘timeout’ is a non-negative number, it blocks at most ‘timeout’ seconds and raises the Empty exception if no item was available within that time. Otherwise (‘block’ is false), return an item if one is immediately available, else raise the Empty exception (‘timeout’ is ignored in that case).
-
-
class
advutils.threader.
IterDecouple
(iterable, processes=None, buffsize=0, handler=None)[source]¶ Bases:
future.types.newobject.newobject
Decouple iterator from main thread and with processes.
-
next
()¶
-
-
class
advutils.threader.
MultiProcessingAPI
(spawn=False)[source]¶ Bases:
future.types.newobject.newobject
Class to unify Multi processing and threading
-
Thread
(*args, **kwargs)¶ Parameters: - args –
- kwargs –
Returns:
-
-
class
advutils.threader.
PriorityQueue
(maxsize=0)[source]¶ Bases:
Queue.PriorityQueue
Variant of Queue.PriorityQueue in that FIFO rule is kept inside the same priority number groups.
Entries are typically tuples of the form: (priority number, data).
-
class
advutils.threader.
QueueCarrier
(priority)[source]¶ Bases:
advutils.BaseCreation
Base class Carrier used to convey data reliably in PriorityQueues
-
HIGHEST_PRIORITY
= inf¶
-
LOWEST_PRIORITY
= -inf¶
-
-
advutils.threader.
heappop
(l)[source]¶ Consume last item from queue list (biggest carrier)
Parameters: l – list queue Returns: last item from list
Module contents¶
-
class
advutils.
BaseCopySupporter
[source]¶ Bases:
object
Base class for classes supporting cloning and spawning of itself. This same behaviour can be obtained using @copy_support decorator.
-
clone
(*args, **kwargs)¶ Clones instance with modifying parameters. Not that this creates a new instance.
Returns: new_instance
-
get_arguments
(args=(), kwargs=None, onlykeys=False, onlyused=False, func=None)¶ Get all function parameters configured in this instance mixed with additional arguments.
Parameters: - self – instance object
- args – arguments to modify
- kwargs – key arguments to modify
- onlykeys – return only key arguments
- onlyused – return only modified arguments
- func – function to get parameters from. If None it uses self.__init__
Returns: args, kwargs
-
spawn
(*args, **kwargs)¶ Creates new Carrier of the same class with parameters of this instance.
Returns: new_instance
-
-
class
advutils.
BaseCreation
[source]¶ Bases:
object
Base class Carrier used to convey data reliably in PriorityQueues
-
creation_order
¶
-
creation_time
¶
-
creation_time_str
¶ Creation time formated string
-
creation_time_struct
¶ Creation time structure
-
-
exception
advutils.
ClassNotAllowed
[source]¶ Bases:
exceptions.Exception
Exception to denote that given class is not allowed
-
exception
advutils.
CorruptPersistent
[source]¶ Bases:
exceptions.EOFError
,exceptions.IOError
Used for persistent data read from disk like pickles to denote it has been corrupted
-
exception
advutils.
NoParserFound
[source]¶ Bases:
exceptions.Exception
Raise when no parser is found to use in a shell i.e to interpret user input
-
exception
advutils.
NotCallable
[source]¶ Bases:
exceptions.Exception
Defines objectGetter error: given object is not callable.
-
exception
advutils.
NotConvertibleToInt
[source]¶ Bases:
exceptions.ValueError
Exception to denote that value cannot be represented as int
-
exception
advutils.
NotCreatable
[source]¶ Bases:
exceptions.Exception
Defines objectGetter error: objectGetter cannot create new object.
-
exception
advutils.
TimeOutException
[source]¶ Bases:
exceptions.Exception
Raise an exception when a process surpasses the timeout
-
exception
advutils.
TransferExeption
[source]¶ Bases:
exceptions.Exception
Raise an exception when transfered data is corrupt
-
exception
advutils.
VariableNotAvailable
[source]¶ Bases:
exceptions.Exception
Exception for variable that is not available
-
exception
advutils.
VariableNotDeletable
[source]¶ Bases:
exceptions.Exception
Exception for property not deletable
-
exception
advutils.
VariableNotGettable
[source]¶ Bases:
exceptions.Exception
Exception for property not gettable
-
exception
advutils.
VariableNotSettable
[source]¶ Bases:
exceptions.Exception
Exception for property not settable
-
advutils.
clone
(self, *args, **kwargs)[source]¶ Clones instance with modifying parameters. Not that this creates a new instance.
Returns: new_instance
-
advutils.
copy_support
(_map=None, convert=None, overwrite=())[source]¶ Class decorator that fills spawn and clone methods. Be careful when using this decorator as it can give unexpected results if __init__ arguments and instance variables do not correspond to each other. Be very wary of property methods since they change the behaviour of calling a variable. You must ensure that classes abide the rules or decorator adapts to class to ensure good behaviour. It implements methods like “__repr__” to represent instance creation, “get_arguments” to get __init__ parameters with overwriting arguments, “clone” to copy instance with overwriting arguments and “spawn”, to create new instance with constructor __init__ and its overwriting arguments.
example:
# simple example @copy_support class Klass(object) def __init__(data): self.data = data arguments = {"data":"Original"} instanceA = Klass(**arguments) for key, val in arguments.items(): assert val == getattr(instanceA,key) instanceB = instanceA.spawn("Spawned") instanceC = instanceA.clone("Cloned") print(repr(instanceA)) print(repr(instanceB)) print(repr(instanceC)) # example mapping parameters _map = {"data":"_data"} @copy_support(_map = _map) class Klass2(object) def __init__(data): self._data = data arguments = {"data":"Original"} instanceA2 = Klass2(**arguments) for key, val in arguments.items(): assert val == getattr(instanceA2,_map[key]) instanceB2 = instanceA.spawn("Spawned") instanceC2 = instanceA.clone("Cloned") print(repr(instanceA2)) print(repr(instanceB2)) print(repr(instanceC2))
Parameters: - _map – dictionary to map __init__ arguments with the instance variable names e.g. if in __init__ an argument is “data” but is assigned as “_data” then use {“data”:”_data”}.
- convert – dictionary with the copying functions to add to class
- overwrite – force list of parameters to overwrite
Returns: class
Note
- There is not risk from inheritance and they can be overwritten
- applying the decorator again. Classes with no __init__ or no parameters in them do not have risk of bad behaviour.
-
advutils.
get_arguments
(self, args=(), kwargs=None, onlykeys=False, onlyused=False, func=None)[source]¶ Get all function parameters configured in this instance mixed with additional arguments.
Parameters: - self – instance object
- args – arguments to modify
- kwargs – key arguments to modify
- onlykeys – return only key arguments
- onlyused – return only modified arguments
- func – function to get parameters from. If None it uses self.__init__
Returns: args, kwargs
-
advutils.
get_parameters
(func, args=(), kwargs=None, onlykeys=False, onlyused=False, default=None)[source]¶ Get all function parameters with default values.
Parameters: - func – function to get parameters from
- args – arguments to modify
- kwargs – key arguments to modify
- onlykeys – return only key arguments
- onlyused – return only modified arguments
- default – default value to assign to key arguments
Returns: args, kwargs