Returns the earliest class in the module
541759
def earliest_class
      earliest = self.first
      self.each { |c| earliest = c if c.time < earliest.time }
      earliest
    end
1077539
def check_class():
    
    # get frames
    frames = inspect.stack()
    cls = None
    # should be the third frame
    # 0: this function
    # 1: function/decorator
    # 2: class that contains the function
    if len(frames) > 2:
        frame = frames[2][0]
        if '__module__' in frame.f_code.co_names:
            cls = SillyClass(**frame.f_locals)
            cls.__cls_name__ = frame.f_code.co_name
    return cls
1005991
@Nullable
    public static Class<?> findClass(ScriptModule module, String className) {
        Set<Class<?>> classes = module.getLoadedClasses();
        Class<?> targetClass = null;
        for (Class<?> clazz : classes) {
            if (clazz.getName().equals(className)) {
                targetClass = clazz;
                break;
            }
        }

        return targetClass;
    }
207222
private static int classPriority(Class<?> o1) {
    Priority p = o1.getAnnotation(Priority.class);
    if(p == null) {
      Class<?> pa = o1.getDeclaringClass();
      p = (pa != null) ? pa.getAnnotation(Priority.class) : null;
    }
    return p != null ? p.value() : Priority.DEFAULT;
  }
684270
def get_complete_class_name(class_or_module, name = class_or_module.name)
      if !class_or_module.parent.name.nil? && class_or_module.parent.is_a?(RDoc::NormalModule)
        get_complete_class_name(class_or_module.parent, "#{class_or_module.parent.name}::#{name}")
      else
        name
      end
    end
943818
def find_first_object(self, ObjectClass, **kwargs):
        

        # Convert each name/value pair in 'kwargs' into a filter
        query = ObjectClass.query
        for field_name, field_value in kwargs.items():

            # Make sure that ObjectClass has a 'field_name' property
            field = getattr(ObjectClass, field_name, None)
            if field is None:
                raise KeyError("BaseAlchemyAdapter.find_first_object(): Class '%s' has no field '%s'." % (ObjectClass, field_name))

            # Add a case sensitive filter to the query
            query = query.filter(field==field_value)  # case sensitive!!

        # Execute query
        return query.first()
1169956
def get_module_class(self):
        
        pkg, cname = self.parse_module_class()
        logger.debug(f'pkg: {pkg}, class: {cname}')
        pkg = pkg.split('.')
        mod = reduce(lambda m, n: getattr(m, n), pkg[1:], __import__(pkg[0]))
        logger.debug(f'mod: {mod}')
        if self.reload:
            importlib.reload(mod)
        cls = getattr(mod, cname)
        logger.debug(f'class: {cls}')
        return mod, cls
933830
def find_class(self, name):
        """"""
        defclass = lib.EnvFindDefclass(self._env, name.encode())
        if defclass == ffi.NULL:
            raise LookupError("Class '%s' not found" % name)

        return Class(self._env, defclass)
500035
def first(self):
        
        if self.mode == 'local':
            return self.values[0]

        if self.mode == 'spark':
            return self.values.first().toarray()
277105
def class_string(self, klass):
        ''''''
        if isinstance(klass, string_types):
            return klass
        return klass.__module__ + '.' + klass.__name__
811506
function checkClass(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (tokens[i].class_l) return tokens[i].class_l;

  // Skip `.`.
  if (tokens[i].type === TokenType.FullStop) i++;
  else return 0;

  if (l = checkIdentOrInterpolation(i)) i += l;
  else return 0;

  while (i < tokensLength) {
    if (l = checkIdentOrInterpolation(i)) {
      tokens[start].class_l = l + 1;
      i += l;
    } else break;
  }

  tokens[start].classEnd = i;

  return i - start;
}
373266
public function getModelClass()
    {
        if (isset($this->parent)) {
            return $this->parent->getModelClass();
        }

        if (isset($this->getCollection()->first)) {
            return $this->getCollection()->first->class;
        }

        return get_class($this->getCollection()->getModel());
    }
104020
def GetTimeRange(cls):
    """"""
    first = getattr(cls, '_lower', 0)
    last = getattr(cls, '_upper', cls.MAX_INT64)

    if first < last:
      return first, last

    return last, first
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
758405
def first(self):
        
        pairs = self.resolve()
        try:
            return iter_first(pairs)
        except ValueError:
            raise NotFoundError(u"{0} not found".format(self.name))
345165
function getPseudoClass1() {
  const type = NodeType.PseudocType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [];

  // Skip `:`.
  pos++;

  content.push(getIdent());

  {
    const type = NodeType.ArgumentsType;
    const token = tokens[pos];
    const line = token.ln;
    const column = token.col;

    // Skip `(`.
    pos++;

    const selectorContent = [].concat(
      getSC(),
      getSelectorsGroup(),
      getSC()
    );

    const end = getLastPosition(selectorContent, line, column, 1);
    const args = newNode(type, selectorContent, line, column, end);
    content.push(args);

    // Skip `)`.
    pos++;
  }

  return newNode(type, content, line, column);
}
612106
def oldest_frame(self, raw=False):
        
        if raw:
            return self.buffer.values[:, self._start_index, :]
        return self.buffer.iloc[:, self._start_index, :]