Return the first magic that matches this path or None.
761365
def _match_magic(self, full_path):
        """"""
        for magic in self.magics:
            if magic.matches(full_path):
                return magic
1006854
def first(self):
        
        if self.mode == 'local':
            return self.values[tuple(zeros(len(self.baseaxes))) + (slice(None, None),)]

        if self.mode == 'spark':
            return self.values.first().toarray()
1168629
public E getFirst() {
        final Node<E> f = first;
        if (f == null)
            throw new NoSuchElementException();
        return f.item;
    }
919671
def find(self, path):
        """"""
        path = path.split('.')
        node = self
        while node._parent:
            node = node._parent
        for name in path:
            node = node._tree.get(name, None)
            if node is None or type(node) is float:
                return None
        return node
1351486
def first(self, default=None, as_dict=False, as_ordereddict=False):
        """"""

        # Try to get a record, or return/raise default.
        try:
            record = self[0]
        except IndexError:
            if isexception(default):
                raise default
            return default

        # Cast and return.
        if as_dict:
            return record.as_dict()
        elif as_ordereddict:
            return record.as_dict(ordered=True)
        else:
            return record
406013
def joinpath(cls, first, *others):
        
        if not isinstance(first, cls):
            first = cls(first)
        return first._next_class(first.module.join(first, *others))
1354515
def find_first_object(self, ObjectClass, **kwargs):
        
        filter = None
        for k, v in kwargs.items():
            cond = getattr(ObjectClass, k) == v
            filter = cond if filter is None else filter & cond

        return list(ObjectClass.scan(filter, limit=1))[0]
471518
def find_first_version(self):
        """"""
        for version in self.versions_to_try:
            remote_url = self.get_download_url(version=version)
            if http_url_exists(remote_url):
                return version, remote_url
        return None, None
989795
def get_first(self, table=None):
        """"""
        if table is None: table = self.main_table
        query = 'SELECT * FROM "%s" LIMIT 1;' % table
        return self.own_cursor.execute(query).fetchone()
430516
def is_magic(self):
        """"""
        return (self.name.startswith('__') and
                self.name.endswith('__') and
                self.name not in VARIADIC_MAGIC_METHODS)
829461
def get_first(self, name):
        
        for a in self.all_annotations:
            if a.name == name:
                return a
        return None
854065
def find_segment_first(self, *args, **kwargs):
        """"""

        for m in self.find_segments(*args, **kwargs):
            return m

        return None
200550
def get_context_first_matching_object(context, context_lookups):
    
    for key in context_lookups:
        context_object = context.get(key)
        if context_object:
            return key, context_object
    return None, None
1161400
def find_one(self, cls, id):
        """"""
        one = self._find(cls, {"_id": id})
        if not one:
            return None
        return one[0]
409124
def first_set
      first = steps[0]

      if first.is_a?(Rule)
        return first.first_set
      elsif first
        return [first]
      else
        return []
      end
    end
777826
def getFirstUrn(self, reference=None):
        
        if reference is not None:
            if ":" in reference:
                urn = reference
            else:
                urn = "{}:{}".format(
                    str(URN(str(self.urn)).upTo(URN.NO_PASSAGE)),
                    str(reference)
                )
        else:
            urn = str(self.urn)
        _first = _SharedMethod.firstUrn(
            self.retriever.getFirstUrn(
                urn
            )
        )
        return _first
917030
def get_first_mapping(cls):
    """"""
    from .models import Indexable

    if issubclass(cls, Indexable) and hasattr(cls, "Mapping"):
        return cls.Mapping
    for base in cls.__bases__:
        mapping = get_first_mapping(base)
        if mapping:
            return mapping
    return None