Get the AWS account id where an ASG is created.
Warning: This is expensive as it loops through all instances currently registered.

@param asgName The name of the ASG
@return the account id
421515
private String getASGAccount(String asgName) {
        Applications apps = registry.getApplicationsFromLocalRegionOnly();

        for (Application app : apps.getRegisteredApplications()) {
            for (InstanceInfo instanceInfo : app.getInstances()) {
                String thisAsgName = instanceInfo.getASGName();
                if (thisAsgName != null && thisAsgName.equals(asgName)) {
                    String localAccountId = getAccountId(instanceInfo, null);
                    if (localAccountId != null) {
                        return localAccountId;
                    }
                }
            }
        }

        logger.info("Couldn't get the ASG account for {}, using the default accountId instead", asgName);
        return accountId;
    }
243222
public long getId()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getId");
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getId", ""+messageProcessorId);
      return messageProcessorId;
   }
282959
public java.util.List<String> getGroupId() {
        if (groupId == null) {
            groupId = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return groupId;
    }
804361
private static String getRegistrationId(Context context) {
        final SharedPreferences prefs = getGcmPreferences(context);
        String registrationId = prefs.getString(PROPERTY_REG_ID, "");
        if (registrationId.isEmpty()) {
            return "";
        }
        // Check if app was updated; if so, it must clear the registration ID
        // since the existing regID is not guaranteed to work with the new
        // app version.
        int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
        int currentVersion = getAppVersion(context);
        if (registeredVersion != currentVersion) {
            return "";
        }

        if (OrtcClient.getOnRegistrationId() != null){
            OrtcClient.getOnRegistrationId().run(registrationId);
        }

        return registrationId;
    }
821088
def _get_securitygroupname_id(securitygroupname_list):
    '''
    
    '''
    securitygroupid_set = set()
    if not isinstance(securitygroupname_list, list):
        securitygroupname_list = [securitygroupname_list]
    params = {'Action': 'DescribeSecurityGroups'}
    for sg in aws.query(params, location=get_location(),
                        provider=get_provider(), opts=__opts__, sigver='4'):
        if sg['groupName'] in securitygroupname_list:
            log.debug(
                'AWS SecurityGroup ID of %s is %s',
                sg['groupName'], sg['groupId']
            )
            securitygroupid_set.add(sg['groupId'])
    return list(securitygroupid_set)
61297
public static String getUniqueId(String accessId, String realm) {
    
        if (realm != null) {
            Pattern pattern = Pattern.compile("([^:]+):(" + Pattern.quote(realm) + ")/(.*)");
            Matcher m = pattern.matcher(accessId);
            if (m.matches()) {
                if (m.group(3).length() > 0) {
                    return m.group(3);
                }
            }
        }
        // if there is no match, fall back.
        return getUniqueId(accessId);
    }
222234
public String getRelatedSignatureId() throws HelloSignException {
        JSONObject metadata = (JSONObject) get(EVENT_METADATA);
        if (metadata == null) {
            return null;
        }
        String id = null;
        try {
            id = metadata.getString(RELATED_SIGNATURE_ID);
        } catch (JSONException ex) {
            // No related signature request with this event
        }
        return id;
    }
487409
private String getIdentityFromLegacyId() throws CharacterCodingException {
        byte[] data = legacyId;
        int len = Util.toShort(data, 1);
        return Util.decodeString(data, 3, len);
    }
828775
public String getInstanceId() {
        String rc = toString();
        int i = rc.indexOf("@");
        if (i > 0) {
            rc = rc.substring(i + 1);
        }
        return rc;
    }
844883
public static Map<String, List<String>> groupAsgNamesByClusterName(List<String> asgNames) {
        return groupByClusterName(asgNames, new AsgNameProvider<String>() {
            public String extractAsgName(String asgName) {
                return asgName;
            }
        });
    }
590396
public DruidQuerySignature asAggregateSignature(RowSignature sourceSignature)
  {
    return new DruidQuerySignature(
        sourceSignature,
        virtualColumnPrefix,
        virtualColumnsByExpression,
        virtualColumnsByName,
        true
    );
  }
1050843
def get_instance_id():
    
    log = logging.getLogger(mod_logger + '.get_instance_id')

    # Exit if not running on AWS
    if not is_aws():
        log.info('This machine is not running in AWS, exiting...')
        return

    instance_id_url = metadata_url + 'instance-id'
    try:
        response = urllib.urlopen(instance_id_url)
    except(IOError, OSError) as ex:
        msg = 'Unable to query URL to get instance ID: {u}\n{e}'. \
            format(u=instance_id_url, e=ex)
        log.error(msg)
        return

    # Check the code
    if response.getcode() != 200:
        msg = 'There was a problem querying url: {u}, returned code: {c}, unable to get the instance-id'.format(
                u=instance_id_url, c=response.getcode())
        log.error(msg)
        return
    instance_id = response.read()
    return instance_id
300248
private String getManagerId() {
    return "name='" + name +
      "', objectId=" + Integer.toString(System.identityHashCode(this), 36) +
      ", classloaderId=" + Integer.toString(System.identityHashCode(classLoader), 36) +
      ", default=" + defaultManager;
  }
975737
private static String getClientId(Map<String, Object> params, RequestOptions options)
      throws AuthenticationException {
    String clientId = Stripe.clientId;
    if ((options != null) && (options.getClientId() != null)) {
      clientId = options.getClientId();
    }
    if ((params != null) && (params.get("client_id") != null)) {
      clientId = (String) params.get("client_id");
    }

    if (clientId == null) {
      throw new AuthenticationException(
          "No client_id provided. (HINT: set client_id key using 'Stripe.clientId = <CLIENT-ID>'. "
              + "You can find your client_ids in your Stripe dashboard at "
              + "https://dashboard.stripe.com/account/applications/settings, "
              + "after registering your account as a platform. See "
              + "https://stripe.com/docs/connect/standard-accounts for details, "
              + "or email support@stripe.com if you have any questions.",
          null, null, 0);
    }

    return clientId;
  }
131206
public String getFingerprint() {
        RSAPublicKey key = InstanceIdentityProvider.RSA.getPublicKey();
        if (key == null) {
            return null;
        }
        // TODO replace with org.jenkinsci.remoting.util.KeyUtils once JENKINS-36871 changes are merged
        try {
            MessageDigest digest = MessageDigest.getInstance("MD5");
            digest.reset();
            byte[] bytes = digest.digest(key.getEncoded());
            StringBuilder result = new StringBuilder(Math.max(0, bytes.length * 3 - 1));
            for (int i = 0; i < bytes.length; i++) {
                if (i > 0) {
                    result.append(':');
                }
                int b = bytes[i] & 0xFF;
                result.append(Character.forDigit((b>>4)&0x0f, 16)).append(Character.forDigit(b&0xf, 16));
            }
            return result.toString();
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalStateException("JLS mandates MD5 support");
        }
    }
881378
protected String determineIdentity(final OpenIdService service, final Assertion assertion) {
        if (assertion != null && OpenIdProtocolConstants.OPENID_IDENTIFIERSELECT.equals(service.getIdentity())) {
            return this.openIdPrefixUrl + '/' + assertion.getPrimaryAuthentication().getPrincipal().getId();
        }
        return service.getIdentity();
    }
777222
public String getMessageId() {
        Object messageId = getHeader(JmsMessageHeaders.MESSAGE_ID);

        if (messageId != null) {
            return messageId.toString();
        }

        return null;
    }