Returns the list of open assignments from the
            viewpoint of this user.
556992
def open_assignments(self):
        '''
            
        '''
        # Include only assignments with future, or no, hard deadline
        qs = Assignment.objects.filter(hard_deadline__gt=timezone.now(
        )) | Assignment.objects.filter(hard_deadline__isnull=True)
        # Include only assignments that are already published,
        # as long as you are not a tutor / course owner
        if not self.can_see_future():
            qs = qs.filter(publish_at__lt=timezone.now())
        # Include only assignments from courses that you are registered for
        qs = qs.filter(course__in=self.user_courses())
        # Ordering of resulting list
        qs = qs.order_by('soft_deadline', '-gradingScheme', 'title')
        waiting_for_action = [subm.assignment for subm in self.user.authored.all(
        ).exclude(state=Submission.WITHDRAWN)]
        # Emulate is_null sorting for soft_deadline
        qs_without_soft_deadline = qs.filter(soft_deadline__isnull=True)
        qs_with_soft_deadline = qs.filter(soft_deadline__isnull=False)
        ass_list = [
            ass for ass in qs_without_soft_deadline if ass not in waiting_for_action]
        ass_list += [
            ass for ass in qs_with_soft_deadline if ass not in waiting_for_action]
        return ass_list
461064
def availableRoles(self):
        '''
        
        '''
        if not hasattr(self.instructor,'instructorprivatelessondetails'):
            return []
        return [
            [x.id,x.name] for x in
            self.instructor.instructorprivatelessondetails.roles.all()
        ]
1250008
private List getDestinations() {

        List result = new ArrayList();
        result.add(new CmsSelectWidgetOption("WEB-INF/classes/"));
        result.add(new CmsSelectWidgetOption("WEB-INF/lib/"));
        return result;
    }
247931
@SuppressWarnings("unchecked")
	public View[] getWindowDecorViews()
	{

		Field viewsField;
		Field instanceField;
		try {
			viewsField = windowManager.getDeclaredField("mViews");
			instanceField = windowManager.getDeclaredField(windowManagerString);
			viewsField.setAccessible(true);
			instanceField.setAccessible(true);
			Object instance = instanceField.get(null);
			View[] result;
			if (android.os.Build.VERSION.SDK_INT >= 19) {
				result = ((ArrayList<View>) viewsField.get(instance)).toArray(new View[0]);
			} else {
				result = (View[]) viewsField.get(instance);
			}
			return result;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
239241
public List<Assignment> findAllAssignments() {
        List<Assignment> list = new ArrayList<>();
        List<String> assignmentStrings;
        try {
            assignmentStrings = readLines(assignmentsFile);
        } catch (IOException e) {
            throw new FileBasedRuntimeException(e);
        }

        for (String assignmentString : assignmentStrings) {
            if (StringUtils.isNotBlank(assignmentString)) {
                String[] substrings =
                    StringUtils
                            .splitByWholeSeparator(assignmentString, Configuration.get().getAssociationSeparator());
                if (substrings.length < 2 || StringUtils.isBlank(substrings[1])) {
                    continue;
                }
                Assignment assignment = new Assignment(substrings[0], substrings[1]);
                if (substrings.length > 2) {
                    assignment.setRoles(Arrays.asList(StringUtils.splitByWholeSeparator(substrings[2], Configuration
                            .get().getValueSeparator())));
                }
                list.add(assignment);
            }
        }
        return list;
    }
520618
@Override
    public List<Assignment> findAssignments() {
        List<Assignment> assignmentList;
        try {
            assignmentList = createAssignments(ldapDao.getDirectChildren(DnFactory.assignments()));
        } catch (NoSuchNodeException | MissingParentException e) {
            LOGGER.error("LDAP exception", e);
            throw new LdapRuntimeException(e);
        }
        return assignmentList;
    }
932907
def list_windows(self):
        
        windows = [w for w in self._windows if w['session_id'] == self._session_id]

        return [Window(session=self, **window) for window in windows]
1219413
def _getRightsAssignments(user_right):
    '''
    
    '''
    sids = []
    polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS)
    sids = win32security.LsaEnumerateAccountsWithUserRight(polHandle, user_right)
    return sids
536885
def policy_assignments_list(**kwargs):
    '''
    

    '''
    result = {}
    polconn = __utils__['azurearm.get_client']('policy', **kwargs)
    try:
        policy_assign = __utils__['azurearm.paged_object_to_list'](polconn.policy_assignments.list())

        for assign in policy_assign:
            result[assign['name']] = assign
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
769896
def get_open_spaces(board):
  """"""
  open_spaces = []
  for i in range(3):
    for j in range(3):
      if board[i][j] == 0:
        open_spaces.append(encode_pos(i, j))
  return open_spaces
530319
@Exported
    public Collection<View> getViews() {
        List<View> orig = views();
        List<View> copy = new ArrayList<>(orig.size());
        for (View v : orig) {
            if (v.hasPermission(View.READ))
                copy.add(v);
        }
        copy.sort(View.SORTER);
        return copy;
    }
865761
def getReadAlignments(self, reference, start=None, end=None):
        
        return self._getReadAlignments(reference, start, end, self, None)
99590
def assigned_add_ons(self):
        
        if self._assigned_add_ons is None:
            self._assigned_add_ons = AssignedAddOnList(
                self._version,
                account_sid=self._solution['account_sid'],
                resource_sid=self._solution['sid'],
            )
        return self._assigned_add_ons
475320
def _getOpenChoices(self):
        
        tsk = self._taskParsObj.getName()
        taskFiles = set()
        dirsSoFar = [] # this helps speed this up (skip unneeded globs)

        # last dir
        aDir = os.path.dirname(self._taskParsObj.filename)
        if len(aDir) < 1: aDir = os.curdir
        dirsSoFar.append(aDir)
        taskFiles.update(cfgpars.getCfgFilesInDirForTask(aDir, tsk))

        # current dir
        aDir = os.getcwd()
        if aDir not in dirsSoFar:
            dirsSoFar.append(aDir)
            taskFiles.update(cfgpars.getCfgFilesInDirForTask(aDir, tsk))

        # task's python pkg dir (if tsk == python pkg name)
        try:
            x, pkgf = cfgpars.findCfgFileForPkg(tsk, '.cfg', taskName=tsk,
                              pkgObj=self._taskParsObj.getAssocPkg())
            taskFiles.update( (pkgf,) )
        except cfgpars.NoCfgFileError:
            pass # no big deal - maybe there is no python package

        # user's own resourceDir
        aDir = self._rcDir
        if aDir not in dirsSoFar:
            dirsSoFar.append(aDir)
            taskFiles.update(cfgpars.getCfgFilesInDirForTask(aDir, tsk))

        # extra loc - see if they used the app's env. var
        aDir = dirsSoFar[0] # flag to skip this if no env var found
        envVarName = APP_NAME.upper()+'_CFG'
        if envVarName in os.environ: aDir = os.environ[envVarName]
        if aDir not in dirsSoFar:
            dirsSoFar.append(aDir)
            taskFiles.update(cfgpars.getCfgFilesInDirForTask(aDir, tsk))

        # At the very end, add an option which we will later interpret to mean
        # to open the file dialog.
        taskFiles = list(taskFiles) # so as to keep next item at end of seq
        taskFiles.sort()
        taskFiles.append("Other ...")

        return taskFiles
440501
def get_permissions(cls):
        
        perms = []
        for kls_name, kls in cls.registry.items():
            for method_name in cls.__dict__.keys():
                if method_name.endswith('_view'):
                    perms.append("%s.%s" % (kls_name, method_name))
        return perms
75682
public Map<String, SchedulerAssignment> getAssignments() {
        Map<String, SchedulerAssignment> ret = new HashMap<>(this.assignments.size());

        for (String topologyId : this.assignments.keySet()) {
            ret.put(topologyId, this.assignments.get(topologyId));
        }

        return ret;
    }
966493
def getAllViewsAsDict(self):
        """"""
        return {p: self._plugins[p].get_views() for p in self._plugins}