Checks if the network is connected or not.
@param context the context.
@return true if the network is connected.
17364
public static boolean isNetworkConnected(Context context) {
        ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = manager.getActiveNetworkInfo();
        return info != null && info.isConnected();
    }
209347
protected final boolean isAuthenticated(Context context) {
        Account account = context.getSession(AuthConstants.ACCOUNT_ATTRIBUTE);
        if (account == null) {
            account = context.getLocal(AuthConstants.ACCOUNT_ATTRIBUTE);
        }
        return account != null && account.isAuthenticated();
    }
1332194
public boolean isValidAddress(NetworkParameters network) {
      byte version = getVersion();
      if (getAllAddressBytes().length != 21) {
         return false;
      }
      return ((byte) (network.getStandardAddressHeader() & 0xFF)) == version
            || ((byte) (network.getMultisigAddressHeader() & 0xFF)) == version;
   }
228808
private static boolean getSystemConnectivity(Context context) {
    try {
      ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
      if (cm == null) {
        return false;
      }

      NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
      return activeNetwork.isConnectedOrConnecting();
    } catch (Exception exception) {
      return false;
    }
  }
1305645
def is_connected(self, use_cached=True):
        """"""
        device_json = self.get_device_json(use_cached)
        return int(device_json.get("dpConnectionStatus")) > 0
1016865
public boolean canConnect()
  {
    try {
      wake();

      ClientSocket stream = open();

      if (stream != null) {
        stream.free(stream.getIdleStartTime());

        return true;
      }

      return false;
    } catch (Exception e) {
      log.log(Level.FINER, e.toString(), e);

      return false;
    }
  }
106887
public boolean isConnected(String clusterName) {
        boolean isConnected = false;
        synchronized (connections) {
            if (connections.containsKey(clusterName)) {
                isConnected = connections.get(clusterName).isConnected();
            }
        }
        return isConnected;
    }
54360
public static boolean isConnected(String molfile) throws CTKException, ChemistryException {
		return Chemistry.getInstance().getManipulator().isConnected(molfile);
	}
349556
protected synchronized boolean checkConnection()
    {
        if (_connection==null)
        {
            try{
                _connection=_url.openConnection();
            }
            catch(IOException e)
            {
                LogSupport.ignore(log,e);
            }
        }
        return _connection!=null;
    }
188246
public static boolean isCurrentConnectionWifi(Context context) {
    ConnectivityManager cm =
        (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    if (cm == null) {
      return false;
    }
    NetworkInfo info = cm.getActiveNetworkInfo();
    return info != null && info.getType() == ConnectivityManager.TYPE_WIFI;
  }
509920
def isConnected(self):
        
        for pool in self.__pool.values():
            if not pool.empty():
                return True
        return False
486056
public static boolean isInternetAvailable(Context context) {
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            return isInternetAvailable(connectivityManager);
        } else {
            return isInternetAvailablePreLollipop(connectivityManager);
        }
    }
758374
def is_connected(self):
        
        if self._client is not None:
            try:
                self._client.server_info()
            except ConnectionFailure:
                return False
            return True
        else:
            return False
1090222
def get_connected(self):
        
        connected = c_int32()
        result = self.library.Cli_GetConnected(self.pointer, byref(connected))
        check_error(result, context="client")
        return bool(connected)
477915
public static NetworkType getNetworkType(Context context) {
        ConnectivityManager cm = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        final NetworkInfo info = cm.getActiveNetworkInfo();
        if (info == null || !info.isConnectedOrConnecting()) {
            return NetworkType.NONE;
        }
        int type = info.getType();
        if (ConnectivityManager.TYPE_WIFI == type) {
            return NetworkType.WIFI;
        } else if (ConnectivityManager.TYPE_MOBILE == type) {
            return NetworkType.MOBILE;
        } else {
            return NetworkType.OTHER;
        }
    }
1283663
def connected(self):
        
        node_list = self.node_list()
        for node in node_list:
            bfs_list = self.forw_bfs(node)
            if len(bfs_list) != len(node_list):
                return False
        return True
806770
public boolean isConnected() {
        final Health request = new Health.Builder()
                .local()
                .timeout(Ints.saturatedCast(requestTimeout.toSeconds()))
                .build();

        try {
            final JestResult result = JestUtils.execute(jestClient, request, () -> "Couldn't check connection status of Elasticsearch");
            final int numberOfDataNodes = result.getJsonObject().path("number_of_data_nodes").asInt();
            return numberOfDataNodes > 0;
        } catch (ElasticsearchException e) {
            if (LOG.isDebugEnabled()) {
                LOG.error(e.getMessage(), e);
            }
            return false;
        }
    }