tracker command parser
324660
def cmd_tracker(self, args):
        ''''''
        usage = "usage: tracker <start|set|arm|disarm|level|param|mode|position> [options]"
        if len(args) == 0:
            print(usage)
            return
        if args[0] == "start":
            self.cmd_tracker_start()
        elif args[0] == "set":
            self.tracker_settings.command(args[1:])
        elif args[0] == 'arm':
            self.cmd_tracker_arm()
        elif args[0] == 'disarm':
            self.cmd_tracker_disarm()
        elif args[0] == 'level':
            self.cmd_tracker_level()
        elif args[0] == 'param':
            self.cmd_tracker_param(args[1:])
        elif args[0] == 'mode':
            self.cmd_tracker_mode(args[1:])
        elif args[0] == 'position':
            self.cmd_tracker_position(args[1:])
        elif args[0] == 'calpress':
            self.cmd_tracker_calpress(args[1:])
        else:
            print(usage)
406730
function ( tracker, gPoint ) {
            var guid = _generateGuid( tracker, gPoint ),
                i,
                len = trackerPoints.length;
            for ( i = 0; i < len; i++ ) {
                if ( trackerPoints[ i ].guid === guid ) {
                    trackerPoints.splice( i, 1 );
                    // Only run the interval timer if theres gesture pointers to track
                    len--;
                    if ( len === 0 ) {
                        window.clearInterval( intervalId );
                    }
                    break;
                }
            }
        }
197490
def auto_detect(self, args):
        
        suffixes = [
            ".tgz",
            ".txz",
            ".tbz",
            ".tlz"
        ]
        if (not args[0].startswith("-") and args[0] not in self.commands and
                args[0].endswith(tuple(suffixes))):
            packages, not_found = [], []
            for pkg in args:
                if pkg.endswith(tuple(suffixes)):
                    if os.path.isfile(pkg):
                        packages.append(pkg)
                    else:
                        not_found.append(pkg)
            if packages:
                Auto(packages).select()
            if not_found:
                for ntf in not_found:
                    self.msg.pkg_not_found("", ntf, "Not installed", "")
            raise SystemExit()
1016375
def add_trackers(self, infohash, trackers):
        
        data = {'hash': infohash.lower(),
                'urls': trackers}
        return self._post('command/addTrackers', data=data)
779823
def tracking(oracle, obs, trn_type=1, reverse_init=False, method='else', decay=1.0):
    
    N = len(obs)
    if reverse_init:
        r_oracle = create_reverse_oracle(oracle)
        _ind = [r_oracle.n_states - rsfx for rsfx in r_oracle.rsfx[0][:]]
        init_ind = []
        for i in _ind:
            s = i
            while oracle.sfx[s] != 0:
                s = oracle.sfx[s]
            init_ind.append(s)
        K = r_oracle.num_clusters()
    else:
        init_ind = oracle.rsfx[0][:]
        K = oracle.num_clusters()

    P = np.zeros((N, K), dtype='int')
    T = np.zeros((N,), dtype='int')
    map_k_outer = partial(_query_k, oracle=oracle, query=obs)
    map_query = partial(_query_init, oracle=oracle, query=obs[0], method=method)
    #     map_query = partial(_query_init, oracle=oracle, query=obs[0], method)

    argmin = np.argmin

    P[0], C = zip(*map(map_query, init_ind))
    C = np.array(C)
    T[0] = P[0][argmin(C)]

    if trn_type == 1:
        trn = _create_trn_self
    elif trn_type == 2:
        trn = _create_trn_sfx_rsfx
    else:
        trn = _create_trn

    distance_cache = np.zeros(oracle.n_states)

    for i in range(1, N):  # iterate over the rest of query
        state_cache = []
        dist_cache = distance_cache

        map_k_inner = partial(map_k_outer, i=i, P=P, trn=trn, state_cache=state_cache, dist_cache=dist_cache)
        P[i], _c = zip(*map(map_k_inner, range(K)))
        C = decay * C + np.array(_c)
        T[i] = P[i][argmin(C)]

    return T
29231
function() {
    var tracker = this._aSelections;
    if(tracker && tracker.length > 0) {
        for(var i=tracker.length-1; i>-1; i--) {
           if(lang.isString(tracker[i])){
                return tracker[i];
            }
        }
    }
}
1342950
def track(*fields):
    
    def inner(cls):
        _track_class(cls, fields)
        _add_get_tracking_url(cls)
        return cls
    return inner
598491
def cmd_tracker_mode(self, args):
        ''''''
        connection = self.find_connection()
        if not connection:
            print("No antenna tracker found")
            return
        mode_mapping = connection.mode_mapping()
        if mode_mapping is None:
            print('No mode mapping available')
            return
        if len(args) != 1:
            print('Available modes: ', mode_mapping.keys())
            return
        mode = args[0].upper()
        if mode not in mode_mapping:
            print('Unknown mode %s: ' % mode)
            return
        connection.set_mode(mode_mapping[mode])
392867
function getTrackInfo( list, keyOf ){

  var untrack = [], trackMap = {};

  for(var i = 0, len = list.length; i < len ; i++){

    var item = list[i];
    var trackKey = keyOf(list[i]);

    // can be stringify
    if( !trackMap.hasOwnProperty(trackKey) ){

      trackMap[ trackKey ] = i
    }else{

      untrack.push( i )
    }
  }

  return {
    untrack: untrack,
    trackMap: trackMap
  }
}
48096
def track(self, message, name="Message"):
        
        if self.chatbase_token:
            asyncio.ensure_future(self._track(message, name))
785840
def p_command(p):
    """"""
    #print("COMMAND:", p[1], p[2], p[3])
    tests = p[2].get('tests')
    block = None
    if p[3] != ';': block = p[3]
    handler = sifter.handler.get('command', p[1])
    if handler is None:
        print("No handler registered for command '%s' on line %d" %
            (p[1], p.lineno(1)))
        raise SyntaxError
    p[0] = handler(arguments=p[2]['args'], tests=tests, block=block)
123166
function parse(input, done) {
  if (input && input.args) return done(undefined, input);
  if (input) done(undefined, {args: [].concat(input)});
  cmd([
    {option: '-s, --source <s>', text: 'The source path (for expand/watch).'},
    {option: '-w, --watch <s>', text: 'The watched files.', parse: function(value) {
      return value.split(',');
    }}
  ], done);
}
1060453
function (cmd) {
			self.alreadyProcessedTraces[cmd.modelElement.path()] = self.alreadyProcessedTraces[cmd.modelElement.path()] || {};
			self.alreadyProcessedTraces[cmd.modelElement.path()][cmd.toString()] = cmd;
		}
335599
function parseCommandLine(args) {

    var parsed_cmds = [];

    if (args.length <= 2) {
        parsed_cmds.push(defaultCommand());
    } else {

        var cli = args.slice(2);

        var pos = 0;
        var cmd;

        cli.forEach(function(element, index, array) {

            //replace alias name with real name.
            if (element.indexOf('--') === -1 && element.indexOf('-') === 0) {
                cli[index] = alias_map[element];
            }

            //parse command and args
            if (cli[index].indexOf('--') === -1) {
                cmd.args.push(cli[index]);
            } else {

                if (keys[cli[index]] == "undefined") {
                    throw new Error("not support command:" + cli[index]);
                };

                pos = index;
                cmd = commands[cli[index]];
                if (typeof cmd.args == 'undefined') {
                    cmd.args = [];
                };
                parsed_cmds.push(cmd);
            }
        });
    };

    return parsed_cmds;
}
471375
function track(event){
  try {
    // TODO look up for event.data.transformer before setting data
    tracker.set(event);
  } catch(e) {
    /** @cut */ basis.dev.error(namespace + '.track(): Error during tracking event processing', event, e);
  }
}
868711
def get_parser():
    
    desc = Colors.LIGHTBLUE + textwrap.dedent(
        '''\
        Welcome to
                      _                           _                            _
           __ _ _   _| |_ ___      _ __  _   _   | |_ ___  _ __ _ __ ___ _ __ | |_
          / _` | | | | __/ _ \    | '_ \| | | |  | __/ _ \| '__| '__/ _ \ '_ \| __|
         | (_| | |_| | || (_) |   | |_) | |_| |  | || (_) | |  | | |  __/ | | | |_
          \__,_|\__,_|\__\___/____| .__/ \__, |___\__\___/|_|  |_|  \___|_| |_|\__|
                            |_____|_|    |___/_____|

        ------------------------------------
          auto_py_torrent is an automated tool for download files by obtaining
        torrents or magnets that are in different provided pages that the
        user can choose.

          Its goal is to make it easier for users to find the files they want
        and download them instantly.

          An auto_py_torrent command is provided in which the user can
        currently choose between two modes, best_rated and list mode, then it
        selects one of the torrent tracking pages for multimedia content and
        finally enter the text of what you want to download.
        ------------------------------------
        ''') + Colors.ENDC
    usage_info = Colors.LGREEN + textwrap.dedent(
        '''\

        Use "%(prog)s --help" for more information.
        Examples:
            use "%(prog)s MODE SELECTED_PAGE STRING_TO_SEARCH # generic.
            use "%(prog)s 0 0 "The simpsons" # best rated.
            use "%(prog)s 1 0 "The simpsons" # list rated.

        Mode options:
            0: best_rated. # Download the most rated file.
            1: list. # Get a list, and select one of them.

        Page list options:
            0: torrent project.
            1: the pirate bay.
            2: 1337x.
            3: eztv.
            4: limetorrents.
            5: isohunt.
        ''') + Colors.ENDC
    epi = Colors.LIGHTPURPLE + textwrap.dedent(
        '''\
        -> Thanks for using auto_py_torrent!
        ''') + Colors.ENDC

    # Parent and only parser.
    parser = argparse.ArgumentParser(
        add_help=True,
        formatter_class=argparse.RawTextHelpFormatter,
        usage=usage_info,
        description=desc,
        epilog=epi)
    parser.add_argument('mode', action='store',
                        choices=range(len(MODES)),
                        type=int,
                        help='Select mode of file download.\n'
                             '    e.g: 0(rated) or 1(list).')
    parser.add_argument('torr_page', action='store',
                        choices=range(len(TORRENTS)),
                        type=int,
                        help='Select tracking page to download from.\n'
                             '    e.g: 0 to .. ' + str(len(TORRENTS)-1) + '.')
    parser.add_argument('str_search', action='store',
                        type=str,
                        help='Input torrent string to search.\n'
                             '    e.g: "String search"')
    return(parser)
702685
def track(self, tracking_number):
        ""
        resp = self.send_request(tracking_number)
        return self.parse_response(resp)