Connection information as a string.
337085
def toString(self):
        
        string = ""
        if self.toLayer._verbosity > 4:
            string += "wed: from '" + self.fromLayer.name + "' to '" + self.toLayer.name +"'\n" 
            string += "            "
            for j in range(self.toLayer.size):
                string += "        " + self.toLayer.name + "[" + str(j) + "]"
            string += '\n'
            for i in range(self.fromLayer.size):
                string += self.fromLayer.name+ "["+ str(i)+ "]"+ ": "
                for j in range(self.toLayer.size):
                    string += "              " + str(self.wed[i][j])
                string += '\n'
            string += '\n'
            string += "dweight: from '" + self.fromLayer.name + "' to '" + self.toLayer.name +"'\n"
            string += "            "
            for j in range(self.toLayer.size):
                string += "        " + self.toLayer.name+ "["+ str(j)+ "]"
            string += '\n'
            for i in range(self.fromLayer.size):
                string += self.fromLayer.name+ "["+ str(i)+ "]"+ ": "
                for j in range(self.toLayer.size):
                    string +=  "              " + str(self.dweight[i][j])
                string += '\n'
            string += '\n'
        if self.toLayer._verbosity > 2:
            string += "Weights: from '" + self.fromLayer.name + "' to '" + self.toLayer.name +"'\n"
            string += "            "
            for j in range(self.toLayer.size):
                string += "        "  + self.toLayer.name+ "["+ str(j)+ "]"
            string += '\n'
            for i in range(self.fromLayer.size):
                string += self.fromLayer.name+ "["+ str(i)+ "]"+ ": "
                for j in range(self.toLayer.size):
                    string +=  "    " + str(self.weight[i][j])
                string += '\n'
            string += '\n'
        return string
829170
def connection(self):
        
        return {'host': self.host, 'namespace': self.namespace, 'username': self.username, 'password': self.password}
929793
def connection(self):
        """"""
        try:
            con = self.thread.connection
        except AttributeError:
            con = self.steady_connection()
            self.thread.connection = con
        return con
742060
def protocol_str(protocol):
    """"""
    if protocol == const.PROTOCOL_MRP:
        return 'MRP'
    if protocol == const.PROTOCOL_DMAP:
        return 'DMAP'
    if protocol == const.PROTOCOL_AIRPLAY:
        return 'AirPlay'
    return 'Unknown'
439907
def info(host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.info()
838417
def connections(self):
        """"""
        self._check_session()
        status, data = self._rest.get_request('connections')
        return data
795122
private String getRequestLine(HttpConnection conn) {
        return  HttpMethodBase.generateRequestLine(conn, getName(),
                getPath(), getQueryString(), this.effectiveVersion.toString());
    }
1289110
def get_info(self):
        '''  '''
        return {
            'Connected': self.is_connected(),
            'Port': self.port,
            'Bytes Waiting': self.ser.in_waiting if self.ser else 0
        }
961776
def connection(self):
        """"""

        if self._connection:
            return self._connection

        self.log.debug('Initializing connection to %s' % (self.bosh_service.
                                                          netloc))
        if self.bosh_service.scheme == 'http':
            Connection = httplib.HTTPConnection
        elif self.bosh_service.scheme == 'https':
            Connection = httplib.HTTPSConnection
        else:
            # TODO: raise proper exception
            raise Exception('Invalid URL scheme %s' % self.bosh_service.scheme)

        self._connection = Connection(self.bosh_service.netloc, timeout=10)
        self.log.debug('Connection initialized')
        # TODO add exceptions handler there (URL not found etc)

        return self._connection
521984
def get_string_from_data(self, offset, data):
        """"""
        
        # OC Patch
        b = None
        
        try:
            b = data[offset]
        except IndexError:
            return ''
        
        s = ''
        while ord(b):
            s += b
            offset += 1
            try:
                b = data[offset]
            except IndexError:
                break
        
        return s
348695
def netloc(self):
        """"""
        s = ''
        prefix = ''
        if self.username:
            s += self.username
            prefix = '@'

        if self.password:
            s += ":{password}".format(password=self.password)
            prefix = '@'

        s += "{prefix}{hostloc}".format(prefix=prefix, hostloc=self.hostloc)
        return s
511742
private static String threadInfoToString(ThreadInfo info) {
		StringBuilder sb = new StringBuilder(100).append("\"").append(info.getThreadName()).append("\"")
				.append(" Id=").append(info.getThreadId()).append(" ").append(info.getThreadState());
		if (info.getLockName() != null) {
			sb.append(" on ").append(info.getLockName());
		}
		if (info.getLockOwnerName() != null) {
			sb.append(" owned by \"").append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId());
		}
		if (info.isSuspended()) {
			sb.append(" (suspended)");
		}
		if (info.isInNative()) {
			sb.append(" (in native)");
		}
		sb.append('\n');

		StackTraceElement [] stackTrace = info.getStackTrace();
		for (int i = 0; i < stackTrace.length; i++) {
			StackTraceElement ste = stackTrace[i];
			sb.append("\tat ").append(ste.toString());
			sb.append('\n');
			if (i == 0 && info.getLockInfo() != null) {
				Thread.State ts = info.getThreadState();
				switch (ts) {
				case BLOCKED:
					sb.append("\t-  blocked on ").append(info.getLockInfo());
					sb.append('\n');
					break;
				case WAITING:
					sb.append("\t-  waiting on ").append(info.getLockInfo());
					sb.append('\n');
					break;
				case TIMED_WAITING:
					sb.append("\t-  waiting on ").append(info.getLockInfo());
					sb.append('\n');
					break;
				default:
				}
			}

			MonitorInfo [] lockedMonitors = info.getLockedMonitors();
			for (MonitorInfo mi : lockedMonitors) {
				if (mi.getLockedStackDepth() == i) {
					sb.append("\t-  locked ").append(mi);
					sb.append('\n');
				}
			}
		}

		LockInfo [] locks = info.getLockedSynchronizers();
		if (locks.length > 0) {
			sb.append("\n\tNumber of locked synchronizers = ").append(locks.length);
			sb.append('\n');
			for (LockInfo li : locks) {
				sb.append("\t- ").append(li);
				sb.append('\n');
			}
		}
		sb.append('\n');
		return sb.toString();
	}
260554
def get_connections(self, id, connection_name, **args):
        """"""
        return self.request(
            "{0}/{1}/{2}".format(self.version, id, connection_name), args
        )
251144
def describe_connection(self):
        """"""
        if self.device==None:
            return "%s [disconnected]" % (self.name)
        else:
            return "%s connected to %s %s version: %s [serial: %s]" % (self.name, 
                self.vendor_name, self.product_name,
                self.version_number, self.serial_number)
586337
def from_connections(cls, caption, connections):
        """"""

        root = ET.Element('datasource', caption=caption, version='10.0', inline='true')
        outer_connection = ET.SubElement(root, 'connection')
        outer_connection.set('class', 'federated')
        named_conns = ET.SubElement(outer_connection, 'named-connections')
        for conn in connections:
            nc = ET.SubElement(named_conns,
                               'named-connection',
                               name=_make_unique_name(conn.dbclass),
                               caption=conn.server)
            nc.append(conn._connectionXML)
        return cls(root)
580386
def connection_key(self):
        
        return "{host}:{namespace}:{username}".format(host=self.host, namespace=self.namespace, username=self.username)
159738
private static String buildConnectionString(final String connectionString,
                                               final Config config) {

      if(config == null) {
         return connectionString;
      }

      StringBuilder buf = new StringBuilder();
      Iterator<Map.Entry<String, ConfigValue>> iter = config.entrySet().iterator();
      if(iter.hasNext()) {
         Map.Entry<String, ConfigValue> curr = iter.next();
         buf.append(curr.getKey()).append("=").append(curr.getValue().unwrapped().toString());
      } else {
         return connectionString;
      }

      while(iter.hasNext()) {
         Map.Entry<String, ConfigValue> curr = iter.next();
         buf.append("&").append(curr.getKey()).append("=").append(curr.getValue().unwrapped().toString());
      }

      if(connectionString.indexOf('?') > 0) {
         return connectionString + "&" + buf.toString();
      } else {
         return connectionString + "?" + buf.toString();
      }
   }