Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
7d20dcde
Commit
7d20dcde
authored
Aug 02, 2017
by
Shirley He
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add basic permutation support
parent
41b6067e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
util/generate_permutations.py
+24
-0
No files found.
util/generate_permutations.py
0 → 100755
View file @
7d20dcde
#!/usr/bin/env python
# other comment about how this file works, plus probably an example of implementation
import
json
from
argparse
import
ArgumentParser
from
pprint
import
pprint
from
itertools
import
product
def
parse_args
():
parser
=
ArgumentParser
(
description
=
'Create course permutations'
)
parser
.
add_argument
(
'--fields'
,
action
=
''
,
nargs
=
3
)
def
generate_course_permutations
():
with
open
(
'permutations.json'
)
as
permutation_options
:
permutation_data
=
json
.
load
(
permutation_options
)
start_dates
=
permutation_data
[
"permutation_data"
][
"start"
]
availability
=
permutation_data
[
"permutation_data"
][
'availability'
]
permutation_generation
=
[
start_dates
,
availability
]
print
list
(
product
(
*
permutation_generation
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment