是否有网络连接

@param context Context
@return 是否连接
178521
public static boolean isConnected(Context context) {
        if (context == null) {
            return true;
        }
        ConnectivityManager cm = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = cm.getActiveNetworkInfo();
        return info != null && info.isConnectedOrConnecting();
    }
638372
List<ContextDataFactory> getContextDataFactories() {
        if (contextDataFactories == null) {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(contextDataFactories);
    }
1154131
public static Lint instance(Context context) {
        Lint instance = context.get(lintKey);
        if (instance == null)
            instance = new Lint(context);
        return instance;
    }
937666
public ConcurrentMap<String, L> getLoggersInContext(final LoggerContext context) {
        ConcurrentMap<String, L> loggers;
        lock.readLock ().lock ();
        try {
            loggers = registry.get (context);
        } finally {
            lock.readLock ().unlock ();
        }

        if (loggers != null) {
            return loggers;
        } else {
            lock.writeLock ().lock ();
            try {
                loggers = registry.get (context);
                if (loggers == null) {
                    loggers = new ConcurrentHashMap<> ();
                    registry.put (context, loggers);
                }
                return loggers;
            } finally {
                lock.writeLock ().unlock ();
            }
        }
    }
595762
def contexts(self):
        
        if not hasattr(self, "_contexts"):
            cs = {}
            for cr in self.doc["contexts"]:
                cs[cr["name"]] = copy.deepcopy(cr["context"])
            self._contexts = cs
        return self._contexts
859017
public static void contextPath(String context) {
        if (S.blank(context)) ctx = "";
        else {
            E.illegalArgumentIf(!context.startsWith("/"), "context path should start with \"/\"");
            if (context.endsWith("/")) {
                ctx = S.str(context).beforeLast("/").toString();
            }
        }
    }
288980
@SuppressWarnings("PMD.UseStringBufferForStringAppends")
    public static String getContextMarkers(final AdminContext context) {
        String res = "";
        if (isForAdmin(context)) {
            if (isForMain(context)) {
                res += "M";
            }
            res += "A";
        }
        return res;
    }
606965
public static Context getContext() {
        Context context = LOCAL.get();
        if (context == null) {
            context = new Context(null, null);
            LOCAL.set(context);
        }
        return context;
    }
368127
private String contextName(Annotation annotation) {
        if (annotation.annotationType().isAssignableFrom(FromContext.class)) {
            return ((FromContext) annotation).value();
        } else {
            return null;
        }
    }
936038
public void analyze(AnalyzeContext context) {
		boolean bufferLockFlag = false;
		//处理英文字母
		bufferLockFlag = this.processEnglishLetter(context) || bufferLockFlag;
		//处理阿拉伯字母
		bufferLockFlag = this.processArabicLetter(context) || bufferLockFlag;
		//处理混合字母
		bufferLockFlag = this.processMixLetter(context) || bufferLockFlag;
		
		//判断是否锁定缓冲区
		if(bufferLockFlag){
			context.lockBuffer(SEGMENTER_NAME);
		}else{
			//对缓冲区解锁
			context.unlockBuffer(SEGMENTER_NAME);
		}
	}
1035250
public com.google.api.ads.adwords.axis.v201809.cm.RequestContextOperandContextType getContextType() {
        return contextType;
    }
1243410
public static boolean parseRanges(FileRequestContext context) {
    if( !StringUtils.isBlank(context.range) ) {
      Matcher rangeMatcher = rangePattern.matcher(context.range);
      if(rangeMatcher.matches()) {
        String ranges[] = rangeMatcher.group(1).split(",");
        for(String range : ranges) {
          long startBound = -1;
          int hyphenIndex = range.indexOf('-');
          if( hyphenIndex > 0 ) {
            startBound = Long.parseLong(range.substring(0, hyphenIndex));
          }
          long endBound = -1;
          if( hyphenIndex >= 0 && (hyphenIndex + 1) < range.length() ) {
            endBound = Long.parseLong(range.substring(hyphenIndex + 1));
          }
          Range newRange = new Range(startBound, endBound);
          
          if(!(startBound != -1 && endBound != -1 && startBound > endBound) && !(startBound == -1 && endBound == -1)) {
            context.ranges.add(newRange);
          }
        } 
        return !context.ranges.isEmpty();
      }
    }
    return true;
  }
131803
def for_context(context)
      contexts = hash.keys.select { |ckey| context.matches?([ckey]) }
      contexts.map { |exc| hash[exc] }
    end
304181
public static <T extends Context<T>> T deserialize(JsonObject context) {
    return deserialize(context.getString("uri"), context.getObject("context"));
  }
1133116
public List<PersistenceContextRefType<ApplicationDescriptor>> getAllPersistenceContextRef()
   {
      List<PersistenceContextRefType<ApplicationDescriptor>> list = new ArrayList<PersistenceContextRefType<ApplicationDescriptor>>();
      List<Node> nodeList = model.get("persistence-context-ref");
      for(Node node: nodeList)
      {
         PersistenceContextRefType<ApplicationDescriptor>  type = new PersistenceContextRefTypeImpl<ApplicationDescriptor>(this, "persistence-context-ref", model, node);
         list.add(type);
      }
      return list;
   }
48434
public static List<SingleLogoutRequest> getLogoutRequests(final RequestContext context) {
        return (List<SingleLogoutRequest>) context.getFlowScope().get(PARAMETER_LOGOUT_REQUESTS);
    }
991322
public static Span getValue(Context context) {
    @javax.annotation.Nullable
    Span span = CONTEXT_SPAN_KEY.get(Utils.checkNotNull(context, "context"));
    return span == null ? BlankSpan.INSTANCE : span;
  }