Get all classes of current user
495333
def classes(request):
    """"""

    if not request.user.is_authenticated() or not hasattr(request.user, "userprofile"):
        return render_json(request, {
            'error': _('User is not logged in'),
            'error_type': 'user_unauthorized'
        }, template='user_json.html', status=401)
    clss = [c.to_json() for c in Class.objects.filter(owner=request.user.userprofile)]

    return render_json(request, clss, status=200, template='user_json.html', help_text=classes.__doc__)
717394
def get_active_class_for_request(self, request=None):
        
        parsed_url = urlparse(self.link_url)
        if parsed_url.netloc:
            return ''
        if request.path == parsed_url.path:
            return settings.ACTIVE_CLASS
        if (
            request.path.startswith(parsed_url.path) and
            parsed_url.path != '/'
        ):
            return settings.ACTIVE_ANCESTOR_CLASS
        return ''
295175
def list_users(offset=0, limit=20)
      target = "#{self.base_url}/user/"
      options = {
          basic_auth: self.auth,
          query: {
              _limit: limit,
              _offset: offset
          }
      }
      self.class.get(target, options)
    end
152546
def get_all_user_objects(self):
		
		logger.debug('Polling AD for all user objects')
		ldap_filter = r'(objectClass=user)'

		attributes = MSADUser.ATTRS
		for entry in self.pagedsearch(ldap_filter, attributes):
			# TODO: return ldapuser object
			yield MSADUser.from_ldap(entry, self._ldapinfo)
		logger.debug('Finished polling for entries!')
377378
def get_default_classes(self):
        """"""
        if not self.url:
            self.column.classes = [cls for cls in self.column.classes
                                   if cls != "anchor"]
        column_class_string = self.column.get_final_attrs().get('class', "")
        classes = set(column_class_string.split(" "))
        if self.column.status:
            classes.add(self.get_status_class(self.status))

        if self.inline_edit_available:
            classes.add("inline_edit_available")

        return list(classes)
134017
def get_loginclass(name):
    '''
    
    '''
    if __grains__['kernel'] != 'OpenBSD':
        return False
    userinfo = __salt__['cmd.run_stdout'](
        ['userinfo', name],
        python_shell=False)
    for line in userinfo.splitlines():
        if line.startswith('class'):
            try:
                ret = line.split(None, 1)[1]
                break
            except (ValueError, IndexError):
                continue
    else:
        ret = ''
    return ret
633001
def user_courses(self):
        '''
            
        '''
        registered = self.courses.filter(active__exact=True).distinct()
        return (self.tutor_courses() | registered).distinct()
444222
def get_classes(modName):
    """"""
    classNames = []
    for name, obj in inspect.getmembers(sys.modules[modName]):
        if inspect.isclass(obj):
            classNames.append(name)

    return classNames
1234794
def list(self):
        
        
        uri = URITemplate(self.baseuri + '/{owner}').expand(
            owner=self.username)
        return self.session.get(uri)
172126
def can_access(self, user):
        
        return self.class_.is_admin(user) or \
            self.is_ready and self.class_ in user.classes
516658
public function getClasses()
    {
        $ar = get_declared_classes();
        foreach ($ar as $class) {
            $c = new reflectionClass($class);
            if ($c->isUserDefined()) {
                //add only when class is user-defined
                $this->classes[$class] = new IPReflectionClass($class);
            }
        }
        ksort($this->classes);

        return $this->classes;
    }
802628
def currentUser(extras=nil)
      method = 'currentUser'
      type = User
      args = {}
      args[:extras] = extras if extras
      return_object type,method,args,true
    end
24608
def index():
    """"""
    classes = []
    with app.app_context():
        classes = set(current_app.class_references.values())
    if _get_acceptable_response_type() == JSON:
        meta_data = {}
        for cls in classes:
            meta_data[cls.endpoint()] = {
                'link': '/' + cls.endpoint(),
                'meta': '/' + cls.endpoint() + '/meta'
                }
        return jsonify(meta_data)
    else:
        return render_template('index.html', classes=classes)
642509
def find_all_item_classes(self):
        ''''''
        # This is a circular import, but performed after the class is defined and an object is instatiated.
        # We do this in order to get references to any objects definitions in the redmine.py file
        # without requiring anyone editing the file to do anything other than create a class with the proper name.
        import redmine as public_classes

        item_class = {}
        for key, value in public_classes.__dict__.items():
            try:
                if issubclass(value, Redmine_Item):
                    item_class[key.lower()] = value
            except:
                continue
        self.item_class = item_class
774415
def all(self):
        
        class_list = list(self.get_class_list())
        if not class_list:
            self.cache = []
            return []

        if self.cache is not None:
            return self.cache

        results = []
        for cls_path in class_list:
            module_name, class_name = cls_path.rsplit('.', 1)
            try:
                module = __import__(module_name, {}, {}, class_name)
                cls = getattr(module, class_name)
                if self.instances:
                    results.append(cls())
                else:
                    results.append(cls)
            except Exception:
                logger.exception('Unable to import {cls}'.format(cls=cls_path))
                continue
        self.cache = results

        return results
553443
def all(cls, sort=None, limit=None):
        
        return cls.where(sort=sort, limit=limit)
245451
function getObjects(user) {
  var username = (_.isObject(user)) ? user.login : user;
  var isOrg = (_.isObject(user) && user.type === 'Organization');
  var defers = [];

  // Get repos
  defers.push(qG({
    obj: 'repos', method: 'getFromUser', user: username,
    sort: 'created', per_page: 100
  }));

  // Get gists
  defers.push(qG({
    obj: 'gists', method: 'getFromUser', user: username,
    sort: 'created', per_page: 100
  }));

  // Get members (for orgs)
  if (isOrg) {
    defers.push(qG({
      obj: 'orgs', method: 'getMembers', org: username,
      per_page: 100
    }));
  }

  return q.all(defers);
}