xcom-unit ::= ["cm" / "pt" / "in"]
497980
Rule XcomUnit() {
		return Optional(FirstOf(IgnoreCase("cm"), IgnoreCase("pt"), IgnoreCase("in")))
			.label(XcomUnit).suppressSubnodes();
	}
578838
def units(with_prefix: true)
      return '' if @numerator == UNITY_ARRAY && @denominator == UNITY_ARRAY
      output_numerator   = ['1']
      output_denominator = []
      num                = @numerator.clone.compact
      den                = @denominator.clone.compact

      unless num == UNITY_ARRAY
        definitions = num.map { |element| RubyUnits::Unit.definition(element) }
        definitions.reject!(&:prefix?) unless with_prefix
        # there is a bug in jruby 9.1.6.0's implementation of chunk_while
        # see https://github.com/jruby/jruby/issues/4410
        # TODO: fix this after jruby fixes their bug.
        definitions = if definitions.respond_to?(:chunk_while) && RUBY_ENGINE != 'jruby'
                        definitions.chunk_while { |defn, _| defn.prefix? }.to_a
                      else # chunk_while is new to ruby 2.3+, so fallback to less efficient methods for older ruby
                        result = []
                        enumerator = definitions.to_enum
                        loop do
                          first = enumerator.next
                          result << (first.prefix? ? [first, enumerator.next] : [first])
                        end
                        result
                      end
        output_numerator = definitions.map { |element| element.map(&:display_name).join }
      end

      unless den == UNITY_ARRAY
        definitions = den.map { |element| RubyUnits::Unit.definition(element) }
        definitions.reject!(&:prefix?) unless with_prefix
        # there is a bug in jruby 9.1.6.0's implementation of chunk_while
        # see https://github.com/jruby/jruby/issues/4410
        # TODO: fix this after jruby fixes their bug.
        definitions = if definitions.respond_to?(:chunk_while) && RUBY_ENGINE != 'jruby'
                        definitions.chunk_while { |defn, _| defn.prefix? }.to_a
                      else # chunk_while is new to ruby 2.3+, so fallback to less efficient methods for older ruby
                        result = []
                        enumerator = definitions.to_enum
                        loop do
                          first = enumerator.next
                          result << (first.prefix? ? [first, enumerator.next] : [first])
                        end
                        result
                      end
        output_denominator = definitions.map { |element| element.map(&:display_name).join }
      end

      on  = output_numerator
            .uniq
            .map { |x| [x, output_numerator.count(x)] }
            .map { |element, power| (element.to_s.strip + (power > 1 ? "^#{power}" : '')) }
      od  = output_denominator
            .uniq
            .map { |x| [x, output_denominator.count(x)] }
            .map { |element, power| (element.to_s.strip + (power > 1 ? "^#{power}" : '')) }
      "#{on.join('*')}#{od.empty? ? '' : '/' + od.join('*')}".strip
    end
149311
def +(x)
      x = Unit.cast(x)
      check_operable2(x)
      assert_same_dimension(x)
      Unit.new(@factor+x.factor,@dim.dup)
    end
155889
def Incr(self, x, term=1):
        
        self.d[x] = self.d.get(x, 0) + term
298509
def get_x():
    '''
    
    '''
    cmd = 'setxkbmap -query | grep layout'
    out = __salt__['cmd.run'](cmd, python_shell=True).split(':')
    return out[1].strip()
261259
function getCommaCheckIndex(commaNode, nodeIndex) {
        let commaBefore =
          valueNode.before +
          argumentStrings.slice(0, nodeIndex).join("") +
          commaNode.before;

        // 1. Remove comments including preceeding whitespace (when only succeeded by whitespace)
        // 2. Remove all other comments, but leave adjacent whitespace intact
        commaBefore = commaBefore.replace(
          /( *\/(\*.*\*\/(?!\S)|\/.*)|(\/(\*.*\*\/|\/.*)))/,
          ""
        );

        return commaBefore.length;
      }
1277790
def modify(*units):
    """"""
    ret = []
    for unit in units: # add one command for each attribute
        for attr, idx in [("energy", 1), ("life", 2), ("shields", 3)]: # see debug_pb2.UnitValue for enum declaration
            newValue = getattr(unit, attr)
            if not newValue: continue # don't bother setting something that isn't necessary
            new = DebugCommand(unit_value=DebugSetUnitValue(
                value       = newValue,
                unit_value  = idx,
                unit_tag    = unit.tag))
            ret.append(new)
    return ret
1294264
def read_ascii_series(input_, array_type=Series, unpack=True, **kwargs):
    
    xarr, yarr = loadtxt(input_, unpack=unpack, **kwargs)
    return array_type(yarr, xindex=xarr)
231636
def command=(com)

      com = com.is_a?(Array) ? com : com.split(' ')
      com = [ com.first, com.last ]
      com[1] = com[1].to_i if com[1] and com[0] != 'jump'

      h.fields['__command__'] = com
    end
525389
@Override
	public void setXtalInfo(String spaceGroupString, float[] unitCell, double[][] ncsOperMatrixList) {
		// Now set the xtalographic information
		PDBCrystallographicInfo pci = new PDBCrystallographicInfo();
		SpaceGroup spaceGroup = SpaceGroup.parseSpaceGroup(spaceGroupString);
		pci.setSpaceGroup(spaceGroup);
		if (unitCell.length > 0) {
			CrystalCell cell = new CrystalCell(unitCell[0], unitCell[1],
					unitCell[2], unitCell[3], unitCell[4], unitCell[5]);
			pci.setCrystalCell(cell);
			structure.setCrystallographicInfo(pci);
		}

		pci.setNcsOperators(MmtfUtils.getNcsAsMatrix4d(ncsOperMatrixList));
	}
242686
def command2str(num):
    
    for attr in SLOT.__dict__.keys():
        if not attr.startswith('_') and attr == attr.upper():
            if getattr(SLOT, attr) == num:
                return 'SLOT_%s' % attr

    return "0x%02x" % (num)
805107
def _get_wx_units(self, params, name):
        
        units = ""
        for param in params:
            if str(name) == str(param['name']):
                units = param['units']
        return units
991784
def to_unit(value, unit='B'):
    """"""
    byte_array = ['B', 'KB', 'MB', 'GB', 'TB']

    if not isinstance(value, (int, float)):
        value = float(value)

    if unit in byte_array:
        result = value / 1024**byte_array.index(unit)
        return round(result, PRECISION), unit

    return value
916944
function (o, xp, yp) {
        var x = (o[xp] * rx * cosPhi - o[yp] * ry * sinPhi) + cx;
        var y = (o[xp] * rx * sinPhi + o[yp] * ry * cosPhi) + cy;
        o[xp] = x;
        o[yp] = y;
    }
1297249
def unit(self, unit):
        
        allowed_values = ["cm", "inch", "foot"]  # noqa: E501
        if unit is not None and unit not in allowed_values:
            raise ValueError(
                "Invalid value for `unit` ({0}), must be one of {1}"  # noqa: E501
                .format(unit, allowed_values)
            )

        self._unit = unit
75373
def parse_operand(string, location, tokens):
    
    sizes = {
        "dqword":  128,
        "pointer": 72,
        "qword":   64,
        "pointer": 40,
        "dword":   32,
        "word":    16,
        "byte":    8,
        "bit":     1,
    }

    if "immediate" in tokens:
        imm_str = "".join(tokens["immediate"])
        base = 16 if imm_str.startswith("0x") or imm_str.startswith("-0x") else 10

        imm = int(imm_str, base)

        oprnd = ReilImmediateOperand(imm)

    if "register" in tokens:
        if tokens["register"] in ["e", "empty"]:
            oprnd = ReilEmptyOperand()

            oprnd.size = 0
        else:
            name = tokens["register"]

            oprnd = ReilRegisterOperand(name)

    if "size" in tokens:
        oprnd.size = int(sizes[tokens["size"]])

    return [oprnd]
259475
def unit_position(self) -> typing.Tuple[float, float]:
        
        return self.unit_pos_x, self.unit_pos_y