Return the first non null registry given. Use the env var DOCKER_REGISTRY as final fallback
@param checkFirst list of registries to check
@return registry found or null if none.
509123
public static String firstRegistryOf(String ... checkFirst) {
        for (String registry : checkFirst) {
            if (registry != null) {
                return registry;
            }
        }
        // Check environment as last resort
        return System.getenv("DOCKER_REGISTRY");
    }
214601
@Nullable
  public static Element getFirstChildElement (@Nullable final Node aStartNode)
  {
    if (aStartNode == null)
      return null;
    return NodeListIterator.createChildNodeIterator (aStartNode)
                           .findFirstMapped (filterNodeIsElement (), x -> (Element) x);
  }
1249057
@SuppressWarnings("unchecked")
    public Object getFirstKeyPart() {
        Object keyPart = null;
        if (this.key.value() instanceof List && !((List<Object>) this.key.value()).isEmpty()) {
            keyPart = ((List<Object>) this.key.value()).get(0);
        } else {
            // UniqueKey or MultitontKey with only one key part
            keyPart = this.key.value();
        }
        return keyPart;
    }
1267480
public RegistryAuth authForRegistry(final Path configPath, final String registry)
      throws IOException {
    checkNotNull(configPath);
    checkNotNull(registry);

    final DockerConfig config = MAPPER.readValue(configPath.toFile(), DockerConfig.class);
    if (config == null) {
      return RegistryAuth.builder().build();
    }

    final RegistryAuth registryAuth = authForRegistry(config, registry);
    if (registryAuth != null) {
      return registryAuth;
    }
    // If the given server address didn't have a protocol try adding a protocol to the address.
    // This handles cases where older versions of Docker included the protocol when writing
    // auth tokens to config.json.
    try {
      final URI serverAddressUri = new URI(registry);
      if (serverAddressUri.getScheme() == null) {
        for (String proto : Arrays.asList("https://", "http://")) {
          final RegistryAuth protoRegistryAuth = authForRegistry(config, proto + registry);
          if (protoRegistryAuth != null) {
            return protoRegistryAuth;
          }
        }
      }
    } catch (URISyntaxException e) {
      // Nothing to do, just let this fall through below
    }

    throw new IllegalArgumentException(
        "registry \"" + registry + "\" does not appear in config file at " + configPath);
  }
821737
def first(self):
        
        results = self.rpc_model.search_read(
            self.domain, None, 1, self._order_by, self.fields,
            context=self.context
        )
        return results and results[0] or None
1282420
public static <T> T getFirst(T[] objectArray)
    {
        if (ArrayIterate.notEmpty(objectArray))
        {
            return objectArray[0];
        }
        return null;
    }
583792
public Object findFirst(Collection collection, Constraint constraint) {
		return findFirst(collection.iterator(), constraint);
	}
65026
public synchronized RegistrationPoint getOldestRegistrationPoint() {
        return registrationPoints.size() == 0 ? null : registrationPoints.values().iterator().next().get(0);
    }
403069
public static Map<String, Object> getRegistry(String registryName) {
		if (StringUtils.isBlank(registryName)) {
			return null;
		}
		Sysprop registryObject = readRegistryObject(registryName);
		return registryObject == null ? null : registryObject.getProperties();
	}
751339
public static <T> T getFirstOrNull(List<T> list) {
        if (list == null || list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }
672707
@SuppressWarnings("PointlessArithmeticExpression")
    int getDataFirstRecord(final int territoryNumber) {
        assert (0 <= territoryNumber) && (territoryNumber <= Territory.AAA.getNumber());
        return index[territoryNumber + POS_INDEX_FIRST_RECORD];
    }
613752
@Override
    public RowIterator findFirstRowNotNull(Session session,
                                           PersistentStore store) {

        readLock.lock();

        try {
            NodeAVL x = getAccessor(store);

            while (x != null) {
                boolean t = colTypes[0].compare(
                    null, x.getRow(store).getData()[colIndex[0]]) >= 0;

                if (t) {
                    NodeAVL r = x.getRight(store);

                    if (r == null) {
                        break;
                    }

                    x = r;
                } else {
                    NodeAVL l = x.getLeft(store);

                    if (l == null) {
                        break;
                    }

                    x = l;
                }
            }

            while (x != null) {
                Object colvalue = x.getRow(store).getData()[colIndex[0]];

                if (colvalue == null) {
                    x = next(store, x);
                } else {
                    break;
                }
            }

// MVCC
            while (session != null && x != null) {
                Row row = x.getRow(store);

                if (session.database.txManager.canRead(session, row)) {
                    break;
                }

                x = next(store, x);
            }

            return getIterator(session, store, x);
        } finally {
            readLock.unlock();
        }
    }
583594
public SimpleEntry getFirst()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "getFirst");

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(this, tc, "getFirst", new Object[] {first, printList()});
    
    return first;          
  }
66435
public RegistryEntry getEntry(String searchType) {
		for (Map.Entry<Class, RegistryEntry> entry : resources.entrySet()) {
			String type = getResourceType(entry.getKey());
			if (type == null) {
				return null;
			}
			if (type.equals(searchType)) {
				return entry.getValue();
			}
		}
		return null;
	}
672259
public static <T> T getFirst(Iterator<T> iterator) {
		if (null != iterator && iterator.hasNext()) {
			return iterator.next();
		}
		return null;
	}
1047151
@Nullable
  public synchronized K getFirstKey() {
    return mMap.isEmpty() ? null : mMap.keySet().iterator().next();
  }
39253
public T first() {
        Iterator<T> iterator = iterator();
        return (iterator.hasNext() ? iterator.next() : null);
    }