Return all subsidiaries of this company.
481763
def get_all_children(self, include_self=False):
        
        ownership = Ownership.objects.filter(parent=self)
        subsidiaries = Company.objects.filter(child__in=ownership)
        for sub in subsidiaries:
            subsidiaries = subsidiaries | sub.get_all_children()

        if include_self is True:
            self_company = Company.objects.filter(id=self.id)
            subsidiaries = subsidiaries | self_company

        return subsidiaries
972127
def products(self):
        """"""
        _products = []
        for ext in self.exts:
            prod = Product(ext, self.node.opath_from_ext(ext))
            _products.append(prod)

        return _products
267546
def branch(self):
        
        branch = [self]
        for c in self.children:
            branch += c.branch()
        return branch
977091
def close_all(self):
        """"""
        for host, conns in self._cm.get_all().items():
            for h in conns:
                self._cm.remove(h)
                h.close()
1205322
def flatten(&merger)
      trees.reverse_each.reduce(Tree[]) do |result, tree|
        result.merge!(tree, &merger)
      end
    end
1352186
public void consolidate() {
		Decl.Module module = target.getModule();
		for(ExternalGroup group : consolidations) {
			// TODO: this could be made way more efficient by collecting all consolidate
			// units into one batch
			module.putExtern(group.consolidate());
		}
		consolidations.clear();
	}
464639
def release_all(self, callback: Callable[[str, Any, Any], None]):
        """"""
        self._all_callbacks.remove(callback)
441346
def all_jobs(self):
        
        from db.models.jobs import Job

        return Job.all.filter(project=self)
21719
def all(self, data={}, **kwargs):
        "
        return super(Order, self).all(data, **kwargs)
41963
def get_all_parents(self):
        
        ownership = Ownership.objects.filter(child=self)
        parents = Company.objects.filter(parent__in=ownership)
        for parent in parents:
            parents = parents | parent.get_all_parents()
        return parents
426506
def commit_all(self):
        """"""
        while self._transaction_nesting_level != 0:
            if not self._auto_commit and self._transaction_nesting_level == 1:
                return self.commit()
            self.commit()
1069977
def branches(self):
		
		# get all remote branches
		refs = filter(lambda l: isinstance(l, git.RemoteReference), self.repo.references)
		# filter out HEAD branch
		refs = filter(lambda l: l.name != "origin/HEAD", refs)
		# filter out all branches not starting with 'origin/'
		refs = filter(lambda l: l.name.startswith("origin/"), refs)
		for ref in refs:
			self.refs[ref.name[7:]] = ref

		# remove 'origin/' prefix
		return map(lambda l: l.name[7:], refs)
600108
def get_all(self, fields=list(), limit=None, order_by=list(), offset=None):
        """"""
        warnings.warn("get_all() is deprecated, please use get_multiple() instead", DeprecationWarning)
        return self.get_multiple(fields, limit, order_by, offset)
164834
def inherit(self, parent):
        """"""
        if self._parent == parent:
            return
        if self._parent:
            self._parent.release_all(self._parent_changed)
        self_values = {key: self._container[key] for key in self._own_keys}
        self._container = {**parent.to_dictionary(), **self_values}
        self._parent = parent
        self._parent.observe_all(self._parent_changed)
683234
def branch(self):
        """"""
        result = get_branch(repo=self.repo)
        if result is None:
            result = get_travis_branch()
        return result
975218
def ReturnLeasedCronJobs(self, jobs, cursor=None):
    """"""
    if not jobs:
      return

    unleased_jobs = []

    conditions = []
    args = []
    for job in jobs:
      if not job.leased_by or not job.leased_until:
        unleased_jobs.append(job)
        continue

      conditions.append("""
      (job_id = %s AND leased_until = FROM_UNIXTIME(%s) AND leased_by = %s)
      """)
      args += [
          job.cron_job_id,
          mysql_utils.RDFDatetimeToTimestamp(job.leased_until), job.leased_by
      ]

    if conditions:
      query = ("UPDATE cron_jobs "
               "SET leased_until=NULL, leased_by=NULL "
               "WHERE ") + " OR ".join(conditions)
      returned = cursor.execute(query, args)

    if unleased_jobs:
      raise ValueError("CronJobs to return are not leased: %s" % unleased_jobs)
    if returned != len(jobs):
      raise ValueError("%d cronjobs in %s could not be returned." %
                       ((len(jobs) - returned), jobs))
530978
def cancel_all_orders(self) -> List[str]:
        """"""
        order_ids = [o.id for o in self.fetch_all_open_orders()]
        return self.cancel_orders(order_ids)