code
stringlengths
51
2.38k
docstring
stringlengths
4
15.2k
def relation_completions( completion_text: str, bel_spec: BELSpec, bel_fmt: str, size: int ) -> list: if bel_fmt == "short": relation_list = bel_spec["relations"]["list_short"] else: relation_list = bel_spec["relations"]["list_long"] matches = [] for r in relation_list: if re...
Filter BEL relations by prefix Args: prefix: completion string bel_fmt: short, medium, long BEL formats spec: BEL specification Returns: list: list of BEL relations that match prefix
def msg_debug(message): if _log_lvl == logging.DEBUG: to_stdout(" (*) {message}".format(message=message), colorf=cyan) if _logger: _logger.debug(message)
Log a debug message :param message: the message to be logged
def load_session(fname=None): if fname is None: fname = conf.session try: s = six.moves.cPickle.load(gzip.open(fname, "rb")) except IOError: try: s = six.moves.cPickle.load(open(fname, "rb")) except IOError: raise scapy_session = six.moves.builtins...
Load current Scapy session from the file specified in the fname arg. This will erase any existing session. params: - fname: file to load the scapy session from
def _convert_data(self, data, data_type, num_recs, num_values, num_elems): if (data_type == 51 or data_type == 52): return [data[i:i+num_elems].decode('utf-8') for i in range(0, num_recs*num_values*num_elems, num_elems)] else: tofrom = self._convert_option() ...
Converts data to the appropriate type using the struct.unpack method, rather than using numpy.