Array of all milestones
190605
def milestones(self):
        ''''''
        if self.cache['milestones']: return self.cache['milestones']
        milestone_xml = self.bc.list_milestones(self.id)
        milestones = []
        for node in ET.fromstring(milestone_xml).findall("milestone"):
            milestones.append(Milestone(node))

        milestones.sort()
        milestones.reverse()
        self.cache['milestones'] = milestones
        return self.cache['milestones']
1353615
public List<FogbugzMilestone> getMilestones() {
        try {
            HashMap<String, String> params = new HashMap<String, String>();  // Hashmap defaults to <String, String>
            params.put("cmd", "listFixFors");

            Document doc = this.getFogbugzDocument(params);

            List<FogbugzMilestone> milestoneList = new ArrayList<FogbugzMilestone>();
            NodeList milestonesNodeList = doc.getElementsByTagName("fixfor");
            if (milestonesNodeList != null && milestonesNodeList.getLength() != 0) {
                for (int i = 0; i < milestonesNodeList.getLength(); i++) {
                    Element currentNode = (Element) milestonesNodeList.item(i);
                    // Construct event object from retrieved data.
                    milestoneList.add(new FogbugzMilestone(
                            Integer.parseInt(currentNode.getElementsByTagName("ixFixFor").item(0).getTextContent()),
                            currentNode.getElementsByTagName("sFixFor").item(0).getTextContent(),
                            Boolean.valueOf(currentNode.getElementsByTagName("fDeleted").item(0).getTextContent()),
                            Boolean.valueOf(currentNode.getElementsByTagName("fReallyDeleted").item(0).getTextContent())
                    ));
                }
            }

            return milestoneList;

        } catch (Exception e) {
            FogbugzManager.log.log(Level.SEVERE, "Exception while fetching milestones", e);
        }
        return new ArrayList<FogbugzMilestone>();
    }
300229
def log_progress(sequence, every=None, size=None, name='Items'):
    """"""
    from ipywidgets import IntProgress, HTML, VBox
    from IPython.display import display

    is_iterator = False
    if size is None:
        try:
            size = len(sequence)
        except TypeError:
            is_iterator = True
    if size is not None:
        if every is None:
            if size <= 200:
                every = 1
            else:
                every = int(size / 200)     # every 0.5%
    else:
        assert every is not None, 'sequence is iterator, set every'

    if is_iterator:
        progress = IntProgress(min=0, max=1, value=1)
        progress.bar_style = 'info'
    else:
        progress = IntProgress(min=0, max=size, value=0)
    label = HTML()
    box = VBox(children=[label, progress])
    display(box)

    index = 0
    try:
        for index, record in enumerate(sequence, 1):
            if index == 1 or index % every == 0:
                if is_iterator:
                    label.value = '{name}: {index} / ?'.format(
                        name=name,
                        index=index
                    )
                else:
                    progress.value = index
                    label.value = u'{name}: {index} / {size}'.format(
                        name=name,
                        index=index,
                        size=size
                    )
            yield record
    except Exception as e:
        progress.bar_style = 'danger'
        raise
    else:
        progress.bar_style = 'success'
        progress.value = index
        label.value = "{name}: {index}".format(
            name=name,
            index=str(index or '?')
        )
532760
function(tasks, callback) {

      var keys; var length; var i; var results; var kind;
      var updated_tasks = [];
      var is_object;
      var counter = 0;

      if (isArray(tasks)) {

        length = tasks.length;
        results = [];

      } else if (isObject(tasks)) {

        is_object = true;
        keys = ObjectKeys(tasks);
        length = keys.length;
        results = {};

      } else {
        return callback();
      }

      for (i=0; i<length; i++) {

        if (is_object) {
          updated_tasks.push({ k: keys[i], t: tasks[keys[i]] });
        } else {
          updated_tasks.push({ k: i, t: tasks[i] });
        }

      }

      updated_tasks.forEach(function(task_object) {

        task_object.t(function(err, result) {
          if (err) return callback(err);

          results[task_object.k] = result;

          counter++;
          if (counter == length) callback(null, results);
        });

      });

    }
576744
function _each(array, func) {
        for (var i = 0, l = array.length; i < l; i++) {
            func(array[i]);
        }
    }
235324
private static <T> void batchFastListCollectIf(T[] array, int start, int end, FastListCollectIfProcedure<T, ?> castProcedure)
    {
        for (int i = start; i < end; i++)
        {
            castProcedure.value(array[i]);
        }
    }
72796
def get_all_triggers(bump, file_triggers):
    """"""
    triggers = set()
    if file_triggers:
        triggers = triggers.union(detect_file_triggers(config.trigger_patterns))
    if bump:
        _LOG.debug("trigger: %s bump requested", bump)
        triggers.add(bump)
    return triggers
1326913
def all():
    
    return [goal for _, goal in sorted(Goal._goal_by_name.items()) if goal.active]
183988
def every(self, step, offset=0):
        
        new = []

        for position, item in enumerate(self.items):
            if position % step == offset:
                new.append(item)

        return self.__class__(new)
1076450
function visitAll(state, paths, cwd, one, done) {
  var expected = paths.length
  var actual = -1
  var result = []

  paths.forEach(each)

  next()

  function each(filePath) {
    visit(state, join(cwd || '', filePath), one, onvisit)
  }

  function onvisit(files) {
    result = result.concat(files)
    next()
  }

  function next() {
    actual++

    if (actual === expected) {
      done(result)
    }
  }
}
1134292
def events(options = {})
      batches = Enumerator.new do |y|
        options = options.merge(stack_name: @name)
        resp = @client.describe_stack_events(options)
        resp.each_page do |page|
          batch = []
          page.data.stack_events.each do |s|
            batch << Event.new(
              id: s.event_id,
              data: s,
              client: @client
            )
          end
          y.yield(batch)
        end
      end
      Event::Collection.new(batches)
    end
796432
def parse_wordnet(self,debug=False):
        '''
        '''
        synList = []
        self.milestone = 0 # to start from beginning of file
        while self.milestone < os.path.getsize(self.fileName) - 5:
            if debug:
                print ('self.milestone', self.milestone)
            a = self.parse_synset(offset=self.milestone)
            synList.append(a)
            self.milestone = self.file.tell()
        return synList
547023
public function milestones(array $parameters = [])
    {
        $data = $this->client->milestones()->all($this->id, $parameters);

        $milestones = array();
        foreach ($data as $milestone) {
            $milestones[] = Milestone::fromArray($this->getClient(), $this, $milestone);
        }

        return $milestones;
    }
955258
@Override
	public Endpoint next(Endpoint[] array) {
		return array[counter.incrementAndGet() % array.length];
	}
808450
public List<Milestone> getGroupMilestones(Object groupIdOrPath) throws GitLabApiException {
        return (getGroupMilestones(groupIdOrPath, getDefaultPerPage()).all());
    }
650251
function getTemplatesTasks(baseTask, app) {
	var tasks = [];
	var templates = getTemplates(app);

	if (templates) {
		for (index = 0; index < templates.length; ++index) {
		    tasks.push(baseTask + '.' + templates[index]);
		}
	}

	return tasks;
}
1290813
def milestone(self, column=None, value=None, **kwargs):
        
        return self._resolve_call('GIC_MILESTONE', column, value, **kwargs)