Return the first element.
500035
def first(self):
        
        if self.mode == 'local':
            return self.values[0]

        if self.mode == 'spark':
            return self.values.first().toarray()
73414
def first(self):
        
        self.reset()
        value = next(self, None)
        if value is None:
            raise ConstraintViolation("{} did not find any results.".format(self.mode.capitalize()))
        return value
919686
def first(self):
        """"""
        with self.lock:
            try:
                return self.data[0][0]
            except IndexError as ex:
                ex.args = ('DEPQ is empty',)
                raise
785937
public T removeFirst() {
		if (isEmpty()) {
			return null;
		}
		T firstElement = elements[firstIndex];
		elements[firstIndex] = null;
		firstIndex = incrementIndex(firstIndex, 0);
		return firstElement;
	}
600090
def select_first(root)
      stack = [root]
      while node = stack.pop
        if node.tag? && subset = match(node, true)
          return subset.first if !subset.empty?
        elsif children = node.children
          stack.concat children.reverse
        end
      end
      nil
    end
481293
def get(self, selector, index=0, default=None):
        
        elements = self(selector)
        if elements:
            try:
                return elements[index]
            except (IndexError):
                pass
        return default
1043162
def element(self):
        """"""
        try:
            return Element.from_Z(self.Z)
        except (KeyError, IndexError):
            return Element.from_Z(int(self.Z))
628592
public static <E> E first(Iterable<E> iterable) {
        dbc.precondition(iterable != null, "cannot call first with a null iterable");
        return new FirstElement<E>().apply(iterable.iterator());
    }
1276809
def one(self):
        
        return self.element(np.ones(self.shape, dtype=self.dtype,
                                    order=self.default_order))
958505
public Object getFirst(String name) {
    Object value = get(name);
    if (value instanceof Collection<?>) {
      @SuppressWarnings("unchecked")
      Collection<Object> collectionValue = (Collection<Object>) value;
      Iterator<Object> iterator = collectionValue.iterator();
      return iterator.hasNext() ? iterator.next() : null;
    }
    return value;
  }
216851
public String getFirst(String name)
    {
        List<String> values = delegate.get(name);
        if (values != null) {
            if (values.size() > 0) {
                return values.get(0);
            }
        }
        return null;
    }
636186
def one(self):
        
        first = self.first()
        second = next(self, None)
        if second is not None:
            raise ConstraintViolation("{} found more than one result.".format(self.mode.capitalize()))
        return first
964285
def first(self):
        """"""
        self.open()
        seq = SeqIO.parse(self.handle, self.format).next()
        self.close()
        return seq
815838
def first_element
      check_section!('first_element')
      range = dom_nodes
      nodes = `range.startContainer.childNodes`

      start_index = `range.startOffset`
      end_index = `range.endOffset`

      start_index.upto(end_index) do |index|
        node = `nodes[index]`

        # Return if an element
        if `node.nodeType === 1`
          return node
        end
      end

      return nil
    end
1006380
public function first()
    {
        if (empty($this->data)) {
            throw new OutOfBoundsException('Can\'t determine first item. Collection is empty');
        }

        \reset($this->data);

        return \current($this->data);
    }
1168629
public E getFirst() {
        final Node<E> f = first;
        if (f == null)
            throw new NoSuchElementException();
        return f.item;
    }
1100523
public Article getFirst() {
		try {
			List<Article> articleList = get();
			if(articleList == null || articleList.size() < 1)
				return null;

			return articleList.get(0);
		} catch (IOException e) {
			return null;
		}
	}