id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
235,000 | UCL-INGI/INGInious | base-containers/base/inginious/feedback.py | load_feedback | def load_feedback():
""" Open existing feedback file """
result = {}
if os.path.exists(_feedback_file):
f = open(_feedback_file, 'r')
cont = f.read()
f.close()
else:
cont = '{}'
try:
result = json.loads(cont) if cont else {}
except ValueError as e:
... | python | def load_feedback():
""" Open existing feedback file """
result = {}
if os.path.exists(_feedback_file):
f = open(_feedback_file, 'r')
cont = f.read()
f.close()
else:
cont = '{}'
try:
result = json.loads(cont) if cont else {}
except ValueError as e:
... | [
"def",
"load_feedback",
"(",
")",
":",
"result",
"=",
"{",
"}",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"_feedback_file",
")",
":",
"f",
"=",
"open",
"(",
"_feedback_file",
",",
"'r'",
")",
"cont",
"=",
"f",
".",
"read",
"(",
")",
"f",
".",
... | Open existing feedback file | [
"Open",
"existing",
"feedback",
"file"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/base-containers/base/inginious/feedback.py#L18-L32 |
235,001 | UCL-INGI/INGInious | base-containers/base/inginious/feedback.py | save_feedback | def save_feedback(rdict):
""" Save feedback file """
# Check for output folder
if not os.path.exists(_feedback_dir):
os.makedirs(_feedback_dir)
jcont = json.dumps(rdict)
f = open(_feedback_file, 'w')
f.write(jcont)
f.close() | python | def save_feedback(rdict):
""" Save feedback file """
# Check for output folder
if not os.path.exists(_feedback_dir):
os.makedirs(_feedback_dir)
jcont = json.dumps(rdict)
f = open(_feedback_file, 'w')
f.write(jcont)
f.close() | [
"def",
"save_feedback",
"(",
"rdict",
")",
":",
"# Check for output folder",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"_feedback_dir",
")",
":",
"os",
".",
"makedirs",
"(",
"_feedback_dir",
")",
"jcont",
"=",
"json",
".",
"dumps",
"(",
"rdict",
... | Save feedback file | [
"Save",
"feedback",
"file"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/base-containers/base/inginious/feedback.py#L35-L44 |
235,002 | UCL-INGI/INGInious | base-containers/base/inginious/feedback.py | set_problem_result | def set_problem_result(result, problem_id):
""" Set problem specific result value """
rdict = load_feedback()
if not 'problems' in rdict:
rdict['problems'] = {}
cur_val = rdict['problems'].get(problem_id, '')
rdict['problems'][problem_id] = [result, cur_val] if type(cur_val) == str else [res... | python | def set_problem_result(result, problem_id):
""" Set problem specific result value """
rdict = load_feedback()
if not 'problems' in rdict:
rdict['problems'] = {}
cur_val = rdict['problems'].get(problem_id, '')
rdict['problems'][problem_id] = [result, cur_val] if type(cur_val) == str else [res... | [
"def",
"set_problem_result",
"(",
"result",
",",
"problem_id",
")",
":",
"rdict",
"=",
"load_feedback",
"(",
")",
"if",
"not",
"'problems'",
"in",
"rdict",
":",
"rdict",
"[",
"'problems'",
"]",
"=",
"{",
"}",
"cur_val",
"=",
"rdict",
"[",
"'problems'",
"... | Set problem specific result value | [
"Set",
"problem",
"specific",
"result",
"value"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/base-containers/base/inginious/feedback.py#L55-L62 |
235,003 | UCL-INGI/INGInious | base-containers/base/inginious/feedback.py | set_global_feedback | def set_global_feedback(feedback, append=False):
""" Set global feedback in case of error """
rdict = load_feedback()
rdict['text'] = rdict.get('text', '') + feedback if append else feedback
save_feedback(rdict) | python | def set_global_feedback(feedback, append=False):
""" Set global feedback in case of error """
rdict = load_feedback()
rdict['text'] = rdict.get('text', '') + feedback if append else feedback
save_feedback(rdict) | [
"def",
"set_global_feedback",
"(",
"feedback",
",",
"append",
"=",
"False",
")",
":",
"rdict",
"=",
"load_feedback",
"(",
")",
"rdict",
"[",
"'text'",
"]",
"=",
"rdict",
".",
"get",
"(",
"'text'",
",",
"''",
")",
"+",
"feedback",
"if",
"append",
"else"... | Set global feedback in case of error | [
"Set",
"global",
"feedback",
"in",
"case",
"of",
"error"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/base-containers/base/inginious/feedback.py#L72-L76 |
235,004 | UCL-INGI/INGInious | base-containers/base/inginious/feedback.py | set_problem_feedback | def set_problem_feedback(feedback, problem_id, append=False):
""" Set problem specific feedback """
rdict = load_feedback()
if not 'problems' in rdict:
rdict['problems'] = {}
cur_val = rdict['problems'].get(problem_id, '')
rdict['problems'][problem_id] = (cur_val + feedback if append else fe... | python | def set_problem_feedback(feedback, problem_id, append=False):
""" Set problem specific feedback """
rdict = load_feedback()
if not 'problems' in rdict:
rdict['problems'] = {}
cur_val = rdict['problems'].get(problem_id, '')
rdict['problems'][problem_id] = (cur_val + feedback if append else fe... | [
"def",
"set_problem_feedback",
"(",
"feedback",
",",
"problem_id",
",",
"append",
"=",
"False",
")",
":",
"rdict",
"=",
"load_feedback",
"(",
")",
"if",
"not",
"'problems'",
"in",
"rdict",
":",
"rdict",
"[",
"'problems'",
"]",
"=",
"{",
"}",
"cur_val",
"... | Set problem specific feedback | [
"Set",
"problem",
"specific",
"feedback"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/base-containers/base/inginious/feedback.py#L79-L86 |
235,005 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer._display_big_warning | def _display_big_warning(self, content):
""" Displays a BIG warning """
print("")
print(BOLD + WARNING + "--- WARNING ---" + ENDC)
print(WARNING + content + ENDC)
print("") | python | def _display_big_warning(self, content):
""" Displays a BIG warning """
print("")
print(BOLD + WARNING + "--- WARNING ---" + ENDC)
print(WARNING + content + ENDC)
print("") | [
"def",
"_display_big_warning",
"(",
"self",
",",
"content",
")",
":",
"print",
"(",
"\"\"",
")",
"print",
"(",
"BOLD",
"+",
"WARNING",
"+",
"\"--- WARNING ---\"",
"+",
"ENDC",
")",
"print",
"(",
"WARNING",
"+",
"content",
"+",
"ENDC",
")",
"print",
"(",
... | Displays a BIG warning | [
"Displays",
"a",
"BIG",
"warning"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L64-L69 |
235,006 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer._ask_local_config | def _ask_local_config(self):
""" Ask some parameters about the local configuration """
options = {"backend": "local", "local-config": {}}
# Concurrency
while True:
concurrency = self._ask_with_default(
"Maximum concurrency (number of tasks running simultaneou... | python | def _ask_local_config(self):
""" Ask some parameters about the local configuration """
options = {"backend": "local", "local-config": {}}
# Concurrency
while True:
concurrency = self._ask_with_default(
"Maximum concurrency (number of tasks running simultaneou... | [
"def",
"_ask_local_config",
"(",
"self",
")",
":",
"options",
"=",
"{",
"\"backend\"",
":",
"\"local\"",
",",
"\"local-config\"",
":",
"{",
"}",
"}",
"# Concurrency",
"while",
"True",
":",
"concurrency",
"=",
"self",
".",
"_ask_with_default",
"(",
"\"Maximum c... | Ask some parameters about the local configuration | [
"Ask",
"some",
"parameters",
"about",
"the",
"local",
"configuration"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L170-L230 |
235,007 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer.ask_backend | def ask_backend(self):
""" Ask the user to choose the backend """
response = self._ask_boolean(
"Do you have a local docker daemon (on Linux), do you use docker-machine via a local machine, or do you use "
"Docker for macOS?", True)
if (response):
self._displa... | python | def ask_backend(self):
""" Ask the user to choose the backend """
response = self._ask_boolean(
"Do you have a local docker daemon (on Linux), do you use docker-machine via a local machine, or do you use "
"Docker for macOS?", True)
if (response):
self._displa... | [
"def",
"ask_backend",
"(",
"self",
")",
":",
"response",
"=",
"self",
".",
"_ask_boolean",
"(",
"\"Do you have a local docker daemon (on Linux), do you use docker-machine via a local machine, or do you use \"",
"\"Docker for macOS?\"",
",",
"True",
")",
"if",
"(",
"response",
... | Ask the user to choose the backend | [
"Ask",
"the",
"user",
"to",
"choose",
"the",
"backend"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L252-L265 |
235,008 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer.try_mongodb_opts | def try_mongodb_opts(self, host="localhost", database_name='INGInious'):
""" Try MongoDB configuration """
try:
mongo_client = MongoClient(host=host)
except Exception as e:
self._display_warning("Cannot connect to MongoDB on host %s: %s" % (host, str(e)))
retu... | python | def try_mongodb_opts(self, host="localhost", database_name='INGInious'):
""" Try MongoDB configuration """
try:
mongo_client = MongoClient(host=host)
except Exception as e:
self._display_warning("Cannot connect to MongoDB on host %s: %s" % (host, str(e)))
retu... | [
"def",
"try_mongodb_opts",
"(",
"self",
",",
"host",
"=",
"\"localhost\"",
",",
"database_name",
"=",
"'INGInious'",
")",
":",
"try",
":",
"mongo_client",
"=",
"MongoClient",
"(",
"host",
"=",
"host",
")",
"except",
"Exception",
"as",
"e",
":",
"self",
"."... | Try MongoDB configuration | [
"Try",
"MongoDB",
"configuration"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L271-L291 |
235,009 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer.configure_task_directory | def configure_task_directory(self):
""" Configure task directory """
self._display_question(
"Please choose a directory in which to store the course/task files. By default, the tool will put them in the current "
"directory")
task_directory = None
while task_direc... | python | def configure_task_directory(self):
""" Configure task directory """
self._display_question(
"Please choose a directory in which to store the course/task files. By default, the tool will put them in the current "
"directory")
task_directory = None
while task_direc... | [
"def",
"configure_task_directory",
"(",
"self",
")",
":",
"self",
".",
"_display_question",
"(",
"\"Please choose a directory in which to store the course/task files. By default, the tool will put them in the current \"",
"\"directory\"",
")",
"task_directory",
"=",
"None",
"while",
... | Configure task directory | [
"Configure",
"task",
"directory"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L326-L360 |
235,010 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer.download_containers | def download_containers(self, to_download, current_options):
""" Download the chosen containers on all the agents """
if current_options["backend"] == "local":
self._display_info("Connecting to the local Docker daemon...")
try:
docker_connection = docker.from_env(... | python | def download_containers(self, to_download, current_options):
""" Download the chosen containers on all the agents """
if current_options["backend"] == "local":
self._display_info("Connecting to the local Docker daemon...")
try:
docker_connection = docker.from_env(... | [
"def",
"download_containers",
"(",
"self",
",",
"to_download",
",",
"current_options",
")",
":",
"if",
"current_options",
"[",
"\"backend\"",
"]",
"==",
"\"local\"",
":",
"self",
".",
"_display_info",
"(",
"\"Connecting to the local Docker daemon...\"",
")",
"try",
... | Download the chosen containers on all the agents | [
"Download",
"the",
"chosen",
"containers",
"on",
"all",
"the",
"agents"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L366-L385 |
235,011 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer.configure_containers | def configure_containers(self, current_options):
""" Configures the container dict """
containers = [
("default", "Default container. For Bash and Python 2 tasks"),
("cpp", "Contains gcc and g++ for compiling C++"),
("java7", "Contains Java 7"),
("java8sca... | python | def configure_containers(self, current_options):
""" Configures the container dict """
containers = [
("default", "Default container. For Bash and Python 2 tasks"),
("cpp", "Contains gcc and g++ for compiling C++"),
("java7", "Contains Java 7"),
("java8sca... | [
"def",
"configure_containers",
"(",
"self",
",",
"current_options",
")",
":",
"containers",
"=",
"[",
"(",
"\"default\"",
",",
"\"Default container. For Bash and Python 2 tasks\"",
")",
",",
"(",
"\"cpp\"",
",",
"\"Contains gcc and g++ for compiling C++\"",
")",
",",
"(... | Configures the container dict | [
"Configures",
"the",
"container",
"dict"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L387-L424 |
235,012 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer.configure_backup_directory | def configure_backup_directory(self):
""" Configure backup directory """
self._display_question("Please choose a directory in which to store the backup files. By default, the tool will them in the current "
"directory")
backup_directory = None
while backup_... | python | def configure_backup_directory(self):
""" Configure backup directory """
self._display_question("Please choose a directory in which to store the backup files. By default, the tool will them in the current "
"directory")
backup_directory = None
while backup_... | [
"def",
"configure_backup_directory",
"(",
"self",
")",
":",
"self",
".",
"_display_question",
"(",
"\"Please choose a directory in which to store the backup files. By default, the tool will them in the current \"",
"\"directory\"",
")",
"backup_directory",
"=",
"None",
"while",
"ba... | Configure backup directory | [
"Configure",
"backup",
"directory"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L439-L451 |
235,013 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer.ldap_plugin | def ldap_plugin(self):
""" Configures the LDAP plugin """
name = self._ask_with_default("Authentication method name (will be displayed on the login page)", "LDAP")
prefix = self._ask_with_default("Prefix to append to the username before db storage. Usefull when you have more than one auth method... | python | def ldap_plugin(self):
""" Configures the LDAP plugin """
name = self._ask_with_default("Authentication method name (will be displayed on the login page)", "LDAP")
prefix = self._ask_with_default("Prefix to append to the username before db storage. Usefull when you have more than one auth method... | [
"def",
"ldap_plugin",
"(",
"self",
")",
":",
"name",
"=",
"self",
".",
"_ask_with_default",
"(",
"\"Authentication method name (will be displayed on the login page)\"",
",",
"\"LDAP\"",
")",
"prefix",
"=",
"self",
".",
"_ask_with_default",
"(",
"\"Prefix to append to the ... | Configures the LDAP plugin | [
"Configures",
"the",
"LDAP",
"plugin"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L453-L481 |
235,014 | UCL-INGI/INGInious | inginious/frontend/installer.py | Installer.configure_authentication | def configure_authentication(self, database):
""" Configure the authentication """
options = {"plugins": [], "superadmins": []}
self._display_info("We will now create the first user.")
username = self._ask_with_default("Enter the login of the superadmin", "superadmin")
realname... | python | def configure_authentication(self, database):
""" Configure the authentication """
options = {"plugins": [], "superadmins": []}
self._display_info("We will now create the first user.")
username = self._ask_with_default("Enter the login of the superadmin", "superadmin")
realname... | [
"def",
"configure_authentication",
"(",
"self",
",",
"database",
")",
":",
"options",
"=",
"{",
"\"plugins\"",
":",
"[",
"]",
",",
"\"superadmins\"",
":",
"[",
"]",
"}",
"self",
".",
"_display_info",
"(",
"\"We will now create the first user.\"",
")",
"username"... | Configure the authentication | [
"Configure",
"the",
"authentication"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/installer.py#L483-L515 |
235,015 | UCL-INGI/INGInious | inginious/frontend/app.py | _close_app | def _close_app(app, mongo_client, client):
""" Ensures that the app is properly closed """
app.stop()
client.close()
mongo_client.close() | python | def _close_app(app, mongo_client, client):
""" Ensures that the app is properly closed """
app.stop()
client.close()
mongo_client.close() | [
"def",
"_close_app",
"(",
"app",
",",
"mongo_client",
",",
"client",
")",
":",
"app",
".",
"stop",
"(",
")",
"client",
".",
"close",
"(",
")",
"mongo_client",
".",
"close",
"(",
")"
] | Ensures that the app is properly closed | [
"Ensures",
"that",
"the",
"app",
"is",
"properly",
"closed"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/app.py#L113-L117 |
235,016 | UCL-INGI/INGInious | inginious/agent/docker_agent/__init__.py | DockerAgent._init_clean | async def _init_clean(self):
""" Must be called when the agent is starting """
# Data about running containers
self._containers_running = {}
self._container_for_job = {}
self._student_containers_running = {}
self._student_containers_for_job = {}
self._containers... | python | async def _init_clean(self):
""" Must be called when the agent is starting """
# Data about running containers
self._containers_running = {}
self._container_for_job = {}
self._student_containers_running = {}
self._student_containers_for_job = {}
self._containers... | [
"async",
"def",
"_init_clean",
"(",
"self",
")",
":",
"# Data about running containers",
"self",
".",
"_containers_running",
"=",
"{",
"}",
"self",
".",
"_container_for_job",
"=",
"{",
"}",
"self",
".",
"_student_containers_running",
"=",
"{",
"}",
"self",
".",
... | Must be called when the agent is starting | [
"Must",
"be",
"called",
"when",
"the",
"agent",
"is",
"starting"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/agent/docker_agent/__init__.py#L57-L99 |
235,017 | UCL-INGI/INGInious | inginious/agent/docker_agent/__init__.py | DockerAgent._end_clean | async def _end_clean(self):
""" Must be called when the agent is closing """
await self._timeout_watcher.clean()
async def close_and_delete(container_id):
try:
await self._docker.remove_container(container_id)
except:
pass
for con... | python | async def _end_clean(self):
""" Must be called when the agent is closing """
await self._timeout_watcher.clean()
async def close_and_delete(container_id):
try:
await self._docker.remove_container(container_id)
except:
pass
for con... | [
"async",
"def",
"_end_clean",
"(",
"self",
")",
":",
"await",
"self",
".",
"_timeout_watcher",
".",
"clean",
"(",
")",
"async",
"def",
"close_and_delete",
"(",
"container_id",
")",
":",
"try",
":",
"await",
"self",
".",
"_docker",
".",
"remove_container",
... | Must be called when the agent is closing | [
"Must",
"be",
"called",
"when",
"the",
"agent",
"is",
"closing"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/agent/docker_agent/__init__.py#L101-L114 |
235,018 | UCL-INGI/INGInious | inginious/agent/docker_agent/__init__.py | DockerAgent._watch_docker_events | async def _watch_docker_events(self):
""" Get raw docker events and convert them to more readable objects, and then give them to self._docker_events_subscriber """
try:
source = AsyncIteratorWrapper(self._docker.sync.event_stream(filters={"event": ["die", "oom"]}))
async for i in... | python | async def _watch_docker_events(self):
""" Get raw docker events and convert them to more readable objects, and then give them to self._docker_events_subscriber """
try:
source = AsyncIteratorWrapper(self._docker.sync.event_stream(filters={"event": ["die", "oom"]}))
async for i in... | [
"async",
"def",
"_watch_docker_events",
"(",
"self",
")",
":",
"try",
":",
"source",
"=",
"AsyncIteratorWrapper",
"(",
"self",
".",
"_docker",
".",
"sync",
".",
"event_stream",
"(",
"filters",
"=",
"{",
"\"event\"",
":",
"[",
"\"die\"",
",",
"\"oom\"",
"]"... | Get raw docker events and convert them to more readable objects, and then give them to self._docker_events_subscriber | [
"Get",
"raw",
"docker",
"events",
"and",
"convert",
"them",
"to",
"more",
"readable",
"objects",
"and",
"then",
"give",
"them",
"to",
"self",
".",
"_docker_events_subscriber"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/agent/docker_agent/__init__.py#L120-L155 |
235,019 | UCL-INGI/INGInious | inginious/agent/docker_agent/__init__.py | DockerAgent.handle_student_job_closing | async def handle_student_job_closing(self, container_id, retval):
"""
Handle a closing student container. Do some cleaning, verify memory limits, timeouts, ... and returns data to the associated grading
container
"""
try:
self._logger.debug("Closing student %s", conta... | python | async def handle_student_job_closing(self, container_id, retval):
"""
Handle a closing student container. Do some cleaning, verify memory limits, timeouts, ... and returns data to the associated grading
container
"""
try:
self._logger.debug("Closing student %s", conta... | [
"async",
"def",
"handle_student_job_closing",
"(",
"self",
",",
"container_id",
",",
"retval",
")",
":",
"try",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"Closing student %s\"",
",",
"container_id",
")",
"try",
":",
"job_id",
",",
"parent_container_id",
... | Handle a closing student container. Do some cleaning, verify memory limits, timeouts, ... and returns data to the associated grading
container | [
"Handle",
"a",
"closing",
"student",
"container",
".",
"Do",
"some",
"cleaning",
"verify",
"memory",
"limits",
"timeouts",
"...",
"and",
"returns",
"data",
"to",
"the",
"associated",
"grading",
"container"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/agent/docker_agent/__init__.py#L452-L499 |
235,020 | UCL-INGI/INGInious | inginious/agent/docker_agent/__init__.py | DockerAgent.kill_job | async def kill_job(self, message: BackendKillJob):
""" Handles `kill` messages. Kill things. """
try:
if message.job_id in self._container_for_job:
self._containers_killed[self._container_for_job[message.job_id]] = "killed"
await self._docker.kill_container(se... | python | async def kill_job(self, message: BackendKillJob):
""" Handles `kill` messages. Kill things. """
try:
if message.job_id in self._container_for_job:
self._containers_killed[self._container_for_job[message.job_id]] = "killed"
await self._docker.kill_container(se... | [
"async",
"def",
"kill_job",
"(",
"self",
",",
"message",
":",
"BackendKillJob",
")",
":",
"try",
":",
"if",
"message",
".",
"job_id",
"in",
"self",
".",
"_container_for_job",
":",
"self",
".",
"_containers_killed",
"[",
"self",
".",
"_container_for_job",
"["... | Handles `kill` messages. Kill things. | [
"Handles",
"kill",
"messages",
".",
"Kill",
"things",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/agent/docker_agent/__init__.py#L629-L640 |
235,021 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/aggregation_edit.py | CourseEditAggregation.get_user_lists | def get_user_lists(self, course, aggregationid=''):
""" Get the available student and tutor lists for aggregation edition"""
tutor_list = course.get_staff()
# Determine student list and if they are grouped
student_list = list(self.database.aggregations.aggregate([
{"$match":... | python | def get_user_lists(self, course, aggregationid=''):
""" Get the available student and tutor lists for aggregation edition"""
tutor_list = course.get_staff()
# Determine student list and if they are grouped
student_list = list(self.database.aggregations.aggregate([
{"$match":... | [
"def",
"get_user_lists",
"(",
"self",
",",
"course",
",",
"aggregationid",
"=",
"''",
")",
":",
"tutor_list",
"=",
"course",
".",
"get_staff",
"(",
")",
"# Determine student list and if they are grouped",
"student_list",
"=",
"list",
"(",
"self",
".",
"database",
... | Get the available student and tutor lists for aggregation edition | [
"Get",
"the",
"available",
"student",
"and",
"tutor",
"lists",
"for",
"aggregation",
"edition"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/aggregation_edit.py#L21-L63 |
235,022 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/aggregation_edit.py | CourseEditAggregation.update_aggregation | def update_aggregation(self, course, aggregationid, new_data):
""" Update aggregation and returns a list of errored students"""
student_list = self.user_manager.get_course_registered_users(course, False)
# If aggregation is new
if aggregationid == 'None':
# Remove _id for c... | python | def update_aggregation(self, course, aggregationid, new_data):
""" Update aggregation and returns a list of errored students"""
student_list = self.user_manager.get_course_registered_users(course, False)
# If aggregation is new
if aggregationid == 'None':
# Remove _id for c... | [
"def",
"update_aggregation",
"(",
"self",
",",
"course",
",",
"aggregationid",
",",
"new_data",
")",
":",
"student_list",
"=",
"self",
".",
"user_manager",
".",
"get_course_registered_users",
"(",
"course",
",",
"False",
")",
"# If aggregation is new",
"if",
"aggr... | Update aggregation and returns a list of errored students | [
"Update",
"aggregation",
"and",
"returns",
"a",
"list",
"of",
"errored",
"students"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/aggregation_edit.py#L65-L132 |
235,023 | UCL-INGI/INGInious | inginious/frontend/pages/mycourses.py | MyCoursesPage.POST_AUTH | def POST_AUTH(self): # pylint: disable=arguments-differ
""" Parse course registration or course creation and display the course list page """
username = self.user_manager.session_username()
user_info = self.database.users.find_one({"username": username})
user_input = web.input()
... | python | def POST_AUTH(self): # pylint: disable=arguments-differ
""" Parse course registration or course creation and display the course list page """
username = self.user_manager.session_username()
user_info = self.database.users.find_one({"username": username})
user_input = web.input()
... | [
"def",
"POST_AUTH",
"(",
"self",
")",
":",
"# pylint: disable=arguments-differ",
"username",
"=",
"self",
".",
"user_manager",
".",
"session_username",
"(",
")",
"user_info",
"=",
"self",
".",
"database",
".",
"users",
".",
"find_one",
"(",
"{",
"\"username\"",
... | Parse course registration or course creation and display the course list page | [
"Parse",
"course",
"registration",
"or",
"course",
"creation",
"and",
"display",
"the",
"course",
"list",
"page"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/mycourses.py#L21-L47 |
235,024 | UCL-INGI/INGInious | inginious/frontend/arch_helper.py | _restart_on_cancel | async def _restart_on_cancel(logger, agent):
""" Restarts an agent when it is cancelled """
while True:
try:
await agent.run()
except asyncio.CancelledError:
logger.exception("Restarting agent")
pass | python | async def _restart_on_cancel(logger, agent):
""" Restarts an agent when it is cancelled """
while True:
try:
await agent.run()
except asyncio.CancelledError:
logger.exception("Restarting agent")
pass | [
"async",
"def",
"_restart_on_cancel",
"(",
"logger",
",",
"agent",
")",
":",
"while",
"True",
":",
"try",
":",
"await",
"agent",
".",
"run",
"(",
")",
"except",
"asyncio",
".",
"CancelledError",
":",
"logger",
".",
"exception",
"(",
"\"Restarting agent\"",
... | Restarts an agent when it is cancelled | [
"Restarts",
"an",
"agent",
"when",
"it",
"is",
"cancelled"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/arch_helper.py#L49-L56 |
235,025 | UCL-INGI/INGInious | inginious/frontend/pages/utils.py | INGIniousAuthPage.GET | def GET(self, *args, **kwargs):
"""
Checks if user is authenticated and calls GET_AUTH or performs logout.
Otherwise, returns the login template.
"""
if self.user_manager.session_logged_in():
if not self.user_manager.session_username() and not self.__class__.__name__ ... | python | def GET(self, *args, **kwargs):
"""
Checks if user is authenticated and calls GET_AUTH or performs logout.
Otherwise, returns the login template.
"""
if self.user_manager.session_logged_in():
if not self.user_manager.session_username() and not self.__class__.__name__ ... | [
"def",
"GET",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"user_manager",
".",
"session_logged_in",
"(",
")",
":",
"if",
"not",
"self",
".",
"user_manager",
".",
"session_username",
"(",
")",
"and",
"not",
"se... | Checks if user is authenticated and calls GET_AUTH or performs logout.
Otherwise, returns the login template. | [
"Checks",
"if",
"user",
"is",
"authenticated",
"and",
"calls",
"GET_AUTH",
"or",
"performs",
"logout",
".",
"Otherwise",
"returns",
"the",
"login",
"template",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/utils.py#L135-L150 |
235,026 | UCL-INGI/INGInious | inginious/frontend/static_middleware.py | StaticMiddleware.normpath | def normpath(self, path):
""" Normalize the path """
path2 = posixpath.normpath(urllib.parse.unquote(path))
if path.endswith("/"):
path2 += "/"
return path2 | python | def normpath(self, path):
""" Normalize the path """
path2 = posixpath.normpath(urllib.parse.unquote(path))
if path.endswith("/"):
path2 += "/"
return path2 | [
"def",
"normpath",
"(",
"self",
",",
"path",
")",
":",
"path2",
"=",
"posixpath",
".",
"normpath",
"(",
"urllib",
".",
"parse",
".",
"unquote",
"(",
"path",
")",
")",
"if",
"path",
".",
"endswith",
"(",
"\"/\"",
")",
":",
"path2",
"+=",
"\"/\"",
"r... | Normalize the path | [
"Normalize",
"the",
"path"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/static_middleware.py#L66-L71 |
235,027 | UCL-INGI/INGInious | inginious/frontend/pages/api/submissions.py | _get_submissions | def _get_submissions(course_factory, submission_manager, user_manager, translations, courseid, taskid, with_input, submissionid=None):
"""
Helper for the GET methods of the two following classes
"""
try:
course = course_factory.get_course(courseid)
except:
raise APINotFound("Cou... | python | def _get_submissions(course_factory, submission_manager, user_manager, translations, courseid, taskid, with_input, submissionid=None):
"""
Helper for the GET methods of the two following classes
"""
try:
course = course_factory.get_course(courseid)
except:
raise APINotFound("Cou... | [
"def",
"_get_submissions",
"(",
"course_factory",
",",
"submission_manager",
",",
"user_manager",
",",
"translations",
",",
"courseid",
",",
"taskid",
",",
"with_input",
",",
"submissionid",
"=",
"None",
")",
":",
"try",
":",
"course",
"=",
"course_factory",
"."... | Helper for the GET methods of the two following classes | [
"Helper",
"for",
"the",
"GET",
"methods",
"of",
"the",
"two",
"following",
"classes"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/api/submissions.py#L15-L73 |
235,028 | UCL-INGI/INGInious | inginious/frontend/pages/api/submissions.py | APISubmissionSingle.API_GET | def API_GET(self, courseid, taskid, submissionid): # pylint: disable=arguments-differ
"""
List all the submissions that the connected user made. Returns list of the form
::
[
{
"id": "submission_id1",
... | python | def API_GET(self, courseid, taskid, submissionid): # pylint: disable=arguments-differ
"""
List all the submissions that the connected user made. Returns list of the form
::
[
{
"id": "submission_id1",
... | [
"def",
"API_GET",
"(",
"self",
",",
"courseid",
",",
"taskid",
",",
"submissionid",
")",
":",
"# pylint: disable=arguments-differ",
"with_input",
"=",
"\"input\"",
"in",
"web",
".",
"input",
"(",
")",
"return",
"_get_submissions",
"(",
"self",
".",
"course_facto... | List all the submissions that the connected user made. Returns list of the form
::
[
{
"id": "submission_id1",
"submitted_on": "date",
"status" : "done", #can be "done", "waiting", "error" ... | [
"List",
"all",
"the",
"submissions",
"that",
"the",
"connected",
"user",
"made",
".",
"Returns",
"list",
"of",
"the",
"form"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/api/submissions.py#L81-L110 |
235,029 | UCL-INGI/INGInious | inginious/frontend/courses.py | WebAppCourse.is_registration_possible | def is_registration_possible(self, user_info):
""" Returns true if users can register for this course """
return self.get_accessibility().is_open() and self._registration.is_open() and self.is_user_accepted_by_access_control(user_info) | python | def is_registration_possible(self, user_info):
""" Returns true if users can register for this course """
return self.get_accessibility().is_open() and self._registration.is_open() and self.is_user_accepted_by_access_control(user_info) | [
"def",
"is_registration_possible",
"(",
"self",
",",
"user_info",
")",
":",
"return",
"self",
".",
"get_accessibility",
"(",
")",
".",
"is_open",
"(",
")",
"and",
"self",
".",
"_registration",
".",
"is_open",
"(",
")",
"and",
"self",
".",
"is_user_accepted_b... | Returns true if users can register for this course | [
"Returns",
"true",
"if",
"users",
"can",
"register",
"for",
"this",
"course"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/courses.py#L88-L90 |
235,030 | UCL-INGI/INGInious | inginious/frontend/courses.py | WebAppCourse.get_accessibility | def get_accessibility(self, plugin_override=True):
""" Return the AccessibleTime object associated with the accessibility of this course """
vals = self._hook_manager.call_hook('course_accessibility', course=self, default=self._accessible)
return vals[0] if len(vals) and plugin_override else sel... | python | def get_accessibility(self, plugin_override=True):
""" Return the AccessibleTime object associated with the accessibility of this course """
vals = self._hook_manager.call_hook('course_accessibility', course=self, default=self._accessible)
return vals[0] if len(vals) and plugin_override else sel... | [
"def",
"get_accessibility",
"(",
"self",
",",
"plugin_override",
"=",
"True",
")",
":",
"vals",
"=",
"self",
".",
"_hook_manager",
".",
"call_hook",
"(",
"'course_accessibility'",
",",
"course",
"=",
"self",
",",
"default",
"=",
"self",
".",
"_accessible",
"... | Return the AccessibleTime object associated with the accessibility of this course | [
"Return",
"the",
"AccessibleTime",
"object",
"associated",
"with",
"the",
"accessibility",
"of",
"this",
"course"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/courses.py#L100-L103 |
235,031 | UCL-INGI/INGInious | inginious/frontend/courses.py | WebAppCourse.is_user_accepted_by_access_control | def is_user_accepted_by_access_control(self, user_info):
""" Returns True if the user is allowed by the ACL """
if self.get_access_control_method() is None:
return True
elif not user_info:
return False
elif self.get_access_control_method() == "username":
... | python | def is_user_accepted_by_access_control(self, user_info):
""" Returns True if the user is allowed by the ACL """
if self.get_access_control_method() is None:
return True
elif not user_info:
return False
elif self.get_access_control_method() == "username":
... | [
"def",
"is_user_accepted_by_access_control",
"(",
"self",
",",
"user_info",
")",
":",
"if",
"self",
".",
"get_access_control_method",
"(",
")",
"is",
"None",
":",
"return",
"True",
"elif",
"not",
"user_info",
":",
"return",
"False",
"elif",
"self",
".",
"get_a... | Returns True if the user is allowed by the ACL | [
"Returns",
"True",
"if",
"the",
"user",
"is",
"allowed",
"by",
"the",
"ACL"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/courses.py#L140-L152 |
235,032 | UCL-INGI/INGInious | inginious/frontend/courses.py | WebAppCourse.allow_unregister | def allow_unregister(self, plugin_override=True):
""" Returns True if students can unregister from course """
vals = self._hook_manager.call_hook('course_allow_unregister', course=self, default=self._allow_unregister)
return vals[0] if len(vals) and plugin_override else self._allow_unregister | python | def allow_unregister(self, plugin_override=True):
""" Returns True if students can unregister from course """
vals = self._hook_manager.call_hook('course_allow_unregister', course=self, default=self._allow_unregister)
return vals[0] if len(vals) and plugin_override else self._allow_unregister | [
"def",
"allow_unregister",
"(",
"self",
",",
"plugin_override",
"=",
"True",
")",
":",
"vals",
"=",
"self",
".",
"_hook_manager",
".",
"call_hook",
"(",
"'course_allow_unregister'",
",",
"course",
"=",
"self",
",",
"default",
"=",
"self",
".",
"_allow_unregist... | Returns True if students can unregister from course | [
"Returns",
"True",
"if",
"students",
"can",
"unregister",
"from",
"course"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/courses.py#L157-L160 |
235,033 | UCL-INGI/INGInious | inginious/frontend/courses.py | WebAppCourse.get_name | def get_name(self, language):
""" Return the name of this course """
return self.gettext(language, self._name) if self._name else "" | python | def get_name(self, language):
""" Return the name of this course """
return self.gettext(language, self._name) if self._name else "" | [
"def",
"get_name",
"(",
"self",
",",
"language",
")",
":",
"return",
"self",
".",
"gettext",
"(",
"language",
",",
"self",
".",
"_name",
")",
"if",
"self",
".",
"_name",
"else",
"\"\""
] | Return the name of this course | [
"Return",
"the",
"name",
"of",
"this",
"course"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/courses.py#L162-L164 |
235,034 | UCL-INGI/INGInious | inginious/frontend/courses.py | WebAppCourse.get_description | def get_description(self, language):
"""Returns the course description """
description = self.gettext(language, self._description) if self._description else ''
return ParsableText(description, "rst", self._translations.get(language, gettext.NullTranslations())) | python | def get_description(self, language):
"""Returns the course description """
description = self.gettext(language, self._description) if self._description else ''
return ParsableText(description, "rst", self._translations.get(language, gettext.NullTranslations())) | [
"def",
"get_description",
"(",
"self",
",",
"language",
")",
":",
"description",
"=",
"self",
".",
"gettext",
"(",
"language",
",",
"self",
".",
"_description",
")",
"if",
"self",
".",
"_description",
"else",
"''",
"return",
"ParsableText",
"(",
"description... | Returns the course description | [
"Returns",
"the",
"course",
"description"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/courses.py#L166-L169 |
235,035 | UCL-INGI/INGInious | inginious/frontend/courses.py | WebAppCourse.get_all_tags_names_as_list | def get_all_tags_names_as_list(self, admin=False, language="en"):
""" Computes and cache two list containing all tags name sorted by natural order on name """
if admin:
if self._all_tags_cache_list_admin != {} and language in self._all_tags_cache_list_admin:
return self._all... | python | def get_all_tags_names_as_list(self, admin=False, language="en"):
""" Computes and cache two list containing all tags name sorted by natural order on name """
if admin:
if self._all_tags_cache_list_admin != {} and language in self._all_tags_cache_list_admin:
return self._all... | [
"def",
"get_all_tags_names_as_list",
"(",
"self",
",",
"admin",
"=",
"False",
",",
"language",
"=",
"\"en\"",
")",
":",
"if",
"admin",
":",
"if",
"self",
".",
"_all_tags_cache_list_admin",
"!=",
"{",
"}",
"and",
"language",
"in",
"self",
".",
"_all_tags_cach... | Computes and cache two list containing all tags name sorted by natural order on name | [
"Computes",
"and",
"cache",
"two",
"list",
"containing",
"all",
"tags",
"name",
"sorted",
"by",
"natural",
"order",
"on",
"name"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/courses.py#L200-L225 |
235,036 | UCL-INGI/INGInious | inginious/frontend/courses.py | WebAppCourse.update_all_tags_cache | def update_all_tags_cache(self):
""" Force the cache refreshing """
self._all_tags_cache = None
self._all_tags_cache_list = {}
self._all_tags_cache_list_admin = {}
self._organisational_tags_to_task = {}
self.get_all_tags()
self.get_all_tags_n... | python | def update_all_tags_cache(self):
""" Force the cache refreshing """
self._all_tags_cache = None
self._all_tags_cache_list = {}
self._all_tags_cache_list_admin = {}
self._organisational_tags_to_task = {}
self.get_all_tags()
self.get_all_tags_n... | [
"def",
"update_all_tags_cache",
"(",
"self",
")",
":",
"self",
".",
"_all_tags_cache",
"=",
"None",
"self",
".",
"_all_tags_cache_list",
"=",
"{",
"}",
"self",
".",
"_all_tags_cache_list_admin",
"=",
"{",
"}",
"self",
".",
"_organisational_tags_to_task",
"=",
"{... | Force the cache refreshing | [
"Force",
"the",
"cache",
"refreshing"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/courses.py#L243-L253 |
235,037 | UCL-INGI/INGInious | inginious/frontend/webdav.py | get_app | def get_app(config):
""" Init the webdav app """
mongo_client = MongoClient(host=config.get('mongo_opt', {}).get('host', 'localhost'))
database = mongo_client[config.get('mongo_opt', {}).get('database', 'INGInious')]
# Create the FS provider
if "tasks_directory" not in config:
raise Runtime... | python | def get_app(config):
""" Init the webdav app """
mongo_client = MongoClient(host=config.get('mongo_opt', {}).get('host', 'localhost'))
database = mongo_client[config.get('mongo_opt', {}).get('database', 'INGInious')]
# Create the FS provider
if "tasks_directory" not in config:
raise Runtime... | [
"def",
"get_app",
"(",
"config",
")",
":",
"mongo_client",
"=",
"MongoClient",
"(",
"host",
"=",
"config",
".",
"get",
"(",
"'mongo_opt'",
",",
"{",
"}",
")",
".",
"get",
"(",
"'host'",
",",
"'localhost'",
")",
")",
"database",
"=",
"mongo_client",
"["... | Init the webdav app | [
"Init",
"the",
"webdav",
"app"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/webdav.py#L120-L140 |
235,038 | UCL-INGI/INGInious | inginious/frontend/webdav.py | INGIniousDAVDomainController.getDomainRealm | def getDomainRealm(self, inputURL, environ):
"""Resolve a relative url to the appropriate realm name."""
# we don't get the realm here, its already been resolved in
# request_resolver
if inputURL.startswith("/"):
inputURL = inputURL[1:]
parts = inputURL.split("/")
... | python | def getDomainRealm(self, inputURL, environ):
"""Resolve a relative url to the appropriate realm name."""
# we don't get the realm here, its already been resolved in
# request_resolver
if inputURL.startswith("/"):
inputURL = inputURL[1:]
parts = inputURL.split("/")
... | [
"def",
"getDomainRealm",
"(",
"self",
",",
"inputURL",
",",
"environ",
")",
":",
"# we don't get the realm here, its already been resolved in",
"# request_resolver",
"if",
"inputURL",
".",
"startswith",
"(",
"\"/\"",
")",
":",
"inputURL",
"=",
"inputURL",
"[",
"1",
... | Resolve a relative url to the appropriate realm name. | [
"Resolve",
"a",
"relative",
"url",
"to",
"the",
"appropriate",
"realm",
"name",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/webdav.py#L30-L37 |
235,039 | UCL-INGI/INGInious | inginious/frontend/webdav.py | INGIniousDAVDomainController.isRealmUser | def isRealmUser(self, realmname, username, environ):
"""Returns True if this username is valid for the realm, False otherwise."""
try:
course = self.course_factory.get_course(realmname)
ok = self.user_manager.has_admin_rights_on_course(course, username=username)
retur... | python | def isRealmUser(self, realmname, username, environ):
"""Returns True if this username is valid for the realm, False otherwise."""
try:
course = self.course_factory.get_course(realmname)
ok = self.user_manager.has_admin_rights_on_course(course, username=username)
retur... | [
"def",
"isRealmUser",
"(",
"self",
",",
"realmname",
",",
"username",
",",
"environ",
")",
":",
"try",
":",
"course",
"=",
"self",
".",
"course_factory",
".",
"get_course",
"(",
"realmname",
")",
"ok",
"=",
"self",
".",
"user_manager",
".",
"has_admin_righ... | Returns True if this username is valid for the realm, False otherwise. | [
"Returns",
"True",
"if",
"this",
"username",
"is",
"valid",
"for",
"the",
"realm",
"False",
"otherwise",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/webdav.py#L44-L51 |
235,040 | UCL-INGI/INGInious | inginious/frontend/webdav.py | INGIniousDAVDomainController.getRealmUserPassword | def getRealmUserPassword(self, realmname, username, environ):
"""Return the password for the given username for the realm.
Used for digest authentication.
"""
return self.user_manager.get_user_api_key(username, create=True) | python | def getRealmUserPassword(self, realmname, username, environ):
"""Return the password for the given username for the realm.
Used for digest authentication.
"""
return self.user_manager.get_user_api_key(username, create=True) | [
"def",
"getRealmUserPassword",
"(",
"self",
",",
"realmname",
",",
"username",
",",
"environ",
")",
":",
"return",
"self",
".",
"user_manager",
".",
"get_user_api_key",
"(",
"username",
",",
"create",
"=",
"True",
")"
] | Return the password for the given username for the realm.
Used for digest authentication. | [
"Return",
"the",
"password",
"for",
"the",
"given",
"username",
"for",
"the",
"realm",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/webdav.py#L53-L58 |
235,041 | UCL-INGI/INGInious | inginious/frontend/webdav.py | INGIniousFilesystemProvider.getResourceInst | def getResourceInst(self, path, environ):
"""Return info dictionary for path.
See DAVProvider.getResourceInst()
"""
self._count_getResourceInst += 1
fp = self._locToFilePath(path)
if not os.path.exists(fp):
return None
if os.path.isdir(fp):
... | python | def getResourceInst(self, path, environ):
"""Return info dictionary for path.
See DAVProvider.getResourceInst()
"""
self._count_getResourceInst += 1
fp = self._locToFilePath(path)
if not os.path.exists(fp):
return None
if os.path.isdir(fp):
... | [
"def",
"getResourceInst",
"(",
"self",
",",
"path",
",",
"environ",
")",
":",
"self",
".",
"_count_getResourceInst",
"+=",
"1",
"fp",
"=",
"self",
".",
"_locToFilePath",
"(",
"path",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"fp",
")",
... | Return info dictionary for path.
See DAVProvider.getResourceInst() | [
"Return",
"info",
"dictionary",
"for",
"path",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/webdav.py#L105-L117 |
235,042 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/task_edit.py | CourseEditTask.contains_is_html | def contains_is_html(cls, data):
""" Detect if the problem has at least one "xyzIsHTML" key """
for key, val in data.items():
if isinstance(key, str) and key.endswith("IsHTML"):
return True
if isinstance(val, (OrderedDict, dict)) and cls.contains_is_html(val):
... | python | def contains_is_html(cls, data):
""" Detect if the problem has at least one "xyzIsHTML" key """
for key, val in data.items():
if isinstance(key, str) and key.endswith("IsHTML"):
return True
if isinstance(val, (OrderedDict, dict)) and cls.contains_is_html(val):
... | [
"def",
"contains_is_html",
"(",
"cls",
",",
"data",
")",
":",
"for",
"key",
",",
"val",
"in",
"data",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"key",
",",
"str",
")",
"and",
"key",
".",
"endswith",
"(",
"\"IsHTML\"",
")",
":",
"return"... | Detect if the problem has at least one "xyzIsHTML" key | [
"Detect",
"if",
"the",
"problem",
"has",
"at",
"least",
"one",
"xyzIsHTML",
"key"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/task_edit.py#L73-L80 |
235,043 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/task_edit.py | CourseEditTask.parse_problem | def parse_problem(self, problem_content):
""" Parses a problem, modifying some data """
del problem_content["@order"]
return self.task_factory.get_problem_types().get(problem_content["type"]).parse_problem(problem_content) | python | def parse_problem(self, problem_content):
""" Parses a problem, modifying some data """
del problem_content["@order"]
return self.task_factory.get_problem_types().get(problem_content["type"]).parse_problem(problem_content) | [
"def",
"parse_problem",
"(",
"self",
",",
"problem_content",
")",
":",
"del",
"problem_content",
"[",
"\"@order\"",
"]",
"return",
"self",
".",
"task_factory",
".",
"get_problem_types",
"(",
")",
".",
"get",
"(",
"problem_content",
"[",
"\"type\"",
"]",
")",
... | Parses a problem, modifying some data | [
"Parses",
"a",
"problem",
"modifying",
"some",
"data"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/task_edit.py#L113-L116 |
235,044 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/task_edit.py | CourseEditTask.wipe_task | def wipe_task(self, courseid, taskid):
""" Wipe the data associated to the taskid from DB"""
submissions = self.database.submissions.find({"courseid": courseid, "taskid": taskid})
for submission in submissions:
for key in ["input", "archive"]:
if key in submission and... | python | def wipe_task(self, courseid, taskid):
""" Wipe the data associated to the taskid from DB"""
submissions = self.database.submissions.find({"courseid": courseid, "taskid": taskid})
for submission in submissions:
for key in ["input", "archive"]:
if key in submission and... | [
"def",
"wipe_task",
"(",
"self",
",",
"courseid",
",",
"taskid",
")",
":",
"submissions",
"=",
"self",
".",
"database",
".",
"submissions",
".",
"find",
"(",
"{",
"\"courseid\"",
":",
"courseid",
",",
"\"taskid\"",
":",
"taskid",
"}",
")",
"for",
"submis... | Wipe the data associated to the taskid from DB | [
"Wipe",
"the",
"data",
"associated",
"to",
"the",
"taskid",
"from",
"DB"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/task_edit.py#L118-L130 |
235,045 | UCL-INGI/INGInious | inginious/common/hook_manager.py | HookManager._exception_free_callback | def _exception_free_callback(self, callback, *args, **kwargs):
""" A wrapper that remove all exceptions raised from hooks """
try:
return callback(*args, **kwargs)
except Exception:
self._logger.exception("An exception occurred while calling a hook! ",exc_info=True)
... | python | def _exception_free_callback(self, callback, *args, **kwargs):
""" A wrapper that remove all exceptions raised from hooks """
try:
return callback(*args, **kwargs)
except Exception:
self._logger.exception("An exception occurred while calling a hook! ",exc_info=True)
... | [
"def",
"_exception_free_callback",
"(",
"self",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"callback",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"Exception",
":",
"self",
".",
"_logger",
... | A wrapper that remove all exceptions raised from hooks | [
"A",
"wrapper",
"that",
"remove",
"all",
"exceptions",
"raised",
"from",
"hooks"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/common/hook_manager.py#L18-L24 |
235,046 | UCL-INGI/INGInious | inginious/common/hook_manager.py | HookManager.add_hook | def add_hook(self, name, callback, prio=0):
""" Add a new hook that can be called with the call_hook function.
`prio` is the priority. Higher priority hooks are called before lower priority ones.
This function does not enforce a particular order between hooks with the same priorities.
... | python | def add_hook(self, name, callback, prio=0):
""" Add a new hook that can be called with the call_hook function.
`prio` is the priority. Higher priority hooks are called before lower priority ones.
This function does not enforce a particular order between hooks with the same priorities.
... | [
"def",
"add_hook",
"(",
"self",
",",
"name",
",",
"callback",
",",
"prio",
"=",
"0",
")",
":",
"hook_list",
"=",
"self",
".",
"_hooks",
".",
"get",
"(",
"name",
",",
"[",
"]",
")",
"add",
"=",
"(",
"lambda",
"*",
"args",
",",
"*",
"*",
"kwargs"... | Add a new hook that can be called with the call_hook function.
`prio` is the priority. Higher priority hooks are called before lower priority ones.
This function does not enforce a particular order between hooks with the same priorities. | [
"Add",
"a",
"new",
"hook",
"that",
"can",
"be",
"called",
"with",
"the",
"call_hook",
"function",
".",
"prio",
"is",
"the",
"priority",
".",
"Higher",
"priority",
"hooks",
"are",
"called",
"before",
"lower",
"priority",
"ones",
".",
"This",
"function",
"do... | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/common/hook_manager.py#L26-L37 |
235,047 | UCL-INGI/INGInious | inginious/common/tasks.py | Task.input_is_consistent | def input_is_consistent(self, task_input, default_allowed_extension, default_max_size):
""" Check if an input for a task is consistent. Return true if this is case, false else """
for problem in self._problems:
if not problem.input_is_consistent(task_input, default_allowed_extension, default... | python | def input_is_consistent(self, task_input, default_allowed_extension, default_max_size):
""" Check if an input for a task is consistent. Return true if this is case, false else """
for problem in self._problems:
if not problem.input_is_consistent(task_input, default_allowed_extension, default... | [
"def",
"input_is_consistent",
"(",
"self",
",",
"task_input",
",",
"default_allowed_extension",
",",
"default_max_size",
")",
":",
"for",
"problem",
"in",
"self",
".",
"_problems",
":",
"if",
"not",
"problem",
".",
"input_is_consistent",
"(",
"task_input",
",",
... | Check if an input for a task is consistent. Return true if this is case, false else | [
"Check",
"if",
"an",
"input",
"for",
"a",
"task",
"is",
"consistent",
".",
"Return",
"true",
"if",
"this",
"is",
"case",
"false",
"else"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/common/tasks.py#L75-L80 |
235,048 | UCL-INGI/INGInious | inginious/common/tasks.py | Task.get_limits | def get_limits(self):
""" Return the limits of this task """
vals = self._hook_manager.call_hook('task_limits', course=self.get_course(), task=self, default=self._limits)
return vals[0] if len(vals) else self._limits | python | def get_limits(self):
""" Return the limits of this task """
vals = self._hook_manager.call_hook('task_limits', course=self.get_course(), task=self, default=self._limits)
return vals[0] if len(vals) else self._limits | [
"def",
"get_limits",
"(",
"self",
")",
":",
"vals",
"=",
"self",
".",
"_hook_manager",
".",
"call_hook",
"(",
"'task_limits'",
",",
"course",
"=",
"self",
".",
"get_course",
"(",
")",
",",
"task",
"=",
"self",
",",
"default",
"=",
"self",
".",
"_limits... | Return the limits of this task | [
"Return",
"the",
"limits",
"of",
"this",
"task"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/common/tasks.py#L106-L109 |
235,049 | UCL-INGI/INGInious | inginious/common/tasks.py | Task.allow_network_access_grading | def allow_network_access_grading(self):
""" Return True if the grading container should have access to the network """
vals = self._hook_manager.call_hook('task_network_grading', course=self.get_course(), task=self, default=self._network_grading)
return vals[0] if len(vals) else self._network_gr... | python | def allow_network_access_grading(self):
""" Return True if the grading container should have access to the network """
vals = self._hook_manager.call_hook('task_network_grading', course=self.get_course(), task=self, default=self._network_grading)
return vals[0] if len(vals) else self._network_gr... | [
"def",
"allow_network_access_grading",
"(",
"self",
")",
":",
"vals",
"=",
"self",
".",
"_hook_manager",
".",
"call_hook",
"(",
"'task_network_grading'",
",",
"course",
"=",
"self",
".",
"get_course",
"(",
")",
",",
"task",
"=",
"self",
",",
"default",
"=",
... | Return True if the grading container should have access to the network | [
"Return",
"True",
"if",
"the",
"grading",
"container",
"should",
"have",
"access",
"to",
"the",
"network"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/common/tasks.py#L111-L114 |
235,050 | UCL-INGI/INGInious | inginious/common/tasks.py | Task._create_task_problem | def _create_task_problem(self, problemid, problem_content, task_problem_types):
"""Creates a new instance of the right class for a given problem."""
# Basic checks
if not id_checker(problemid):
raise Exception("Invalid problem _id: " + problemid)
if problem_content.get('type'... | python | def _create_task_problem(self, problemid, problem_content, task_problem_types):
"""Creates a new instance of the right class for a given problem."""
# Basic checks
if not id_checker(problemid):
raise Exception("Invalid problem _id: " + problemid)
if problem_content.get('type'... | [
"def",
"_create_task_problem",
"(",
"self",
",",
"problemid",
",",
"problem_content",
",",
"task_problem_types",
")",
":",
"# Basic checks",
"if",
"not",
"id_checker",
"(",
"problemid",
")",
":",
"raise",
"Exception",
"(",
"\"Invalid problem _id: \"",
"+",
"problemi... | Creates a new instance of the right class for a given problem. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"right",
"class",
"for",
"a",
"given",
"problem",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/common/tasks.py#L162-L170 |
235,051 | UCL-INGI/INGInious | inginious/frontend/plugins/scoreboard/__init__.py | course_menu | def course_menu(course, template_helper):
""" Displays the link to the scoreboards on the course page, if the plugin is activated for this course """
scoreboards = course.get_descriptor().get('scoreboard', [])
if scoreboards != []:
return str(template_helper.get_custom_renderer('frontend/plugins/sc... | python | def course_menu(course, template_helper):
""" Displays the link to the scoreboards on the course page, if the plugin is activated for this course """
scoreboards = course.get_descriptor().get('scoreboard', [])
if scoreboards != []:
return str(template_helper.get_custom_renderer('frontend/plugins/sc... | [
"def",
"course_menu",
"(",
"course",
",",
"template_helper",
")",
":",
"scoreboards",
"=",
"course",
".",
"get_descriptor",
"(",
")",
".",
"get",
"(",
"'scoreboard'",
",",
"[",
"]",
")",
"if",
"scoreboards",
"!=",
"[",
"]",
":",
"return",
"str",
"(",
"... | Displays the link to the scoreboards on the course page, if the plugin is activated for this course | [
"Displays",
"the",
"link",
"to",
"the",
"scoreboards",
"on",
"the",
"course",
"page",
"if",
"the",
"plugin",
"is",
"activated",
"for",
"this",
"course"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/plugins/scoreboard/__init__.py#L172-L179 |
235,052 | UCL-INGI/INGInious | inginious/frontend/plugins/scoreboard/__init__.py | task_menu | def task_menu(course, task, template_helper):
""" Displays the link to the scoreboards on the task page, if the plugin is activated for this course and the task is used in scoreboards """
scoreboards = course.get_descriptor().get('scoreboard', [])
try:
tolink = []
for sid, scoreboard in enum... | python | def task_menu(course, task, template_helper):
""" Displays the link to the scoreboards on the task page, if the plugin is activated for this course and the task is used in scoreboards """
scoreboards = course.get_descriptor().get('scoreboard', [])
try:
tolink = []
for sid, scoreboard in enum... | [
"def",
"task_menu",
"(",
"course",
",",
"task",
",",
"template_helper",
")",
":",
"scoreboards",
"=",
"course",
".",
"get_descriptor",
"(",
")",
".",
"get",
"(",
"'scoreboard'",
",",
"[",
"]",
")",
"try",
":",
"tolink",
"=",
"[",
"]",
"for",
"sid",
"... | Displays the link to the scoreboards on the task page, if the plugin is activated for this course and the task is used in scoreboards | [
"Displays",
"the",
"link",
"to",
"the",
"scoreboards",
"on",
"the",
"task",
"page",
"if",
"the",
"plugin",
"is",
"activated",
"for",
"this",
"course",
"and",
"the",
"task",
"is",
"used",
"in",
"scoreboards"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/plugins/scoreboard/__init__.py#L182-L195 |
235,053 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/classroom_edit.py | CourseEditClassroom.get_user_lists | def get_user_lists(self, course, classroomid):
""" Get the available student and tutor lists for classroom edition"""
tutor_list = course.get_staff()
# Determine if user is grouped or not in the classroom
student_list = list(self.database.classrooms.aggregate([
{"$match": {"... | python | def get_user_lists(self, course, classroomid):
""" Get the available student and tutor lists for classroom edition"""
tutor_list = course.get_staff()
# Determine if user is grouped or not in the classroom
student_list = list(self.database.classrooms.aggregate([
{"$match": {"... | [
"def",
"get_user_lists",
"(",
"self",
",",
"course",
",",
"classroomid",
")",
":",
"tutor_list",
"=",
"course",
".",
"get_staff",
"(",
")",
"# Determine if user is grouped or not in the classroom",
"student_list",
"=",
"list",
"(",
"self",
".",
"database",
".",
"c... | Get the available student and tutor lists for classroom edition | [
"Get",
"the",
"available",
"student",
"and",
"tutor",
"lists",
"for",
"classroom",
"edition"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/classroom_edit.py#L21-L64 |
235,054 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/classroom_edit.py | CourseEditClassroom.update_classroom | def update_classroom(self, course, classroomid, new_data):
""" Update classroom and returns a list of errored students"""
student_list, tutor_list, other_students, _ = self.get_user_lists(course, classroomid)
# Check tutors
new_data["tutors"] = [tutor for tutor in map(str.strip, new_dat... | python | def update_classroom(self, course, classroomid, new_data):
""" Update classroom and returns a list of errored students"""
student_list, tutor_list, other_students, _ = self.get_user_lists(course, classroomid)
# Check tutors
new_data["tutors"] = [tutor for tutor in map(str.strip, new_dat... | [
"def",
"update_classroom",
"(",
"self",
",",
"course",
",",
"classroomid",
",",
"new_data",
")",
":",
"student_list",
",",
"tutor_list",
",",
"other_students",
",",
"_",
"=",
"self",
".",
"get_user_lists",
"(",
"course",
",",
"classroomid",
")",
"# Check tutor... | Update classroom and returns a list of errored students | [
"Update",
"classroom",
"and",
"returns",
"a",
"list",
"of",
"errored",
"students"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/classroom_edit.py#L66-L116 |
235,055 | UCL-INGI/INGInious | inginious/frontend/parsable_text.py | ParsableText.parse | def parse(self, debug=False):
"""Returns parsed text"""
if self._parsed is None:
try:
if self._mode == "html":
self._parsed = self.html(self._content, self._show_everything, self._translation)
else:
self._parsed = self.r... | python | def parse(self, debug=False):
"""Returns parsed text"""
if self._parsed is None:
try:
if self._mode == "html":
self._parsed = self.html(self._content, self._show_everything, self._translation)
else:
self._parsed = self.r... | [
"def",
"parse",
"(",
"self",
",",
"debug",
"=",
"False",
")",
":",
"if",
"self",
".",
"_parsed",
"is",
"None",
":",
"try",
":",
"if",
"self",
".",
"_mode",
"==",
"\"html\"",
":",
"self",
".",
"_parsed",
"=",
"self",
".",
"html",
"(",
"self",
".",... | Returns parsed text | [
"Returns",
"parsed",
"text"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/parsable_text.py#L144-L157 |
235,056 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/task_edit_file.py | CourseTaskFiles.POST_AUTH | def POST_AUTH(self, courseid, taskid): # pylint: disable=arguments-differ
""" Upload or modify a file """
if not id_checker(taskid):
raise Exception("Invalid task id")
self.get_course_and_check_rights(courseid, allow_all_staff=False)
request = web.input(file={})
if... | python | def POST_AUTH(self, courseid, taskid): # pylint: disable=arguments-differ
""" Upload or modify a file """
if not id_checker(taskid):
raise Exception("Invalid task id")
self.get_course_and_check_rights(courseid, allow_all_staff=False)
request = web.input(file={})
if... | [
"def",
"POST_AUTH",
"(",
"self",
",",
"courseid",
",",
"taskid",
")",
":",
"# pylint: disable=arguments-differ",
"if",
"not",
"id_checker",
"(",
"taskid",
")",
":",
"raise",
"Exception",
"(",
"\"Invalid task id\"",
")",
"self",
".",
"get_course_and_check_rights",
... | Upload or modify a file | [
"Upload",
"or",
"modify",
"a",
"file"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/task_edit_file.py#L40-L53 |
235,057 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/task_edit_file.py | CourseTaskFiles.show_tab_file | def show_tab_file(self, courseid, taskid, error=None):
""" Return the file tab """
return self.template_helper.get_renderer(False).course_admin.edit_tabs.files(
self.course_factory.get_course(courseid), taskid, self.get_task_filelist(self.task_factory, courseid, taskid), error) | python | def show_tab_file(self, courseid, taskid, error=None):
""" Return the file tab """
return self.template_helper.get_renderer(False).course_admin.edit_tabs.files(
self.course_factory.get_course(courseid), taskid, self.get_task_filelist(self.task_factory, courseid, taskid), error) | [
"def",
"show_tab_file",
"(",
"self",
",",
"courseid",
",",
"taskid",
",",
"error",
"=",
"None",
")",
":",
"return",
"self",
".",
"template_helper",
".",
"get_renderer",
"(",
"False",
")",
".",
"course_admin",
".",
"edit_tabs",
".",
"files",
"(",
"self",
... | Return the file tab | [
"Return",
"the",
"file",
"tab"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/task_edit_file.py#L55-L58 |
235,058 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/task_edit_file.py | CourseTaskFiles.action_edit | def action_edit(self, courseid, taskid, path):
""" Edit a file """
wanted_path = self.verify_path(courseid, taskid, path)
if wanted_path is None:
return "Internal error"
try:
content = self.task_factory.get_task_fs(courseid, taskid).get(wanted_path).decode("utf-8"... | python | def action_edit(self, courseid, taskid, path):
""" Edit a file """
wanted_path = self.verify_path(courseid, taskid, path)
if wanted_path is None:
return "Internal error"
try:
content = self.task_factory.get_task_fs(courseid, taskid).get(wanted_path).decode("utf-8"... | [
"def",
"action_edit",
"(",
"self",
",",
"courseid",
",",
"taskid",
",",
"path",
")",
":",
"wanted_path",
"=",
"self",
".",
"verify_path",
"(",
"courseid",
",",
"taskid",
",",
"path",
")",
"if",
"wanted_path",
"is",
"None",
":",
"return",
"\"Internal error\... | Edit a file | [
"Edit",
"a",
"file"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/task_edit_file.py#L131-L140 |
235,059 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/task_edit_file.py | CourseTaskFiles.action_edit_save | def action_edit_save(self, courseid, taskid, path, content):
""" Save an edited file """
wanted_path = self.verify_path(courseid, taskid, path)
if wanted_path is None:
return json.dumps({"error": True})
try:
self.task_factory.get_task_fs(courseid, taskid).put(want... | python | def action_edit_save(self, courseid, taskid, path, content):
""" Save an edited file """
wanted_path = self.verify_path(courseid, taskid, path)
if wanted_path is None:
return json.dumps({"error": True})
try:
self.task_factory.get_task_fs(courseid, taskid).put(want... | [
"def",
"action_edit_save",
"(",
"self",
",",
"courseid",
",",
"taskid",
",",
"path",
",",
"content",
")",
":",
"wanted_path",
"=",
"self",
".",
"verify_path",
"(",
"courseid",
",",
"taskid",
",",
"path",
")",
"if",
"wanted_path",
"is",
"None",
":",
"retu... | Save an edited file | [
"Save",
"an",
"edited",
"file"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/task_edit_file.py#L142-L151 |
235,060 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/task_edit_file.py | CourseTaskFiles.action_download | def action_download(self, courseid, taskid, path):
""" Download a file or a directory """
wanted_path = self.verify_path(courseid, taskid, path)
if wanted_path is None:
raise web.notfound()
task_fs = self.task_factory.get_task_fs(courseid, taskid)
(method, mimetype_... | python | def action_download(self, courseid, taskid, path):
""" Download a file or a directory """
wanted_path = self.verify_path(courseid, taskid, path)
if wanted_path is None:
raise web.notfound()
task_fs = self.task_factory.get_task_fs(courseid, taskid)
(method, mimetype_... | [
"def",
"action_download",
"(",
"self",
",",
"courseid",
",",
"taskid",
",",
"path",
")",
":",
"wanted_path",
"=",
"self",
".",
"verify_path",
"(",
"courseid",
",",
"taskid",
",",
"path",
")",
"if",
"wanted_path",
"is",
"None",
":",
"raise",
"web",
".",
... | Download a file or a directory | [
"Download",
"a",
"file",
"or",
"a",
"directory"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/task_edit_file.py#L235-L251 |
235,061 | UCL-INGI/INGInious | inginious/common/base.py | write_json_or_yaml | def write_json_or_yaml(file_path, content):
""" Write JSON or YAML depending on the file extension. """
with codecs.open(file_path, "w", "utf-8") as f:
f.write(get_json_or_yaml(file_path, content)) | python | def write_json_or_yaml(file_path, content):
""" Write JSON or YAML depending on the file extension. """
with codecs.open(file_path, "w", "utf-8") as f:
f.write(get_json_or_yaml(file_path, content)) | [
"def",
"write_json_or_yaml",
"(",
"file_path",
",",
"content",
")",
":",
"with",
"codecs",
".",
"open",
"(",
"file_path",
",",
"\"w\"",
",",
"\"utf-8\"",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"get_json_or_yaml",
"(",
"file_path",
",",
"content",
"... | Write JSON or YAML depending on the file extension. | [
"Write",
"JSON",
"or",
"YAML",
"depending",
"on",
"the",
"file",
"extension",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/common/base.py#L43-L46 |
235,062 | UCL-INGI/INGInious | inginious/common/base.py | get_json_or_yaml | def get_json_or_yaml(file_path, content):
""" Generate JSON or YAML depending on the file extension. """
if os.path.splitext(file_path)[1] == ".json":
return json.dumps(content, sort_keys=False, indent=4, separators=(',', ': '))
else:
return inginious.common.custom_yaml.dump(content) | python | def get_json_or_yaml(file_path, content):
""" Generate JSON or YAML depending on the file extension. """
if os.path.splitext(file_path)[1] == ".json":
return json.dumps(content, sort_keys=False, indent=4, separators=(',', ': '))
else:
return inginious.common.custom_yaml.dump(content) | [
"def",
"get_json_or_yaml",
"(",
"file_path",
",",
"content",
")",
":",
"if",
"os",
".",
"path",
".",
"splitext",
"(",
"file_path",
")",
"[",
"1",
"]",
"==",
"\".json\"",
":",
"return",
"json",
".",
"dumps",
"(",
"content",
",",
"sort_keys",
"=",
"False... | Generate JSON or YAML depending on the file extension. | [
"Generate",
"JSON",
"or",
"YAML",
"depending",
"on",
"the",
"file",
"extension",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/common/base.py#L49-L54 |
235,063 | UCL-INGI/INGInious | inginious/frontend/user_manager.py | UserManager._set_session | def _set_session(self, username, realname, email, language):
""" Init the session. Preserves potential LTI information. """
self._session.loggedin = True
self._session.email = email
self._session.username = username
self._session.realname = realname
self._session.language... | python | def _set_session(self, username, realname, email, language):
""" Init the session. Preserves potential LTI information. """
self._session.loggedin = True
self._session.email = email
self._session.username = username
self._session.realname = realname
self._session.language... | [
"def",
"_set_session",
"(",
"self",
",",
"username",
",",
"realname",
",",
"email",
",",
"language",
")",
":",
"self",
".",
"_session",
".",
"loggedin",
"=",
"True",
"self",
".",
"_session",
".",
"email",
"=",
"email",
"self",
".",
"_session",
".",
"us... | Init the session. Preserves potential LTI information. | [
"Init",
"the",
"session",
".",
"Preserves",
"potential",
"LTI",
"information",
"."
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/user_manager.py#L184-L193 |
235,064 | UCL-INGI/INGInious | inginious/frontend/user_manager.py | UserManager._destroy_session | def _destroy_session(self):
""" Destroy the session """
self._session.loggedin = False
self._session.email = None
self._session.username = None
self._session.realname = None
self._session.token = None
self._session.lti = None | python | def _destroy_session(self):
""" Destroy the session """
self._session.loggedin = False
self._session.email = None
self._session.username = None
self._session.realname = None
self._session.token = None
self._session.lti = None | [
"def",
"_destroy_session",
"(",
"self",
")",
":",
"self",
".",
"_session",
".",
"loggedin",
"=",
"False",
"self",
".",
"_session",
".",
"email",
"=",
"None",
"self",
".",
"_session",
".",
"username",
"=",
"None",
"self",
".",
"_session",
".",
"realname",... | Destroy the session | [
"Destroy",
"the",
"session"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/user_manager.py#L195-L202 |
235,065 | UCL-INGI/INGInious | inginious/frontend/user_manager.py | UserManager.create_lti_session | def create_lti_session(self, user_id, roles, realname, email, course_id, task_id, consumer_key, outcome_service_url,
outcome_result_id, tool_name, tool_desc, tool_url, context_title, context_label):
""" Creates an LTI cookieless session. Returns the new session id"""
self._de... | python | def create_lti_session(self, user_id, roles, realname, email, course_id, task_id, consumer_key, outcome_service_url,
outcome_result_id, tool_name, tool_desc, tool_url, context_title, context_label):
""" Creates an LTI cookieless session. Returns the new session id"""
self._de... | [
"def",
"create_lti_session",
"(",
"self",
",",
"user_id",
",",
"roles",
",",
"realname",
",",
"email",
",",
"course_id",
",",
"task_id",
",",
"consumer_key",
",",
"outcome_service_url",
",",
"outcome_result_id",
",",
"tool_name",
",",
"tool_desc",
",",
"tool_url... | Creates an LTI cookieless session. Returns the new session id | [
"Creates",
"an",
"LTI",
"cookieless",
"session",
".",
"Returns",
"the",
"new",
"session",
"id"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/user_manager.py#L204-L228 |
235,066 | UCL-INGI/INGInious | inginious/frontend/user_manager.py | UserManager.user_saw_task | def user_saw_task(self, username, courseid, taskid):
""" Set in the database that the user has viewed this task """
self._database.user_tasks.update({"username": username, "courseid": courseid, "taskid": taskid},
{"$setOnInsert": {"username": username, "courseid"... | python | def user_saw_task(self, username, courseid, taskid):
""" Set in the database that the user has viewed this task """
self._database.user_tasks.update({"username": username, "courseid": courseid, "taskid": taskid},
{"$setOnInsert": {"username": username, "courseid"... | [
"def",
"user_saw_task",
"(",
"self",
",",
"username",
",",
"courseid",
",",
"taskid",
")",
":",
"self",
".",
"_database",
".",
"user_tasks",
".",
"update",
"(",
"{",
"\"username\"",
":",
"username",
",",
"\"courseid\"",
":",
"courseid",
",",
"\"taskid\"",
... | Set in the database that the user has viewed this task | [
"Set",
"in",
"the",
"database",
"that",
"the",
"user",
"has",
"viewed",
"this",
"task"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/user_manager.py#L518-L523 |
235,067 | UCL-INGI/INGInious | inginious/frontend/user_manager.py | UserManager.update_user_stats | def update_user_stats(self, username, task, submission, result_str, grade, state, newsub):
""" Update stats with a new submission """
self.user_saw_task(username, submission["courseid"], submission["taskid"])
if newsub:
old_submission = self._database.user_tasks.find_one_and_update(... | python | def update_user_stats(self, username, task, submission, result_str, grade, state, newsub):
""" Update stats with a new submission """
self.user_saw_task(username, submission["courseid"], submission["taskid"])
if newsub:
old_submission = self._database.user_tasks.find_one_and_update(... | [
"def",
"update_user_stats",
"(",
"self",
",",
"username",
",",
"task",
",",
"submission",
",",
"result_str",
",",
"grade",
",",
"state",
",",
"newsub",
")",
":",
"self",
".",
"user_saw_task",
"(",
"username",
",",
"submission",
"[",
"\"courseid\"",
"]",
",... | Update stats with a new submission | [
"Update",
"stats",
"with",
"a",
"new",
"submission"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/user_manager.py#L525-L568 |
235,068 | UCL-INGI/INGInious | inginious/frontend/user_manager.py | UserManager.get_course_aggregations | def get_course_aggregations(self, course):
""" Returns a list of the course aggregations"""
return natsorted(list(self._database.aggregations.find({"courseid": course.get_id()})), key=lambda x: x["description"]) | python | def get_course_aggregations(self, course):
""" Returns a list of the course aggregations"""
return natsorted(list(self._database.aggregations.find({"courseid": course.get_id()})), key=lambda x: x["description"]) | [
"def",
"get_course_aggregations",
"(",
"self",
",",
"course",
")",
":",
"return",
"natsorted",
"(",
"list",
"(",
"self",
".",
"_database",
".",
"aggregations",
".",
"find",
"(",
"{",
"\"courseid\"",
":",
"course",
".",
"get_id",
"(",
")",
"}",
")",
")",
... | Returns a list of the course aggregations | [
"Returns",
"a",
"list",
"of",
"the",
"course",
"aggregations"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/user_manager.py#L650-L652 |
235,069 | UCL-INGI/INGInious | inginious/frontend/tasks.py | WebAppTask.get_accessible_time | def get_accessible_time(self, plugin_override=True):
""" Get the accessible time of this task """
vals = self._hook_manager.call_hook('task_accessibility', course=self.get_course(), task=self, default=self._accessible)
return vals[0] if len(vals) and plugin_override else self._accessible | python | def get_accessible_time(self, plugin_override=True):
""" Get the accessible time of this task """
vals = self._hook_manager.call_hook('task_accessibility', course=self.get_course(), task=self, default=self._accessible)
return vals[0] if len(vals) and plugin_override else self._accessible | [
"def",
"get_accessible_time",
"(",
"self",
",",
"plugin_override",
"=",
"True",
")",
":",
"vals",
"=",
"self",
".",
"_hook_manager",
".",
"call_hook",
"(",
"'task_accessibility'",
",",
"course",
"=",
"self",
".",
"get_course",
"(",
")",
",",
"task",
"=",
"... | Get the accessible time of this task | [
"Get",
"the",
"accessible",
"time",
"of",
"this",
"task"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/tasks.py#L68-L71 |
235,070 | UCL-INGI/INGInious | inginious/frontend/tasks.py | WebAppTask.get_deadline | def get_deadline(self):
""" Returns a string containing the deadline for this task """
if self.get_accessible_time().is_always_accessible():
return _("No deadline")
elif self.get_accessible_time().is_never_accessible():
return _("It's too late")
else:
... | python | def get_deadline(self):
""" Returns a string containing the deadline for this task """
if self.get_accessible_time().is_always_accessible():
return _("No deadline")
elif self.get_accessible_time().is_never_accessible():
return _("It's too late")
else:
... | [
"def",
"get_deadline",
"(",
"self",
")",
":",
"if",
"self",
".",
"get_accessible_time",
"(",
")",
".",
"is_always_accessible",
"(",
")",
":",
"return",
"_",
"(",
"\"No deadline\"",
")",
"elif",
"self",
".",
"get_accessible_time",
"(",
")",
".",
"is_never_acc... | Returns a string containing the deadline for this task | [
"Returns",
"a",
"string",
"containing",
"the",
"deadline",
"for",
"this",
"task"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/tasks.py#L77-L85 |
235,071 | UCL-INGI/INGInious | inginious/frontend/tasks.py | WebAppTask.get_authors | def get_authors(self, language):
""" Return the list of this task's authors """
return self.gettext(language, self._author) if self._author else "" | python | def get_authors(self, language):
""" Return the list of this task's authors """
return self.gettext(language, self._author) if self._author else "" | [
"def",
"get_authors",
"(",
"self",
",",
"language",
")",
":",
"return",
"self",
".",
"gettext",
"(",
"language",
",",
"self",
".",
"_author",
")",
"if",
"self",
".",
"_author",
"else",
"\"\""
] | Return the list of this task's authors | [
"Return",
"the",
"list",
"of",
"this",
"task",
"s",
"authors"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/tasks.py#L106-L108 |
235,072 | UCL-INGI/INGInious | inginious/frontend/tasks.py | WebAppTask.adapt_input_for_backend | def adapt_input_for_backend(self, input_data):
""" Adapt the input from web.py for the inginious.backend """
for problem in self._problems:
input_data = problem.adapt_input_for_backend(input_data)
return input_data | python | def adapt_input_for_backend(self, input_data):
""" Adapt the input from web.py for the inginious.backend """
for problem in self._problems:
input_data = problem.adapt_input_for_backend(input_data)
return input_data | [
"def",
"adapt_input_for_backend",
"(",
"self",
",",
"input_data",
")",
":",
"for",
"problem",
"in",
"self",
".",
"_problems",
":",
"input_data",
"=",
"problem",
".",
"adapt_input_for_backend",
"(",
"input_data",
")",
"return",
"input_data"
] | Adapt the input from web.py for the inginious.backend | [
"Adapt",
"the",
"input",
"from",
"web",
".",
"py",
"for",
"the",
"inginious",
".",
"backend"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/tasks.py#L110-L114 |
235,073 | UCL-INGI/INGInious | inginious/frontend/pages/course_admin/submissions.py | CourseSubmissionsPage.get_users | def get_users(self, course):
""" Returns a sorted list of users """
users = OrderedDict(sorted(list(self.user_manager.get_users_info(self.user_manager.get_course_registered_users(course)).items()),
key=lambda k: k[1][0] if k[1] is not None else ""))
return users | python | def get_users(self, course):
""" Returns a sorted list of users """
users = OrderedDict(sorted(list(self.user_manager.get_users_info(self.user_manager.get_course_registered_users(course)).items()),
key=lambda k: k[1][0] if k[1] is not None else ""))
return users | [
"def",
"get_users",
"(",
"self",
",",
"course",
")",
":",
"users",
"=",
"OrderedDict",
"(",
"sorted",
"(",
"list",
"(",
"self",
".",
"user_manager",
".",
"get_users_info",
"(",
"self",
".",
"user_manager",
".",
"get_course_registered_users",
"(",
"course",
"... | Returns a sorted list of users | [
"Returns",
"a",
"sorted",
"list",
"of",
"users"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course_admin/submissions.py#L107-L111 |
235,074 | UCL-INGI/INGInious | inginious/frontend/pages/course.py | CoursePage.get_course | def get_course(self, courseid):
""" Return the course """
try:
course = self.course_factory.get_course(courseid)
except:
raise web.notfound()
return course | python | def get_course(self, courseid):
""" Return the course """
try:
course = self.course_factory.get_course(courseid)
except:
raise web.notfound()
return course | [
"def",
"get_course",
"(",
"self",
",",
"courseid",
")",
":",
"try",
":",
"course",
"=",
"self",
".",
"course_factory",
".",
"get_course",
"(",
"courseid",
")",
"except",
":",
"raise",
"web",
".",
"notfound",
"(",
")",
"return",
"course"
] | Return the course | [
"Return",
"the",
"course"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course.py#L15-L22 |
235,075 | UCL-INGI/INGInious | inginious/frontend/pages/course.py | CoursePage.show_page | def show_page(self, course):
""" Prepares and shows the course page """
username = self.user_manager.session_username()
if not self.user_manager.course_is_open_to_user(course, lti=False):
return self.template_helper.get_renderer().course_unavailable()
else:
tasks ... | python | def show_page(self, course):
""" Prepares and shows the course page """
username = self.user_manager.session_username()
if not self.user_manager.course_is_open_to_user(course, lti=False):
return self.template_helper.get_renderer().course_unavailable()
else:
tasks ... | [
"def",
"show_page",
"(",
"self",
",",
"course",
")",
":",
"username",
"=",
"self",
".",
"user_manager",
".",
"session_username",
"(",
")",
"if",
"not",
"self",
".",
"user_manager",
".",
"course_is_open_to_user",
"(",
"course",
",",
"lti",
"=",
"False",
")"... | Prepares and shows the course page | [
"Prepares",
"and",
"shows",
"the",
"course",
"page"
] | cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c | https://github.com/UCL-INGI/INGInious/blob/cbda9a9c7f2b8e8eb1e6d7d51f0d18092086300c/inginious/frontend/pages/course.py#L40-L74 |
235,076 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavparms.py | mavparms | def mavparms(logfile):
'''extract mavlink parameters'''
mlog = mavutil.mavlink_connection(filename)
while True:
try:
m = mlog.recv_match(type=['PARAM_VALUE', 'PARM'])
if m is None:
return
except Exception:
return
if m.get_type() ==... | python | def mavparms(logfile):
'''extract mavlink parameters'''
mlog = mavutil.mavlink_connection(filename)
while True:
try:
m = mlog.recv_match(type=['PARAM_VALUE', 'PARM'])
if m is None:
return
except Exception:
return
if m.get_type() ==... | [
"def",
"mavparms",
"(",
"logfile",
")",
":",
"mlog",
"=",
"mavutil",
".",
"mavlink_connection",
"(",
"filename",
")",
"while",
"True",
":",
"try",
":",
"m",
"=",
"mlog",
".",
"recv_match",
"(",
"type",
"=",
"[",
"'PARAM_VALUE'",
",",
"'PARM'",
"]",
")"... | extract mavlink parameters | [
"extract",
"mavlink",
"parameters"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavparms.py#L20-L41 |
235,077 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.send | def send(self, mavmsg, force_mavlink1=False):
'''send a MAVLink message'''
buf = mavmsg.pack(self, force_mavlink1=force_mavlink1)
self.file.write(buf)
self.seq = (self.seq + 1) % 256
self.total_packets_sent += 1
self.total_b... | python | def send(self, mavmsg, force_mavlink1=False):
'''send a MAVLink message'''
buf = mavmsg.pack(self, force_mavlink1=force_mavlink1)
self.file.write(buf)
self.seq = (self.seq + 1) % 256
self.total_packets_sent += 1
self.total_b... | [
"def",
"send",
"(",
"self",
",",
"mavmsg",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"buf",
"=",
"mavmsg",
".",
"pack",
"(",
"self",
",",
"force_mavlink1",
"=",
"force_mavlink1",
")",
"self",
".",
"file",
".",
"write",
"(",
"buf",
")",
"self",
"... | send a MAVLink message | [
"send",
"a",
"MAVLink",
"message"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L7550-L7558 |
235,078 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.bytes_needed | def bytes_needed(self):
'''return number of bytes needed for next parsing stage'''
if self.native:
ret = self.native.expected_length - self.buf_len()
else:
ret = self.expected_length - self.buf_len()
if ret <= 0:
... | python | def bytes_needed(self):
'''return number of bytes needed for next parsing stage'''
if self.native:
ret = self.native.expected_length - self.buf_len()
else:
ret = self.expected_length - self.buf_len()
if ret <= 0:
... | [
"def",
"bytes_needed",
"(",
"self",
")",
":",
"if",
"self",
".",
"native",
":",
"ret",
"=",
"self",
".",
"native",
".",
"expected_length",
"-",
"self",
".",
"buf_len",
"(",
")",
"else",
":",
"ret",
"=",
"self",
".",
"expected_length",
"-",
"self",
".... | return number of bytes needed for next parsing stage | [
"return",
"number",
"of",
"bytes",
"needed",
"for",
"next",
"parsing",
"stage"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L7563-L7572 |
235,079 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.__callbacks | def __callbacks(self, msg):
'''this method exists only to make profiling results easier to read'''
if self.callback:
self.callback(msg, *self.callback_args, **self.callback_kwargs) | python | def __callbacks(self, msg):
'''this method exists only to make profiling results easier to read'''
if self.callback:
self.callback(msg, *self.callback_args, **self.callback_kwargs) | [
"def",
"__callbacks",
"(",
"self",
",",
"msg",
")",
":",
"if",
"self",
".",
"callback",
":",
"self",
".",
"callback",
"(",
"msg",
",",
"*",
"self",
".",
"callback_args",
",",
"*",
"*",
"self",
".",
"callback_kwargs",
")"
] | this method exists only to make profiling results easier to read | [
"this",
"method",
"exists",
"only",
"to",
"make",
"profiling",
"results",
"easier",
"to",
"read"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L7579-L7582 |
235,080 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.parse_char | def parse_char(self, c):
'''input some data bytes, possibly returning a new message'''
self.buf.extend(c)
self.total_bytes_received += len(c)
if self.native:
if native_testing:
self.test_buf.extend(c)
m = self.__pa... | python | def parse_char(self, c):
'''input some data bytes, possibly returning a new message'''
self.buf.extend(c)
self.total_bytes_received += len(c)
if self.native:
if native_testing:
self.test_buf.extend(c)
m = self.__pa... | [
"def",
"parse_char",
"(",
"self",
",",
"c",
")",
":",
"self",
".",
"buf",
".",
"extend",
"(",
"c",
")",
"self",
".",
"total_bytes_received",
"+=",
"len",
"(",
"c",
")",
"if",
"self",
".",
"native",
":",
"if",
"native_testing",
":",
"self",
".",
"te... | input some data bytes, possibly returning a new message | [
"input",
"some",
"data",
"bytes",
"possibly",
"returning",
"a",
"new",
"message"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L7584-L7613 |
235,081 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.parse_buffer | def parse_buffer(self, s):
'''input some data bytes, possibly returning a list of new messages'''
m = self.parse_char(s)
if m is None:
return None
ret = [m]
while True:
m = self.parse_char("")
if m is None:
... | python | def parse_buffer(self, s):
'''input some data bytes, possibly returning a list of new messages'''
m = self.parse_char(s)
if m is None:
return None
ret = [m]
while True:
m = self.parse_char("")
if m is None:
... | [
"def",
"parse_buffer",
"(",
"self",
",",
"s",
")",
":",
"m",
"=",
"self",
".",
"parse_char",
"(",
"s",
")",
"if",
"m",
"is",
"None",
":",
"return",
"None",
"ret",
"=",
"[",
"m",
"]",
"while",
"True",
":",
"m",
"=",
"self",
".",
"parse_char",
"(... | input some data bytes, possibly returning a list of new messages | [
"input",
"some",
"data",
"bytes",
"possibly",
"returning",
"a",
"list",
"of",
"new",
"messages"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L7662-L7673 |
235,082 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.check_signature | def check_signature(self, msgbuf, srcSystem, srcComponent):
'''check signature on incoming message'''
if isinstance(msgbuf, array.array):
msgbuf = msgbuf.tostring()
timestamp_buf = msgbuf[-12:-6]
link_id = msgbuf[-13]
(tlow, thigh) = struct.unp... | python | def check_signature(self, msgbuf, srcSystem, srcComponent):
'''check signature on incoming message'''
if isinstance(msgbuf, array.array):
msgbuf = msgbuf.tostring()
timestamp_buf = msgbuf[-12:-6]
link_id = msgbuf[-13]
(tlow, thigh) = struct.unp... | [
"def",
"check_signature",
"(",
"self",
",",
"msgbuf",
",",
"srcSystem",
",",
"srcComponent",
")",
":",
"if",
"isinstance",
"(",
"msgbuf",
",",
"array",
".",
"array",
")",
":",
"msgbuf",
"=",
"msgbuf",
".",
"tostring",
"(",
")",
"timestamp_buf",
"=",
"msg... | check signature on incoming message | [
"check",
"signature",
"on",
"incoming",
"message"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L7675-L7712 |
235,083 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.flexifunction_set_send | def flexifunction_set_send(self, target_system, target_component, force_mavlink1=False):
'''
Depreciated but used as a compiler flag. Do not remove
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
... | python | def flexifunction_set_send(self, target_system, target_component, force_mavlink1=False):
'''
Depreciated but used as a compiler flag. Do not remove
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
... | [
"def",
"flexifunction_set_send",
"(",
"self",
",",
"target_system",
",",
"target_component",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"flexifunction_set_encode",
"(",
"target_system",
",",
"target_component",
... | Depreciated but used as a compiler flag. Do not remove
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t) | [
"Depreciated",
"but",
"used",
"as",
"a",
"compiler",
"flag",
".",
"Do",
"not",
"remove"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L7855-L7863 |
235,084 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.system_time_send | def system_time_send(self, time_unix_usec, time_boot_ms, force_mavlink1=False):
'''
The system time is the time of the master clock, typically the
computer clock of the main onboard computer.
time_unix_usec : Timestamp of the master clock in mi... | python | def system_time_send(self, time_unix_usec, time_boot_ms, force_mavlink1=False):
'''
The system time is the time of the master clock, typically the
computer clock of the main onboard computer.
time_unix_usec : Timestamp of the master clock in mi... | [
"def",
"system_time_send",
"(",
"self",
",",
"time_unix_usec",
",",
"time_boot_ms",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"system_time_encode",
"(",
"time_unix_usec",
",",
"time_boot_ms",
")",
",",
"for... | The system time is the time of the master clock, typically the
computer clock of the main onboard computer.
time_unix_usec : Timestamp of the master clock in microseconds since UNIX epoch. (uint64_t)
time_boot_ms : Timestamp of the component clock... | [
"The",
"system",
"time",
"is",
"the",
"time",
"of",
"the",
"master",
"clock",
"typically",
"the",
"computer",
"clock",
"of",
"the",
"main",
"onboard",
"computer",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L8636-L8645 |
235,085 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.set_mode_send | def set_mode_send(self, target_system, base_mode, custom_mode, force_mavlink1=False):
'''
THIS INTERFACE IS DEPRECATED. USE COMMAND_LONG with
MAV_CMD_DO_SET_MODE INSTEAD. Set the system mode, as
defined by enum MAV_MODE. There is no target component
... | python | def set_mode_send(self, target_system, base_mode, custom_mode, force_mavlink1=False):
'''
THIS INTERFACE IS DEPRECATED. USE COMMAND_LONG with
MAV_CMD_DO_SET_MODE INSTEAD. Set the system mode, as
defined by enum MAV_MODE. There is no target component
... | [
"def",
"set_mode_send",
"(",
"self",
",",
"target_system",
",",
"base_mode",
",",
"custom_mode",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"set_mode_encode",
"(",
"target_system",
",",
"base_mode",
",",
"... | THIS INTERFACE IS DEPRECATED. USE COMMAND_LONG with
MAV_CMD_DO_SET_MODE INSTEAD. Set the system mode, as
defined by enum MAV_MODE. There is no target component
id as the mode is by definition for the overall
aircraft, not only for one component.
... | [
"THIS",
"INTERFACE",
"IS",
"DEPRECATED",
".",
"USE",
"COMMAND_LONG",
"with",
"MAV_CMD_DO_SET_MODE",
"INSTEAD",
".",
"Set",
"the",
"system",
"mode",
"as",
"defined",
"by",
"enum",
"MAV_MODE",
".",
"There",
"is",
"no",
"target",
"component",
"id",
"as",
"the",
... | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L8760-L8773 |
235,086 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.param_request_list_send | def param_request_list_send(self, target_system, target_component, force_mavlink1=False):
'''
Request all parameters of this component. After this request, all
parameters are emitted.
target_system : System ID (uint8_t)
target_... | python | def param_request_list_send(self, target_system, target_component, force_mavlink1=False):
'''
Request all parameters of this component. After this request, all
parameters are emitted.
target_system : System ID (uint8_t)
target_... | [
"def",
"param_request_list_send",
"(",
"self",
",",
"target_system",
",",
"target_component",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"param_request_list_encode",
"(",
"target_system",
",",
"target_component",
... | Request all parameters of this component. After this request, all
parameters are emitted.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t) | [
"Request",
"all",
"parameters",
"of",
"this",
"component",
".",
"After",
"this",
"request",
"all",
"parameters",
"are",
"emitted",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L8826-L8835 |
235,087 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.mission_current_send | def mission_current_send(self, seq, force_mavlink1=False):
'''
Message that announces the sequence number of the current active
mission item. The MAV will fly towards this mission
item.
seq : Sequence (uint16_t)
... | python | def mission_current_send(self, seq, force_mavlink1=False):
'''
Message that announces the sequence number of the current active
mission item. The MAV will fly towards this mission
item.
seq : Sequence (uint16_t)
... | [
"def",
"mission_current_send",
"(",
"self",
",",
"seq",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"mission_current_encode",
"(",
"seq",
")",
",",
"force_mavlink1",
"=",
"force_mavlink1",
")"
] | Message that announces the sequence number of the current active
mission item. The MAV will fly towards this mission
item.
seq : Sequence (uint16_t) | [
"Message",
"that",
"announces",
"the",
"sequence",
"number",
"of",
"the",
"current",
"active",
"mission",
"item",
".",
"The",
"MAV",
"will",
"fly",
"towards",
"this",
"mission",
"item",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L9590-L9599 |
235,088 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.mission_count_send | def mission_count_send(self, target_system, target_component, count, force_mavlink1=False):
'''
This message is emitted as response to MISSION_REQUEST_LIST by the MAV
and to initiate a write transaction. The GCS can then
request the individual mission item... | python | def mission_count_send(self, target_system, target_component, count, force_mavlink1=False):
'''
This message is emitted as response to MISSION_REQUEST_LIST by the MAV
and to initiate a write transaction. The GCS can then
request the individual mission item... | [
"def",
"mission_count_send",
"(",
"self",
",",
"target_system",
",",
"target_component",
",",
"count",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"mission_count_encode",
"(",
"target_system",
",",
"target_comp... | This message is emitted as response to MISSION_REQUEST_LIST by the MAV
and to initiate a write transaction. The GCS can then
request the individual mission item based on the
knowledge of the total number of MISSIONs.
target_system : System ID ... | [
"This",
"message",
"is",
"emitted",
"as",
"response",
"to",
"MISSION_REQUEST_LIST",
"by",
"the",
"MAV",
"and",
"to",
"initiate",
"a",
"write",
"transaction",
".",
"The",
"GCS",
"can",
"then",
"request",
"the",
"individual",
"mission",
"item",
"based",
"on",
... | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L9635-L9647 |
235,089 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.mission_clear_all_send | def mission_clear_all_send(self, target_system, target_component, force_mavlink1=False):
'''
Delete all mission items at once.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
... | python | def mission_clear_all_send(self, target_system, target_component, force_mavlink1=False):
'''
Delete all mission items at once.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
... | [
"def",
"mission_clear_all_send",
"(",
"self",
",",
"target_system",
",",
"target_component",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"mission_clear_all_encode",
"(",
"target_system",
",",
"target_component",
... | Delete all mission items at once.
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t) | [
"Delete",
"all",
"mission",
"items",
"at",
"once",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L9659-L9667 |
235,090 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.data_stream_send | def data_stream_send(self, stream_id, message_rate, on_off, force_mavlink1=False):
'''
THIS INTERFACE IS DEPRECATED. USE MESSAGE_INTERVAL INSTEAD.
stream_id : The ID of the requested data stream (uint8_t)
message_rate : The me... | python | def data_stream_send(self, stream_id, message_rate, on_off, force_mavlink1=False):
'''
THIS INTERFACE IS DEPRECATED. USE MESSAGE_INTERVAL INSTEAD.
stream_id : The ID of the requested data stream (uint8_t)
message_rate : The me... | [
"def",
"data_stream_send",
"(",
"self",
",",
"stream_id",
",",
"message_rate",
",",
"on_off",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"data_stream_encode",
"(",
"stream_id",
",",
"message_rate",
",",
"o... | THIS INTERFACE IS DEPRECATED. USE MESSAGE_INTERVAL INSTEAD.
stream_id : The ID of the requested data stream (uint8_t)
message_rate : The message rate (uint16_t)
on_off : 1 stream is enabled, 0 stream is stopped. (uint8_t) | [
"THIS",
"INTERFACE",
"IS",
"DEPRECATED",
".",
"USE",
"MESSAGE_INTERVAL",
"INSTEAD",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L10178-L10187 |
235,091 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.command_ack_send | def command_ack_send(self, command, result, force_mavlink1=False):
'''
Report status of a command. Includes feedback wether the command was
executed.
command : Command ID, as defined by MAV_CMD enum. (uint16_t)
result ... | python | def command_ack_send(self, command, result, force_mavlink1=False):
'''
Report status of a command. Includes feedback wether the command was
executed.
command : Command ID, as defined by MAV_CMD enum. (uint16_t)
result ... | [
"def",
"command_ack_send",
"(",
"self",
",",
"command",
",",
"result",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"command_ack_encode",
"(",
"command",
",",
"result",
")",
",",
"force_mavlink1",
"=",
"fo... | Report status of a command. Includes feedback wether the command was
executed.
command : Command ID, as defined by MAV_CMD enum. (uint16_t)
result : See MAV_RESULT enum (uint8_t) | [
"Report",
"status",
"of",
"a",
"command",
".",
"Includes",
"feedback",
"wether",
"the",
"command",
"was",
"executed",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L10452-L10461 |
235,092 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.timesync_send | def timesync_send(self, tc1, ts1, force_mavlink1=False):
'''
Time synchronization message.
tc1 : Time sync timestamp 1 (int64_t)
ts1 : Time sync timestamp 2 (int64_t)
'''
return ... | python | def timesync_send(self, tc1, ts1, force_mavlink1=False):
'''
Time synchronization message.
tc1 : Time sync timestamp 1 (int64_t)
ts1 : Time sync timestamp 2 (int64_t)
'''
return ... | [
"def",
"timesync_send",
"(",
"self",
",",
"tc1",
",",
"ts1",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"timesync_encode",
"(",
"tc1",
",",
"ts1",
")",
",",
"force_mavlink1",
"=",
"force_mavlink1",
")"... | Time synchronization message.
tc1 : Time sync timestamp 1 (int64_t)
ts1 : Time sync timestamp 2 (int64_t) | [
"Time",
"synchronization",
"message",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L11391-L11399 |
235,093 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.camera_trigger_send | def camera_trigger_send(self, time_usec, seq, force_mavlink1=False):
'''
Camera-IMU triggering and synchronisation message.
time_usec : Timestamp for the image frame in microseconds (uint64_t)
seq : Image frame sequen... | python | def camera_trigger_send(self, time_usec, seq, force_mavlink1=False):
'''
Camera-IMU triggering and synchronisation message.
time_usec : Timestamp for the image frame in microseconds (uint64_t)
seq : Image frame sequen... | [
"def",
"camera_trigger_send",
"(",
"self",
",",
"time_usec",
",",
"seq",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"camera_trigger_encode",
"(",
"time_usec",
",",
"seq",
")",
",",
"force_mavlink1",
"=",
... | Camera-IMU triggering and synchronisation message.
time_usec : Timestamp for the image frame in microseconds (uint64_t)
seq : Image frame sequence (uint32_t) | [
"Camera",
"-",
"IMU",
"triggering",
"and",
"synchronisation",
"message",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L11411-L11419 |
235,094 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.log_erase_send | def log_erase_send(self, target_system, target_component, force_mavlink1=False):
'''
Erase all logs
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
return self.send(se... | python | def log_erase_send(self, target_system, target_component, force_mavlink1=False):
'''
Erase all logs
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
return self.send(se... | [
"def",
"log_erase_send",
"(",
"self",
",",
"target_system",
",",
"target_component",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"log_erase_encode",
"(",
"target_system",
",",
"target_component",
")",
",",
"f... | Erase all logs
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t) | [
"Erase",
"all",
"logs"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L11721-L11729 |
235,095 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.log_request_end_send | def log_request_end_send(self, target_system, target_component, force_mavlink1=False):
'''
Stop log transfer and resume normal logging
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
... | python | def log_request_end_send(self, target_system, target_component, force_mavlink1=False):
'''
Stop log transfer and resume normal logging
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t)
'''
... | [
"def",
"log_request_end_send",
"(",
"self",
",",
"target_system",
",",
"target_component",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"log_request_end_encode",
"(",
"target_system",
",",
"target_component",
")",... | Stop log transfer and resume normal logging
target_system : System ID (uint8_t)
target_component : Component ID (uint8_t) | [
"Stop",
"log",
"transfer",
"and",
"resume",
"normal",
"logging"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L11741-L11749 |
235,096 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.power_status_send | def power_status_send(self, Vcc, Vservo, flags, force_mavlink1=False):
'''
Power supply status
Vcc : 5V rail voltage in millivolts (uint16_t)
Vservo : servo rail voltage in millivolts (uint16_t)
fla... | python | def power_status_send(self, Vcc, Vservo, flags, force_mavlink1=False):
'''
Power supply status
Vcc : 5V rail voltage in millivolts (uint16_t)
Vservo : servo rail voltage in millivolts (uint16_t)
fla... | [
"def",
"power_status_send",
"(",
"self",
",",
"Vcc",
",",
"Vservo",
",",
"flags",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"power_status_encode",
"(",
"Vcc",
",",
"Vservo",
",",
"flags",
")",
",",
... | Power supply status
Vcc : 5V rail voltage in millivolts (uint16_t)
Vservo : servo rail voltage in millivolts (uint16_t)
flags : power supply status flags (see MAV_POWER_STATUS enum) (uint16_t) | [
"Power",
"supply",
"status"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L11828-L11837 |
235,097 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.terrain_check_send | def terrain_check_send(self, lat, lon, force_mavlink1=False):
'''
Request that the vehicle report terrain height at the given location.
Used by GCS to check if vehicle has all terrain data
needed for a mission.
lat : ... | python | def terrain_check_send(self, lat, lon, force_mavlink1=False):
'''
Request that the vehicle report terrain height at the given location.
Used by GCS to check if vehicle has all terrain data
needed for a mission.
lat : ... | [
"def",
"terrain_check_send",
"(",
"self",
",",
"lat",
",",
"lon",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"terrain_check_encode",
"(",
"lat",
",",
"lon",
")",
",",
"force_mavlink1",
"=",
"force_mavlin... | Request that the vehicle report terrain height at the given location.
Used by GCS to check if vehicle has all terrain data
needed for a mission.
lat : Latitude (degrees *10^7) (int32_t)
lon : Longitude (degrees ... | [
"Request",
"that",
"the",
"vehicle",
"report",
"terrain",
"height",
"at",
"the",
"given",
"location",
".",
"Used",
"by",
"GCS",
"to",
"check",
"if",
"vehicle",
"has",
"all",
"terrain",
"data",
"needed",
"for",
"a",
"mission",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L12149-L12159 |
235,098 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.gps_input_encode | def gps_input_encode(self, time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible):
'''
GPS sensor input message. This is a raw sensor value sent by the GPS.
... | python | def gps_input_encode(self, time_usec, gps_id, ignore_flags, time_week_ms, time_week, fix_type, lat, lon, alt, hdop, vdop, vn, ve, vd, speed_accuracy, horiz_accuracy, vert_accuracy, satellites_visible):
'''
GPS sensor input message. This is a raw sensor value sent by the GPS.
... | [
"def",
"gps_input_encode",
"(",
"self",
",",
"time_usec",
",",
"gps_id",
",",
"ignore_flags",
",",
"time_week_ms",
",",
"time_week",
",",
"fix_type",
",",
"lat",
",",
"lon",
",",
"alt",
",",
"hdop",
",",
"vdop",
",",
"vn",
",",
"ve",
",",
"vd",
",",
... | GPS sensor input message. This is a raw sensor value sent by the GPS.
This is NOT the global position estimate of the sytem.
time_usec : Timestamp (micros since boot or Unix epoch) (uint64_t)
gps_id : ID of the GPS for multiple GPS inp... | [
"GPS",
"sensor",
"input",
"message",
".",
"This",
"is",
"a",
"raw",
"sensor",
"value",
"sent",
"by",
"the",
"GPS",
".",
"This",
"is",
"NOT",
"the",
"global",
"position",
"estimate",
"of",
"the",
"sytem",
"."
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L12663-L12688 |
235,099 | JdeRobot/base | src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py | MAVLink.message_interval_send | def message_interval_send(self, message_id, interval_us, force_mavlink1=False):
'''
This interface replaces DATA_STREAM
message_id : The ID of the requested MAVLink message. v1.0 is limited to 254 messages. (uint16_t)
interval_us ... | python | def message_interval_send(self, message_id, interval_us, force_mavlink1=False):
'''
This interface replaces DATA_STREAM
message_id : The ID of the requested MAVLink message. v1.0 is limited to 254 messages. (uint16_t)
interval_us ... | [
"def",
"message_interval_send",
"(",
"self",
",",
"message_id",
",",
"interval_us",
",",
"force_mavlink1",
"=",
"False",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
".",
"message_interval_encode",
"(",
"message_id",
",",
"interval_us",
")",
",",
"for... | This interface replaces DATA_STREAM
message_id : The ID of the requested MAVLink message. v1.0 is limited to 254 messages. (uint16_t)
interval_us : The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicat... | [
"This",
"interface",
"replaces",
"DATA_STREAM"
] | 303b18992785b2fe802212f2d758a60873007f1f | https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/matrixpilot.py#L12903-L12911 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.