def query(self, cmd, prefix=None):

        # issue the command, which might return incoming
        # messages, but we'll leave them in the queue
        out = self.command(cmd)

        # the only valid response to a "query" is a
        # single line followed by "OK". if all looks
        # well, return just the single line
        if(len(out) == 2) and (out[-1] == "OK"):
            if prefix is None:
                return out[0].strip()

            # if a prefix was provided, check that the
            # response starts with it, and return the
            # cropped remainder
            else:
                if out[0][:len(prefix)] == prefix:
                    return out[0][len(prefix):].strip()

        # something went wrong, so return the very
        # ambiguous None. it's better than blowing up
        return None
fromshare(info) -> socket object
dataset/ETHPy150Open sahana/eden/modules/pygsm/gsmmodem.py/GsmModem.query--crossover with--dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/socket.py/fromshare