partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
get_rand_bytes
encoding-->str: one of ENCODINGS l-->int: length of unicode str avoid-->list of int: to void (unprintable chars etc) Returns-->bytes representing unicode str of the requested encoding
cffi_utils/py2to3.py
def get_rand_bytes(encoding='latin1', l=64, avoid=[]): ''' encoding-->str: one of ENCODINGS l-->int: length of unicode str avoid-->list of int: to void (unprintable chars etc) Returns-->bytes representing unicode str of the requested encoding ''' return encode( get_rand_str(encoding=...
def get_rand_bytes(encoding='latin1', l=64, avoid=[]): ''' encoding-->str: one of ENCODINGS l-->int: length of unicode str avoid-->list of int: to void (unprintable chars etc) Returns-->bytes representing unicode str of the requested encoding ''' return encode( get_rand_str(encoding=...
[ "encoding", "--", ">", "str", ":", "one", "of", "ENCODINGS", "l", "--", ">", "int", ":", "length", "of", "unicode", "str", "avoid", "--", ">", "list", "of", "int", ":", "to", "void", "(", "unprintable", "chars", "etc", ")", "Returns", "--", ">", "b...
sundarnagarajan/cffi_utils
python
https://github.com/sundarnagarajan/cffi_utils/blob/1d5ab2d2fcb962372228033106bc23f1d73d31fa/cffi_utils/py2to3.py#L353-L363
[ "def", "get_rand_bytes", "(", "encoding", "=", "'latin1'", ",", "l", "=", "64", ",", "avoid", "=", "[", "]", ")", ":", "return", "encode", "(", "get_rand_str", "(", "encoding", "=", "encoding", ",", "l", "=", "l", ",", "avoid", "=", "avoid", ")", "...
1d5ab2d2fcb962372228033106bc23f1d73d31fa
test
main
Parse argv for options and arguments, and start schema generation.
examples/gen_rt_integrity_check.py
def main(): ''' Parse argv for options and arguments, and start schema generation. ''' parser = optparse.OptionParser(usage="%prog [options] <model_path> [another_model_path...]", formatter=optparse.TitledHelpFormatter()) parser....
def main(): ''' Parse argv for options and arguments, and start schema generation. ''' parser = optparse.OptionParser(usage="%prog [options] <model_path> [another_model_path...]", formatter=optparse.TitledHelpFormatter()) parser....
[ "Parse", "argv", "for", "options", "and", "arguments", "and", "start", "schema", "generation", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/examples/gen_rt_integrity_check.py#L253-L302
[ "def", "main", "(", ")", ":", "parser", "=", "optparse", ".", "OptionParser", "(", "usage", "=", "\"%prog [options] <model_path> [another_model_path...]\"", ",", "formatter", "=", "optparse", ".", "TitledHelpFormatter", "(", ")", ")", "parser", ".", "set_description...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
scrape
Rip the events from a given rss feed, normalize the data and store.
comdev/rss_lib.py
def scrape(ctx, url): """ Rip the events from a given rss feed, normalize the data and store. """ data = load_feed(url) feed = data['feed'] entries = data['entries'] # THIS IS SPECIFIC TO # http://konfery.cz/rss/ _type = 'community' country = 'Czech Republic' # title, title_de...
def scrape(ctx, url): """ Rip the events from a given rss feed, normalize the data and store. """ data = load_feed(url) feed = data['feed'] entries = data['entries'] # THIS IS SPECIFIC TO # http://konfery.cz/rss/ _type = 'community' country = 'Czech Republic' # title, title_de...
[ "Rip", "the", "events", "from", "a", "given", "rss", "feed", "normalize", "the", "data", "and", "store", "." ]
kejbaly2/comdev
python
https://github.com/kejbaly2/comdev/blob/5a9067d3c1ae46eeccb9d36e8c231ea5224b42b4/comdev/rss_lib.py#L37-L61
[ "def", "scrape", "(", "ctx", ",", "url", ")", ":", "data", "=", "load_feed", "(", "url", ")", "feed", "=", "data", "[", "'feed'", "]", "entries", "=", "data", "[", "'entries'", "]", "# THIS IS SPECIFIC TO # http://konfery.cz/rss/", "_type", "=", "'community'...
5a9067d3c1ae46eeccb9d36e8c231ea5224b42b4
test
Camera.download_image
Download the image and return the local path to the image file.
zorg_network_camera/adaptor.py
def download_image(self): """ Download the image and return the local path to the image file. """ split = urlsplit(self.url) filename = split.path.split("/")[-1] # Ensure the directory to store the image cache exists if not os.path.exists(self.cache_direc...
def download_image(self): """ Download the image and return the local path to the image file. """ split = urlsplit(self.url) filename = split.path.split("/")[-1] # Ensure the directory to store the image cache exists if not os.path.exists(self.cache_direc...
[ "Download", "the", "image", "and", "return", "the", "local", "path", "to", "the", "image", "file", "." ]
zorg/zorg-network-camera
python
https://github.com/zorg/zorg-network-camera/blob/e2d15725e50370e2df0c38be6b039215873e4278/zorg_network_camera/adaptor.py#L22-L40
[ "def", "download_image", "(", "self", ")", ":", "split", "=", "urlsplit", "(", "self", ".", "url", ")", "filename", "=", "split", ".", "path", ".", "split", "(", "\"/\"", ")", "[", "-", "1", "]", "# Ensure the directory to store the image cache exists", "if"...
e2d15725e50370e2df0c38be6b039215873e4278
test
Camera.has_changed
Method to check if an image has changed since it was last downloaded. By making a head request, this check can be done quicker that downloading and processing the whole file.
zorg_network_camera/adaptor.py
def has_changed(self): """ Method to check if an image has changed since it was last downloaded. By making a head request, this check can be done quicker that downloading and processing the whole file. """ request = urllib_request.Request(self.url) ...
def has_changed(self): """ Method to check if an image has changed since it was last downloaded. By making a head request, this check can be done quicker that downloading and processing the whole file. """ request = urllib_request.Request(self.url) ...
[ "Method", "to", "check", "if", "an", "image", "has", "changed", "since", "it", "was", "last", "downloaded", ".", "By", "making", "a", "head", "request", "this", "check", "can", "be", "done", "quicker", "that", "downloading", "and", "processing", "the", "wh...
zorg/zorg-network-camera
python
https://github.com/zorg/zorg-network-camera/blob/e2d15725e50370e2df0c38be6b039215873e4278/zorg_network_camera/adaptor.py#L42-L67
[ "def", "has_changed", "(", "self", ")", ":", "request", "=", "urllib_request", ".", "Request", "(", "self", ".", "url", ")", "request", ".", "get_method", "=", "lambda", ":", "'HEAD'", "response", "=", "urllib_request", ".", "urlopen", "(", "request", ")",...
e2d15725e50370e2df0c38be6b039215873e4278
test
api_bikes
Gets stolen bikes within a radius of a given postcode. :param request: The aiohttp request. :return: The bikes stolen with the given range from a postcode.
hyperion/api/bike.py
async def api_bikes(request): """ Gets stolen bikes within a radius of a given postcode. :param request: The aiohttp request. :return: The bikes stolen with the given range from a postcode. """ postcode: Optional[str] = request.match_info.get('postcode', None) try: radius = int(requ...
async def api_bikes(request): """ Gets stolen bikes within a radius of a given postcode. :param request: The aiohttp request. :return: The bikes stolen with the given range from a postcode. """ postcode: Optional[str] = request.match_info.get('postcode', None) try: radius = int(requ...
[ "Gets", "stolen", "bikes", "within", "a", "radius", "of", "a", "given", "postcode", ".", ":", "param", "request", ":", "The", "aiohttp", "request", ".", ":", "return", ":", "The", "bikes", "stolen", "with", "the", "given", "range", "from", "a", "postcode...
arlyon/hyperion
python
https://github.com/arlyon/hyperion/blob/d8de0388ba98b85ce472e0f49ac18fecb14d3343/hyperion/api/bike.py#L10-L32
[ "async", "def", "api_bikes", "(", "request", ")", ":", "postcode", ":", "Optional", "[", "str", "]", "=", "request", ".", "match_info", ".", "get", "(", "'postcode'", ",", "None", ")", "try", ":", "radius", "=", "int", "(", "request", ".", "match_info"...
d8de0388ba98b85ce472e0f49ac18fecb14d3343
test
fancy_tag_compiler
Returns a template.Node subclass.
fancy_tag/__init__.py
def fancy_tag_compiler(params, defaults, takes_var_args, takes_var_kwargs, takes_context, name, node_class, parser, token): "Returns a template.Node subclass." bits = token.split_contents()[1:] if takes_context: if 'context' in params[:1]: params = params[1:] else: r...
def fancy_tag_compiler(params, defaults, takes_var_args, takes_var_kwargs, takes_context, name, node_class, parser, token): "Returns a template.Node subclass." bits = token.split_contents()[1:] if takes_context: if 'context' in params[:1]: params = params[1:] else: r...
[ "Returns", "a", "template", ".", "Node", "subclass", "." ]
trapeze/fancy_tag
python
https://github.com/trapeze/fancy_tag/blob/0418a995500dc5ac65cf093cb6c1634e3e628229/fancy_tag/__init__.py#L12-L68
[ "def", "fancy_tag_compiler", "(", "params", ",", "defaults", ",", "takes_var_args", ",", "takes_var_kwargs", ",", "takes_context", ",", "name", ",", "node_class", ",", "parser", ",", "token", ")", ":", "bits", "=", "token", ".", "split_contents", "(", ")", "...
0418a995500dc5ac65cf093cb6c1634e3e628229
test
setup_logging
This will setup logging for a single file but can be called more than once LOG LEVELS are "CRITICAL", "ERROR", "INFO", "DEBUG" :param log_filename: str of the file location :param log_level: str of the overall logging level for setLevel :param str_format: str of the logging format :par...
seaborn_logger/logger.py
def setup_logging(log_filename=None, log_level="DEBUG", str_format=None, date_format=None, log_file_level="DEBUG", log_stdout_level=None, log_restart=False, log_history=False, formatter=None, silence_modules=None, log_filter=None): """ This will setup loggin...
def setup_logging(log_filename=None, log_level="DEBUG", str_format=None, date_format=None, log_file_level="DEBUG", log_stdout_level=None, log_restart=False, log_history=False, formatter=None, silence_modules=None, log_filter=None): """ This will setup loggin...
[ "This", "will", "setup", "logging", "for", "a", "single", "file", "but", "can", "be", "called", "more", "than", "once", "LOG", "LEVELS", "are", "CRITICAL", "ERROR", "INFO", "DEBUG", ":", "param", "log_filename", ":", "str", "of", "the", "file", "location",...
SeabornGames/Logger
python
https://github.com/SeabornGames/Logger/blob/fb8b1700557aaea8d3216bd4c4df33c302bece7f/seaborn_logger/logger.py#L220-L258
[ "def", "setup_logging", "(", "log_filename", "=", "None", ",", "log_level", "=", "\"DEBUG\"", ",", "str_format", "=", "None", ",", "date_format", "=", "None", ",", "log_file_level", "=", "\"DEBUG\"", ",", "log_stdout_level", "=", "None", ",", "log_restart", "=...
fb8b1700557aaea8d3216bd4c4df33c302bece7f
test
setup_stdout_logging
This will setup logging for stdout and stderr :param formatter: :param log_level: str of the overall logging level for setLevel :param log_stdout_level: str of the logging level of stdout :param str_format: str of the logging format :param date_format: str of the date format :p...
seaborn_logger/logger.py
def setup_stdout_logging(log_level="DEBUG", log_stdout_level="DEBUG", str_format=None, date_format=None, formatter=None, silence_modules=None, log_filter=None): """ This will setup logging for stdout and stderr :param formatter: :param log_level: ...
def setup_stdout_logging(log_level="DEBUG", log_stdout_level="DEBUG", str_format=None, date_format=None, formatter=None, silence_modules=None, log_filter=None): """ This will setup logging for stdout and stderr :param formatter: :param log_level: ...
[ "This", "will", "setup", "logging", "for", "stdout", "and", "stderr", ":", "param", "formatter", ":", ":", "param", "log_level", ":", "str", "of", "the", "overall", "logging", "level", "for", "setLevel", ":", "param", "log_stdout_level", ":", "str", "of", ...
SeabornGames/Logger
python
https://github.com/SeabornGames/Logger/blob/fb8b1700557aaea8d3216bd4c4df33c302bece7f/seaborn_logger/logger.py#L261-L286
[ "def", "setup_stdout_logging", "(", "log_level", "=", "\"DEBUG\"", ",", "log_stdout_level", "=", "\"DEBUG\"", ",", "str_format", "=", "None", ",", "date_format", "=", "None", ",", "formatter", "=", "None", ",", "silence_modules", "=", "None", ",", "log_filter", ...
fb8b1700557aaea8d3216bd4c4df33c302bece7f
test
setup_file_logging
This will setup logging for a single file but can be called more than once LOG LEVELS are "CRITICAL", "ERROR", "INFO", "DEBUG" :param log_filename: str of the file location :param log_file_level str of the log level to use on this file :param str_format: str of the logging format :param da...
seaborn_logger/logger.py
def setup_file_logging(log_filename, log_file_level="DEBUG", str_format=None, date_format=None, log_restart=False, log_history=False, formatter=None, silence_modules=None, log_filter=None): """ This will setup logging for a single file but can be called more than on...
def setup_file_logging(log_filename, log_file_level="DEBUG", str_format=None, date_format=None, log_restart=False, log_history=False, formatter=None, silence_modules=None, log_filter=None): """ This will setup logging for a single file but can be called more than on...
[ "This", "will", "setup", "logging", "for", "a", "single", "file", "but", "can", "be", "called", "more", "than", "once", "LOG", "LEVELS", "are", "CRITICAL", "ERROR", "INFO", "DEBUG", ":", "param", "log_filename", ":", "str", "of", "the", "file", "location",...
SeabornGames/Logger
python
https://github.com/SeabornGames/Logger/blob/fb8b1700557aaea8d3216bd4c4df33c302bece7f/seaborn_logger/logger.py#L289-L323
[ "def", "setup_file_logging", "(", "log_filename", ",", "log_file_level", "=", "\"DEBUG\"", ",", "str_format", "=", "None", ",", "date_format", "=", "None", ",", "log_restart", "=", "False", ",", "log_history", "=", "False", ",", "formatter", "=", "None", ",", ...
fb8b1700557aaea8d3216bd4c4df33c302bece7f
test
add_file_handler
:param log_filename: :param log_file_level str of the log level to use on this file :param str_format: str of the logging format :param date_format: str of the date format :param log_restart: bool if True the log file will be deleted first :param log_history: bool if True will sav...
seaborn_logger/logger.py
def add_file_handler(log_file_level, log_filename, str_format=None, date_format=None, formatter=None, log_filter=None): """ :param log_filename: :param log_file_level str of the log level to use on this file :param str_format: str of the logging format :param date_format:...
def add_file_handler(log_file_level, log_filename, str_format=None, date_format=None, formatter=None, log_filter=None): """ :param log_filename: :param log_file_level str of the log level to use on this file :param str_format: str of the logging format :param date_format:...
[ ":", "param", "log_filename", ":", ":", "param", "log_file_level", "str", "of", "the", "log", "level", "to", "use", "on", "this", "file", ":", "param", "str_format", ":", "str", "of", "the", "logging", "format", ":", "param", "date_format", ":", "str", "...
SeabornGames/Logger
python
https://github.com/SeabornGames/Logger/blob/fb8b1700557aaea8d3216bd4c4df33c302bece7f/seaborn_logger/logger.py#L326-L345
[ "def", "add_file_handler", "(", "log_file_level", ",", "log_filename", ",", "str_format", "=", "None", ",", "date_format", "=", "None", ",", "formatter", "=", "None", ",", "log_filter", "=", "None", ")", ":", "formatter", "=", "formatter", "or", "SeabornFormat...
fb8b1700557aaea8d3216bd4c4df33c302bece7f
test
add_handler
:param log_handler_level: str of the level to set for the handler :param handler: logging.Handler handler to add :param formatter: logging.Formatter instance to use :param log_filter: logging.filter instance to add to handler :return: None
seaborn_logger/logger.py
def add_handler(log_handler_level, handler, formatter=None, log_filter=None): """ :param log_handler_level: str of the level to set for the handler :param handler: logging.Handler handler to add :param formatter: logging.Formatter instance to use :param log_filter: l...
def add_handler(log_handler_level, handler, formatter=None, log_filter=None): """ :param log_handler_level: str of the level to set for the handler :param handler: logging.Handler handler to add :param formatter: logging.Formatter instance to use :param log_filter: l...
[ ":", "param", "log_handler_level", ":", "str", "of", "the", "level", "to", "set", "for", "the", "handler", ":", "param", "handler", ":", "logging", ".", "Handler", "handler", "to", "add", ":", "param", "formatter", ":", "logging", ".", "Formatter", "instan...
SeabornGames/Logger
python
https://github.com/SeabornGames/Logger/blob/fb8b1700557aaea8d3216bd4c4df33c302bece7f/seaborn_logger/logger.py#L348-L361
[ "def", "add_handler", "(", "log_handler_level", ",", "handler", ",", "formatter", "=", "None", ",", "log_filter", "=", "None", ")", ":", "handler", ".", "setLevel", "(", "log_handler_level", ")", "if", "formatter", "is", "not", "None", ":", "handler", ".", ...
fb8b1700557aaea8d3216bd4c4df33c302bece7f
test
set_module_log_level
This will raise the log level for the given modules in general this is used to silence them :param modules: list of str of module names ex. ['requests'] :param log_level: str of the new log level :return: None
seaborn_logger/logger.py
def set_module_log_level(modules=None, log_level=logging.WARNING): """ This will raise the log level for the given modules in general this is used to silence them :param modules: list of str of module names ex. ['requests'] :param log_level: str of the new log level :return: ...
def set_module_log_level(modules=None, log_level=logging.WARNING): """ This will raise the log level for the given modules in general this is used to silence them :param modules: list of str of module names ex. ['requests'] :param log_level: str of the new log level :return: ...
[ "This", "will", "raise", "the", "log", "level", "for", "the", "given", "modules", "in", "general", "this", "is", "used", "to", "silence", "them", ":", "param", "modules", ":", "list", "of", "str", "of", "module", "names", "ex", ".", "[", "requests", "]...
SeabornGames/Logger
python
https://github.com/SeabornGames/Logger/blob/fb8b1700557aaea8d3216bd4c4df33c302bece7f/seaborn_logger/logger.py#L364-L376
[ "def", "set_module_log_level", "(", "modules", "=", "None", ",", "log_level", "=", "logging", ".", "WARNING", ")", ":", "modules", "=", "modules", "or", "[", "]", "if", "not", "isinstance", "(", "modules", ",", "list", ")", ":", "modules", "=", "[", "m...
fb8b1700557aaea8d3216bd4c4df33c302bece7f
test
SeabornLogger.findCaller
Find the stack frame of the caller so that we can note the source file name, line number and function name.
seaborn_logger/logger.py
def findCaller(self, stack_info=False): """ Find the stack frame of the caller so that we can note the source file name, line number and function name. """ f = logging.currentframe() # On some versions of IronPython, currentframe() returns None if # IronPython isn...
def findCaller(self, stack_info=False): """ Find the stack frame of the caller so that we can note the source file name, line number and function name. """ f = logging.currentframe() # On some versions of IronPython, currentframe() returns None if # IronPython isn...
[ "Find", "the", "stack", "frame", "of", "the", "caller", "so", "that", "we", "can", "note", "the", "source", "file", "name", "line", "number", "and", "function", "name", "." ]
SeabornGames/Logger
python
https://github.com/SeabornGames/Logger/blob/fb8b1700557aaea8d3216bd4c4df33c302bece7f/seaborn_logger/logger.py#L45-L72
[ "def", "findCaller", "(", "self", ",", "stack_info", "=", "False", ")", ":", "f", "=", "logging", ".", "currentframe", "(", ")", "# On some versions of IronPython, currentframe() returns None if", "# IronPython isn't run with -X:Frames.", "if", "f", "is", "not", "None",...
fb8b1700557aaea8d3216bd4c4df33c302bece7f
test
get_defining_component
get the C_C in which pe_pe is defined
bridgepoint/prebuild.py
def get_defining_component(pe_pe): ''' get the C_C in which pe_pe is defined ''' if pe_pe is None: return None if pe_pe.__class__.__name__ != 'PE_PE': pe_pe = xtuml.navigate_one(pe_pe).PE_PE[8001]() ep_pkg = xtuml.navigate_one(pe_pe).EP_PKG[8000]() if ep_pkg: ...
def get_defining_component(pe_pe): ''' get the C_C in which pe_pe is defined ''' if pe_pe is None: return None if pe_pe.__class__.__name__ != 'PE_PE': pe_pe = xtuml.navigate_one(pe_pe).PE_PE[8001]() ep_pkg = xtuml.navigate_one(pe_pe).EP_PKG[8000]() if ep_pkg: ...
[ "get", "the", "C_C", "in", "which", "pe_pe", "is", "defined" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/prebuild.py#L46-L61
[ "def", "get_defining_component", "(", "pe_pe", ")", ":", "if", "pe_pe", "is", "None", ":", "return", "None", "if", "pe_pe", ".", "__class__", ".", "__name__", "!=", "'PE_PE'", ":", "pe_pe", "=", "xtuml", ".", "navigate_one", "(", "pe_pe", ")", ".", "PE_P...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
prebuild_action
Transform textual OAL actions of an *instance* to instances in the ooaofooa subsystems Value and Body. The provided *instance* must be an instance of one of the following classes: - S_SYNC - S_BRG - O_TFR - O_DBATTR - SM_ACT - SPR_RO - SPR_RS - SPR_PO - SPR_PS
bridgepoint/prebuild.py
def prebuild_action(instance): ''' Transform textual OAL actions of an *instance* to instances in the ooaofooa subsystems Value and Body. The provided *instance* must be an instance of one of the following classes: - S_SYNC - S_BRG - O_TFR - O_DBATTR - SM_ACT - SPR_RO -...
def prebuild_action(instance): ''' Transform textual OAL actions of an *instance* to instances in the ooaofooa subsystems Value and Body. The provided *instance* must be an instance of one of the following classes: - S_SYNC - S_BRG - O_TFR - O_DBATTR - SM_ACT - SPR_RO -...
[ "Transform", "textual", "OAL", "actions", "of", "an", "*", "instance", "*", "to", "instances", "in", "the", "ooaofooa", "subsystems", "Value", "and", "Body", ".", "The", "provided", "*", "instance", "*", "must", "be", "an", "instance", "of", "one", "of", ...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/prebuild.py#L1796-L1828
[ "def", "prebuild_action", "(", "instance", ")", ":", "walker_map", "=", "{", "'S_SYNC'", ":", "FunctionPrebuilder", ",", "'S_BRG'", ":", "BridgePrebuilder", ",", "'O_TFR'", ":", "OperationPrebuilder", ",", "'O_DBATTR'", ":", "DerivedAttributePrebuilder", ",", "'SM_A...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
prebuild_model
Transform textual OAL actions in a ooaofooa *metamodel* to instances in the subsystems Value and Body. Instances of the following classes are supported: - S_SYNC - S_BRG - O_TFR - O_DBATTR - SM_ACT - SPR_RO - SPR_RS - SPR_PO - SPR_PS
bridgepoint/prebuild.py
def prebuild_model(metamodel): ''' Transform textual OAL actions in a ooaofooa *metamodel* to instances in the subsystems Value and Body. Instances of the following classes are supported: - S_SYNC - S_BRG - O_TFR - O_DBATTR - SM_ACT - SPR_RO - SPR_RS - SPR_PO - SPR_P...
def prebuild_model(metamodel): ''' Transform textual OAL actions in a ooaofooa *metamodel* to instances in the subsystems Value and Body. Instances of the following classes are supported: - S_SYNC - S_BRG - O_TFR - O_DBATTR - SM_ACT - SPR_RO - SPR_RS - SPR_PO - SPR_P...
[ "Transform", "textual", "OAL", "actions", "in", "a", "ooaofooa", "*", "metamodel", "*", "to", "instances", "in", "the", "subsystems", "Value", "and", "Body", ".", "Instances", "of", "the", "following", "classes", "are", "supported", ":", "-", "S_SYNC", "-", ...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/prebuild.py#L1831-L1850
[ "def", "prebuild_model", "(", "metamodel", ")", ":", "for", "kind", "in", "[", "'S_SYNC'", ",", "'S_BRG'", ",", "'O_TFR'", ",", "'O_DBATTR'", ",", "'SM_ACT'", ",", "'SPR_RO'", ",", "'SPR_RS'", ",", "'SPR_PO'", ",", "'SPR_PS'", "]", ":", "for", "inst", "i...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
main
Parse command line options and launch the prebuilder.
bridgepoint/prebuild.py
def main(): ''' Parse command line options and launch the prebuilder. ''' parser = optparse.OptionParser(usage="%prog [options] <model_path> [another_model_path..]", version=xtuml.version.complete_string, formatter=optparse.TitledHelp...
def main(): ''' Parse command line options and launch the prebuilder. ''' parser = optparse.OptionParser(usage="%prog [options] <model_path> [another_model_path..]", version=xtuml.version.complete_string, formatter=optparse.TitledHelp...
[ "Parse", "command", "line", "options", "and", "launch", "the", "prebuilder", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/prebuild.py#L1853-L1887
[ "def", "main", "(", ")", ":", "parser", "=", "optparse", ".", "OptionParser", "(", "usage", "=", "\"%prog [options] <model_path> [another_model_path..]\"", ",", "version", "=", "xtuml", ".", "version", ".", "complete_string", ",", "formatter", "=", "optparse", "."...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
SymbolTable.find_symbol
Find a symbol in the symbol table by name, kind, or both.
bridgepoint/prebuild.py
def find_symbol(self, name=None, kind=None): ''' Find a symbol in the symbol table by name, kind, or both. ''' for s in reversed(self.stack): for symbol_name, handle in s.symbols.items(): symbol_kind = handle.__class__.__name__ ...
def find_symbol(self, name=None, kind=None): ''' Find a symbol in the symbol table by name, kind, or both. ''' for s in reversed(self.stack): for symbol_name, handle in s.symbols.items(): symbol_kind = handle.__class__.__name__ ...
[ "Find", "a", "symbol", "in", "the", "symbol", "table", "by", "name", "kind", "or", "both", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/prebuild.py#L90-L109
[ "def", "find_symbol", "(", "self", ",", "name", "=", "None", ",", "kind", "=", "None", ")", ":", "for", "s", "in", "reversed", "(", "self", ".", "stack", ")", ":", "for", "symbol_name", ",", "handle", "in", "s", ".", "symbols", ".", "items", "(", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
Contacts.update_membership
input: gdata ContactEntry and GroupEntry objects
comdev/google_api.py
def update_membership(self, contact, group): ''' input: gdata ContactEntry and GroupEntry objects ''' if not contact: log.debug('Not updating membership for EMPTY contact.') return None _uid = contact.email[0].address _gtitle = group.title.text ...
def update_membership(self, contact, group): ''' input: gdata ContactEntry and GroupEntry objects ''' if not contact: log.debug('Not updating membership for EMPTY contact.') return None _uid = contact.email[0].address _gtitle = group.title.text ...
[ "input", ":", "gdata", "ContactEntry", "and", "GroupEntry", "objects" ]
kejbaly2/comdev
python
https://github.com/kejbaly2/comdev/blob/5a9067d3c1ae46eeccb9d36e8c231ea5224b42b4/comdev/google_api.py#L184-L205
[ "def", "update_membership", "(", "self", ",", "contact", ",", "group", ")", ":", "if", "not", "contact", ":", "log", ".", "debug", "(", "'Not updating membership for EMPTY contact.'", ")", "return", "None", "_uid", "=", "contact", ".", "email", "[", "0", "]"...
5a9067d3c1ae46eeccb9d36e8c231ea5224b42b4
test
is_contained_in
Determine if a PE_PE is contained within a EP_PKG or a C_C.
bridgepoint/ooaofooa.py
def is_contained_in(pe_pe, root): ''' Determine if a PE_PE is contained within a EP_PKG or a C_C. ''' if not pe_pe: return False if type(pe_pe).__name__ != 'PE_PE': pe_pe = one(pe_pe).PE_PE[8001]() ep_pkg = one(pe_pe).EP_PKG[8000]() c_c = one(pe_pe).C_C[8003]() ...
def is_contained_in(pe_pe, root): ''' Determine if a PE_PE is contained within a EP_PKG or a C_C. ''' if not pe_pe: return False if type(pe_pe).__name__ != 'PE_PE': pe_pe = one(pe_pe).PE_PE[8001]() ep_pkg = one(pe_pe).EP_PKG[8000]() c_c = one(pe_pe).C_C[8003]() ...
[ "Determine", "if", "a", "PE_PE", "is", "contained", "within", "a", "EP_PKG", "or", "a", "C_C", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L63-L86
[ "def", "is_contained_in", "(", "pe_pe", ",", "root", ")", ":", "if", "not", "pe_pe", ":", "return", "False", "if", "type", "(", "pe_pe", ")", ".", "__name__", "!=", "'PE_PE'", ":", "pe_pe", "=", "one", "(", "pe_pe", ")", ".", "PE_PE", "[", "8001", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
is_global
Check if a PE_PE is globally defined, i.e. not inside a C_C
bridgepoint/ooaofooa.py
def is_global(pe_pe): ''' Check if a PE_PE is globally defined, i.e. not inside a C_C ''' if type(pe_pe).__name__ != 'PE_PE': pe_pe = one(pe_pe).PE_PE[8001]() if one(pe_pe).C_C[8003](): return False pe_pe = one(pe_pe).EP_PKG[8000].PE_PE[8001]() if not pe_pe: ...
def is_global(pe_pe): ''' Check if a PE_PE is globally defined, i.e. not inside a C_C ''' if type(pe_pe).__name__ != 'PE_PE': pe_pe = one(pe_pe).PE_PE[8001]() if one(pe_pe).C_C[8003](): return False pe_pe = one(pe_pe).EP_PKG[8000].PE_PE[8001]() if not pe_pe: ...
[ "Check", "if", "a", "PE_PE", "is", "globally", "defined", "i", ".", "e", ".", "not", "inside", "a", "C_C" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L89-L103
[ "def", "is_global", "(", "pe_pe", ")", ":", "if", "type", "(", "pe_pe", ")", ".", "__name__", "!=", "'PE_PE'", ":", "pe_pe", "=", "one", "(", "pe_pe", ")", ".", "PE_PE", "[", "8001", "]", "(", ")", "if", "one", "(", "pe_pe", ")", ".", "C_C", "[...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
get_defining_component
Get the BridgePoint component (C_C) that defines the packeable element *pe_pe*.
bridgepoint/ooaofooa.py
def get_defining_component(pe_pe): ''' Get the BridgePoint component (C_C) that defines the packeable element *pe_pe*. ''' if pe_pe is None: return None if type(pe_pe).__name__ != 'PE_PE': pe_pe = one(pe_pe).PE_PE[8001]() ep_pkg = one(pe_pe).EP_PKG[8000]() if ep...
def get_defining_component(pe_pe): ''' Get the BridgePoint component (C_C) that defines the packeable element *pe_pe*. ''' if pe_pe is None: return None if type(pe_pe).__name__ != 'PE_PE': pe_pe = one(pe_pe).PE_PE[8001]() ep_pkg = one(pe_pe).EP_PKG[8000]() if ep...
[ "Get", "the", "BridgePoint", "component", "(", "C_C", ")", "that", "defines", "the", "packeable", "element", "*", "pe_pe", "*", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L106-L121
[ "def", "get_defining_component", "(", "pe_pe", ")", ":", "if", "pe_pe", "is", "None", ":", "return", "None", "if", "type", "(", "pe_pe", ")", ".", "__name__", "!=", "'PE_PE'", ":", "pe_pe", "=", "one", "(", "pe_pe", ")", ".", "PE_PE", "[", "8001", "]...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
get_attribute_type
Get the base data type (S_DT) associated with a BridgePoint attribute.
bridgepoint/ooaofooa.py
def get_attribute_type(o_attr): ''' Get the base data type (S_DT) associated with a BridgePoint attribute. ''' ref_o_attr = one(o_attr).O_RATTR[106].O_BATTR[113].O_ATTR[106]() if ref_o_attr: return get_attribute_type(ref_o_attr) else: return one(o_attr).S_DT[114]()
def get_attribute_type(o_attr): ''' Get the base data type (S_DT) associated with a BridgePoint attribute. ''' ref_o_attr = one(o_attr).O_RATTR[106].O_BATTR[113].O_ATTR[106]() if ref_o_attr: return get_attribute_type(ref_o_attr) else: return one(o_attr).S_DT[114]()
[ "Get", "the", "base", "data", "type", "(", "S_DT", ")", "associated", "with", "a", "BridgePoint", "attribute", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L124-L132
[ "def", "get_attribute_type", "(", "o_attr", ")", ":", "ref_o_attr", "=", "one", "(", "o_attr", ")", ".", "O_RATTR", "[", "106", "]", ".", "O_BATTR", "[", "113", "]", ".", "O_ATTR", "[", "106", "]", "(", ")", "if", "ref_o_attr", ":", "return", "get_at...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
_get_data_type_name
Convert a BridgePoint data type to a pyxtuml meta model type.
bridgepoint/ooaofooa.py
def _get_data_type_name(s_dt): ''' Convert a BridgePoint data type to a pyxtuml meta model type. ''' s_cdt = one(s_dt).S_CDT[17]() if s_cdt and s_cdt.Core_Typ in range(1, 6): return s_dt.Name.upper() if one(s_dt).S_EDT[17](): return 'INTEGER' s_dt = one(s_dt).S_UDT[...
def _get_data_type_name(s_dt): ''' Convert a BridgePoint data type to a pyxtuml meta model type. ''' s_cdt = one(s_dt).S_CDT[17]() if s_cdt and s_cdt.Core_Typ in range(1, 6): return s_dt.Name.upper() if one(s_dt).S_EDT[17](): return 'INTEGER' s_dt = one(s_dt).S_UDT[...
[ "Convert", "a", "BridgePoint", "data", "type", "to", "a", "pyxtuml", "meta", "model", "type", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L135-L148
[ "def", "_get_data_type_name", "(", "s_dt", ")", ":", "s_cdt", "=", "one", "(", "s_dt", ")", ".", "S_CDT", "[", "17", "]", "(", ")", "if", "s_cdt", "and", "s_cdt", ".", "Core_Typ", "in", "range", "(", "1", ",", "6", ")", ":", "return", "s_dt", "."...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
_get_related_attributes
The two lists of attributes which relates two classes in an association.
bridgepoint/ooaofooa.py
def _get_related_attributes(r_rgo, r_rto): ''' The two lists of attributes which relates two classes in an association. ''' l1 = list() l2 = list() ref_filter = lambda ref: ref.OIR_ID == r_rgo.OIR_ID for o_ref in many(r_rto).O_RTIDA[110].O_REF[111](ref_filter): o_attr = one(o_re...
def _get_related_attributes(r_rgo, r_rto): ''' The two lists of attributes which relates two classes in an association. ''' l1 = list() l2 = list() ref_filter = lambda ref: ref.OIR_ID == r_rgo.OIR_ID for o_ref in many(r_rto).O_RTIDA[110].O_REF[111](ref_filter): o_attr = one(o_re...
[ "The", "two", "lists", "of", "attributes", "which", "relates", "two", "classes", "in", "an", "association", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L151-L166
[ "def", "_get_related_attributes", "(", "r_rgo", ",", "r_rto", ")", ":", "l1", "=", "list", "(", ")", "l2", "=", "list", "(", ")", "ref_filter", "=", "lambda", "ref", ":", "ref", ".", "OIR_ID", "==", "r_rgo", ".", "OIR_ID", "for", "o_ref", "in", "many...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_enum
Create a named tuple from a BridgePoint enumeration.
bridgepoint/ooaofooa.py
def mk_enum(s_edt): ''' Create a named tuple from a BridgePoint enumeration. ''' s_dt = one(s_edt).S_DT[17]() enums = list() kwlist =['False', 'None', 'True'] + keyword.kwlist for enum in many(s_edt).S_ENUM[27](): if enum.Name in kwlist: enums.append(enum.Name + '_') ...
def mk_enum(s_edt): ''' Create a named tuple from a BridgePoint enumeration. ''' s_dt = one(s_edt).S_DT[17]() enums = list() kwlist =['False', 'None', 'True'] + keyword.kwlist for enum in many(s_edt).S_ENUM[27](): if enum.Name in kwlist: enums.append(enum.Name + '_') ...
[ "Create", "a", "named", "tuple", "from", "a", "BridgePoint", "enumeration", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L169-L183
[ "def", "mk_enum", "(", "s_edt", ")", ":", "s_dt", "=", "one", "(", "s_edt", ")", ".", "S_DT", "[", "17", "]", "(", ")", "enums", "=", "list", "(", ")", "kwlist", "=", "[", "'False'", ",", "'None'", ",", "'True'", "]", "+", "keyword", ".", "kwli...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_bridge
Create a python function from a BridgePoint bridge.
bridgepoint/ooaofooa.py
def mk_bridge(metamodel, s_brg): ''' Create a python function from a BridgePoint bridge. ''' action = s_brg.Action_Semantics_internal label = s_brg.Name return lambda **kwargs: interpret.run_function(metamodel, label, action, kwargs)
def mk_bridge(metamodel, s_brg): ''' Create a python function from a BridgePoint bridge. ''' action = s_brg.Action_Semantics_internal label = s_brg.Name return lambda **kwargs: interpret.run_function(metamodel, label, action, kwargs)
[ "Create", "a", "python", "function", "from", "a", "BridgePoint", "bridge", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L186-L193
[ "def", "mk_bridge", "(", "metamodel", ",", "s_brg", ")", ":", "action", "=", "s_brg", ".", "Action_Semantics_internal", "label", "=", "s_brg", ".", "Name", "return", "lambda", "*", "*", "kwargs", ":", "interpret", ".", "run_function", "(", "metamodel", ",", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_external_entity
Create a python object from a BridgePoint external entity with bridges realized as python member functions.
bridgepoint/ooaofooa.py
def mk_external_entity(metamodel, s_ee): ''' Create a python object from a BridgePoint external entity with bridges realized as python member functions. ''' bridges = many(s_ee).S_BRG[19]() names = [brg.Name for brg in bridges] EE = collections.namedtuple(s_ee.Key_Lett, names) funcs = l...
def mk_external_entity(metamodel, s_ee): ''' Create a python object from a BridgePoint external entity with bridges realized as python member functions. ''' bridges = many(s_ee).S_BRG[19]() names = [brg.Name for brg in bridges] EE = collections.namedtuple(s_ee.Key_Lett, names) funcs = l...
[ "Create", "a", "python", "object", "from", "a", "BridgePoint", "external", "entity", "with", "bridges", "realized", "as", "python", "member", "functions", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L196-L210
[ "def", "mk_external_entity", "(", "metamodel", ",", "s_ee", ")", ":", "bridges", "=", "many", "(", "s_ee", ")", ".", "S_BRG", "[", "19", "]", "(", ")", "names", "=", "[", "brg", ".", "Name", "for", "brg", "in", "bridges", "]", "EE", "=", "collectio...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_function
Create a python function from a BridgePoint function.
bridgepoint/ooaofooa.py
def mk_function(metamodel, s_sync): ''' Create a python function from a BridgePoint function. ''' action = s_sync.Action_Semantics_internal label = s_sync.Name return lambda **kwargs: interpret.run_function(metamodel, label, action, kwargs)
def mk_function(metamodel, s_sync): ''' Create a python function from a BridgePoint function. ''' action = s_sync.Action_Semantics_internal label = s_sync.Name return lambda **kwargs: interpret.run_function(metamodel, label, action, kwargs)
[ "Create", "a", "python", "function", "from", "a", "BridgePoint", "function", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L213-L220
[ "def", "mk_function", "(", "metamodel", ",", "s_sync", ")", ":", "action", "=", "s_sync", ".", "Action_Semantics_internal", "label", "=", "s_sync", ".", "Name", "return", "lambda", "*", "*", "kwargs", ":", "interpret", ".", "run_function", "(", "metamodel", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_constant
Create a python value from a BridgePoint constant.
bridgepoint/ooaofooa.py
def mk_constant(cnst_syc): ''' Create a python value from a BridgePoint constant. ''' s_dt = one(cnst_syc).S_DT[1500]() cnst_lsc = one(cnst_syc).CNST_LFSC[1502].CNST_LSC[1503]() if s_dt.Name == 'boolean': return cnst_lsc.Value.lower() == 'true' if s_dt.Name == 'integer': ...
def mk_constant(cnst_syc): ''' Create a python value from a BridgePoint constant. ''' s_dt = one(cnst_syc).S_DT[1500]() cnst_lsc = one(cnst_syc).CNST_LFSC[1502].CNST_LSC[1503]() if s_dt.Name == 'boolean': return cnst_lsc.Value.lower() == 'true' if s_dt.Name == 'integer': ...
[ "Create", "a", "python", "value", "from", "a", "BridgePoint", "constant", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L223-L240
[ "def", "mk_constant", "(", "cnst_syc", ")", ":", "s_dt", "=", "one", "(", "cnst_syc", ")", ".", "S_DT", "[", "1500", "]", "(", ")", "cnst_lsc", "=", "one", "(", "cnst_syc", ")", ".", "CNST_LFSC", "[", "1502", "]", ".", "CNST_LSC", "[", "1503", "]",...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_operation
Create a python function that interprets that action of a BridgePoint class operation.
bridgepoint/ooaofooa.py
def mk_operation(metaclass, o_tfr): ''' Create a python function that interprets that action of a BridgePoint class operation. ''' o_obj = one(o_tfr).O_OBJ[115]() action = o_tfr.Action_Semantics_internal label = '%s::%s' % (o_obj.Name, o_tfr.Name) run = interpret.run_operation i...
def mk_operation(metaclass, o_tfr): ''' Create a python function that interprets that action of a BridgePoint class operation. ''' o_obj = one(o_tfr).O_OBJ[115]() action = o_tfr.Action_Semantics_internal label = '%s::%s' % (o_obj.Name, o_tfr.Name) run = interpret.run_operation i...
[ "Create", "a", "python", "function", "that", "interprets", "that", "action", "of", "a", "BridgePoint", "class", "operation", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L243-L257
[ "def", "mk_operation", "(", "metaclass", ",", "o_tfr", ")", ":", "o_obj", "=", "one", "(", "o_tfr", ")", ".", "O_OBJ", "[", "115", "]", "(", ")", "action", "=", "o_tfr", ".", "Action_Semantics_internal", "label", "=", "'%s::%s'", "%", "(", "o_obj", "."...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_derived_attribute
Create a python property that interprets that action of a BridgePoint derived attribute.
bridgepoint/ooaofooa.py
def mk_derived_attribute(metaclass, o_dbattr): ''' Create a python property that interprets that action of a BridgePoint derived attribute. ''' o_attr = one(o_dbattr).O_BATTR[107].O_ATTR[106]() o_obj = one(o_attr).O_OBJ[102]() action = o_dbattr.Action_Semantics_internal label = '%s::%s' ...
def mk_derived_attribute(metaclass, o_dbattr): ''' Create a python property that interprets that action of a BridgePoint derived attribute. ''' o_attr = one(o_dbattr).O_BATTR[107].O_ATTR[106]() o_obj = one(o_attr).O_OBJ[102]() action = o_dbattr.Action_Semantics_internal label = '%s::%s' ...
[ "Create", "a", "python", "property", "that", "interprets", "that", "action", "of", "a", "BridgePoint", "derived", "attribute", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L260-L271
[ "def", "mk_derived_attribute", "(", "metaclass", ",", "o_dbattr", ")", ":", "o_attr", "=", "one", "(", "o_dbattr", ")", ".", "O_BATTR", "[", "107", "]", ".", "O_ATTR", "[", "106", "]", "(", ")", "o_obj", "=", "one", "(", "o_attr", ")", ".", "O_OBJ", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_class
Create a pyxtuml class from a BridgePoint class.
bridgepoint/ooaofooa.py
def mk_class(m, o_obj, derived_attributes=False): ''' Create a pyxtuml class from a BridgePoint class. ''' first_filter = lambda selected: not one(selected).O_ATTR[103, 'succeeds']() o_attr = one(o_obj).O_ATTR[102](first_filter) attributes = list() while o_attr: s_dt = get_a...
def mk_class(m, o_obj, derived_attributes=False): ''' Create a pyxtuml class from a BridgePoint class. ''' first_filter = lambda selected: not one(selected).O_ATTR[103, 'succeeds']() o_attr = one(o_obj).O_ATTR[102](first_filter) attributes = list() while o_attr: s_dt = get_a...
[ "Create", "a", "pyxtuml", "class", "from", "a", "BridgePoint", "class", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L274-L319
[ "def", "mk_class", "(", "m", ",", "o_obj", ",", "derived_attributes", "=", "False", ")", ":", "first_filter", "=", "lambda", "selected", ":", "not", "one", "(", "selected", ")", ".", "O_ATTR", "[", "103", ",", "'succeeds'", "]", "(", ")", "o_attr", "="...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_simple_association
Create a pyxtuml association from a simple association in BridgePoint.
bridgepoint/ooaofooa.py
def mk_simple_association(m, r_simp): ''' Create a pyxtuml association from a simple association in BridgePoint. ''' r_rel = one(r_simp).R_REL[206]() r_form = one(r_simp).R_FORM[208]() r_part = one(r_simp).R_PART[207]() r_rgo = one(r_form).R_RGO[205]() r_rto = one(r_part).R_RTO[204...
def mk_simple_association(m, r_simp): ''' Create a pyxtuml association from a simple association in BridgePoint. ''' r_rel = one(r_simp).R_REL[206]() r_form = one(r_simp).R_FORM[208]() r_part = one(r_simp).R_PART[207]() r_rgo = one(r_form).R_RGO[205]() r_rto = one(r_part).R_RTO[204...
[ "Create", "a", "pyxtuml", "association", "from", "a", "simple", "association", "in", "BridgePoint", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L322-L359
[ "def", "mk_simple_association", "(", "m", ",", "r_simp", ")", ":", "r_rel", "=", "one", "(", "r_simp", ")", ".", "R_REL", "[", "206", "]", "(", ")", "r_form", "=", "one", "(", "r_simp", ")", ".", "R_FORM", "[", "208", "]", "(", ")", "r_part", "="...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_linked_association
Create pyxtuml associations from a linked association in BridgePoint.
bridgepoint/ooaofooa.py
def mk_linked_association(m, r_assoc): ''' Create pyxtuml associations from a linked association in BridgePoint. ''' r_rel = one(r_assoc).R_REL[206]() r_rgo = one(r_assoc).R_ASSR[211].R_RGO[205]() source_o_obj = one(r_rgo).R_OIR[203].O_OBJ[201]() def _mk_assoc(side1, side2): r_r...
def mk_linked_association(m, r_assoc): ''' Create pyxtuml associations from a linked association in BridgePoint. ''' r_rel = one(r_assoc).R_REL[206]() r_rgo = one(r_assoc).R_ASSR[211].R_RGO[205]() source_o_obj = one(r_rgo).R_OIR[203].O_OBJ[201]() def _mk_assoc(side1, side2): r_r...
[ "Create", "pyxtuml", "associations", "from", "a", "linked", "association", "in", "BridgePoint", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L362-L397
[ "def", "mk_linked_association", "(", "m", ",", "r_assoc", ")", ":", "r_rel", "=", "one", "(", "r_assoc", ")", ".", "R_REL", "[", "206", "]", "(", ")", "r_rgo", "=", "one", "(", "r_assoc", ")", ".", "R_ASSR", "[", "211", "]", ".", "R_RGO", "[", "2...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_subsuper_association
Create pyxtuml associations from a sub/super association in BridgePoint.
bridgepoint/ooaofooa.py
def mk_subsuper_association(m, r_subsup): ''' Create pyxtuml associations from a sub/super association in BridgePoint. ''' r_rel = one(r_subsup).R_REL[206]() r_rto = one(r_subsup).R_SUPER[212].R_RTO[204]() target_o_obj = one(r_rto).R_OIR[203].O_OBJ[201]() for r_sub in many(r_subsup).R_S...
def mk_subsuper_association(m, r_subsup): ''' Create pyxtuml associations from a sub/super association in BridgePoint. ''' r_rel = one(r_subsup).R_REL[206]() r_rto = one(r_subsup).R_SUPER[212].R_RTO[204]() target_o_obj = one(r_rto).R_OIR[203].O_OBJ[201]() for r_sub in many(r_subsup).R_S...
[ "Create", "pyxtuml", "associations", "from", "a", "sub", "/", "super", "association", "in", "BridgePoint", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L400-L423
[ "def", "mk_subsuper_association", "(", "m", ",", "r_subsup", ")", ":", "r_rel", "=", "one", "(", "r_subsup", ")", ".", "R_REL", "[", "206", "]", "(", ")", "r_rto", "=", "one", "(", "r_subsup", ")", ".", "R_SUPER", "[", "212", "]", ".", "R_RTO", "["...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_association
Create a pyxtuml association from a R_REL in ooaofooa.
bridgepoint/ooaofooa.py
def mk_association(m, r_rel): ''' Create a pyxtuml association from a R_REL in ooaofooa. ''' handler = { 'R_SIMP': mk_simple_association, 'R_ASSOC': mk_linked_association, 'R_SUBSUP': mk_subsuper_association, 'R_COMP': mk_derived_association, } inst = subtype(r_re...
def mk_association(m, r_rel): ''' Create a pyxtuml association from a R_REL in ooaofooa. ''' handler = { 'R_SIMP': mk_simple_association, 'R_ASSOC': mk_linked_association, 'R_SUBSUP': mk_subsuper_association, 'R_COMP': mk_derived_association, } inst = subtype(r_re...
[ "Create", "a", "pyxtuml", "association", "from", "a", "R_REL", "in", "ooaofooa", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L433-L445
[ "def", "mk_association", "(", "m", ",", "r_rel", ")", ":", "handler", "=", "{", "'R_SIMP'", ":", "mk_simple_association", ",", "'R_ASSOC'", ":", "mk_linked_association", ",", "'R_SUBSUP'", ":", "mk_subsuper_association", ",", "'R_COMP'", ":", "mk_derived_association...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
mk_component
Create a pyxtuml meta model from a BridgePoint model. Optionally, restrict to classes and associations contained in the component c_c.
bridgepoint/ooaofooa.py
def mk_component(bp_model, c_c=None, derived_attributes=False): ''' Create a pyxtuml meta model from a BridgePoint model. Optionally, restrict to classes and associations contained in the component c_c. ''' target = Domain() c_c_filt = lambda sel: c_c is None or is_contained_in(sel, c_c) ...
def mk_component(bp_model, c_c=None, derived_attributes=False): ''' Create a pyxtuml meta model from a BridgePoint model. Optionally, restrict to classes and associations contained in the component c_c. ''' target = Domain() c_c_filt = lambda sel: c_c is None or is_contained_in(sel, c_c) ...
[ "Create", "a", "pyxtuml", "meta", "model", "from", "a", "BridgePoint", "model", ".", "Optionally", "restrict", "to", "classes", "and", "associations", "contained", "in", "the", "component", "c_c", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L448-L490
[ "def", "mk_component", "(", "bp_model", ",", "c_c", "=", "None", ",", "derived_attributes", "=", "False", ")", ":", "target", "=", "Domain", "(", ")", "c_c_filt", "=", "lambda", "sel", ":", "c_c", "is", "None", "or", "is_contained_in", "(", "sel", ",", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
load_metamodel
Load and return a metamodel expressed in ooaofooa from a *resource*. The resource may be either a filename, a path, or a list of filenames and/or paths.
bridgepoint/ooaofooa.py
def load_metamodel(resource=None, load_globals=True): ''' Load and return a metamodel expressed in ooaofooa from a *resource*. The resource may be either a filename, a path, or a list of filenames and/or paths. ''' loader = _mk_loader(resource, load_globals) return loader.build_metamodel()
def load_metamodel(resource=None, load_globals=True): ''' Load and return a metamodel expressed in ooaofooa from a *resource*. The resource may be either a filename, a path, or a list of filenames and/or paths. ''' loader = _mk_loader(resource, load_globals) return loader.build_metamodel()
[ "Load", "and", "return", "a", "metamodel", "expressed", "in", "ooaofooa", "from", "a", "*", "resource", "*", ".", "The", "resource", "may", "be", "either", "a", "filename", "a", "path", "or", "a", "list", "of", "filenames", "and", "/", "or", "paths", "...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L557-L564
[ "def", "load_metamodel", "(", "resource", "=", "None", ",", "load_globals", "=", "True", ")", ":", "loader", "=", "_mk_loader", "(", "resource", ",", "load_globals", ")", "return", "loader", ".", "build_metamodel", "(", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
load_component
Load and return a model from a *resource*. The resource may be either a filename, a path, or a list of filenames and/or paths.
bridgepoint/ooaofooa.py
def load_component(resource, name=None, load_globals=True): ''' Load and return a model from a *resource*. The resource may be either a filename, a path, or a list of filenames and/or paths. ''' loader = _mk_loader(resource, load_globals) return loader.build_component()
def load_component(resource, name=None, load_globals=True): ''' Load and return a model from a *resource*. The resource may be either a filename, a path, or a list of filenames and/or paths. ''' loader = _mk_loader(resource, load_globals) return loader.build_component()
[ "Load", "and", "return", "a", "model", "from", "a", "*", "resource", "*", ".", "The", "resource", "may", "be", "either", "a", "filename", "a", "path", "or", "a", "list", "of", "filenames", "and", "/", "or", "paths", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L567-L573
[ "def", "load_component", "(", "resource", ",", "name", "=", "None", ",", "load_globals", "=", "True", ")", ":", "loader", "=", "_mk_loader", "(", "resource", ",", "load_globals", ")", "return", "loader", ".", "build_component", "(", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
delete_globals
Remove global instances, e.g. the core data type integer.
bridgepoint/ooaofooa.py
def delete_globals(m, disconnect=False): ''' Remove global instances, e.g. the core data type integer. ''' filt = lambda sel: (247728914420827907967735776184937480192 <= sel.DT_ID <= 247728914420827907967735776184937480208) for s_dt in m.select_many...
def delete_globals(m, disconnect=False): ''' Remove global instances, e.g. the core data type integer. ''' filt = lambda sel: (247728914420827907967735776184937480192 <= sel.DT_ID <= 247728914420827907967735776184937480208) for s_dt in m.select_many...
[ "Remove", "global", "instances", "e", ".", "g", ".", "the", "core", "data", "type", "integer", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L576-L587
[ "def", "delete_globals", "(", "m", ",", "disconnect", "=", "False", ")", ":", "filt", "=", "lambda", "sel", ":", "(", "247728914420827907967735776184937480192", "<=", "sel", ".", "DT_ID", "<=", "247728914420827907967735776184937480208", ")", "for", "s_dt", "in", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.filename_input
Open and read input from a *path or filename*, and parse its content. If the filename is a directory, files that ends with .xtuml located somewhere in the directory or sub directories will be loaded as well.
bridgepoint/ooaofooa.py
def filename_input(self, path_or_filename): ''' Open and read input from a *path or filename*, and parse its content. If the filename is a directory, files that ends with .xtuml located somewhere in the directory or sub directories will be loaded as well. ''' if ...
def filename_input(self, path_or_filename): ''' Open and read input from a *path or filename*, and parse its content. If the filename is a directory, files that ends with .xtuml located somewhere in the directory or sub directories will be loaded as well. ''' if ...
[ "Open", "and", "read", "input", "from", "a", "*", "path", "or", "filename", "*", "and", "parse", "its", "content", ".", "If", "the", "filename", "is", "a", "directory", "files", "that", "ends", "with", ".", "xtuml", "located", "somewhere", "in", "the", ...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L506-L519
[ "def", "filename_input", "(", "self", ",", "path_or_filename", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "path_or_filename", ")", ":", "for", "path", ",", "_", ",", "files", "in", "os", ".", "walk", "(", "path_or_filename", ")", ":", "for",...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.build_component
Instantiate and build a component from ooaofooa named *name* as a pyxtuml model. Classes, associations, attributes and unique identifers, i.e. O_OBJ, R_REL, O_ATTR in ooaofooa, are defined in the resulting pyxtuml model. Optionally, control whether *derived attributes* shall be ...
bridgepoint/ooaofooa.py
def build_component(self, name=None, derived_attributes=False): ''' Instantiate and build a component from ooaofooa named *name* as a pyxtuml model. Classes, associations, attributes and unique identifers, i.e. O_OBJ, R_REL, O_ATTR in ooaofooa, are defined in the resulting pyxtum...
def build_component(self, name=None, derived_attributes=False): ''' Instantiate and build a component from ooaofooa named *name* as a pyxtuml model. Classes, associations, attributes and unique identifers, i.e. O_OBJ, R_REL, O_ATTR in ooaofooa, are defined in the resulting pyxtum...
[ "Instantiate", "and", "build", "a", "component", "from", "ooaofooa", "named", "*", "name", "*", "as", "a", "pyxtuml", "model", ".", "Classes", "associations", "attributes", "and", "unique", "identifers", "i", ".", "e", ".", "O_OBJ", "R_REL", "O_ATTR", "in", ...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/bridgepoint/ooaofooa.py#L521-L541
[ "def", "build_component", "(", "self", ",", "name", "=", "None", ",", "derived_attributes", "=", "False", ")", ":", "mm", "=", "self", ".", "build_metamodel", "(", ")", "c_c", "=", "mm", ".", "select_any", "(", "'C_C'", ",", "where", "(", "Name", "=", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
default_malformed_message_handler
The default malformed message handler for :class:`Worker`. It warns as a :exc:`MalformedMessage`.
zeronimo/core.py
def default_malformed_message_handler(worker, exc_info, message_parts): """The default malformed message handler for :class:`Worker`. It warns as a :exc:`MalformedMessage`. """ exc_type, exc, tb = exc_info exc_strs = traceback.format_exception_only(exc_type, exc) exc_str = exc_strs[0].strip() ...
def default_malformed_message_handler(worker, exc_info, message_parts): """The default malformed message handler for :class:`Worker`. It warns as a :exc:`MalformedMessage`. """ exc_type, exc, tb = exc_info exc_strs = traceback.format_exception_only(exc_type, exc) exc_str = exc_strs[0].strip() ...
[ "The", "default", "malformed", "message", "handler", "for", ":", "class", ":", "Worker", ".", "It", "warns", "as", "a", ":", "exc", ":", "MalformedMessage", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/core.py#L133-L142
[ "def", "default_malformed_message_handler", "(", "worker", ",", "exc_info", ",", "message_parts", ")", ":", "exc_type", ",", "exc", ",", "tb", "=", "exc_info", "exc_strs", "=", "traceback", ".", "format_exception_only", "(", "exc_type", ",", "exc", ")", "exc_str...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
Worker.work
Calls a function and send results to the collector. It supports all of function actions. A function could return, yield, raise any packable objects.
zeronimo/core.py
def work(self, socket, call, args, kwargs, topics=()): """Calls a function and send results to the collector. It supports all of function actions. A function could return, yield, raise any packable objects. """ task_id = uuid4_bytes() reply_socket, topics = self.replier...
def work(self, socket, call, args, kwargs, topics=()): """Calls a function and send results to the collector. It supports all of function actions. A function could return, yield, raise any packable objects. """ task_id = uuid4_bytes() reply_socket, topics = self.replier...
[ "Calls", "a", "function", "and", "send", "results", "to", "the", "collector", ".", "It", "supports", "all", "of", "function", "actions", ".", "A", "function", "could", "return", "yield", "raise", "any", "packable", "objects", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/core.py#L268-L314
[ "def", "work", "(", "self", ",", "socket", ",", "call", ",", "args", ",", "kwargs", ",", "topics", "=", "(", ")", ")", ":", "task_id", "=", "uuid4_bytes", "(", ")", "reply_socket", ",", "topics", "=", "self", ".", "replier", "(", "socket", ",", "to...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
Worker.accept
Sends ACCEPT reply.
zeronimo/core.py
def accept(self, reply_socket, channel): """Sends ACCEPT reply.""" info = self.info or b'' self.send_raw(reply_socket, ACCEPT, info, *channel)
def accept(self, reply_socket, channel): """Sends ACCEPT reply.""" info = self.info or b'' self.send_raw(reply_socket, ACCEPT, info, *channel)
[ "Sends", "ACCEPT", "reply", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/core.py#L331-L334
[ "def", "accept", "(", "self", ",", "reply_socket", ",", "channel", ")", ":", "info", "=", "self", ".", "info", "or", "b''", "self", ".", "send_raw", "(", "reply_socket", ",", "ACCEPT", ",", "info", ",", "*", "channel", ")" ]
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
Worker.reject
Sends REJECT reply.
zeronimo/core.py
def reject(self, reply_socket, call_id, topics=()): """Sends REJECT reply.""" info = self.info or b'' self.send_raw(reply_socket, REJECT, info, call_id, b'', topics)
def reject(self, reply_socket, call_id, topics=()): """Sends REJECT reply.""" info = self.info or b'' self.send_raw(reply_socket, REJECT, info, call_id, b'', topics)
[ "Sends", "REJECT", "reply", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/core.py#L336-L339
[ "def", "reject", "(", "self", ",", "reply_socket", ",", "call_id", ",", "topics", "=", "(", ")", ")", ":", "info", "=", "self", ".", "info", "or", "b''", "self", ".", "send_raw", "(", "reply_socket", ",", "REJECT", ",", "info", ",", "call_id", ",", ...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
Worker.raise_
Sends RAISE reply.
zeronimo/core.py
def raise_(self, reply_socket, channel, exc_info=None): """Sends RAISE reply.""" if not reply_socket: return if exc_info is None: exc_info = sys.exc_info() exc_type, exc, tb = exc_info while tb.tb_next is not None: tb = tb.tb_next if is...
def raise_(self, reply_socket, channel, exc_info=None): """Sends RAISE reply.""" if not reply_socket: return if exc_info is None: exc_info = sys.exc_info() exc_type, exc, tb = exc_info while tb.tb_next is not None: tb = tb.tb_next if is...
[ "Sends", "RAISE", "reply", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/core.py#L341-L360
[ "def", "raise_", "(", "self", ",", "reply_socket", ",", "channel", ",", "exc_info", "=", "None", ")", ":", "if", "not", "reply_socket", ":", "return", "if", "exc_info", "is", "None", ":", "exc_info", "=", "sys", ".", "exc_info", "(", ")", "exc_type", "...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
_Caller._call_wait
Allocates a call id and emit.
zeronimo/core.py
def _call_wait(self, hints, name, args, kwargs, topics=(), raw=False, limit=None, retry=False, max_retries=None): """Allocates a call id and emit.""" col = self.collector if not col.is_running(): col.start() call_id = uuid4_bytes() reply_to = (DUPLE...
def _call_wait(self, hints, name, args, kwargs, topics=(), raw=False, limit=None, retry=False, max_retries=None): """Allocates a call id and emit.""" col = self.collector if not col.is_running(): col.start() call_id = uuid4_bytes() reply_to = (DUPLE...
[ "Allocates", "a", "call", "id", "and", "emit", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/core.py#L454-L475
[ "def", "_call_wait", "(", "self", ",", "hints", ",", "name", ",", "args", ",", "kwargs", ",", "topics", "=", "(", ")", ",", "raw", "=", "False", ",", "limit", "=", "None", ",", "retry", "=", "False", ",", "max_retries", "=", "None", ")", ":", "co...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
Collector.establish
Waits for the call is accepted by workers and starts to collect the results.
zeronimo/core.py
def establish(self, call_id, timeout, limit=None, retry=None, max_retries=None): """Waits for the call is accepted by workers and starts to collect the results. """ rejected = 0 retried = 0 results = [] result_queue = self.result_queues[call_id] ...
def establish(self, call_id, timeout, limit=None, retry=None, max_retries=None): """Waits for the call is accepted by workers and starts to collect the results. """ rejected = 0 retried = 0 results = [] result_queue = self.result_queues[call_id] ...
[ "Waits", "for", "the", "call", "is", "accepted", "by", "workers", "and", "starts", "to", "collect", "the", "results", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/core.py#L607-L641
[ "def", "establish", "(", "self", ",", "call_id", ",", "timeout", ",", "limit", "=", "None", ",", "retry", "=", "None", ",", "max_retries", "=", "None", ")", ":", "rejected", "=", "0", "retried", "=", "0", "results", "=", "[", "]", "result_queue", "="...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
Collector.dispatch_reply
Dispatches the reply to the proper queue.
zeronimo/core.py
def dispatch_reply(self, reply, value): """Dispatches the reply to the proper queue.""" method = reply.method call_id = reply.call_id task_id = reply.task_id if method & ACK: try: result_queue = self.result_queues[call_id] except KeyError: ...
def dispatch_reply(self, reply, value): """Dispatches the reply to the proper queue.""" method = reply.method call_id = reply.call_id task_id = reply.task_id if method & ACK: try: result_queue = self.result_queues[call_id] except KeyError: ...
[ "Dispatches", "the", "reply", "to", "the", "proper", "queue", "." ]
sublee/zeronimo
python
https://github.com/sublee/zeronimo/blob/b216638232932718d2cbc5eabd870c8f5b5e83fb/zeronimo/core.py#L675-L694
[ "def", "dispatch_reply", "(", "self", ",", "reply", ",", "value", ")", ":", "method", "=", "reply", ".", "method", "call_id", "=", "reply", ".", "call_id", "task_id", "=", "reply", ".", "task_id", "if", "method", "&", "ACK", ":", "try", ":", "result_qu...
b216638232932718d2cbc5eabd870c8f5b5e83fb
test
guess_type_name
Guess the type name of a serialized value.
xtuml/load.py
def guess_type_name(value): ''' Guess the type name of a serialized value. ''' value = str(value) if value.upper() in ['TRUE', 'FALSE']: return 'BOOLEAN' elif re.match(r'(-)?(\d+)(\.\d+)', value): return 'REAL' elif re.match(r'(-)?(\d+)', value): return...
def guess_type_name(value): ''' Guess the type name of a serialized value. ''' value = str(value) if value.upper() in ['TRUE', 'FALSE']: return 'BOOLEAN' elif re.match(r'(-)?(\d+)(\.\d+)', value): return 'REAL' elif re.match(r'(-)?(\d+)', value): return...
[ "Guess", "the", "type", "name", "of", "a", "serialized", "value", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L37-L56
[ "def", "guess_type_name", "(", "value", ")", ":", "value", "=", "str", "(", "value", ")", "if", "value", ".", "upper", "(", ")", "in", "[", "'TRUE'", ",", "'FALSE'", "]", ":", "return", "'BOOLEAN'", "elif", "re", ".", "match", "(", "r'(-)?(\\d+)(\\.\\d...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
deserialize_value
Deserialize a value of some type
xtuml/load.py
def deserialize_value(ty, value): ''' Deserialize a value of some type ''' uty = ty.upper() if uty == 'BOOLEAN': if value.isdigit(): return bool(int(value)) elif value.upper() == 'FALSE': return False elif value.upper() == 'TRUE': retu...
def deserialize_value(ty, value): ''' Deserialize a value of some type ''' uty = ty.upper() if uty == 'BOOLEAN': if value.isdigit(): return bool(int(value)) elif value.upper() == 'FALSE': return False elif value.upper() == 'TRUE': retu...
[ "Deserialize", "a", "value", "of", "some", "type" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L59-L91
[ "def", "deserialize_value", "(", "ty", ",", "value", ")", ":", "uty", "=", "ty", ".", "upper", "(", ")", "if", "uty", "==", "'BOOLEAN'", ":", "if", "value", ".", "isdigit", "(", ")", ":", "return", "bool", "(", "int", "(", "value", ")", ")", "eli...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
load_metamodel
Load and return a metamodel from a *resource*. The *resource* may be either a filename, or a list of filenames. Usage example: >>> metamodel = xtuml.load_metamodel(['schema.sql', 'data.sql'])
xtuml/load.py
def load_metamodel(resource): ''' Load and return a metamodel from a *resource*. The *resource* may be either a filename, or a list of filenames. Usage example: >>> metamodel = xtuml.load_metamodel(['schema.sql', 'data.sql']) ''' if isinstance(resource, str): resource = [re...
def load_metamodel(resource): ''' Load and return a metamodel from a *resource*. The *resource* may be either a filename, or a list of filenames. Usage example: >>> metamodel = xtuml.load_metamodel(['schema.sql', 'data.sql']) ''' if isinstance(resource, str): resource = [re...
[ "Load", "and", "return", "a", "metamodel", "from", "a", "*", "resource", "*", ".", "The", "*", "resource", "*", "may", "be", "either", "a", "filename", "or", "a", "list", "of", "filenames", ".", "Usage", "example", ":", ">>>", "metamodel", "=", "xtuml"...
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L696-L712
[ "def", "load_metamodel", "(", "resource", ")", ":", "if", "isinstance", "(", "resource", ",", "str", ")", ":", "resource", "=", "[", "resource", "]", "loader", "=", "ModelLoader", "(", ")", "for", "filename", "in", "resource", ":", "loader", ".", "filena...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.input
Parse *data* directly from a string. The *name* is used when reporting positional information if the parser encounter syntax errors.
xtuml/load.py
def input(self, data, name='<string>'): ''' Parse *data* directly from a string. The *name* is used when reporting positional information if the parser encounter syntax errors. ''' lexer = lex.lex(debuglog=logger, errorlog=logger, o...
def input(self, data, name='<string>'): ''' Parse *data* directly from a string. The *name* is used when reporting positional information if the parser encounter syntax errors. ''' lexer = lex.lex(debuglog=logger, errorlog=logger, o...
[ "Parse", "*", "data", "*", "directly", "from", "a", "string", ".", "The", "*", "name", "*", "is", "used", "when", "reporting", "positional", "information", "if", "the", "parser", "encounter", "syntax", "errors", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L214-L228
[ "def", "input", "(", "self", ",", "data", ",", "name", "=", "'<string>'", ")", ":", "lexer", "=", "lex", ".", "lex", "(", "debuglog", "=", "logger", ",", "errorlog", "=", "logger", ",", "optimize", "=", "1", ",", "module", "=", "self", ",", "output...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.file_input
Read and parse data from a *file object*, i.e. the type of object returned by the builtin python function *open()*.
xtuml/load.py
def file_input(self, file_object): ''' Read and parse data from a *file object*, i.e. the type of object returned by the builtin python function *open()*. ''' return self.input(file_object.read(), name=file_object.name)
def file_input(self, file_object): ''' Read and parse data from a *file object*, i.e. the type of object returned by the builtin python function *open()*. ''' return self.input(file_object.read(), name=file_object.name)
[ "Read", "and", "parse", "data", "from", "a", "*", "file", "object", "*", "i", ".", "e", ".", "the", "type", "of", "object", "returned", "by", "the", "builtin", "python", "function", "*", "open", "()", "*", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L237-L242
[ "def", "file_input", "(", "self", ",", "file_object", ")", ":", "return", "self", ".", "input", "(", "file_object", ".", "read", "(", ")", ",", "name", "=", "file_object", ".", "name", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.populate_classes
Populate a *metamodel* with classes previously encountered from input.
xtuml/load.py
def populate_classes(self, metamodel): ''' Populate a *metamodel* with classes previously encountered from input. ''' for stmt in self.statements: if isinstance(stmt, CreateClassStmt): metamodel.define_class(stmt.kind, stmt.attributes)
def populate_classes(self, metamodel): ''' Populate a *metamodel* with classes previously encountered from input. ''' for stmt in self.statements: if isinstance(stmt, CreateClassStmt): metamodel.define_class(stmt.kind, stmt.attributes)
[ "Populate", "a", "*", "metamodel", "*", "with", "classes", "previously", "encountered", "from", "input", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L244-L250
[ "def", "populate_classes", "(", "self", ",", "metamodel", ")", ":", "for", "stmt", "in", "self", ".", "statements", ":", "if", "isinstance", "(", "stmt", ",", "CreateClassStmt", ")", ":", "metamodel", ".", "define_class", "(", "stmt", ".", "kind", ",", "...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.populate_associations
Populate a *metamodel* with associations previously encountered from input.
xtuml/load.py
def populate_associations(self, metamodel): ''' Populate a *metamodel* with associations previously encountered from input. ''' for stmt in self.statements: if not isinstance(stmt, CreateAssociationStmt): continue ass = metamod...
def populate_associations(self, metamodel): ''' Populate a *metamodel* with associations previously encountered from input. ''' for stmt in self.statements: if not isinstance(stmt, CreateAssociationStmt): continue ass = metamod...
[ "Populate", "a", "*", "metamodel", "*", "with", "associations", "previously", "encountered", "from", "input", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L252-L272
[ "def", "populate_associations", "(", "self", ",", "metamodel", ")", ":", "for", "stmt", "in", "self", ".", "statements", ":", "if", "not", "isinstance", "(", "stmt", ",", "CreateAssociationStmt", ")", ":", "continue", "ass", "=", "metamodel", ".", "define_as...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.populate_unique_identifiers
Populate a *metamodel* with class unique identifiers previously encountered from input.
xtuml/load.py
def populate_unique_identifiers(self, metamodel): ''' Populate a *metamodel* with class unique identifiers previously encountered from input. ''' for stmt in self.statements: if isinstance(stmt, CreateUniqueStmt): metamodel.define_unique_identifier(stm...
def populate_unique_identifiers(self, metamodel): ''' Populate a *metamodel* with class unique identifiers previously encountered from input. ''' for stmt in self.statements: if isinstance(stmt, CreateUniqueStmt): metamodel.define_unique_identifier(stm...
[ "Populate", "a", "*", "metamodel", "*", "with", "class", "unique", "identifiers", "previously", "encountered", "from", "input", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L274-L282
[ "def", "populate_unique_identifiers", "(", "self", ",", "metamodel", ")", ":", "for", "stmt", "in", "self", ".", "statements", ":", "if", "isinstance", "(", "stmt", ",", "CreateUniqueStmt", ")", ":", "metamodel", ".", "define_unique_identifier", "(", "stmt", "...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader._populate_matching_class
Populate a *metamodel* with a class that matches the given *insert statement*.
xtuml/load.py
def _populate_matching_class(metamodel, kind, names, values): ''' Populate a *metamodel* with a class that matches the given *insert statement*. ''' attributes = list() for name, value in zip(names, values): ty = guess_type_name(value) attr = (name...
def _populate_matching_class(metamodel, kind, names, values): ''' Populate a *metamodel* with a class that matches the given *insert statement*. ''' attributes = list() for name, value in zip(names, values): ty = guess_type_name(value) attr = (name...
[ "Populate", "a", "*", "metamodel", "*", "with", "a", "class", "that", "matches", "the", "given", "*", "insert", "statement", "*", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L285-L296
[ "def", "_populate_matching_class", "(", "metamodel", ",", "kind", ",", "names", ",", "values", ")", ":", "attributes", "=", "list", "(", ")", "for", "name", ",", "value", "in", "zip", "(", "names", ",", "values", ")", ":", "ty", "=", "guess_type_name", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader._populate_instance_with_positional_arguments
Populate a *metamodel* with an instance previously encountered from input that was defined using positional arguments.
xtuml/load.py
def _populate_instance_with_positional_arguments(metamodel, stmt): ''' Populate a *metamodel* with an instance previously encountered from input that was defined using positional arguments. ''' if stmt.kind.upper() not in metamodel.metaclasses: names = ['_%s' % idx f...
def _populate_instance_with_positional_arguments(metamodel, stmt): ''' Populate a *metamodel* with an instance previously encountered from input that was defined using positional arguments. ''' if stmt.kind.upper() not in metamodel.metaclasses: names = ['_%s' % idx f...
[ "Populate", "a", "*", "metamodel", "*", "with", "an", "instance", "previously", "encountered", "from", "input", "that", "was", "defined", "using", "positional", "arguments", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L299-L326
[ "def", "_populate_instance_with_positional_arguments", "(", "metamodel", ",", "stmt", ")", ":", "if", "stmt", ".", "kind", ".", "upper", "(", ")", "not", "in", "metamodel", ".", "metaclasses", ":", "names", "=", "[", "'_%s'", "%", "idx", "for", "idx", "in"...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader._populate_instance_with_named_arguments
Populate a *metamodel* with an instance previously encountered from input that was defined using named arguments.
xtuml/load.py
def _populate_instance_with_named_arguments(metamodel, stmt): ''' Populate a *metamodel* with an instance previously encountered from input that was defined using named arguments. ''' if stmt.kind.upper() not in metamodel.metaclasses: ModelLoader._populate_matching_c...
def _populate_instance_with_named_arguments(metamodel, stmt): ''' Populate a *metamodel* with an instance previously encountered from input that was defined using named arguments. ''' if stmt.kind.upper() not in metamodel.metaclasses: ModelLoader._populate_matching_c...
[ "Populate", "a", "*", "metamodel", "*", "with", "an", "instance", "previously", "encountered", "from", "input", "that", "was", "defined", "using", "named", "arguments", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L329-L363
[ "def", "_populate_instance_with_named_arguments", "(", "metamodel", ",", "stmt", ")", ":", "if", "stmt", ".", "kind", ".", "upper", "(", ")", "not", "in", "metamodel", ".", "metaclasses", ":", "ModelLoader", ".", "_populate_matching_class", "(", "metamodel", ","...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.populate_instances
Populate a *metamodel* with instances previously encountered from input.
xtuml/load.py
def populate_instances(self, metamodel): ''' Populate a *metamodel* with instances previously encountered from input. ''' for stmt in self.statements: if not isinstance(stmt, CreateInstanceStmt): continue if stmt.names: ...
def populate_instances(self, metamodel): ''' Populate a *metamodel* with instances previously encountered from input. ''' for stmt in self.statements: if not isinstance(stmt, CreateInstanceStmt): continue if stmt.names: ...
[ "Populate", "a", "*", "metamodel", "*", "with", "instances", "previously", "encountered", "from", "input", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L365-L379
[ "def", "populate_instances", "(", "self", ",", "metamodel", ")", ":", "for", "stmt", "in", "self", ".", "statements", ":", "if", "not", "isinstance", "(", "stmt", ",", "CreateInstanceStmt", ")", ":", "continue", "if", "stmt", ".", "names", ":", "fn", "="...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.populate_connections
Populate links in a *metamodel* with connections between them.
xtuml/load.py
def populate_connections(self, metamodel): ''' Populate links in a *metamodel* with connections between them. ''' storage = dict() for ass in metamodel.associations: source_class = ass.source_link.to_metaclass target_class = ass.target_link.to_metaclass ...
def populate_connections(self, metamodel): ''' Populate links in a *metamodel* with connections between them. ''' storage = dict() for ass in metamodel.associations: source_class = ass.source_link.to_metaclass target_class = ass.target_link.to_metaclass ...
[ "Populate", "links", "in", "a", "*", "metamodel", "*", "with", "connections", "between", "them", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L381-L422
[ "def", "populate_connections", "(", "self", ",", "metamodel", ")", ":", "storage", "=", "dict", "(", ")", "for", "ass", "in", "metamodel", ".", "associations", ":", "source_class", "=", "ass", ".", "source_link", ".", "to_metaclass", "target_class", "=", "as...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.populate
Populate a *metamodel* with entities previously encountered from input.
xtuml/load.py
def populate(self, metamodel): ''' Populate a *metamodel* with entities previously encountered from input. ''' self.populate_classes(metamodel) self.populate_unique_identifiers(metamodel) self.populate_associations(metamodel) self.populate_instances(metamodel) ...
def populate(self, metamodel): ''' Populate a *metamodel* with entities previously encountered from input. ''' self.populate_classes(metamodel) self.populate_unique_identifiers(metamodel) self.populate_associations(metamodel) self.populate_instances(metamodel) ...
[ "Populate", "a", "*", "metamodel", "*", "with", "entities", "previously", "encountered", "from", "input", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L424-L432
[ "def", "populate", "(", "self", ",", "metamodel", ")", ":", "self", ".", "populate_classes", "(", "metamodel", ")", "self", ".", "populate_unique_identifiers", "(", "metamodel", ")", "self", ".", "populate_associations", "(", "metamodel", ")", "self", ".", "po...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.build_metamodel
Build and return a *xtuml.MetaModel* containing previously loaded input.
xtuml/load.py
def build_metamodel(self, id_generator=None): ''' Build and return a *xtuml.MetaModel* containing previously loaded input. ''' m = xtuml.MetaModel(id_generator) self.populate(m) return m
def build_metamodel(self, id_generator=None): ''' Build and return a *xtuml.MetaModel* containing previously loaded input. ''' m = xtuml.MetaModel(id_generator) self.populate(m) return m
[ "Build", "and", "return", "a", "*", "xtuml", ".", "MetaModel", "*", "containing", "previously", "loaded", "input", "." ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L434-L442
[ "def", "build_metamodel", "(", "self", ",", "id_generator", "=", "None", ")", ":", "m", "=", "xtuml", ".", "MetaModel", "(", "id_generator", ")", "self", ".", "populate", "(", "m", ")", "return", "m" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_COMMA
r',
xtuml/load.py
def t_COMMA(self, t): r',' t.endlexpos = t.lexpos + len(t.value) return t
def t_COMMA(self, t): r',' t.endlexpos = t.lexpos + len(t.value) return t
[ "r" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L449-L452
[ "def", "t_COMMA", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_FRACTION
r'(\d+)(\.\d+)
xtuml/load.py
def t_FRACTION(self, t): r'(\d+)(\.\d+)' t.endlexpos = t.lexpos + len(t.value) return t
def t_FRACTION(self, t): r'(\d+)(\.\d+)' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "(", "\\", "d", "+", ")", "(", "\\", ".", "\\", "d", "+", ")" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L454-L457
[ "def", "t_FRACTION", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_RELID
r'R[0-9]+
xtuml/load.py
def t_RELID(self, t): r'R[0-9]+' t.endlexpos = t.lexpos + len(t.value) return t
def t_RELID(self, t): r'R[0-9]+' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "R", "[", "0", "-", "9", "]", "+" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L459-L462
[ "def", "t_RELID", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_CARDINALITY
r'(1C)
xtuml/load.py
def t_CARDINALITY(self, t): r'(1C)' t.endlexpos = t.lexpos + len(t.value) return t
def t_CARDINALITY(self, t): r'(1C)' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "(", "1C", ")" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L464-L467
[ "def", "t_CARDINALITY", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_ID
r'[A-Za-z_][\w_]*
xtuml/load.py
def t_ID(self, t): r'[A-Za-z_][\w_]*' vup = t.value.upper() if vup in self.reserved: t.type = vup t.endlexpos = t.lexpos + len(t.value) return t
def t_ID(self, t): r'[A-Za-z_][\w_]*' vup = t.value.upper() if vup in self.reserved: t.type = vup t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "[", "A", "-", "Za", "-", "z_", "]", "[", "\\", "w_", "]", "*" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L469-L475
[ "def", "t_ID", "(", "self", ",", "t", ")", ":", "vup", "=", "t", ".", "value", ".", "upper", "(", ")", "if", "vup", "in", "self", ".", "reserved", ":", "t", ".", "type", "=", "vup", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_LPAREN
r'\(
xtuml/load.py
def t_LPAREN(self, t): r'\(' t.endlexpos = t.lexpos + len(t.value) return t
def t_LPAREN(self, t): r'\(' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "\\", "(" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L477-L480
[ "def", "t_LPAREN", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_MINUS
r'-
xtuml/load.py
def t_MINUS(self, t): r'-' t.endlexpos = t.lexpos + len(t.value) return t
def t_MINUS(self, t): r'-' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "-" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L482-L485
[ "def", "t_MINUS", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_NUMBER
r'[0-9]+
xtuml/load.py
def t_NUMBER(self, t): r'[0-9]+' t.endlexpos = t.lexpos + len(t.value) return t
def t_NUMBER(self, t): r'[0-9]+' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "[", "0", "-", "9", "]", "+" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L487-L490
[ "def", "t_NUMBER", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_RPAREN
r'\)
xtuml/load.py
def t_RPAREN(self, t): r'\)' t.endlexpos = t.lexpos + len(t.value) return t
def t_RPAREN(self, t): r'\)' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "\\", ")" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L492-L495
[ "def", "t_RPAREN", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_SEMICOLON
r';
xtuml/load.py
def t_SEMICOLON(self, t): r';' t.endlexpos = t.lexpos + len(t.value) return t
def t_SEMICOLON(self, t): r';' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", ";" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L497-L500
[ "def", "t_SEMICOLON", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_GUID
r'\"([^\\\n]|(\\.))*?\"
xtuml/load.py
def t_GUID(self, t): r'\"([^\\\n]|(\\.))*?\"' t.endlexpos = t.lexpos + len(t.value) return t
def t_GUID(self, t): r'\"([^\\\n]|(\\.))*?\"' t.endlexpos = t.lexpos + len(t.value) return t
[ "r", "\\", "(", "[", "^", "\\\\\\", "n", "]", "|", "(", "\\\\", ".", "))", "*", "?", "\\" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L508-L511
[ "def", "t_GUID", "(", "self", ",", "t", ")", ":", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")", "return", "t" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.t_newline
r'\n+
xtuml/load.py
def t_newline(self, t): r'\n+' t.lexer.lineno += len(t.value) t.endlexpos = t.lexpos + len(t.value)
def t_newline(self, t): r'\n+' t.lexer.lineno += len(t.value) t.endlexpos = t.lexpos + len(t.value)
[ "r", "\\", "n", "+" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L513-L516
[ "def", "t_newline", "(", "self", ",", "t", ")", ":", "t", ".", "lexer", ".", "lineno", "+=", "len", "(", "t", ".", "value", ")", "t", ".", "endlexpos", "=", "t", ".", "lexpos", "+", "len", "(", "t", ".", "value", ")" ]
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.p_statement
statement : create_table_statement SEMICOLON | insert_into_statement SEMICOLON | create_rop_statement SEMICOLON | create_index_statement SEMICOLON
xtuml/load.py
def p_statement(self, p): ''' statement : create_table_statement SEMICOLON | insert_into_statement SEMICOLON | create_rop_statement SEMICOLON | create_index_statement SEMICOLON ''' p[0] = p[1] p[0].offset = p.lexpos(1) ...
def p_statement(self, p): ''' statement : create_table_statement SEMICOLON | insert_into_statement SEMICOLON | create_rop_statement SEMICOLON | create_index_statement SEMICOLON ''' p[0] = p[1] p[0].offset = p.lexpos(1) ...
[ "statement", ":", "create_table_statement", "SEMICOLON", "|", "insert_into_statement", "SEMICOLON", "|", "create_rop_statement", "SEMICOLON", "|", "create_index_statement", "SEMICOLON" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L539-L549
[ "def", "p_statement", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "p", "[", "0", "]", ".", "offset", "=", "p", ".", "lexpos", "(", "1", ")", "p", "[", "0", "]", ".", "lineno", "=", "p", ".", "lineno", "...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.p_create_rop_statement
create_rop_statement : CREATE ROP REF_ID RELID FROM association_end TO association_end
xtuml/load.py
def p_create_rop_statement(self, p): '''create_rop_statement : CREATE ROP REF_ID RELID FROM association_end TO association_end''' args = [p[4]] args.extend(p[6]) args.extend(p[8]) p[0] = CreateAssociationStmt(*args)
def p_create_rop_statement(self, p): '''create_rop_statement : CREATE ROP REF_ID RELID FROM association_end TO association_end''' args = [p[4]] args.extend(p[6]) args.extend(p[8]) p[0] = CreateAssociationStmt(*args)
[ "create_rop_statement", ":", "CREATE", "ROP", "REF_ID", "RELID", "FROM", "association_end", "TO", "association_end" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L615-L620
[ "def", "p_create_rop_statement", "(", "self", ",", "p", ")", ":", "args", "=", "[", "p", "[", "4", "]", "]", "args", ".", "extend", "(", "p", "[", "6", "]", ")", "args", ".", "extend", "(", "p", "[", "8", "]", ")", "p", "[", "0", "]", "=", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.p_cardinality_1
cardinality : NUMBER
xtuml/load.py
def p_cardinality_1(self, p): '''cardinality : NUMBER''' if p[1] != '1': raise ParsingException("illegal cardinality (%s) at %s:%d" % (p[1], p.lexer.filename, p.lineno(1))) p[0] = p[1]
def p_cardinality_1(self, p): '''cardinality : NUMBER''' if p[1] != '1': raise ParsingException("illegal cardinality (%s) at %s:%d" % (p[1], p.lexer.filename, p.lineno(1))) p[0] = p[1]
[ "cardinality", ":", "NUMBER" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L630-L635
[ "def", "p_cardinality_1", "(", "self", ",", "p", ")", ":", "if", "p", "[", "1", "]", "!=", "'1'", ":", "raise", "ParsingException", "(", "\"illegal cardinality (%s) at %s:%d\"", "%", "(", "p", "[", "1", "]", ",", "p", ".", "lexer", ".", "filename", ","...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
ModelLoader.p_cardinality_many
cardinality : ID
xtuml/load.py
def p_cardinality_many(self, p): '''cardinality : ID''' if p[1] not in ['M', 'MC']: raise ParsingException("illegal cardinality (%s) at %s:%d" % (p[1], p.lexer.filename, p.lineno(1))) p[0] = p[1]
def p_cardinality_many(self, p): '''cardinality : ID''' if p[1] not in ['M', 'MC']: raise ParsingException("illegal cardinality (%s) at %s:%d" % (p[1], p.lexer.filename, p.lineno(1))) p[0] = p[1]
[ "cardinality", ":", "ID" ]
xtuml/pyxtuml
python
https://github.com/xtuml/pyxtuml/blob/7dd9343b9a0191d1db1887ab9288d0a026608d9a/xtuml/load.py#L637-L642
[ "def", "p_cardinality_many", "(", "self", ",", "p", ")", ":", "if", "p", "[", "1", "]", "not", "in", "[", "'M'", ",", "'MC'", "]", ":", "raise", "ParsingException", "(", "\"illegal cardinality (%s) at %s:%d\"", "%", "(", "p", "[", "1", "]", ",", "p", ...
7dd9343b9a0191d1db1887ab9288d0a026608d9a
test
Searcher.append_known_secrets
Read key-value pair files with secrets. For example, .conf and .ini files. :return:
find_known_secrets/searcher.py
def append_known_secrets(self): # type: () -> None """ Read key-value pair files with secrets. For example, .conf and .ini files. :return: """ for file_name in self.files: if "~" in file_name: file_name = os.path.expanduser(file_name) if n...
def append_known_secrets(self): # type: () -> None """ Read key-value pair files with secrets. For example, .conf and .ini files. :return: """ for file_name in self.files: if "~" in file_name: file_name = os.path.expanduser(file_name) if n...
[ "Read", "key", "-", "value", "pair", "files", "with", "secrets", ".", "For", "example", ".", "conf", "and", ".", "ini", "files", ".", ":", "return", ":" ]
matthewdeanmartin/find_known_secrets
python
https://github.com/matthewdeanmartin/find_known_secrets/blob/f25735c1ab4512bad85ade33af7021f6fac1d13b/find_known_secrets/searcher.py#L58-L80
[ "def", "append_known_secrets", "(", "self", ")", ":", "# type: () -> None", "for", "file_name", "in", "self", ".", "files", ":", "if", "\"~\"", "in", "file_name", ":", "file_name", "=", "os", ".", "path", ".", "expanduser", "(", "file_name", ")", "if", "no...
f25735c1ab4512bad85ade33af7021f6fac1d13b
test
Searcher.search_known_secrets
Search a path for known secrets, outputing text and file when found :return:
find_known_secrets/searcher.py
def search_known_secrets(self): # type: () -> None """ Search a path for known secrets, outputing text and file when found :return: """ count = 0 here = os.path.abspath(self.source) # python 3 only! # for file in glob.glob(here + "/" + "**/*.*", recursive...
def search_known_secrets(self): # type: () -> None """ Search a path for known secrets, outputing text and file when found :return: """ count = 0 here = os.path.abspath(self.source) # python 3 only! # for file in glob.glob(here + "/" + "**/*.*", recursive...
[ "Search", "a", "path", "for", "known", "secrets", "outputing", "text", "and", "file", "when", "found", ":", "return", ":" ]
matthewdeanmartin/find_known_secrets
python
https://github.com/matthewdeanmartin/find_known_secrets/blob/f25735c1ab4512bad85ade33af7021f6fac1d13b/find_known_secrets/searcher.py#L82-L126
[ "def", "search_known_secrets", "(", "self", ")", ":", "# type: () -> None", "count", "=", "0", "here", "=", "os", ".", "path", ".", "abspath", "(", "self", ".", "source", ")", "# python 3 only!", "# for file in glob.glob(here + \"/\" + \"**/*.*\", recursive=True):", "...
f25735c1ab4512bad85ade33af7021f6fac1d13b
test
eid
Encode id (bytes) as a Unicode string. The encoding is done such that lexicographic order is preserved. No concern is given to wasting space. The inverse of ``eid`` is ``did``.
dossier/store/elastic.py
def eid(s): '''Encode id (bytes) as a Unicode string. The encoding is done such that lexicographic order is preserved. No concern is given to wasting space. The inverse of ``eid`` is ``did``. ''' if isinstance(s, unicode): s = s.encode('utf-8') return u''.join('{:02x}'.format(ord(b...
def eid(s): '''Encode id (bytes) as a Unicode string. The encoding is done such that lexicographic order is preserved. No concern is given to wasting space. The inverse of ``eid`` is ``did``. ''' if isinstance(s, unicode): s = s.encode('utf-8') return u''.join('{:02x}'.format(ord(b...
[ "Encode", "id", "(", "bytes", ")", "as", "a", "Unicode", "string", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L861-L871
[ "def", "eid", "(", "s", ")", ":", "if", "isinstance", "(", "s", ",", "unicode", ")", ":", "s", "=", "s", ".", "encode", "(", "'utf-8'", ")", "return", "u''", ".", "join", "(", "'{:02x}'", ".", "format", "(", "ord", "(", "b", ")", ")", "for", ...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
did
Decode id (Unicode string) as a bytes. The inverse of ``did`` is ``eid``.
dossier/store/elastic.py
def did(s): '''Decode id (Unicode string) as a bytes. The inverse of ``did`` is ``eid``. ''' return ''.join(chr(int(s[i:i+2], base=16)) for i in xrange(0, len(s), 2))
def did(s): '''Decode id (Unicode string) as a bytes. The inverse of ``did`` is ``eid``. ''' return ''.join(chr(int(s[i:i+2], base=16)) for i in xrange(0, len(s), 2))
[ "Decode", "id", "(", "Unicode", "string", ")", "as", "a", "bytes", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L874-L879
[ "def", "did", "(", "s", ")", ":", "return", "''", ".", "join", "(", "chr", "(", "int", "(", "s", "[", "i", ":", "i", "+", "2", "]", ",", "base", "=", "16", ")", ")", "for", "i", "in", "xrange", "(", "0", ",", "len", "(", "s", ")", ",", ...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.get
Retrieve a feature collection. If a feature collection with the given id does not exist, then ``None`` is returned. :param str content_id: Content identifier. :param [str] feature_names: A list of feature names to retrieve. When ``None``, all features are retrieved....
dossier/store/elastic.py
def get(self, content_id, feature_names=None): '''Retrieve a feature collection. If a feature collection with the given id does not exist, then ``None`` is returned. :param str content_id: Content identifier. :param [str] feature_names: A list of feature names to retr...
def get(self, content_id, feature_names=None): '''Retrieve a feature collection. If a feature collection with the given id does not exist, then ``None`` is returned. :param str content_id: Content identifier. :param [str] feature_names: A list of feature names to retr...
[ "Retrieve", "a", "feature", "collection", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L140-L160
[ "def", "get", "(", "self", ",", "content_id", ",", "feature_names", "=", "None", ")", ":", "try", ":", "resp", "=", "self", ".", "conn", ".", "get", "(", "index", "=", "self", ".", "index", ",", "doc_type", "=", "self", ".", "type", ",", "id", "=...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.get_many
Returns an iterable of feature collections. This efficiently retrieves multiple FCs corresponding to the list of ids given. Tuples of identifier and feature collection are yielded. If the feature collection for a given id does not exist, then ``None`` is returned as the second element o...
dossier/store/elastic.py
def get_many(self, content_ids, feature_names=None): '''Returns an iterable of feature collections. This efficiently retrieves multiple FCs corresponding to the list of ids given. Tuples of identifier and feature collection are yielded. If the feature collection for a given id does not ...
def get_many(self, content_ids, feature_names=None): '''Returns an iterable of feature collections. This efficiently retrieves multiple FCs corresponding to the list of ids given. Tuples of identifier and feature collection are yielded. If the feature collection for a given id does not ...
[ "Returns", "an", "iterable", "of", "feature", "collections", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L162-L187
[ "def", "get_many", "(", "self", ",", "content_ids", ",", "feature_names", "=", "None", ")", ":", "try", ":", "resp", "=", "self", ".", "conn", ".", "mget", "(", "index", "=", "self", ".", "index", ",", "doc_type", "=", "self", ".", "type", ",", "_s...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.put
Adds feature collections to the store. This efficiently adds multiple FCs to the store. The iterable of ``items`` given should yield tuples of ``(content_id, FC)``. :param items: Iterable of ``(content_id, FC)``. :param [str] feature_names: A list of feature names to retrieve...
dossier/store/elastic.py
def put(self, items, indexes=True): '''Adds feature collections to the store. This efficiently adds multiple FCs to the store. The iterable of ``items`` given should yield tuples of ``(content_id, FC)``. :param items: Iterable of ``(content_id, FC)``. :param [str] feature_names...
def put(self, items, indexes=True): '''Adds feature collections to the store. This efficiently adds multiple FCs to the store. The iterable of ``items`` given should yield tuples of ``(content_id, FC)``. :param items: Iterable of ``(content_id, FC)``. :param [str] feature_names...
[ "Adds", "feature", "collections", "to", "the", "store", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L189-L228
[ "def", "put", "(", "self", ",", "items", ",", "indexes", "=", "True", ")", ":", "actions", "=", "[", "]", "for", "cid", ",", "fc", "in", "items", ":", "# TODO: If we store features in a columnar order, then we", "# could tell ES to index the feature values directly. -...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.delete
Deletes the corresponding feature collection. If the FC does not exist, then this is a no-op.
dossier/store/elastic.py
def delete(self, content_id): '''Deletes the corresponding feature collection. If the FC does not exist, then this is a no-op. ''' try: self.conn.delete(index=self.index, doc_type=self.type, id=eid(content_id)) except NotFoundError: ...
def delete(self, content_id): '''Deletes the corresponding feature collection. If the FC does not exist, then this is a no-op. ''' try: self.conn.delete(index=self.index, doc_type=self.type, id=eid(content_id)) except NotFoundError: ...
[ "Deletes", "the", "corresponding", "feature", "collection", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L230-L239
[ "def", "delete", "(", "self", ",", "content_id", ")", ":", "try", ":", "self", ".", "conn", ".", "delete", "(", "index", "=", "self", ".", "index", ",", "doc_type", "=", "self", ".", "type", ",", "id", "=", "eid", "(", "content_id", ")", ")", "ex...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.delete_all
Deletes all feature collections. This does not destroy the ES index, but instead only deletes all FCs with the configured document type (defaults to ``fc``).
dossier/store/elastic.py
def delete_all(self): '''Deletes all feature collections. This does not destroy the ES index, but instead only deletes all FCs with the configured document type (defaults to ``fc``). ''' try: self.conn.indices.delete_mapping( index=self.index,...
def delete_all(self): '''Deletes all feature collections. This does not destroy the ES index, but instead only deletes all FCs with the configured document type (defaults to ``fc``). ''' try: self.conn.indices.delete_mapping( index=self.index,...
[ "Deletes", "all", "feature", "collections", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L241-L253
[ "def", "delete_all", "(", "self", ")", ":", "try", ":", "self", ".", "conn", ".", "indices", ".", "delete_mapping", "(", "index", "=", "self", ".", "index", ",", "doc_type", "=", "self", ".", "type", ")", "except", "TransportError", ":", "logger", ".",...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.delete_index
Deletes the underlying ES index. Only use this if you know what you're doing. This destroys the entire underlying ES index, which could be shared by multiple distinct ElasticStore instances.
dossier/store/elastic.py
def delete_index(self): '''Deletes the underlying ES index. Only use this if you know what you're doing. This destroys the entire underlying ES index, which could be shared by multiple distinct ElasticStore instances. ''' if self.conn.indices.exists(index=self.index): ...
def delete_index(self): '''Deletes the underlying ES index. Only use this if you know what you're doing. This destroys the entire underlying ES index, which could be shared by multiple distinct ElasticStore instances. ''' if self.conn.indices.exists(index=self.index): ...
[ "Deletes", "the", "underlying", "ES", "index", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L255-L263
[ "def", "delete_index", "(", "self", ")", ":", "if", "self", ".", "conn", ".", "indices", ".", "exists", "(", "index", "=", "self", ".", "index", ")", ":", "self", ".", "conn", ".", "indices", ".", "delete", "(", "index", "=", "self", ".", "index", ...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.scan
Scan for FCs in the given id ranges. :param key_ranges: ``key_ranges`` should be a list of pairs of ranges. The first value is the lower bound id and the second value is the upper bound id. Use ``()`` in either position to leave it unbounded. If no ``key_ranges`` are giv...
dossier/store/elastic.py
def scan(self, *key_ranges, **kwargs): '''Scan for FCs in the given id ranges. :param key_ranges: ``key_ranges`` should be a list of pairs of ranges. The first value is the lower bound id and the second value is the upper bound id. Use ``()`` in either position to leave it...
def scan(self, *key_ranges, **kwargs): '''Scan for FCs in the given id ranges. :param key_ranges: ``key_ranges`` should be a list of pairs of ranges. The first value is the lower bound id and the second value is the upper bound id. Use ``()`` in either position to leave it...
[ "Scan", "for", "FCs", "in", "the", "given", "id", "ranges", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L275-L290
[ "def", "scan", "(", "self", ",", "*", "key_ranges", ",", "*", "*", "kwargs", ")", ":", "for", "hit", "in", "self", ".", "_scan", "(", "*", "key_ranges", ",", "*", "*", "kwargs", ")", ":", "yield", "did", "(", "hit", "[", "'_id'", "]", ")", ",",...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.scan_ids
Scan for ids only in the given id ranges. :param key_ranges: ``key_ranges`` should be a list of pairs of ranges. The first value is the lower bound id and the second value is the upper bound id. Use ``()`` in either position to leave it unbounded. If no ``key_ranges`` ar...
dossier/store/elastic.py
def scan_ids(self, *key_ranges, **kwargs): '''Scan for ids only in the given id ranges. :param key_ranges: ``key_ranges`` should be a list of pairs of ranges. The first value is the lower bound id and the second value is the upper bound id. Use ``()`` in either position to...
def scan_ids(self, *key_ranges, **kwargs): '''Scan for ids only in the given id ranges. :param key_ranges: ``key_ranges`` should be a list of pairs of ranges. The first value is the lower bound id and the second value is the upper bound id. Use ``()`` in either position to...
[ "Scan", "for", "ids", "only", "in", "the", "given", "id", "ranges", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L292-L308
[ "def", "scan_ids", "(", "self", ",", "*", "key_ranges", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'feature_names'", "]", "=", "False", "for", "hit", "in", "self", ".", "_scan", "(", "*", "key_ranges", ",", "*", "*", "kwargs", ")", ":", "yi...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.scan_prefix
Scan for FCs with a given prefix. :param str prefix: Identifier prefix. :param [str] feature_names: A list of feature names to retrieve. When ``None``, all features are retrieved. Wildcards are allowed. :rtype: Iterable of ``(content_id, FC)``
dossier/store/elastic.py
def scan_prefix(self, prefix, feature_names=None): '''Scan for FCs with a given prefix. :param str prefix: Identifier prefix. :param [str] feature_names: A list of feature names to retrieve. When ``None``, all features are retrieved. Wildcards are allowed. :rtype: It...
def scan_prefix(self, prefix, feature_names=None): '''Scan for FCs with a given prefix. :param str prefix: Identifier prefix. :param [str] feature_names: A list of feature names to retrieve. When ``None``, all features are retrieved. Wildcards are allowed. :rtype: It...
[ "Scan", "for", "FCs", "with", "a", "given", "prefix", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L310-L321
[ "def", "scan_prefix", "(", "self", ",", "prefix", ",", "feature_names", "=", "None", ")", ":", "resp", "=", "self", ".", "_scan_prefix", "(", "prefix", ",", "feature_names", "=", "feature_names", ")", "for", "hit", "in", "resp", ":", "yield", "did", "(",...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.scan_prefix_ids
Scan for ids with a given prefix. :param str prefix: Identifier prefix. :param [str] feature_names: A list of feature names to retrieve. When ``None``, all features are retrieved. Wildcards are allowed. :rtype: Iterable of ``content_id``
dossier/store/elastic.py
def scan_prefix_ids(self, prefix): '''Scan for ids with a given prefix. :param str prefix: Identifier prefix. :param [str] feature_names: A list of feature names to retrieve. When ``None``, all features are retrieved. Wildcards are allowed. :rtype: Iterable of ``cont...
def scan_prefix_ids(self, prefix): '''Scan for ids with a given prefix. :param str prefix: Identifier prefix. :param [str] feature_names: A list of feature names to retrieve. When ``None``, all features are retrieved. Wildcards are allowed. :rtype: Iterable of ``cont...
[ "Scan", "for", "ids", "with", "a", "given", "prefix", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L323-L334
[ "def", "scan_prefix_ids", "(", "self", ",", "prefix", ")", ":", "resp", "=", "self", ".", "_scan_prefix", "(", "prefix", ",", "feature_names", "=", "False", ")", "for", "hit", "in", "resp", ":", "yield", "did", "(", "hit", "[", "'_id'", "]", ")" ]
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.fulltext_scan
Fulltext search. Yields an iterable of triples (score, identifier, FC) corresponding to the search results of the fulltext search in ``query``. This will only search text indexed under the given feature named ``fname``. Note that, unless ``preserve_order`` is set to True, the ...
dossier/store/elastic.py
def fulltext_scan(self, query_id=None, query_fc=None, feature_names=None, preserve_order=True, indexes=None): '''Fulltext search. Yields an iterable of triples (score, identifier, FC) corresponding to the search results of the fulltext search in ``query``. This wil...
def fulltext_scan(self, query_id=None, query_fc=None, feature_names=None, preserve_order=True, indexes=None): '''Fulltext search. Yields an iterable of triples (score, identifier, FC) corresponding to the search results of the fulltext search in ``query``. This wil...
[ "Fulltext", "search", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L336-L366
[ "def", "fulltext_scan", "(", "self", ",", "query_id", "=", "None", ",", "query_fc", "=", "None", ",", "feature_names", "=", "None", ",", "preserve_order", "=", "True", ",", "indexes", "=", "None", ")", ":", "it", "=", "self", ".", "_fulltext_scan", "(", ...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.fulltext_scan_ids
Fulltext search for identifiers. Yields an iterable of triples (score, identifier) corresponding to the search results of the fulltext search in ``query``. This will only search text indexed under the given feature named ``fname``. Note that, unless ``preserve_order`` is set to...
dossier/store/elastic.py
def fulltext_scan_ids(self, query_id=None, query_fc=None, preserve_order=True, indexes=None): '''Fulltext search for identifiers. Yields an iterable of triples (score, identifier) corresponding to the search results of the fulltext search in ``query``. This wil...
def fulltext_scan_ids(self, query_id=None, query_fc=None, preserve_order=True, indexes=None): '''Fulltext search for identifiers. Yields an iterable of triples (score, identifier) corresponding to the search results of the fulltext search in ``query``. This wil...
[ "Fulltext", "search", "for", "identifiers", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L368-L393
[ "def", "fulltext_scan_ids", "(", "self", ",", "query_id", "=", "None", ",", "query_fc", "=", "None", ",", "preserve_order", "=", "True", ",", "indexes", "=", "None", ")", ":", "it", "=", "self", ".", "_fulltext_scan", "(", "query_id", ",", "query_fc", ",...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f
test
ElasticStore.keyword_scan
Keyword scan for feature collections. This performs a keyword scan using the query given. A keyword scan searches for FCs with terms in each of the query's indexed fields. At least one of ``query_id`` or ``query_fc`` must be provided. If ``query_fc`` is ``None``, then the query...
dossier/store/elastic.py
def keyword_scan(self, query_id=None, query_fc=None, feature_names=None): '''Keyword scan for feature collections. This performs a keyword scan using the query given. A keyword scan searches for FCs with terms in each of the query's indexed fields. At least one of ``query_id`` ...
def keyword_scan(self, query_id=None, query_fc=None, feature_names=None): '''Keyword scan for feature collections. This performs a keyword scan using the query given. A keyword scan searches for FCs with terms in each of the query's indexed fields. At least one of ``query_id`` ...
[ "Keyword", "scan", "for", "feature", "collections", "." ]
dossier/dossier.store
python
https://github.com/dossier/dossier.store/blob/b22ffe2470bba9fcc98a30cb55b437bfa1521e7f/dossier/store/elastic.py#L395-L418
[ "def", "keyword_scan", "(", "self", ",", "query_id", "=", "None", ",", "query_fc", "=", "None", ",", "feature_names", "=", "None", ")", ":", "it", "=", "self", ".", "_keyword_scan", "(", "query_id", ",", "query_fc", ",", "feature_names", "=", "feature_name...
b22ffe2470bba9fcc98a30cb55b437bfa1521e7f