Retrieve a policy Arn from a identifier that can be either the ARN or the name
@param {String} identifier
@param {[type]} context
@param {[type]} searchParams
@returns {[type]}
334408
function retrievePolicyArn(identifier, context, searchParams) {
  if (/arn:aws:iam::\d{12}:policy\/?[a-zA-Z_0-9+=,.@\-_/]+]/.test(identifier)) {
    return Promise.resolve(identifier);
  }

  // @TODO make this code more beautiful
  // Try ENV_PolicyName_stage
  let policyIdentifier = context.environment + '_' + identifier + '_' + context.stage;
  return getPolicyByName(policyIdentifier, searchParams)
  .then(policy => {
    if (!policy) {
      // Try ENV_PolicyName
      policyIdentifier = context.environment + '_' + identifier;
      return getPolicyByName(policyIdentifier, searchParams)
      .then(policy => {
        if (!policy) {
          // Try PolicyName
          return getPolicyByName(identifier, searchParams)
          .then(policy => {
            if (!policy) {
              return findAndDeployPolicy(identifier, context)
              .then(report => {
                if (!report) {
                  throw new Error('The policy ' + identifier + ' could not be found.');
                }
                return { Arn: report.arn };
              });
            }
            return policy;
          });
        }
        return policy;
      });
    }
    return policy;
  })
  .then(policy => {
    return policy.Arn;
  });
}
559667
function getURLParameter( name ) {
    return decodeURI(
        ( new RegExp( name + '=' + '(.+?)(&|$)' ).exec( location.search ) || [ null, null ] )[ 1 ]
    );
}
749826
function stripGatewayAuthenticationParameter(aUrl) {
  if (aUrl.query && aUrl.query.useGateway) {
    delete aUrl.query.useGateway;
  }
  if (aUrl.query.nextUrl) {
    var theNextUrl = decodeURIComponent(aUrl.query.nextUrl);
    aUrl.query.nextUrl = decodeURIComponent(theNextUrl);
  }
  var theUrl = url.format(aUrl);

  return theUrl;
}
1084128
function getURLParameter(url, name) {
        var URLParamRegEx = new RegExp('[?|&]?' + name + '=([^&;]+?)(&|#|;|$)');
        var value = URLParamRegEx.exec(url);
        value = (value) ? value[1] : "";
        return decodeURIComponent(value.replace(/\+/g, '%20')) || null;
    }
8742
function getAppLinkIntentFilterDictionary(linkDomain, androidPrefix) {
    const scheme = "https";
    const output = {
      $: {
        "android:host": linkDomain,
        "android:scheme": scheme
      }
    };

    if (androidPrefix) {
      output.$["android:pathPrefix"] = androidPrefix;
    }

    return output;
  }
1165698
public static HTMLElement resolveElement(HTMLElement context, String identifier) {
        Element element = DATA_ELEMENT.select(context, identifier);
        HTMLElement htmlElement = Js.cast(element);
        return htmlElement;
    }
198183
def get_id_by_name(api, search_name):
    
    entities = api.get_all(q='name==' + "'" + search_name + "'").content
    if entities:
        return entities[0].id
    return
351769
function getDataRegistry(identifier) {
  assert(!identifier || (typeof identifier === 'string'), `Invalid identifier specified: ${identifier}`);

  if (!window.__private__) window.__private__ = {};
  if (window.__private__.dataRegistry === undefined) window.__private__.dataRegistry = {};

  if (identifier)
    return namespace(identifier, window.__private__.dataRegistry);
  else if (identifier === null)
    return null
  else
    return window.__private__.dataRegistry;
}
132659
public Method get(final MethodIdentifier identifier) {
        // search for available methods
        readWriteLock.readLock().lock();
        try {
            final Optional<? extends IdentifiableMethod> method = availableMethods.stream().filter(m -> m.matches(identifier)).findAny();
            if (method.isPresent())
                return method.get();
        } finally {
            readWriteLock.readLock().unlock();
        }

        // apply default behaviour
        return DEFAULT_METHOD.apply(identifier);
    }
690588
def get(cls, identifier: Any) -> 'Entity':
        
        logger.debug(f'Lookup `{cls.__name__}` object with identifier {identifier}')
        # Get the ID field for the entity
        filters = {
            cls.meta_.id_field.field_name: identifier
        }

        # Find this item in the repository or raise Error
        results = cls.query.filter(**filters).limit(1).all()
        if not results:
            raise ObjectNotFoundError(
                f'`{cls.__name__}` object with identifier {identifier} '
                f'does not exist.')

        # Return the first result
        return results.first
987952
def lookup_identifier(name)
      if has_rule?(name)
        ident = lookup_rule(name)
      elsif has_terminal?(name)
        ident = @terminals[name]
      else
        ident = nil
      end

      return ident
    end
8785
private String getUrl(final IRI identifier) {
        return getServices().getResourceService().toExternal(identifier, getBaseUrl()).getIRIString();
    }
747245
function (context) {

            var parameter = context.request.urlInfo.parameter;
            if (parameter.method) {
                return parameter.method.toUpperCase();
            }

            return context.request.method;
        }
356143
function getContextualTypeForArgument(callTarget, arg) {
            var args = getEffectiveCallArguments(callTarget);
            var argIndex = ts.indexOf(args, arg);
            if (argIndex >= 0) {
                var signature = getResolvedOrAnySignature(callTarget);
                return getTypeAtPosition(signature, argIndex);
            }
            return undefined;
        }
68818
def get_entity_by_identifier(self, url: str, identifier: str) -> Optional[NamespaceEntry]:
        """"""
        entry_filter = and_(Namespace.url == url, NamespaceEntry.identifier == identifier)
        return self.session.query(NamespaceEntry).join(Namespace).filter(entry_filter).one_or_none()
889983
function _identifiers (options) {
  var query = {}

  for (var prop in options.hash) {
    if (/^-/.test(prop)) {
      query[prop.replace(/^-/, '!')] = options.hash[prop]
    } else if (/^_/.test(prop)) {
      query[prop.replace(/^_/, '')] = new RegExp(options.hash[prop])
    } else {
      query[prop] = options.hash[prop]
    }
  }
  return arrayify(options.data.root).filter(where(query)).filter(function (doclet) {
    return !doclet.ignore && (state.options.private ? true : doclet.access !== 'private')
  })
}
703538
def parse_identitie(self, global_params, region, identity_name):
        
        identity = {'name': identity_name, 'policies': {}}
        policy_names = api_clients[region].list_identity_policies(Identity = identity_name)['PolicyNames']
        if len(policy_names):
            policies = api_clients[region].get_identity_policies(Identity = identity_name, PolicyNames = policy_names)['Policies']
            for policy_name in policies:
                identity['policies'][policy_name] = json.loads(policies[policy_name])
        dkim = api_clients[region].get_identity_dkim_attributes(Identities = [ identity_name ])['DkimAttributes'][identity_name]
        identity['DkimEnabled'] = dkim['DkimEnabled']
        identity['DkimVerificationStatus'] = dkim['DkimVerificationStatus']
        self.identities[self.get_non_aws_id(identity_name)] = identity