Returns the current group.

		@param shutit_pexpect_child:    See send()
		@param note:     See send()

		@return: the first group found
		@rtype: string
770477
def whoarewe(self,
	             shutit_pexpect_child=None,
	             note=None,
	             loglevel=logging.DEBUG):
		
		shutit_global.shutit_global_object.yield_to_draw()
		shutit_pexpect_child = shutit_pexpect_child or self.get_current_shutit_pexpect_session().pexpect_child
		shutit_pexpect_session = self.get_shutit_pexpect_session_from_child(shutit_pexpect_child)
		return shutit_pexpect_session.whoarewe(note=note,
		                                       loglevel=loglevel)
832717
public int getGroupForPrimary(long p) {
        p >>= 16;
        if(p < scriptStarts[1] || scriptStarts[scriptStarts.length - 1] <= p) {
            return -1;
        }
        int index = 1;
        while(p >= scriptStarts[index + 1]) { ++index; }
        for(int i = 0; i < numScripts; ++i) {
            if(scriptsIndex[i] == index) {
                return i;
            }
        }
        for(int i = 0; i < MAX_NUM_SPECIAL_REORDER_CODES; ++i) {
            if(scriptsIndex[numScripts + i] == index) {
                return Collator.ReorderCodes.FIRST + i;
            }
        }
        return -1;
    }
591596
private Glyph handlePEGroup(Set<PhysicalEntity> pes, String context) {
		int sz = pes.size();		
		if (sz > 1) {
			List<Glyph> gs = getGlyphsOfPEs(pes, context);
			return connectWithAND(gs);
		} else if (sz == 1) {
			PhysicalEntity pe = pes.iterator().next();
			if(glyphMap.containsKey(convertID(pe.getUri())))
				return getGlyphToLink(pe, context);
		}
		
		//'pes' was empty
		return null;
	}
803750
def pexpect(self):
        
        import pexpect

        assert not self._ignore_errors

        _check_directory(self.directory)

        arguments = self.arguments

        return pexpect.spawn(
            arguments[0], args=arguments[1:], env=self.env, cwd=self.directory
        )
231224
def groupletters(x, _low=lower_function):
    
    return "".join(ichain.from_iterable((_low(y), y) for y in x))
113486
def inspect
      # NOTES:
      #
      # * Exceptions raised here result in `(Object doesn't support #inspect)`. No other details are available, be careful.
      # * We don't return value from here, we **print** it directly.

      nodes = @instance.nodes.select {|node| node.parent == @parent}

      # Empty group?
      if nodes.empty?
        ::Kernel.puts "No groups/hacks here"
        return nil
      end

      # Not empty group, list contents.

      nodes = nodes.sort_by do |node|
        [
          node.is_a?(Node::Group) ? 0 : 1,    # Groups first.
          node.name.to_s,
        ]
      end

      # Compute name alignment width.
      names = nodes.map {|node| Tools.format_node_name(node)}
      name_align = Tools.compute_name_align(names, @instance.conf.local_name_align)

      nodes.each do |node|
        brief_desc = node.brief_desc || @instance.conf.brief_desc_stub

        fmt = "%-#{name_align}s%s"

        ::Kernel.puts(fmt % [
          Tools.format_node_name(node),
          brief_desc ? " # #{brief_desc}" : "",
        ])
      end # nodes.each

      nil
    end
1132976
function tabView_waitForGroupUndo(aSpec) {
    var spec = aSpec || {};
    var group = spec.group;

    if (!group) {
      throw new Error(arguments.callee.name + ": Group not specified.");
    }

    var element = null;
    this._groupItemsObject.groupItems.forEach(function(node) {
      if (node.container == group.getNode()) {
        element = node;
      }
    });

    mozmill.utils.waitFor(function() {
      return element && element.hidden == false;
    }, TIMEOUT, 100, "Tab Group has not been reopened.");

    // XXX: Ugly but otherwise the events on the button aren't get processed
    this._controller.sleep(0);
  }
281187
private String getTransitiveGroup(Circuit initialCircuit, Tile tile)
    {
        final Set<Circuit> circuitSet = circuits.keySet();
        final Collection<String> groups = new HashSet<>(circuitSet.size());
        final String groupIn = mapGroup.getGroup(tile);
        for (final Circuit circuit : circuitSet)
        {
            final String groupOut = circuit.getOut();
            for (final Tile neighbor : map.getNeighbors(tile))
            {
                final String groupNeighbor = mapGroup.getGroup(neighbor);
                if (groupNeighbor.equals(groupOut) && !groupNeighbor.equals(groupIn))
                {
                    return groupOut;
                }
            }
            groups.add(groupOut);
        }
        return getShortestTransitiveGroup(groups, initialCircuit);
    }
211662
def get_env_pass(self,
	                 user=None,
	                 msg=None,
	                 shutit_pexpect_child=None,
	                 note=None):
		
		shutit_global.shutit_global_object.yield_to_draw()
		shutit_pexpect_child = shutit_pexpect_child or self.get_current_shutit_pexpect_session().pexpect_child
		shutit_pexpect_session = self.get_shutit_pexpect_session_from_child(shutit_pexpect_child)
		return shutit_pexpect_session.get_env_pass(user=user,
		                                           msg=msg,
		                                           note=note)
792675
def handle_note(self, note, command='', training_input=''):
		
		shutit_global.shutit_global_object.yield_to_draw()
		if self.build['walkthrough'] and note != None and note != '':
			assert isinstance(note, str), shutit_util.print_debug()
			wait = self.build['walkthrough_wait']
			wrap = '\n' + 80*'=' + '\n'
			message = wrap + note + wrap
			if command != '':
				message += 'Command to be run is:\n\t' + command + wrap
			if wait >= 0:
				self.pause_point(message, color=31, wait=wait)
			else:
				if training_input != '' and self.build['training']:
					if len(training_input.split('\n')) == 1:
						shutit_global.shutit_global_object.shutit_print(shutit_util.colorise('31',message))
						while shutit_util.util_raw_input(prompt=shutit_util.colorise('32','Enter the command to continue (or "s" to skip typing it in): ')) not in (training_input,'s'):
							shutit_global.shutit_global_object.shutit_print('Wrong! Try again!')
						shutit_global.shutit_global_object.shutit_print(shutit_util.colorise('31','OK!'))
					else:
						self.pause_point(message + '\nToo long to use for training, so skipping the option to type in!\nHit CTRL-] to continue', color=31)
				else:
					self.pause_point(message + '\nHit CTRL-] to continue', color=31)
		return True
147027
def get_current_environment(self, note=None):
		
		shutit_global.shutit_global_object.yield_to_draw()
		self.handle_note(note)
		res = self.get_current_shutit_pexpect_session_environment().environment_id
		self.handle_note_after(note)
		return res
1050877
def group(self, indent: int = DEFAULT_INDENT, add_line: bool = True) -> _TextGroup:
        
        return _TextGroup(self, indent, add_line)
1039166
def note_to_int(note):
    
    if is_valid_note(note):
        val = _note_dict[note[0]]
    else:
        raise NoteFormatError("Unknown note format '%s'" % note)

    # Check for '#' and 'b' postfixes
    for post in note[1:]:
        if post == 'b':
            val -= 1
        elif post == '#':
            val += 1
    return val % 12
640643
def group(self):
        
        retval = None
        parent = self.get_parent()
        Group = get_group_model()
        if issubclass(parent.specific_class, Group):
            retval = parent.specific
        if retval is None:
            retval = self.group_page
        return retval
602634
public static int getNumBondsInGroup(List<Atom> atomsInGroup) {
		int bondCounter = 0;
		for(Atom atom : atomsInGroup) {
			if(atom.getBonds()==null){
				continue;
			}
			for(Bond bond : atom.getBonds()) {
				// Now set the bonding information.
				Atom other = bond.getOther(atom);
				// If both atoms are in the group
				if (atomsInGroup.indexOf(other)!=-1){
					Integer firstBondIndex = atomsInGroup.indexOf(atom);
					Integer secondBondIndex = atomsInGroup.indexOf(other);
					// Don't add the same bond twice
					if (firstBondIndex<secondBondIndex){
						bondCounter++;
					}
				}
			}
		}
		return bondCounter;
	}
1282668
private JNoteElementAbstract getHighestNoteGlyphBetween(NoteAbstract start, NoteAbstract end, boolean excludeStartAndEnd) {
		Collection jnotes = getNoteGlyphesBetween(start, end);
		JNoteElementAbstract ret = null;
		boolean first = true;
		for (Iterator it = jnotes.iterator(); it.hasNext();) {
			JNoteElementAbstract n = (JNoteElementAbstract) it.next();
			if (first && excludeStartAndEnd) {
				//ignore start ?
				first = false;
				continue;
			}
			if (!it.hasNext() && excludeStartAndEnd) {
				//ignore end ?
				break;
			}
			if (ret == null)
				ret = n;
			else {
				if (n.getBoundingBox().getMinY()
					< ret.getBoundingBox().getMinY())
					ret = n;
			}
		}
		return ret;
	}
842492
def sendline(self, sendspec):
		
		assert not sendspec.started, shutit_util.print_debug()
		shutit = self.shutit
		shutit.log('Sending in pexpect session (' + str(id(self)) + '): ' + str(sendspec.send), level=logging.DEBUG)
		if sendspec.expect:
			shutit.log('Expecting: ' + str(sendspec.expect), level=logging.DEBUG)
		else:
			shutit.log('Not expecting anything', level=logging.DEBUG)
		try:
			# Check there are no background commands running that have block_other_commands set iff
			# this sendspec says
			if self._check_blocked(sendspec) and sendspec.ignore_background != True:
				shutit.log('sendline: blocked', level=logging.DEBUG)
				return False
			# If this is marked as in the background, create a background object and run in the background.
			if sendspec.run_in_background:
				shutit.log('sendline: run_in_background', level=logging.DEBUG)
				# If this is marked as in the background, create a background object and run in the background after newlines sorted.
				shutit_background_command_object = self.login_stack.get_current_login_item().append_background_send(sendspec)
				# Makes no sense to check exit for a background command.
				sendspec.check_exit = False
			if sendspec.nonewline != True:
				sendspec.send += '\n'
				# sendspec has newline added now, so no need to keep marker
				sendspec.nonewline = True
			if sendspec.run_in_background:
				shutit_background_command_object.run_background_command()
				return True
			#shutit.log('sendline: actually sending: ' + sendspec.send, level=logging.DEBUG)
			self.pexpect_child.send(sendspec.send)
			return False
		except OSError:
			self.shutit.fail('Caught failure to send, assuming user has exited from pause point.')