Gets the location of a ZIP code
    Syntax: {command} (zipcode)
    Powered by STANDS4, www.stands4.com
350415
def cmd(send, msg, args):
    
    uid = args['config']['api']['stands4uid']
    token = args['config']['api']['stands4token']
    parser = arguments.ArgParser(args['config'])
    parser.add_argument('zipcode', action=arguments.ZipParser)
    try:
        cmdargs = parser.parse_args(msg)
    except arguments.ArgumentException as e:
        send(str(e))
        return

    req = get("http://www.stands4.com/services/v2/zip.php", params={'uid': uid, 'tokenid': token, 'zip': cmdargs.zipcode})

    xml = etree.fromstring(req.content, parser=etree.XMLParser(recover=True))
    location = xml.find('location').text
    send("%s: %s" % (cmdargs.zipcode, location))
144089
def validate_address_cmd(street, number, quarter, postalcode, town, state, complement="Sem Complemento"):
    
    return ValidateAddressCmd(street=street, number=number, quarter=quarter, postalcode=postalcode, town=town,
                              state=state, complement=complement)
236053
def is_location_command(self, cmd):
        ''''''
        mav_cmd = mavutil.mavlink.enums['MAV_CMD']
        if not cmd in mav_cmd:
            return False
        if not mav_cmd[cmd].param.get(5,'').startswith('Latitude'):
            return False
        if not mav_cmd[cmd].param.get(6,'').startswith('Longitude'):
            return False
        return True
191300
function GetCampCode($strMessageIndex) {
        if($this->posnetResponse->koiInfo == null)
            return "";

        if(array_key_exists($strMessageIndex, $this->posnetResponse->koiInfo))
            return $this->posnetResponse->koiInfo[$strMessageIndex]['code'];
        else
            return "";
    }
720720
function parseMessage(line) { // {{{
  var message = {};
  var match;

  // Parse prefix
  if (match = line.match(/^:([^ ]+) +/)) {
    message.prefix = match[1];
    line = line.replace(/^:[^ ]+ +/, '');
    if (match = message.prefix.match(/^([_a-zA-Z0-9\[\]\\`^{}|-]*)(!([^@]+)@(.*))?$/)) {
      message.nick = match[1];
      message.user = match[3];
      message.host = match[4];
    }
    else
      message.server = message.prefix;
  }

  // Parse command
  match = line.match(/^([^ ]+) +/);
  message.command = match[1];
  message.rawCommand = match[1];
  message.commandType = 'normal';
  line = line.replace(/^[^ ]+ +/, '');

  if (replyFor[message.rawCommand]) {
    message.command     = replyFor[message.rawCommand].name;
    message.commandType = replyFor[message.rawCommand].type;
  }

  message.args = [];
  var middle, trailing;

  // Parse parameters
  if (line.indexOf(':') != -1) {
    var index = line.indexOf(':');
    middle = line.substr(0, index).replace(/ +$/, "");
    trailing = line.substr(index+1);
  } else
    middle = line;

  if (middle.length)
    message.args = middle.split(/ +/);

  if (typeof(trailing) != 'undefined' && trailing.length)
    message.args.push(trailing);

  return message;
}
746976
function GetCommandList(execName, packageJson, Commands) {
  const header = `\
${packageJson.title || packageJson.name || execName} ${packageJson.version}
Usage:    ${execName} ${col.bold('<command>')} [options]
Commands:`;

  const grouped = _.groupBy(Commands, 'helpGroup');
  const sorted = _.mapValues(grouped, arr => _.sortBy(arr, 'helpPriority'));
  const sortedGroups = _.sortBy(sorted, grp => grp[0].helpPriority);
  const longestCmd = _.max(_.map(Commands, cmd => cmd.name.length));
  const commandListStr = _.map(sortedGroups, (helpGroup) => {
    const groupName = _.first(helpGroup).helpGroup;
    return _.flatten([
      `\n  * ${col.primary(groupName)}`,
      _.map(helpGroup, (cmd) => {
        const cmdName = _.padEnd(cmd.name, longestCmd);
        return `    ${col.bold(cmdName)} ${cmd.desc}`;
      }),
    ]).join('\n');
  }).join('\n');

  return `\
${header}
${commandListStr}

Use ${col.bold(`${execName} <command> -h`)} for command-specific help.`;
}
839823
def location_cmd(name, accepts_force=False):
    
    COMMANDS_TAKING_LOCATIONS.add(name)

    def decorator(func):
        @_cmd(name)
        def command_wrapper(editor, variables):
            location = variables.get('location')
            force = bool(variables['force'])

            if force and not accepts_force:
                editor.show_message('No ! allowed')
            elif accepts_force:
                func(editor, location, force=force)
            else:
                func(editor, location)
        return func
    return decorator
763206
function getCommentLocatuons(node) {
            const contentStartIndex = node.commentOpen.range[1]
            const contentEndIndex = node.commentClose.range[0]
            const contentText = sourceCode.text.slice(
                contentStartIndex,
                contentEndIndex
            )
            const contentFirstIndex = (() => {
                const index = contentText.search(/\S/u)
                if (index >= 0) {
                    return index + contentStartIndex
                }
                return contentEndIndex
            })()
            const contentLastIndex = (() => {
                const index = contentText.search(/\S\s*$/gu)
                if (index >= 0) {
                    return index + contentStartIndex + 1
                }
                return contentStartIndex
            })()

            return {
                first: {
                    index: contentFirstIndex,
                    loc: sourceCode.getLocFromIndex(contentFirstIndex),
                },
                last: {
                    index: contentLastIndex,
                    loc: sourceCode.getLocFromIndex(contentLastIndex),
                },
            }
        }
100403
function( url ) {
            var match = url.match(/^([a-z]+:)\/\//i);
            if ( match === null ) {
                // Relative URL, retrive the protocol from window.location
                return window.location.protocol;
            }
            return match[1].toLowerCase();
        }
82424
function(windowOverride) {
      var loc = windowOverride ? windowOverride.location : window.location;
      var match = loc.href.match(/#(.*)$/);
      return match ? match[1] : '';
    }
131992
def coordinates?
      text.is_a?(Array) or (
        text.is_a?(String) and
        !!text.to_s.match(/\A-?[0-9\.]+, *-?[0-9\.]+\z/)
      )
    end
288636
def parse_location(data):
    

    tokens = data.split(",")
    location = Location(directories=[], files=[], filters_in=[], filters_out=[], targets=[])
    if not tokens:
        return location

    for token in tokens:
        token = token.strip()
        if not token:
            continue

        if foundations.common.path_exists(token):
            if os.path.isdir(token):
                location.directories.append(token)
            else:
                location.files.append(token)
        else:
            match = re.match("(?P<filterIn>\*\.\w+)", token)
            if match:
                location.filters_in.append(fnmatch.translate(match.group("filterIn")))
                continue
            match = re.match("!(?P<filterOut>\*\.\w+)", token)
            if match:
                location.filters_out.append(fnmatch.translate(match.group("filterOut")))
                continue
            match = re.match("\<(?P<target>[\w ]+)\>", token)
            if match:
                location.targets.append(match.group("target"))
                continue
    return location
481651
function getSourceLocation(offset) {
  const lines = new Error().stack.split(/\n/);
  const line = lines[offset] || '';
  const ret = line.match(/at (.*):(\d+):(\d+)/);
  if (!ret) {
    return { file: '', line: 0, column: 0, info: '' };
  }
  let file = ret[1];
  const ret2 = file.match(/\((.*)/);
  if (ret2) {
    file = ret2[1];
  }
  const lineNum = Number(ret[2] || 0);
  const column = Number(ret[3] || 0);
  return {
    file,
    line: lineNum,
    column,
    info: `${ file }:${ lineNum }:${ column }`,
  };
}
272844
void eitherZeroOrOneOrAddress(String command) {
    if (!isAddressCommand && !(isZeroCommand ^ isOneCommand)) {
      throwException(CMD + command + ": (zero|one) specified incorrectly");
    }
    if (isAddressCommand && (isZeroCommand || isOneCommand)) {
      throwException(CMD + command + ": cannot specify address with (zero|one)");
    }
  }
1196577
def zip_code(anon, obj, field, val):
    
    return anon.faker.zipcode(field=field)
346778
def get_location(address=""):
    
    coordinates = None
    try:
        geolocator = Nominatim()
        location = geolocator.geocode(address)
        coordinates = (location.latitude, location.longitude)
    except Exception as ex:
        logger.error('Fail get location - {}'.format(ex))
    return coordinates
187058
ExecutionLocation getLocation(ParserRuleContext object) {
    Token start = object.getStart();
    return new ExecutionLocation(currentScope.declaringEnvironment.path, start.getLine(), start.getCharPositionInLine() + 1);
  }