function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def test_round_deals_system_card(self): game_round = Round(game=self.game, number=self.current.number + 1, turn=self.current.turn) game_round.deal() self.assertTrue(game_round.card is not None)
jminuscula/dixit-online
[ 70, 19, 70, 23, 1465385513 ]
def test_deal_fails_when_not_enough_cards_available(self): max_players = Card.objects.count() // (settings.GAME_HAND_SIZE + 1) for i in range(max_players + 1): test_username = 'test_n_{}'.format(i) test_email = '{}@localhost'.format(test_username) user = User.objects...
jminuscula/dixit-online
[ 70, 19, 70, 23, 1465385513 ]
def test_providing_round_can_not_be_closed(self): story_card = self.current.turn._pick_card() story_play = Play.play_for_round(self.current, self.current.turn, story_card, 'test') Play.play_for_round(self.current, self.player2, self.player2._pick_card()) self.assertEqual(self.current.sta...
jminuscula/dixit-online
[ 70, 19, 70, 23, 1465385513 ]
def test_complete_round_can_be_closed(self): story_card = self.current.turn._pick_card() Play.play_for_round(self.current, self.game.storyteller, story_card, 'story') players = self.game.players.all().exclude(id=self.game.storyteller.id) for player in players: Play.play_for_r...
jminuscula/dixit-online
[ 70, 19, 70, 23, 1465385513 ]
def test_storyteller_doesnt_score_when_all_players_guess(self): story_card = self.current.turn._pick_card() story_play = Play.play_for_round(self.current, self.current.turn, story_card, 'test') card2 = self.player2._pick_card() play2 = Play.play_for_round(self.current, self.player2, car...
jminuscula/dixit-online
[ 70, 19, 70, 23, 1465385513 ]
def __init__( self, accessDictionary = None, accessFile = "" ): """ @summary: LogFileAccessManager constructor.
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def saveAccessDictionary( self ): """ @summary: Saves the current accessDictionary into the accessfile. """
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def loadAccessFile(self): """ @summary: Loads the accessFile into the accessDictionary.
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def getLineAssociatedWith( self, identifier ): """ @param identifier: Identifier string of the following format: fileType_client/sourcename_machineName
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def getLastReadPositionAssociatedWith(self, identifier): """ @param identifier: Identifier string of the following format: fileType_client/sourcename_machineName
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def getFirstLineFromFile(self, fileName): """ @summary: Reads the first line of a file and returns it.
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def getFirstLineAndLastReadPositionAssociatedwith(self, identifier): """ @param identifier: Identifier string of the following format: fileType_client/sourcename_machineName
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def setFirstLineAssociatedwith(self, firstLine, identifier ): """ @summary: Simple setter that hides data structure implementation so that methods still work if implementation is ever to change.
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def setLastReadPositionAssociatedwith(self, lastReadPosition, identifier ): """ @summary: Simple setter that hides data structure implementation so that methods still work if implementation is ever to change.
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def setFirstLineAndLastReadPositionAssociatedwith(self, firstLine, lastReadPosition, identifier ): """ @summary: Simple setter that hides data structure implementation so that methods still work if implementation is ever to change.
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def isTheLastFileThatWasReadByThisIdentifier(self, fileName, identifier ): """ @summary : Returns whether or not(True or False ) the specified file was the last one read by the identifier.
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def main(): """ @summary: Small test case to see if everything works out well.
khosrow/metpx
[ 1, 1, 1, 1, 1446661693 ]
def __new__(cls, modified, added, removed, deleted, unknown, ignored, clean): assert all(isinstance(f, str) for f in modified) assert all(isinstance(f, str) for f in added) assert all(isinstance(f, str) for f in removed) assert all(isinstance(f, str) for f in deleted) assert all(...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def modified(self): """files that have been modified""" return self[0]
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def added(self): """files that have been added""" return self[1]
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def removed(self): """files that have been removed""" return self[2]
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def deleted(self): """files that are in the dirstate, but have been deleted from the working copy (aka "missing") """ return self[3]
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def unknown(self): """files not in the dirstate that are not ignored""" return self[4]
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def ignored(self): """files not in the dirstate that are ignored (by _dirignore())""" return self[5]
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def clean(self): """files that have not been modified""" return self[6]
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def nochangesfound(ui, repo, excluded=None): """Report no changes for push/pull, excluded is None or a list of nodes excluded from the push/pull. """ secretlist = [] if excluded: for n in excluded: ctx = repo[n] if ctx.phase() >= phases.secret: secretl...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def _uploadtraceback(ui, message, trace): key = "flat/errortrace-%(host)s-%(pid)s-%(time)s" % { "host": socket.gethostname(), "pid": os.getpid(), "time": time.time(), } payload = message + "\n\n" + trace # TODO: Move this into a background task that renders from # blackbox i...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def checknewlabel(repo, lbl, kind): # Do not use the "kind" parameter in ui output. # It makes strings difficult to translate. if lbl in ["tip", ".", "null"]: raise error.Abort(_("the name '%s' is reserved") % lbl) for c in (":", "\0", "\n", "\r"): if c in lbl: raise error.Ab...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def checkportable(ui, f): """Check if filename f is portable and warn or abort depending on config""" checkfilename(f) abort, warn = checkportabilityalert(ui) if abort or warn: msg = winutil.checkwinfilename(f) if msg: msg = "%s: %s" % (msg, util.shellquote(f)) if...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __init__(self, ui, abort, dirstate): self._ui = ui self._abort = abort if not dirstate._istreestate and not dirstate._istreedirstate: allfiles = "\0".join(dirstate._map) self._loweredfiles = set(encoding.lower(allfiles).split("\0")) else: # Still n...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def walkrepos(path, followsym=False, seen_dirs=None, recurse=False): """yield every hg repository under path, always recursively. The recurse flag will only control recursion into repo working dirs""" def errhandler(err): if err.filename == path: raise err samestat = getattr(os.pat...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def intrev(ctx): """Return integer for a given basectx that can be used in comparison or arithmetic operation""" rev = ctx.rev() if rev is None: return wdirrev return rev
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def revsingle(repo, revspec, default=".", localalias=None): """Resolve a single revset with user-defined revset aliases. This should only be used for resolving user-provided command-line flags or arguments. For internal code paths not interacting with user-provided arguments, use repo.revs (ignore...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def revpair(repo, revs): if not revs: return repo.dirstate.p1(), None l = revrange(repo, revs) if not l: first = second = None elif l.isascending(): first = l.min() second = l.max() elif l.isdescending(): first = l.max() second = l.min() else: ...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def expandpats(pats): """Expand bare globs when running on windows. On posix we assume it already has already been done by sh.""" if not util.expandglobs: return list(pats) ret = [] for kindpat in pats: kind, pat = matchmod._patsplit(kindpat, None) if kind is None: ...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def bad(f, msg): ctx.repo().ui.warn("%s: %s\n" % (m.rel(f), msg))
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def match( ctx, pats=(), opts=None, globbed=False, default="relpath", badfn=None, emptyalways=True,
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def matchall(repo): """Return a matcher that will efficiently match everything.""" return matchmod.always(repo.root, repo.getcwd())
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def parsefollowlinespattern(repo, rev, pat, msg): """Return a file name from `pat` pattern suitable for usage in followlines logic. """ if not matchmod.patkind(pat): return pathutil.canonpath(repo.root, repo.getcwd(), pat) else: ctx = repo[rev] m = matchmod.match(repo.root, r...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __init__(self, repo, revcontainer): self._torev = repo.changelog.rev self._revcontains = revcontainer.__contains__
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def cleanupnodes(repo, replacements, operation, moves=None, metadata=None): """do common cleanups when old nodes are replaced by new nodes That includes writing obsmarkers or stripping nodes, and moving bookmarks. (we might also want to move working directory parent in the future) By default, bookmark...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def badfn(f, msg): if f in m.files(): m.bad(f, msg) rejected.append(f)
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def marktouched(repo, files, similarity=0.0): """Assert that files have somehow been operated upon. files are relative to the repo root.""" m = matchfiles(repo, files, badfn=lambda x, y: rejected.append(x)) rejected = [] added, unknown, deleted, removed, forgotten = _interestingfiles(repo, m) ...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def _findrenames(repo, matcher, added, removed, similarity): """Find renames from removed files to added ones.""" renames = {} if similarity > 0: for old, new, score in similar.findrenames(repo, added, removed, similarity): if repo.ui.verbose or not matcher.exact(old) or not matcher.exac...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def dirstatecopy(ui, repo, wctx, src, dst, dryrun=False, cwd=None): """Update the dirstate to reflect the intent of copying src to dst. For different reasons it might not end with dst being marked as copied from src. """ origsrc = repo.dirstate.copied(src) or src if dst == origsrc: # copying back a...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def writerequires(opener, requirements): content = "".join("%s\n" % r for r in sorted(requirements)) opener.writeutf8("requires", content)
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __init__(self, path, stat): self.path = path self.cachestat = None if stat: path = self.path else: path = None self.cachestat = filecachesubentry.stat(path)
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def changed(self): newstat = filecachesubentry.stat(self.path) if self.cachestat != newstat: self.cachestat = newstat return True else: return False
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def stat(path): return util.cachestat(path)
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __init__(self, paths, stat=True): self._entries = [] for path in paths: self._entries.append(filecachesubentry(path, stat))
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def refresh(self): for entry in self._entries: entry.refresh()
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __init__(self, *paths): self.paths = [ path if isinstance(path, tuple) else (path, self.join) for path in paths ]
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __call__(self, func): self.func = func self.name = func.__name__ return self
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __set__(self, obj, value): if self.name not in obj._filecache: # we add an entry for the missing value because X in __dict__ # implies X in _filecache paths = [joiner(obj, path) for (path, joiner) in self.paths] ce = filecacheentry(paths, False) ob...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def extdatasource(repo, source): """Gather a map of rev -> value dict from the specified source A source spec is treated as a URL, with a special case shell: type for parsing the output from a shell command. The data is parsed as a series of newline-separated records where each record is a revisio...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def gddeltaconfig(ui): """helper function to know if incoming delta should be optimised""" # experimental config: format.generaldelta return ui.configbool("format", "generaldelta")
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __init__(self, vfs, path, keys=None): self.vfs = vfs self.path = path
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def write(self, data, firstline=None): """Write key=>value mapping to a file data is a dict. Keys must be alphanumerical and start with a letter. Values must not contain newline characters. If 'firstline' is not None, it is written to file before everything else, as it is, not i...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def wrapconvertsink(sink): """Allow extensions to wrap the sink returned by convcmd.convertsink() before it is used, whether or not the convert extension was formally loaded. """ return sink
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def trackrevnumfortests(repo, specs): """Attempt to collect information to replace revision number with revset expressions in tests. This works with the TESTFILE and TESTLINE environment variable set by run-tests.py. Information will be written to $TESTDIR/.testrevnum. """ if not util.iste...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def revf64decode(rev): """Convert rev encoded by revf64encode back to the original rev >>> revs = [i + j for i in [0, 1 << 56] for j in range(2)] + [None] >>> encoded = [revf64encode(i) for i in revs] >>> decoded = [revf64decode(i) for i in encoded] >>> revs == decoded True """ if rev i...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def prefixlines(raw): """Surround lineswith a comment char and a new line""" lines = raw.splitlines() commentedlines = ["# %s" % line for line in lines] return "\n".join(commentedlines) + "\n"
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def helpmessage(ui, continuecmd, abortcmd): msg = _("To continue: %s\n" "To abort: %s") % ( continuecmd, abortcmd, ) ui.warn(prefixlines(msg))
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def histeditmsg(repo, ui): helpmessage(ui, "hg histedit --continue", "hg histedit --abort")
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def updatecleanmsg(dest=None): warning = _("warning: this will discard uncommitted changes") return "hg update --clean %s (%s)" % (dest or ".", warning)
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def updatemsg(repo, ui): previousargs = repo.localvfs.tryreadutf8(UPDATEARGS) if previousargs: continuecmd = "hg " + previousargs else: continuecmd = "hg update " + repo.localvfs.readutf8("updatestate")[:12] abortcmd = updatecleanmsg(repo._activebookmark) helpmessage(ui, continuecmd,...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def mergemsg(repo, ui): # tweakdefaults requires `update` to have a rev hence the `.` helpmessage(ui, "hg commit", updatecleanmsg())
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def fileexistspredicate(filename): return lambda repo: repo.localvfs.exists(filename)
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def extsetup(ui): if ui.configbool("morestatus", "show") and not ui.plain(): wrapcommand(commands.table, "status", statuscmd) # Write down `hg update` args to show the continue command in # interrupted update state. ui.setconfig("hooks", "pre-update.morestatus", saveupdateargs) ...
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def cleanupdateargs(repo, **kwargs): with repo.wlock(): repo.localvfs.tryunlink(UPDATEARGS)
facebookexperimental/eden
[ 4737, 192, 4737, 106, 1462467227 ]
def __init__(self, backends): """ Constructor, creating all the gtk widgets @param backends: a reference to the dialog in which this is loaded """ super().__init__(orientation=Gtk.Orientation.VERTICAL) self.dialog = backends self.should_spinner_be_shown =...
getting-things-gnome/gtg
[ 519, 158, 519, 226, 1394882179 ]
def _create_widgets(self): """ This function fills this box with widgets """ # Division of the available space in three segments: # top, middle and bottom (parameters_ui) top = Gtk.Box() top.set_spacing(6) middle = Gtk.Box() middle.set_spacing(6) ...
getting-things-gnome/gtg
[ 519, 158, 519, 226, 1394882179 ]
def _fill_middle_box(self, box): """ Helper function to fill an box with a label and a button @param box: the Gtk.Box to fill """ self.sync_status_label = Gtk.Label() self.sync_status_label.set_alignment(xalign=0.8, yalign=0.5) self.sync_button = Gtk.Button() ...
getting-things-gnome/gtg
[ 519, 158, 519, 226, 1394882179 ]
def refresh_title(self, sender=None, data=None): """ Callback for the signal that notifies backends name changes. It changes the title of this view @param sender: not used, here only for signal callback compatibility @param data: not used, here only for signal callback compatibi...
getting-things-gnome/gtg
[ 519, 158, 519, 226, 1394882179 ]
def refresh_sync_status_label(self): """ Refreshes the Gtk.Label that shows the current state of this backend """ if self.backend.is_default(): label = _("This is the default synchronization service") else: if self.backend.is_enabled(): lab...
getting-things-gnome/gtg
[ 519, 158, 519, 226, 1394882179 ]
def on_sync_button_clicked(self, sender): """ Signal callback when a backend is enabled/disabled via the UI button @param sender: not used, here only for signal callback compatibility """ self.parameters_ui.commit_changes() self.req.set_backend_enabled(self.backend.get_i...
getting-things-gnome/gtg
[ 519, 158, 519, 226, 1394882179 ]
def on_sync_ended(self, sender, backend_id): """ If the backend has stopped syncing tasks, update the state of the Gtk.Spinner @param sender: not used, here only for signal callback compatibility @param backend_id: the id of the backend that emitted this signal """ ...
getting-things-gnome/gtg
[ 519, 158, 519, 226, 1394882179 ]
def __init__(self, covar): self.name = covar self.pop_ronas = defaultdict(list) self.corr_coef = {} self.avg_ronas = [] self.stderr_ronas = []
StuntsPT/pyRona
[ 9, 2, 9, 2, 1478901588 ]
def count_markers(self): """ Counts the number of markers in the instance. """ return len(self.pop_ronas)
StuntsPT/pyRona
[ 9, 2, 9, 2, 1478901588 ]
def results_summary(ronas, use_weights): """ This function outputs a summary of the RONAS for each population and covariate. """ pop_names = ronas[0].pop_names for i, j in enumerate(pop_names): if i == 0: print("Covar\t%s" % "\t".join([x.name for x in ronas])) pri...
StuntsPT/pyRona
[ 9, 2, 9, 2, 1478901588 ]
def main(): """ Main function. Takes all the inputs as arguments and runs the remaining functions of the program. """ if len(argv) < 2: arg_list = ["-h"] else: arg_list = argv[1:] arg = argument_parser(arg_list) if arg.upstream == "baypass": present_covariates =...
StuntsPT/pyRona
[ 9, 2, 9, 2, 1478901588 ]
def course_info(request, course_slug): if is_course_student_by_slug(request, course_slug): return _course_info_student(request, course_slug) elif is_course_staff_by_slug(request, course_slug): return _course_info_staff(request, course_slug) else: return ForbiddenResponse(request)
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def reorder_activity(request, course_slug): """ Ajax way to reorder activity. This ajax view function is called in the course_info page. """ course = get_object_or_404(CourseOffering, slug=course_slug) if request.method == 'POST': neaten_activity_positions(course) # find the acti...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def _course_info_staff(request, course_slug): """ Course front page """ course = get_object_or_404(CourseOffering, slug=course_slug) member = Member.objects.get(offering=course, person__userid=request.user.username, role__in=['INST','TA','APPR']) activities = all_activities_filter(offering=cours...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def course_config(request, course_slug): from forum.models import Forum course = get_object_or_404(CourseOffering, slug=course_slug) try: forum = Forum.objects.get(offering=course) except Forum.DoesNotExist: forum = Forum(offering=course) forum.enabled = False if request.met...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def _course_info_student(request, course_slug): course = get_object_or_404(CourseOffering, slug=course_slug) activities = all_activities_filter(offering=course) activities = [a for a in activities if a.status in ['RLS', 'URLS']] any_group = True in [a.group for a in activities] has_index = bool(Page...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def activity_info_oldurl(request, course_slug, activity_slug, tail): """ Redirect old activity URLs to new (somewhat intelligently: don't redirect if there's no activity there) """ course = get_object_or_404(CourseOffering, slug=course_slug) activity = get_object_or_404(Activity, slug=activity_slug,...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def activity_info(request, course_slug, activity_slug): if is_course_student_by_slug(request, course_slug): return _activity_info_student(request, course_slug, activity_slug) elif is_course_staff_by_slug(request, course_slug): return _activity_info_staff(request, course_slug, activity_slug) ...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def _activity_info_student(request, course_slug, activity_slug): course = get_object_or_404(CourseOffering, slug=course_slug) activities = all_activities_filter(slug=activity_slug, offering=course)
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def activity_info_with_groups(request, course_slug, activity_slug): course = get_object_or_404(CourseOffering, slug = course_slug) activities = all_activities_filter(slug=activity_slug, offering=course) if len(activities) != 1: return NotFoundResponse(request)
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def activity_stat(request, course_slug, activity_slug): course = get_object_or_404(CourseOffering, slug=course_slug) activities = all_activities_filter(slug=activity_slug, offering=course)
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def activity_choice(request, course_slug): course = get_object_or_404(CourseOffering, slug=course_slug) context = {'course': course} return render(request, 'grades/activity_choice.html', context)
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def edit_cutoffs(request, course_slug, activity_slug): course = get_object_or_404(CourseOffering, slug=course_slug) activity = get_object_or_404(CalLetterActivity, slug=activity_slug, offering=course, deleted=False) if request.method == 'POST': form = CutoffForm(request.POST) if form.is_...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def _cutoffsdict(cutoff): data = dict() data['ap'] = cutoff[0] data['a'] = cutoff[1] data['am'] = cutoff[2] data['bp'] = cutoff[3] data['b'] = cutoff[4] data['bm'] = cutoff[5] data['cp'] = cutoff[6] data['c'] = cutoff[7] data['cm'] = cutoff[8] data['d'] = cutoff[9] return...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def compare_official(request, course_slug, activity_slug): """ Screen to compare member.official_grade to this letter activity """ course = get_object_or_404(CourseOffering, slug=course_slug) activity = get_object_or_404(LetterActivity, slug=activity_slug, offering=course, deleted=False)
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def grade_change(request, course_slug, activity_slug, userid): """ Produce grade change form """ course = get_object_or_404(CourseOffering, slug=course_slug) activity = get_object_or_404(LetterActivity, slug=activity_slug, offering=course, deleted=False) member = get_object_or_404(Member, ~Q(rol...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def add_numeric_activity(request, course_slug): course = get_object_or_404(CourseOffering, slug=course_slug) activities_list = [(None, '\u2014'),] activities = all_activities_filter(course) for a in activities: if a.group == True: activities_list.append((a.slug, a.name))
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def add_cal_numeric_activity(request, course_slug): course = get_object_or_404(CourseOffering, slug=course_slug) numeric_activities = NumericActivity.objects.filter(offering=course, deleted=False)
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def add_cal_letter_activity(request, course_slug): course = get_object_or_404(CourseOffering, slug=course_slug) letter_activities = LetterActivity.objects.filter(offering=course) numact_choices = [(na.pk, na.name) for na in NumericActivity.objects.filter(offering=course, deleted=False)] examact_choices ...
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]
def formula_tester(request, course_slug): course = get_object_or_404(CourseOffering, slug=course_slug) numeric_activities = NumericActivity.objects.filter(offering=course, deleted=False) result = ""
sfu-fas/coursys
[ 61, 17, 61, 39, 1407368110 ]