at least one item must be filled
321242
function (args) {
                args.HasError = false;
                args.ErrorMessage = "";

                if (this.Items !== undefined && this.Items.length === 0) {
                    args.HasError = true;
                    args.ErrorMessage = "At least one item must be on invoice.";
                    args.TranslateArgs = { TranslateId: "AnyItem", MessageArgs: undefined };
                    return;
                }
            }
815017
def _ensure_counter(self):
        """"""
        if self._counter_path not in self._client.kv:
            self._client.kv[self._counter_path] = ''.zfill(self._COUNTER_FILL)
1173423
def include_any?(*items)
      items = items.first if items.length == 1 && items.first.kind_of?(Array)
      !(self & items).empty?
    end
491189
def fill_parentidid2obj_r1(self, id2obj_user, child_obj):
        """"""
        for higher_obj in self._getobjs_higher(child_obj):
            if higher_obj.item_id not in id2obj_user:
                id2obj_user[higher_obj.item_id] = higher_obj
                self.fill_parentidid2obj_r1(id2obj_user, higher_obj)
506655
def choose_one(things):
    """"""
    choice = SystemRandom().randint(0, len(things) - 1)
    return things[choice].strip()
211074
def put(self, item, **kwargs):
        """"""
        if self.full():
            raise Full()
        self._append(item)
712412
def appendleft(self, item):
        
        self._deque.appendleft(item)
        self.notEmpty.set()
466371
def add(self, item):
        """"""
        if item in self._set:
            self._fifo.remove(item)
        elif len(self._set) == self.max_items:
            self._set.remove(self._fifo.pop(0))
        self._fifo.append(item)
        self._set.add(item)
977469
function pack(items) {
		var data = arguments,
			idx = 0,
			buffer,
			bufferSize = 0;

		// Calculate buffer size
		items = items.split('');
		items.forEach(function(type) {
			if (type == 'v') {
				bufferSize += 2;
			} else if (type == 'V' || type == 'l') {
				bufferSize += 4;
			}
		});

		// Fill buffer
		buffer = new Buffer(bufferSize);
		items.forEach(function(type, index) {
			if (type == 'v') {
				buffer.writeUInt16LE(data[index + 1], idx);
				idx += 2;
			} else if (type == 'V') {
				buffer.writeUInt32LE(data[index + 1], idx);
				idx += 4;
			} else if (type == 'l') {
				buffer.writeInt32LE(data[index + 1], idx);
				idx += 4;
			}
		});

		return buffer;
	}
397930
private void ensureAvail(int n) {
    if (pos + n >= buf.length) {
      int newSize = Math.max(pos + n, buf.length * 2);
      buf = Arrays.copyOf(buf, newSize);
    }
  }
706700
def _insert_item(self, key, new_item, instance, is_after):
        """"""
        index = self._get_index_for_insert(key, instance)
        index = index + 1 if is_after else index
        self.__items = self.__items[:index] + new_item + self.__items[index:]
        # Make sure indexing works with new items
        for new_key, new_value in new_item:
            if new_key in self:
                value_list = [val for k, val in self.__items if k == new_key]
                dict_setitem(self, new_key, value_list)
            else:
                dict_setitem(self, new_key, [new_value])
348228
def _ensure_insert(self, new_items, insert_to):
        
        insert_to = insert_to or []
        insert_to.insert(0, new_items)
        return insert_to
1090874
def customer_item_quantity_remaining(item_code = nil, code = nil)
      item = customer_item(item_code, code)
      item ? item[:quantityIncluded] - item[:quantity] : 0
    end
834208
public void ensureCapacity(int capacity) {
        if (capacity > data.length) {
            int newCap = Math.max(data.length << 1, capacity);
            int[] tmp = new int[newCap];
            System.arraycopy(data, 0, tmp, 0, data.length);
            data = tmp;
        }
    }
1096195
private void ensureCapacity(int wordsRequired)
  {
    if (words.length >= wordsRequired) {
      return;
    }
    int newLength = Math.max(words.length << 1, wordsRequired);
    words = Arrays.copyOf(words, newLength);
  }
691250
def demand
      if variables.empty?
        if @source.dimension > 0
          self.class.new( @dest.element( INT.new( 0 ) ),
                          @source.element( INT.new( 0 ) ) ).demand
          INT.new( 1 ).upto INT.new( @source.shape.last ) - 1 do |i|
            dest = @dest.element INT.new( i )
            source = @source.element INT.new( i )
            self.class.new( dest, source ).demand
            Store.new( dest, dest + @dest.element( INT.new( i ) - 1 ) ).demand
          end
        else
          Store.new( @dest, @source ).demand
        end
        @dest
      else
        super
      end
    end
183849
private void ensureCapacity(int index)
  {
    int capacity = words == null ? 0 : words.length;
    if (capacity > index) {
      return;
    }
    capacity = Math.max(capacity << 1, index + 1);

    if (words == null) {
      // nothing to copy
      words = new int[capacity];
      return;
    }
    words = Arrays.copyOf(words, capacity);
  }